
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

void pollwrap_add_fd_events(pollwrapper *pw,int fd,int events)

{
  short *psVar1;
  int iVar2;
  int *piVar3;
  int *e;
  pollfd *ppVar4;
  uint uVar5;
  size_t n;
  int in_GS_OFFSET;
  pollwrap_fdtopos f2p_find;
  
  iVar2 = *(int *)(in_GS_OFFSET + 0x14);
  if (fd < 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");
  }
  f2p_find.fd = fd;
  piVar3 = (int *)find234(pw->fdtopos,&f2p_find,(cmpfn234)0x0);
  if (piVar3 == (int *)0x0) {
    uVar5 = pw->nfd;
    ppVar4 = pw->fds;
    if (pw->fdsize <= uVar5) {
      n = (uVar5 * 5 >> 2) + 0x20;
      pw->fdsize = n;
      ppVar4 = (pollfd *)saferealloc(ppVar4,n,8);
      uVar5 = pw->nfd;
      pw->fds = ppVar4;
    }
    ppVar4 = ppVar4 + uVar5;
    pw->nfd = uVar5 + 1;
    ppVar4->fd = fd;
    ppVar4->events = 0;
    ppVar4->revents = 0;
    e = (int *)safemalloc(1,8);
    *e = fd;
    e[1] = uVar5;
    piVar3 = (int *)add234(pw->fdtopos,e);
    if (e != piVar3) {
                    /* WARNING: Subroutine does not return */
      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");
    }
  }
  psVar1 = &pw->fds[piVar3[1]].events;
  *psVar1 = *psVar1 | (ushort)events;
  if (iVar2 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void FUN_00087870(int *param_1,int param_2,ushort param_3)

{
  ushort *puVar1;
  int *piVar2;
  int *piVar3;
  int iVar4;
  uint uVar5;
  int iVar6;
  int in_GS_OFFSET;
  int local_28 [2];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x87879;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_2 < 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");
  }
  local_28[0] = param_2;
  piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);
  if (piVar2 == (int *)0x0) {
    uVar5 = param_1[1];
    iVar4 = *param_1;
    if ((uint)param_1[2] <= uVar5) {
      iVar6 = (uVar5 * 5 >> 2) + 0x20;
      param_1[2] = iVar6;
      iVar4 = FUN_0001dc50(iVar4,iVar6,8);
      uVar5 = param_1[1];
      *param_1 = iVar4;
    }
    piVar2 = (int *)(iVar4 + uVar5 * 8);
    param_1[1] = uVar5 + 1;
    *piVar2 = param_2;
    piVar2[1] = 0;
    piVar3 = (int *)FUN_0001db90(1,8);
    *piVar3 = param_2;
    piVar3[1] = uVar5;
    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);
    if (piVar3 != piVar2) {
                    /* WARNING: Subroutine does not return */
      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");
    }
  }
  puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);
  *puVar1 = *puVar1 | param_3;
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0008eb20();
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000149a0
ADD EBX,0x48517
SUB ESP,0x2c
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x1c],EAX
XOR EAX,EAX
MOV EDI,dword ptr [ESP + 0x44]
MOV ESI,dword ptr [ESP + 0x40]
TEST EDI,EDI
JS 0x00087972
MOV dword ptr [ESP + 0x14],EDI
SUB ESP,0x4
PUSH 0x0
LEA EAX,[ESP + 0x1c]
PUSH EAX
PUSH dword ptr [ESI + 0xc]
CALL 0x00082010
ADD ESP,0x10
TEST EAX,EAX
JZ 0x000878e8
MOV EDX,dword ptr [EAX + 0x4]
MOV EAX,dword ptr [ESI]
MOV ECX,dword ptr [ESP + 0x48]
OR word ptr [EAX + EDX*0x8 + 0x4],CX
MOV EAX,dword ptr [ESP + 0x1c]
XOR EAX,dword ptr GS:[0x14]
JNZ 0x0008798e
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EDX,dword ptr [ESI + 0x4]
MOV EAX,dword ptr [ESI]
CMP EDX,dword ptr [ESI + 0x8]
JNC 0x00087950
MOV dword ptr [ESP + 0xc],EDX
LEA ECX,[EDX + 0x1]
SUB ESP,0x8
LEA EAX,[EAX + EDX*0x8]
MOV dword ptr [ESI + 0x4],ECX
MOV dword ptr [EAX],EDI
MOV dword ptr [EAX + 0x4],0x0
PUSH 0x8
PUSH 0x1
CALL 0x0001db90
MOV EDX,dword ptr [ESP + 0x1c]
MOV EBP,EAX
MOV dword ptr [EAX],EDI
MOV dword ptr [EAX + 0x4],EDX
POP EAX
POP EDX
PUSH EBP
PUSH dword ptr [ESI + 0xc]
CALL 0x00081c30
ADD ESP,0x10
CMP EBP,EAX
JZ 0x000878bb
LEA EAX,[EBX + 0xfffd0df8]
PUSH EAX
LEA EAX,[EBX + 0xfffd0d90]
PUSH 0x4a
PUSH EAX
LEA EAX,[EBX + 0xfffd0da6]
PUSH EAX
CALL 0x00014870
LEA EDX,[EDX + EDX*0x4]
SUB ESP,0x4
SHR EDX,0x2
ADD EDX,0x20
MOV dword ptr [ESI + 0x8],EDX
PUSH 0x8
PUSH EDX
PUSH EAX
CALL 0x0001dc50
MOV EDX,dword ptr [ESI + 0x4]
ADD ESP,0x10
MOV dword ptr [ESI],EAX
JMP 0x000878f2
LEA EAX,[EBX + 0xfffd0df8]
PUSH EAX
LEA EAX,[EBX + 0xfffd0d90]
PUSH 0x39
PUSH EAX
LEA EAX,[EBX + 0xfffd0d9e]
PUSH EAX
CALL 0x00014870
CALL 0x0008eb20
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_00087870(int *param_1,int param_2,ushort param_3)\n\n{\n  ushort *puVar1;\n  int *piVar2;\n  int *piVar3;\n  int iVar4;\n  uint uVar5;\n  int iVar6;\n  int in_GS_OFFSET;\n  int local_28 [2];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x87879;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 < 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }\n  local_28[0] = param_2;\n  piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);\n  if (piVar2 == (int *)0x0) {\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }\n  puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);\n  *puVar1 = *puVar1 | param_3;\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0008eb20();\n}\n\n" comment (function_definition "void FUN_00087870(int *param_1,int param_2,ushort param_3)\n\n{\n  ushort *puVar1;\n  int *piVar2;\n  int *piVar3;\n  int iVar4;\n  uint uVar5;\n  int iVar6;\n  int in_GS_OFFSET;\n  int local_28 [2];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x87879;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 < 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }\n  local_28[0] = param_2;\n  piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);\n  if (piVar2 == (int *)0x0) {\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }\n  puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);\n  *puVar1 = *puVar1 | param_3;\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0008eb20();\n}" primitive_type (function_declarator "FUN_00087870(int *param_1,int param_2,ushort param_3)" identifier (parameter_list "(int *param_1,int param_2,ushort param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "ushort param_3" type_identifier identifier) ))) (compound_statement "{\n  ushort *puVar1;\n  int *piVar2;\n  int *piVar3;\n  int iVar4;\n  uint uVar5;\n  int iVar6;\n  int in_GS_OFFSET;\n  int local_28 [2];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x87879;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 < 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }\n  local_28[0] = param_2;\n  piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);\n  if (piVar2 == (int *)0x0) {\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }\n  puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);\n  *puVar1 = *puVar1 | param_3;\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0008eb20();\n}" { (declaration "ushort *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "int local_28 [2];" primitive_type (array_declarator "local_28 [2]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x87879;" (assignment_expression "uStack_14 = 0x87879" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (param_2 < 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }" if (parenthesized_expression "(param_2 < 0)" ( (binary_expression "param_2 < 0" identifier < number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }" { comment (expression_statement "__assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");" (call_expression "__assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events")" identifier (argument_list "("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events")" ( (string_literal ""fd >= 0"" " string_content ") , (string_literal ""unix/uxpoll.c"" " string_content ") , number_literal , (string_literal ""pollwrap_add_fd_events"" " string_content ") ))) ;) })) (expression_statement "local_28[0] = param_2;" (assignment_expression "local_28[0] = param_2" (subscript_expression "local_28[0]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);" (assignment_expression "piVar2 = (int *)FUN_00082010(param_1[3],local_28,0)" identifier = (cast_expression "(int *)FUN_00082010(param_1[3],local_28,0)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00082010(param_1[3],local_28,0)" identifier (argument_list "(param_1[3],local_28,0)" ( (subscript_expression "param_1[3]" identifier [ number_literal ]) , identifier , number_literal ))))) ;) (if_statement "if (piVar2 == (int *)0x0) {\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }" if (parenthesized_expression "(piVar2 == (int *)0x0)" ( (binary_expression "piVar2 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }" { (expression_statement "uVar5 = param_1[1];" (assignment_expression "uVar5 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "iVar4 = *param_1;" (assignment_expression "iVar4 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }" if (parenthesized_expression "((uint)param_1[2] <= uVar5)" ( (binary_expression "(uint)param_1[2] <= uVar5" (cast_expression "(uint)param_1[2]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) <= identifier) )) (compound_statement "{\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }" { (expression_statement "iVar6 = (uVar5 * 5 >> 2) + 0x20;" (assignment_expression "iVar6 = (uVar5 * 5 >> 2) + 0x20" identifier = (binary_expression "(uVar5 * 5 >> 2) + 0x20" (parenthesized_expression "(uVar5 * 5 >> 2)" ( (binary_expression "uVar5 * 5 >> 2" (binary_expression "uVar5 * 5" identifier * number_literal) >> number_literal) )) + number_literal)) ;) (expression_statement "param_1[2] = iVar6;" (assignment_expression "param_1[2] = iVar6" (subscript_expression "param_1[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "iVar4 = FUN_0001dc50(iVar4,iVar6,8);" (assignment_expression "iVar4 = FUN_0001dc50(iVar4,iVar6,8)" identifier = (call_expression "FUN_0001dc50(iVar4,iVar6,8)" identifier (argument_list "(iVar4,iVar6,8)" ( identifier , identifier , number_literal )))) ;) (expression_statement "uVar5 = param_1[1];" (assignment_expression "uVar5 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "*param_1 = iVar4;" (assignment_expression "*param_1 = iVar4" (pointer_expression "*param_1" * identifier) = identifier) ;) })) (expression_statement "piVar2 = (int *)(iVar4 + uVar5 * 8);" (assignment_expression "piVar2 = (int *)(iVar4 + uVar5 * 8)" identifier = (cast_expression "(int *)(iVar4 + uVar5 * 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar4 + uVar5 * 8)" ( (binary_expression "iVar4 + uVar5 * 8" identifier + (binary_expression "uVar5 * 8" identifier * number_literal)) )))) ;) (expression_statement "param_1[1] = uVar5 + 1;" (assignment_expression "param_1[1] = uVar5 + 1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "uVar5 + 1" identifier + number_literal)) ;) (expression_statement "*piVar2 = param_2;" (assignment_expression "*piVar2 = param_2" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "piVar2[1] = 0;" (assignment_expression "piVar2[1] = 0" (subscript_expression "piVar2[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar3 = (int *)FUN_0001db90(1,8);" (assignment_expression "piVar3 = (int *)FUN_0001db90(1,8)" identifier = (cast_expression "(int *)FUN_0001db90(1,8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001db90(1,8)" identifier (argument_list "(1,8)" ( number_literal , number_literal ))))) ;) (expression_statement "*piVar3 = param_2;" (assignment_expression "*piVar3 = param_2" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "piVar3[1] = uVar5;" (assignment_expression "piVar3[1] = uVar5" (subscript_expression "piVar3[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);" (assignment_expression "piVar2 = (int *)FUN_00081c30(param_1[3],piVar3)" identifier = (cast_expression "(int *)FUN_00081c30(param_1[3],piVar3)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00081c30(param_1[3],piVar3)" identifier (argument_list "(param_1[3],piVar3)" ( (subscript_expression "param_1[3]" identifier [ number_literal ]) , identifier ))))) ;) (if_statement "if (piVar3 != piVar2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }" if (parenthesized_expression "(piVar3 != piVar2)" ( (binary_expression "piVar3 != piVar2" identifier != identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }" { comment (expression_statement "__assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");" (call_expression "__assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events")" identifier (argument_list "("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events")" ( (string_literal ""added == f2p"" " string_content ") , (string_literal ""unix/uxpoll.c"" " string_content ") , number_literal , (string_literal ""pollwrap_add_fd_events"" " string_content ") ))) ;) })) })) (expression_statement "puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);" (assignment_expression "puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8)" identifier = (cast_expression "(ushort *)(*param_1 + 4 + piVar2[1] * 8)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + 4 + piVar2[1] * 8)" ( (binary_expression "*param_1 + 4 + piVar2[1] * 8" (binary_expression "*param_1 + 4" (pointer_expression "*param_1" * identifier) + number_literal) + (binary_expression "piVar2[1] * 8" (subscript_expression "piVar2[1]" identifier [ number_literal ]) * number_literal)) )))) ;) (expression_statement "*puVar1 = *puVar1 | param_3;" (assignment_expression "*puVar1 = *puVar1 | param_3" (pointer_expression "*puVar1" * identifier) = (binary_expression "*puVar1 | param_3" (pointer_expression "*puVar1" * identifier) | identifier)) ;) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) comment (expression_statement "FUN_0008eb20();" (call_expression "FUN_0008eb20()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nvoid pollwrap_add_fd_events(pollwrapper *pw,int fd,int events)\n\n{\n  short *psVar1;\n  int iVar2;\n  int *piVar3;\n  int *e;\n  pollfd *ppVar4;\n  uint uVar5;\n  size_t n;\n  int in_GS_OFFSET;\n  pollwrap_fdtopos f2p_find;\n  \n  iVar2 = *(int *)(in_GS_OFFSET + 0x14);\n  if (fd < 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }\n  f2p_find.fd = fd;\n  piVar3 = (int *)find234(pw->fdtopos,&f2p_find,(cmpfn234)0x0);\n  if (piVar3 == (int *)0x0) {\n    uVar5 = pw->nfd;\n    ppVar4 = pw->fds;\n    if (pw->fdsize <= uVar5) {\n      n = (uVar5 * 5 >> 2) + 0x20;\n      pw->fdsize = n;\n      ppVar4 = (pollfd *)saferealloc(ppVar4,n,8);\n      uVar5 = pw->nfd;\n      pw->fds = ppVar4;\n    }\n    ppVar4 = ppVar4 + uVar5;\n    pw->nfd = uVar5 + 1;\n    ppVar4->fd = fd;\n    ppVar4->events = 0;\n    ppVar4->revents = 0;\n    e = (int *)safemalloc(1,8);\n    *e = fd;\n    e[1] = uVar5;\n    piVar3 = (int *)add234(pw->fdtopos,e);\n    if (e != piVar3) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }\n  psVar1 = &pw->fds[piVar3[1]].events;\n  *psVar1 = *psVar1 | (ushort)events;\n  if (iVar2 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment (function_definition "void pollwrap_add_fd_events(pollwrapper *pw,int fd,int events)\n\n{\n  short *psVar1;\n  int iVar2;\n  int *piVar3;\n  int *e;\n  pollfd *ppVar4;\n  uint uVar5;\n  size_t n;\n  int in_GS_OFFSET;\n  pollwrap_fdtopos f2p_find;\n  \n  iVar2 = *(int *)(in_GS_OFFSET + 0x14);\n  if (fd < 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }\n  f2p_find.fd = fd;\n  piVar3 = (int *)find234(pw->fdtopos,&f2p_find,(cmpfn234)0x0);\n  if (piVar3 == (int *)0x0) {\n    uVar5 = pw->nfd;\n    ppVar4 = pw->fds;\n    if (pw->fdsize <= uVar5) {\n      n = (uVar5 * 5 >> 2) + 0x20;\n      pw->fdsize = n;\n      ppVar4 = (pollfd *)saferealloc(ppVar4,n,8);\n      uVar5 = pw->nfd;\n      pw->fds = ppVar4;\n    }\n    ppVar4 = ppVar4 + uVar5;\n    pw->nfd = uVar5 + 1;\n    ppVar4->fd = fd;\n    ppVar4->events = 0;\n    ppVar4->revents = 0;\n    e = (int *)safemalloc(1,8);\n    *e = fd;\n    e[1] = uVar5;\n    piVar3 = (int *)add234(pw->fdtopos,e);\n    if (e != piVar3) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }\n  psVar1 = &pw->fds[piVar3[1]].events;\n  *psVar1 = *psVar1 | (ushort)events;\n  if (iVar2 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (function_declarator "pollwrap_add_fd_events(pollwrapper *pw,int fd,int events)" identifier (parameter_list "(pollwrapper *pw,int fd,int events)" ( (parameter_declaration "pollwrapper *pw" type_identifier (pointer_declarator "*pw" * identifier)) , (parameter_declaration "int fd" primitive_type identifier) , (parameter_declaration "int events" primitive_type identifier) ))) (compound_statement "{\n  short *psVar1;\n  int iVar2;\n  int *piVar3;\n  int *e;\n  pollfd *ppVar4;\n  uint uVar5;\n  size_t n;\n  int in_GS_OFFSET;\n  pollwrap_fdtopos f2p_find;\n  \n  iVar2 = *(int *)(in_GS_OFFSET + 0x14);\n  if (fd < 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }\n  f2p_find.fd = fd;\n  piVar3 = (int *)find234(pw->fdtopos,&f2p_find,(cmpfn234)0x0);\n  if (piVar3 == (int *)0x0) {\n    uVar5 = pw->nfd;\n    ppVar4 = pw->fds;\n    if (pw->fdsize <= uVar5) {\n      n = (uVar5 * 5 >> 2) + 0x20;\n      pw->fdsize = n;\n      ppVar4 = (pollfd *)saferealloc(ppVar4,n,8);\n      uVar5 = pw->nfd;\n      pw->fds = ppVar4;\n    }\n    ppVar4 = ppVar4 + uVar5;\n    pw->nfd = uVar5 + 1;\n    ppVar4->fd = fd;\n    ppVar4->events = 0;\n    ppVar4->revents = 0;\n    e = (int *)safemalloc(1,8);\n    *e = fd;\n    e[1] = uVar5;\n    piVar3 = (int *)add234(pw->fdtopos,e);\n    if (e != piVar3) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }\n  psVar1 = &pw->fds[piVar3[1]].events;\n  *psVar1 = *psVar1 | (ushort)events;\n  if (iVar2 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "short *psVar1;" (sized_type_specifier "short" short) (pointer_declarator "*psVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "int *e;" primitive_type (pointer_declarator "*e" * identifier) ;) (declaration "pollfd *ppVar4;" type_identifier (pointer_declarator "*ppVar4" * identifier) ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "size_t n;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "pollwrap_fdtopos f2p_find;" type_identifier identifier ;) (expression_statement "iVar2 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar2 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (fd < 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }" if (parenthesized_expression "(fd < 0)" ( (binary_expression "fd < 0" identifier < number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }" { comment (expression_statement "__assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");" (call_expression "__assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events")" identifier (argument_list "("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events")" ( (string_literal ""fd >= 0"" " string_content ") , (string_literal ""unix/uxpoll.c"" " string_content ") , number_literal , (string_literal ""pollwrap_add_fd_events"" " string_content ") ))) ;) })) (expression_statement "f2p_find.fd = fd;" (assignment_expression "f2p_find.fd = fd" (field_expression "f2p_find.fd" identifier . field_identifier) = identifier) ;) (expression_statement "piVar3 = (int *)find234(pw->fdtopos,&f2p_find,(cmpfn234)0x0);" (assignment_expression "piVar3 = (int *)find234(pw->fdtopos,&f2p_find,(cmpfn234)0x0)" identifier = (cast_expression "(int *)find234(pw->fdtopos,&f2p_find,(cmpfn234)0x0)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "find234(pw->fdtopos,&f2p_find,(cmpfn234)0x0)" identifier (argument_list "(pw->fdtopos,&f2p_find,(cmpfn234)0x0)" ( (field_expression "pw->fdtopos" identifier -> field_identifier) , (pointer_expression "&f2p_find" & identifier) , (cast_expression "(cmpfn234)0x0" ( (type_descriptor "cmpfn234" type_identifier) ) number_literal) ))))) ;) (if_statement "if (piVar3 == (int *)0x0) {\n    uVar5 = pw->nfd;\n    ppVar4 = pw->fds;\n    if (pw->fdsize <= uVar5) {\n      n = (uVar5 * 5 >> 2) + 0x20;\n      pw->fdsize = n;\n      ppVar4 = (pollfd *)saferealloc(ppVar4,n,8);\n      uVar5 = pw->nfd;\n      pw->fds = ppVar4;\n    }\n    ppVar4 = ppVar4 + uVar5;\n    pw->nfd = uVar5 + 1;\n    ppVar4->fd = fd;\n    ppVar4->events = 0;\n    ppVar4->revents = 0;\n    e = (int *)safemalloc(1,8);\n    *e = fd;\n    e[1] = uVar5;\n    piVar3 = (int *)add234(pw->fdtopos,e);\n    if (e != piVar3) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }" if (parenthesized_expression "(piVar3 == (int *)0x0)" ( (binary_expression "piVar3 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    uVar5 = pw->nfd;\n    ppVar4 = pw->fds;\n    if (pw->fdsize <= uVar5) {\n      n = (uVar5 * 5 >> 2) + 0x20;\n      pw->fdsize = n;\n      ppVar4 = (pollfd *)saferealloc(ppVar4,n,8);\n      uVar5 = pw->nfd;\n      pw->fds = ppVar4;\n    }\n    ppVar4 = ppVar4 + uVar5;\n    pw->nfd = uVar5 + 1;\n    ppVar4->fd = fd;\n    ppVar4->events = 0;\n    ppVar4->revents = 0;\n    e = (int *)safemalloc(1,8);\n    *e = fd;\n    e[1] = uVar5;\n    piVar3 = (int *)add234(pw->fdtopos,e);\n    if (e != piVar3) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }" { (expression_statement "uVar5 = pw->nfd;" (assignment_expression "uVar5 = pw->nfd" identifier = (field_expression "pw->nfd" identifier -> field_identifier)) ;) (expression_statement "ppVar4 = pw->fds;" (assignment_expression "ppVar4 = pw->fds" identifier = (field_expression "pw->fds" identifier -> field_identifier)) ;) (if_statement "if (pw->fdsize <= uVar5) {\n      n = (uVar5 * 5 >> 2) + 0x20;\n      pw->fdsize = n;\n      ppVar4 = (pollfd *)saferealloc(ppVar4,n,8);\n      uVar5 = pw->nfd;\n      pw->fds = ppVar4;\n    }" if (parenthesized_expression "(pw->fdsize <= uVar5)" ( (binary_expression "pw->fdsize <= uVar5" (field_expression "pw->fdsize" identifier -> field_identifier) <= identifier) )) (compound_statement "{\n      n = (uVar5 * 5 >> 2) + 0x20;\n      pw->fdsize = n;\n      ppVar4 = (pollfd *)saferealloc(ppVar4,n,8);\n      uVar5 = pw->nfd;\n      pw->fds = ppVar4;\n    }" { (expression_statement "n = (uVar5 * 5 >> 2) + 0x20;" (assignment_expression "n = (uVar5 * 5 >> 2) + 0x20" identifier = (binary_expression "(uVar5 * 5 >> 2) + 0x20" (parenthesized_expression "(uVar5 * 5 >> 2)" ( (binary_expression "uVar5 * 5 >> 2" (binary_expression "uVar5 * 5" identifier * number_literal) >> number_literal) )) + number_literal)) ;) (expression_statement "pw->fdsize = n;" (assignment_expression "pw->fdsize = n" (field_expression "pw->fdsize" identifier -> field_identifier) = identifier) ;) (expression_statement "ppVar4 = (pollfd *)saferealloc(ppVar4,n,8);" (assignment_expression "ppVar4 = (pollfd *)saferealloc(ppVar4,n,8)" identifier = (cast_expression "(pollfd *)saferealloc(ppVar4,n,8)" ( (type_descriptor "pollfd *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "saferealloc(ppVar4,n,8)" identifier (argument_list "(ppVar4,n,8)" ( identifier , identifier , number_literal ))))) ;) (expression_statement "uVar5 = pw->nfd;" (assignment_expression "uVar5 = pw->nfd" identifier = (field_expression "pw->nfd" identifier -> field_identifier)) ;) (expression_statement "pw->fds = ppVar4;" (assignment_expression "pw->fds = ppVar4" (field_expression "pw->fds" identifier -> field_identifier) = identifier) ;) })) (expression_statement "ppVar4 = ppVar4 + uVar5;" (assignment_expression "ppVar4 = ppVar4 + uVar5" identifier = (binary_expression "ppVar4 + uVar5" identifier + identifier)) ;) (expression_statement "pw->nfd = uVar5 + 1;" (assignment_expression "pw->nfd = uVar5 + 1" (field_expression "pw->nfd" identifier -> field_identifier) = (binary_expression "uVar5 + 1" identifier + number_literal)) ;) (expression_statement "ppVar4->fd = fd;" (assignment_expression "ppVar4->fd = fd" (field_expression "ppVar4->fd" identifier -> field_identifier) = identifier) ;) (expression_statement "ppVar4->events = 0;" (assignment_expression "ppVar4->events = 0" (field_expression "ppVar4->events" identifier -> field_identifier) = number_literal) ;) (expression_statement "ppVar4->revents = 0;" (assignment_expression "ppVar4->revents = 0" (field_expression "ppVar4->revents" identifier -> field_identifier) = number_literal) ;) (expression_statement "e = (int *)safemalloc(1,8);" (assignment_expression "e = (int *)safemalloc(1,8)" identifier = (cast_expression "(int *)safemalloc(1,8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(1,8)" identifier (argument_list "(1,8)" ( number_literal , number_literal ))))) ;) (expression_statement "*e = fd;" (assignment_expression "*e = fd" (pointer_expression "*e" * identifier) = identifier) ;) (expression_statement "e[1] = uVar5;" (assignment_expression "e[1] = uVar5" (subscript_expression "e[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar3 = (int *)add234(pw->fdtopos,e);" (assignment_expression "piVar3 = (int *)add234(pw->fdtopos,e)" identifier = (cast_expression "(int *)add234(pw->fdtopos,e)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "add234(pw->fdtopos,e)" identifier (argument_list "(pw->fdtopos,e)" ( (field_expression "pw->fdtopos" identifier -> field_identifier) , identifier ))))) ;) (if_statement "if (e != piVar3) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }" if (parenthesized_expression "(e != piVar3)" ( (binary_expression "e != piVar3" identifier != identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }" { comment (expression_statement "__assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");" (call_expression "__assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events")" identifier (argument_list "("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events")" ( (string_literal ""added == f2p"" " string_content ") , (string_literal ""unix/uxpoll.c"" " string_content ") , number_literal , (string_literal ""pollwrap_add_fd_events"" " string_content ") ))) ;) })) })) (expression_statement "psVar1 = &pw->fds[piVar3[1]].events;" (assignment_expression "psVar1 = &pw->fds[piVar3[1]].events" identifier = (pointer_expression "&pw->fds[piVar3[1]].events" & (field_expression "pw->fds[piVar3[1]].events" (subscript_expression "pw->fds[piVar3[1]]" (field_expression "pw->fds" identifier -> field_identifier) [ (subscript_expression "piVar3[1]" identifier [ number_literal ]) ]) . field_identifier))) ;) (expression_statement "*psVar1 = *psVar1 | (ushort)events;" (assignment_expression "*psVar1 = *psVar1 | (ushort)events" (pointer_expression "*psVar1" * identifier) = (binary_expression "*psVar1 | (ushort)events" (pointer_expression "*psVar1" * identifier) | (cast_expression "(ushort)events" ( (type_descriptor "ushort" type_identifier) ) identifier))) ;) (if_statement "if (iVar2 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(iVar2 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar2 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "void FUN_00087870(int *param_1,int param_2,ushort param_3)\n\n{\n  ushort *puVar1;\n  int *piVar2;\n  int *piVar3;\n  int iVar4;\n  uint uVar5;\n  int iVar6;\n  int in_GS_OFFSET;\n  int local_28 [2];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x87879;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 < 0) {\n                    \n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }\n  local_28[0] = param_2;\n  piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);\n  if (piVar2 == (int *)0x0) {\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }\n  puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);\n  *puVar1 = *puVar1 | param_3;\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0008eb20();\n}\n\n" (function_definition "void FUN_00087870(int *param_1,int param_2,ushort param_3)\n\n{\n  ushort *puVar1;\n  int *piVar2;\n  int *piVar3;\n  int iVar4;\n  uint uVar5;\n  int iVar6;\n  int in_GS_OFFSET;\n  int local_28 [2];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x87879;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 < 0) {\n                    \n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }\n  local_28[0] = param_2;\n  piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);\n  if (piVar2 == (int *)0x0) {\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }\n  puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);\n  *puVar1 = *puVar1 | param_3;\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0008eb20();\n}" primitive_type (function_declarator "FUN_00087870(int *param_1,int param_2,ushort param_3)" identifier (parameter_list "(int *param_1,int param_2,ushort param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "ushort param_3" type_identifier identifier) ))) (compound_statement "{\n  ushort *puVar1;\n  int *piVar2;\n  int *piVar3;\n  int iVar4;\n  uint uVar5;\n  int iVar6;\n  int in_GS_OFFSET;\n  int local_28 [2];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x87879;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 < 0) {\n                    \n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }\n  local_28[0] = param_2;\n  piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);\n  if (piVar2 == (int *)0x0) {\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }\n  puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);\n  *puVar1 = *puVar1 | param_3;\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0008eb20();\n}" { (declaration "ushort *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "int local_28 [2];" primitive_type (array_declarator "local_28 [2]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x87879;" (assignment_expression "uStack_14 = 0x87879" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (param_2 < 0) {\n                    \n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }" if (parenthesized_expression "(param_2 < 0)" ( (binary_expression "param_2 < 0" identifier < number_literal) )) (compound_statement "{\n                    \n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }" { (expression_statement "__assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");" (call_expression "__assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events")" identifier (argument_list "("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events")" ( (string_literal ""fd >= 0"" " string_content ") , (string_literal ""unix/uxpoll.c"" " string_content ") , number_literal , (string_literal ""pollwrap_add_fd_events"" " string_content ") ))) ;) })) (expression_statement "local_28[0] = param_2;" (assignment_expression "local_28[0] = param_2" (subscript_expression "local_28[0]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);" (assignment_expression "piVar2 = (int *)FUN_00082010(param_1[3],local_28,0)" identifier = (cast_expression "(int *)FUN_00082010(param_1[3],local_28,0)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00082010(param_1[3],local_28,0)" identifier (argument_list "(param_1[3],local_28,0)" ( (subscript_expression "param_1[3]" identifier [ number_literal ]) , identifier , number_literal ))))) ;) (if_statement "if (piVar2 == (int *)0x0) {\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }" if (parenthesized_expression "(piVar2 == (int *)0x0)" ( (binary_expression "piVar2 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }" { (expression_statement "uVar5 = param_1[1];" (assignment_expression "uVar5 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "iVar4 = *param_1;" (assignment_expression "iVar4 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }" if (parenthesized_expression "((uint)param_1[2] <= uVar5)" ( (binary_expression "(uint)param_1[2] <= uVar5" (cast_expression "(uint)param_1[2]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) <= identifier) )) (compound_statement "{\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }" { (expression_statement "iVar6 = (uVar5 * 5 >> 2) + 0x20;" (assignment_expression "iVar6 = (uVar5 * 5 >> 2) + 0x20" identifier = (binary_expression "(uVar5 * 5 >> 2) + 0x20" (parenthesized_expression "(uVar5 * 5 >> 2)" ( (binary_expression "uVar5 * 5 >> 2" (binary_expression "uVar5 * 5" identifier * number_literal) >> number_literal) )) + number_literal)) ;) (expression_statement "param_1[2] = iVar6;" (assignment_expression "param_1[2] = iVar6" (subscript_expression "param_1[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "iVar4 = FUN_0001dc50(iVar4,iVar6,8);" (assignment_expression "iVar4 = FUN_0001dc50(iVar4,iVar6,8)" identifier = (call_expression "FUN_0001dc50(iVar4,iVar6,8)" identifier (argument_list "(iVar4,iVar6,8)" ( identifier , identifier , number_literal )))) ;) (expression_statement "uVar5 = param_1[1];" (assignment_expression "uVar5 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "*param_1 = iVar4;" (assignment_expression "*param_1 = iVar4" (pointer_expression "*param_1" * identifier) = identifier) ;) })) (expression_statement "piVar2 = (int *)(iVar4 + uVar5 * 8);" (assignment_expression "piVar2 = (int *)(iVar4 + uVar5 * 8)" identifier = (cast_expression "(int *)(iVar4 + uVar5 * 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar4 + uVar5 * 8)" ( (binary_expression "iVar4 + uVar5 * 8" identifier + (binary_expression "uVar5 * 8" identifier * number_literal)) )))) ;) (expression_statement "param_1[1] = uVar5 + 1;" (assignment_expression "param_1[1] = uVar5 + 1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "uVar5 + 1" identifier + number_literal)) ;) (expression_statement "*piVar2 = param_2;" (assignment_expression "*piVar2 = param_2" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "piVar2[1] = 0;" (assignment_expression "piVar2[1] = 0" (subscript_expression "piVar2[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar3 = (int *)FUN_0001db90(1,8);" (assignment_expression "piVar3 = (int *)FUN_0001db90(1,8)" identifier = (cast_expression "(int *)FUN_0001db90(1,8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001db90(1,8)" identifier (argument_list "(1,8)" ( number_literal , number_literal ))))) ;) (expression_statement "*piVar3 = param_2;" (assignment_expression "*piVar3 = param_2" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "piVar3[1] = uVar5;" (assignment_expression "piVar3[1] = uVar5" (subscript_expression "piVar3[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);" (assignment_expression "piVar2 = (int *)FUN_00081c30(param_1[3],piVar3)" identifier = (cast_expression "(int *)FUN_00081c30(param_1[3],piVar3)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00081c30(param_1[3],piVar3)" identifier (argument_list "(param_1[3],piVar3)" ( (subscript_expression "param_1[3]" identifier [ number_literal ]) , identifier ))))) ;) (if_statement "if (piVar3 != piVar2) {\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }" if (parenthesized_expression "(piVar3 != piVar2)" ( (binary_expression "piVar3 != piVar2" identifier != identifier) )) (compound_statement "{\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }" { (expression_statement "__assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");" (call_expression "__assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events")" identifier (argument_list "("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events")" ( (string_literal ""added == f2p"" " string_content ") , (string_literal ""unix/uxpoll.c"" " string_content ") , number_literal , (string_literal ""pollwrap_add_fd_events"" " string_content ") ))) ;) })) })) (expression_statement "puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);" (assignment_expression "puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8)" identifier = (cast_expression "(ushort *)(*param_1 + 4 + piVar2[1] * 8)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + 4 + piVar2[1] * 8)" ( (binary_expression "*param_1 + 4 + piVar2[1] * 8" (binary_expression "*param_1 + 4" (pointer_expression "*param_1" * identifier) + number_literal) + (binary_expression "piVar2[1] * 8" (subscript_expression "piVar2[1]" identifier [ number_literal ]) * number_literal)) )))) ;) (expression_statement "*puVar1 = *puVar1 | param_3;" (assignment_expression "*puVar1 = *puVar1 | param_3" (pointer_expression "*puVar1" * identifier) = (binary_expression "*puVar1 | param_3" (pointer_expression "*puVar1" * identifier) | identifier)) ;) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "FUN_0008eb20();" (call_expression "FUN_0008eb20()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) , IDENT , LIT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression (binary_expression IDENT * LIT) >> LIT) )) + LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , LIT )))) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT , LIT ))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) , IDENT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (pointer_expression * IDENT) + LIT) + (binary_expression (subscript_expression IDENT [ LIT ]) * LIT)) )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (pointer_expression * IDENT) | IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "void FUN_00087870(int *param_1,int param_2,ushort param_3)\n\n{\n  ushort *puVar1;\n  int *piVar2;\n  int *piVar3;\n  int iVar4;\n  uint uVar5;\n  int iVar6;\n  int in_GS_OFFSET;\n  int local_28 [2];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x87879;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 < 0) {\n                    \n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }\n  local_28[0] = param_2;\n  piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);\n  if (piVar2 == (int *)0x0) {\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }\n  puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);\n  *puVar1 = *puVar1 | param_3;\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0008eb20();\n}" (primitive_type "void") (function_declarator "FUN_00087870(int *param_1,int param_2,ushort param_3)" (identifier "FUN_00087870") (parameter_list "(int *param_1,int param_2,ushort param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "ushort param_3" (type_identifier "ushort") (identifier "param_3")) () ")"))) (compound_statement "{\n  ushort *puVar1;\n  int *piVar2;\n  int *piVar3;\n  int iVar4;\n  uint uVar5;\n  int iVar6;\n  int in_GS_OFFSET;\n  int local_28 [2];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x87879;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 < 0) {\n                    \n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }\n  local_28[0] = param_2;\n  piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);\n  if (piVar2 == (int *)0x0) {\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }\n  puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);\n  *puVar1 = *puVar1 | param_3;\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0008eb20();\n}" ({ "{") (declaration "ushort *puVar1;" (type_identifier "ushort") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "uint uVar5;" (type_identifier "uint") (identifier "uVar5") (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "int local_28 [2];" (primitive_type "int") (array_declarator "local_28 [2]" (identifier "local_28") ([ "[") (number_literal "2") (] "]")) (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x87879;" (assignment_expression "uStack_14 = 0x87879" (identifier "uStack_14") (= "=") (number_literal "0x87879")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (if_statement "if (param_2 < 0) {\n                    \n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }" (if "if") (parenthesized_expression "(param_2 < 0)" (( "(") (binary_expression "param_2 < 0" (identifier "param_2") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");\n  }" ({ "{") (expression_statement "__assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");" (call_expression "__assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events")" (identifier "__assert_fail") (argument_list "("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events")" (( "(") (string_literal ""fd >= 0"" (" """) (string_content "fd >= 0") (" """)) (, ",") (string_literal ""unix/uxpoll.c"" (" """) (string_content "unix/uxpoll.c") (" """)) (, ",") (number_literal "0x39") (, ",") (string_literal ""pollwrap_add_fd_events"" (" """) (string_content "pollwrap_add_fd_events") (" """)) () ")"))) (; ";")) (} "}"))) (expression_statement "local_28[0] = param_2;" (assignment_expression "local_28[0] = param_2" (subscript_expression "local_28[0]" (identifier "local_28") ([ "[") (number_literal "0") (] "]")) (= "=") (identifier "param_2")) (; ";")) (expression_statement "piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);" (assignment_expression "piVar2 = (int *)FUN_00082010(param_1[3],local_28,0)" (identifier "piVar2") (= "=") (cast_expression "(int *)FUN_00082010(param_1[3],local_28,0)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00082010(param_1[3],local_28,0)" (identifier "FUN_00082010") (argument_list "(param_1[3],local_28,0)" (( "(") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (, ",") (identifier "local_28") (, ",") (number_literal "0") () ")"))))) (; ";")) (if_statement "if (piVar2 == (int *)0x0) {\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }" (if "if") (parenthesized_expression "(piVar2 == (int *)0x0)" (( "(") (binary_expression "piVar2 == (int *)0x0" (identifier "piVar2") (== "==") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    uVar5 = param_1[1];\n    iVar4 = *param_1;\n    if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }\n    piVar2 = (int *)(iVar4 + uVar5 * 8);\n    param_1[1] = uVar5 + 1;\n    *piVar2 = param_2;\n    piVar2[1] = 0;\n    piVar3 = (int *)FUN_0001db90(1,8);\n    *piVar3 = param_2;\n    piVar3[1] = uVar5;\n    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);\n    if (piVar3 != piVar2) {\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }\n  }" ({ "{") (expression_statement "uVar5 = param_1[1];" (assignment_expression "uVar5 = param_1[1]" (identifier "uVar5") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "iVar4 = *param_1;" (assignment_expression "iVar4 = *param_1" (identifier "iVar4") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if ((uint)param_1[2] <= uVar5) {\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }" (if "if") (parenthesized_expression "((uint)param_1[2] <= uVar5)" (( "(") (binary_expression "(uint)param_1[2] <= uVar5" (cast_expression "(uint)param_1[2]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (<= "<=") (identifier "uVar5")) () ")")) (compound_statement "{\n      iVar6 = (uVar5 * 5 >> 2) + 0x20;\n      param_1[2] = iVar6;\n      iVar4 = FUN_0001dc50(iVar4,iVar6,8);\n      uVar5 = param_1[1];\n      *param_1 = iVar4;\n    }" ({ "{") (expression_statement "iVar6 = (uVar5 * 5 >> 2) + 0x20;" (assignment_expression "iVar6 = (uVar5 * 5 >> 2) + 0x20" (identifier "iVar6") (= "=") (binary_expression "(uVar5 * 5 >> 2) + 0x20" (parenthesized_expression "(uVar5 * 5 >> 2)" (( "(") (binary_expression "uVar5 * 5 >> 2" (binary_expression "uVar5 * 5" (identifier "uVar5") (* "*") (number_literal "5")) (>> ">>") (number_literal "2")) () ")")) (+ "+") (number_literal "0x20"))) (; ";")) (expression_statement "param_1[2] = iVar6;" (assignment_expression "param_1[2] = iVar6" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "iVar6")) (; ";")) (expression_statement "iVar4 = FUN_0001dc50(iVar4,iVar6,8);" (assignment_expression "iVar4 = FUN_0001dc50(iVar4,iVar6,8)" (identifier "iVar4") (= "=") (call_expression "FUN_0001dc50(iVar4,iVar6,8)" (identifier "FUN_0001dc50") (argument_list "(iVar4,iVar6,8)" (( "(") (identifier "iVar4") (, ",") (identifier "iVar6") (, ",") (number_literal "8") () ")")))) (; ";")) (expression_statement "uVar5 = param_1[1];" (assignment_expression "uVar5 = param_1[1]" (identifier "uVar5") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "*param_1 = iVar4;" (assignment_expression "*param_1 = iVar4" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "iVar4")) (; ";")) (} "}"))) (expression_statement "piVar2 = (int *)(iVar4 + uVar5 * 8);" (assignment_expression "piVar2 = (int *)(iVar4 + uVar5 * 8)" (identifier "piVar2") (= "=") (cast_expression "(int *)(iVar4 + uVar5 * 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar4 + uVar5 * 8)" (( "(") (binary_expression "iVar4 + uVar5 * 8" (identifier "iVar4") (+ "+") (binary_expression "uVar5 * 8" (identifier "uVar5") (* "*") (number_literal "8"))) () ")")))) (; ";")) (expression_statement "param_1[1] = uVar5 + 1;" (assignment_expression "param_1[1] = uVar5 + 1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "uVar5 + 1" (identifier "uVar5") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*piVar2 = param_2;" (assignment_expression "*piVar2 = param_2" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (identifier "param_2")) (; ";")) (expression_statement "piVar2[1] = 0;" (assignment_expression "piVar2[1] = 0" (subscript_expression "piVar2[1]" (identifier "piVar2") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar3 = (int *)FUN_0001db90(1,8);" (assignment_expression "piVar3 = (int *)FUN_0001db90(1,8)" (identifier "piVar3") (= "=") (cast_expression "(int *)FUN_0001db90(1,8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001db90(1,8)" (identifier "FUN_0001db90") (argument_list "(1,8)" (( "(") (number_literal "1") (, ",") (number_literal "8") () ")"))))) (; ";")) (expression_statement "*piVar3 = param_2;" (assignment_expression "*piVar3 = param_2" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "param_2")) (; ";")) (expression_statement "piVar3[1] = uVar5;" (assignment_expression "piVar3[1] = uVar5" (subscript_expression "piVar3[1]" (identifier "piVar3") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "uVar5")) (; ";")) (expression_statement "piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);" (assignment_expression "piVar2 = (int *)FUN_00081c30(param_1[3],piVar3)" (identifier "piVar2") (= "=") (cast_expression "(int *)FUN_00081c30(param_1[3],piVar3)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00081c30(param_1[3],piVar3)" (identifier "FUN_00081c30") (argument_list "(param_1[3],piVar3)" (( "(") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (, ",") (identifier "piVar3") () ")"))))) (; ";")) (if_statement "if (piVar3 != piVar2) {\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }" (if "if") (parenthesized_expression "(piVar3 != piVar2)" (( "(") (binary_expression "piVar3 != piVar2" (identifier "piVar3") (!= "!=") (identifier "piVar2")) () ")")) (compound_statement "{\n                    \n      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");\n    }" ({ "{") (expression_statement "__assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");" (call_expression "__assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events")" (identifier "__assert_fail") (argument_list "("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events")" (( "(") (string_literal ""added == f2p"" (" """) (string_content "added == f2p") (" """)) (, ",") (string_literal ""unix/uxpoll.c"" (" """) (string_content "unix/uxpoll.c") (" """)) (, ",") (number_literal "0x4a") (, ",") (string_literal ""pollwrap_add_fd_events"" (" """) (string_content "pollwrap_add_fd_events") (" """)) () ")"))) (; ";")) (} "}"))) (} "}"))) (expression_statement "puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);" (assignment_expression "puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8)" (identifier "puVar1") (= "=") (cast_expression "(ushort *)(*param_1 + 4 + piVar2[1] * 8)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + 4 + piVar2[1] * 8)" (( "(") (binary_expression "*param_1 + 4 + piVar2[1] * 8" (binary_expression "*param_1 + 4" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "4")) (+ "+") (binary_expression "piVar2[1] * 8" (subscript_expression "piVar2[1]" (identifier "piVar2") ([ "[") (number_literal "1") (] "]")) (* "*") (number_literal "8"))) () ")")))) (; ";")) (expression_statement "*puVar1 = *puVar1 | param_3;" (assignment_expression "*puVar1 = *puVar1 | param_3" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (binary_expression "*puVar1 | param_3" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (| "|") (identifier "param_3"))) (; ";")) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" (if "if") (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "FUN_0008eb20();" (call_expression "FUN_0008eb20()" (identifier "FUN_0008eb20") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

void function_1(type_1 *pw,int var_2,int events)

{
  short *psVar1;
  int var_12;
  int *var_5;
  int *var_11;
  type_2 *var_8;
  type_3 var_6;
  size_t n;
  int var_1;
  type_4 f2p_find;
  
  var_12 = *(int *)(var_1 + 0x14);
  if (var_2 < 0) {
                    /* WARNING: Subroutine does not return */
    var_3("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");
  }
  f2p_find.var_2 = var_2;
  var_5 = (int *)var_4(pw->fdtopos,&f2p_find,(type_5)0x0);
  if (var_5 == (int *)0x0) {
    var_6 = pw->nfd;
    var_8 = pw->fds;
    if (pw->fdsize <= var_6) {
      n = (var_6 * 5 >> 2) + 0x20;
      pw->fdsize = n;
      var_8 = (type_2 *)var_7(var_8,n,8);
      var_6 = pw->nfd;
      pw->fds = var_8;
    }
    var_8 = var_8 + var_6;
    pw->nfd = var_6 + 1;
    var_8->var_2 = var_2;
    var_8->events = 0;
    var_8->revents = 0;
    var_11 = (int *)var_9(1,8);
    *var_11 = var_2;
    var_11[1] = var_6;
    var_5 = (int *)var_10(pw->fdtopos,var_11);
    if (var_11 != var_5) {
                    /* WARNING: Subroutine does not return */
      var_3("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");
    }
  }
  psVar1 = &pw->fds[var_5[1]].events;
  *psVar1 = *psVar1 | (type_6)events;
  if (var_12 == *(int *)(var_1 + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  var_13();
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (string_literal (string_content)) (number_literal) (string_literal (string_content))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (subscript_expression argument: (identifier) index: (number_literal)) (identifier) (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (subscript_expression argument: (identifier) index: (number_literal))) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (number_literal))) right: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (number_literal) (number_literal)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (subscript_expression argument: (identifier) index: (number_literal)) (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (string_literal (string_content)) (number_literal) (string_literal (string_content))))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal)) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (binary_expression left: (pointer_expression argument: (identifier)) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (return_statement))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void MASKED(int *param_1,int param_2,ushort param_3)

{
  ushort *puVar1;
  int *piVar2;
  int *piVar3;
  int iVar4;
  uint uVar5;
  int iVar6;
  int in_GS_OFFSET;
  int local_28 [2];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x87879;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_2 < 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("fd >= 0","unix/uxpoll.c",0x39,"pollwrap_add_fd_events");
  }
  local_28[0] = param_2;
  piVar2 = (int *)FUN_00082010(param_1[3],local_28,0);
  if (piVar2 == (int *)0x0) {
    uVar5 = param_1[1];
    iVar4 = *param_1;
    if ((uint)param_1[2] <= uVar5) {
      iVar6 = (uVar5 * 5 >> 2) + 0x20;
      param_1[2] = iVar6;
      iVar4 = FUN_0001dc50(iVar4,iVar6,8);
      uVar5 = param_1[1];
      *param_1 = iVar4;
    }
    piVar2 = (int *)(iVar4 + uVar5 * 8);
    param_1[1] = uVar5 + 1;
    *piVar2 = param_2;
    piVar2[1] = 0;
    piVar3 = (int *)FUN_0001db90(1,8);
    *piVar3 = param_2;
    piVar3[1] = uVar5;
    piVar2 = (int *)FUN_00081c30(param_1[3],piVar3);
    if (piVar3 != piVar2) {
                    /* WARNING: Subroutine does not return */
      __assert_fail("added == f2p","unix/uxpoll.c",0x4a,"pollwrap_add_fd_events");
    }
  }
  puVar1 = (ushort *)(*param_1 + 4 + piVar2[1] * 8);
  *puVar1 = *puVar1 | param_3;
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0008eb20();
}

