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

int remember_fd_if_non_cloexec(int fd,void *context)

{
  uint uVar1;
  void *pvVar2;
  int iVar3;
  
  uVar1 = rpl_fcntl(fd,1);
  if ((uVar1 & 1) == 0) {
                    /* WARNING: Load size is inaccurate */
    pvVar2 = extendbuf(*context,*(int *)((int)context + 4) * 4 + 4,(size_t *)((int)context + 8));
    if (pvVar2 != (void *)0x0) {
      *(void **)context = pvVar2;
      *(int *)((int)pvVar2 + *(int *)((int)context + 4) * 4) = fd;
      *(int *)((int)context + 4) = *(int *)((int)context + 4) + 1;
      return 0;
    }
    iVar3 = -1;
  }
  else {
    iVar3 = 0;
  }
  return iVar3;
}



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

undefined4 FUN_000230e0(undefined4 param_1,int *param_2)

{
  uint uVar1;
  int iVar2;
  undefined4 uVar3;
  
  uVar1 = FUN_000349d0(param_1,1);
  if ((uVar1 & 1) == 0) {
    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);
    if (iVar2 != 0) {
      *param_2 = iVar2;
      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;
      param_2[1] = param_2[1] + 1;
      return 0;
    }
    uVar3 = 0xffffffff;
  }
  else {
    uVar3 = 0;
  }
  return uVar3;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00014d70
ADD EBX,0x47bff
SUB ESP,0x14
MOV EDI,dword ptr [ESP + 0x28]
MOV EBP,dword ptr [ESP + 0x2c]
PUSH 0x1
PUSH EDI
CALL 0x000349d0
ADD ESP,0x10
AND EAX,0x1
JZ 0x00023120
XOR ESI,ESI
ADD ESP,0xc
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x4
MOV ESI,EAX
LEA EAX,[EBP + 0x8]
PUSH EAX
MOV EAX,dword ptr [EBP + 0x4]
LEA EAX,[EAX*0x4 + 0x4]
PUSH EAX
PUSH dword ptr [EBP]
CALL 0x00022e90
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0002315a
MOV EDX,dword ptr [EBP + 0x4]
MOV dword ptr [EBP],EAX
MOV dword ptr [EAX + EDX*0x4],EDI
MOV EAX,ESI
ADD dword ptr [EBP + 0x4],0x1
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV ESI,0xffffffff
JMP 0x0002310c
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 FUN_000230e0(undefined4 param_1,int *param_2)\n\n{\n  uint uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = FUN_000349d0(param_1,1);\n  if ((uVar1 & 1) == 0) {\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = 0;\n  }\n  return uVar3;\n}\n\n" comment (function_definition "undefined4 FUN_000230e0(undefined4 param_1,int *param_2)\n\n{\n  uint uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = FUN_000349d0(param_1,1);\n  if ((uVar1 & 1) == 0) {\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = 0;\n  }\n  return uVar3;\n}" type_identifier (function_declarator "FUN_000230e0(undefined4 param_1,int *param_2)" identifier (parameter_list "(undefined4 param_1,int *param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = FUN_000349d0(param_1,1);\n  if ((uVar1 & 1) == 0) {\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = 0;\n  }\n  return uVar3;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (expression_statement "uVar1 = FUN_000349d0(param_1,1);" (assignment_expression "uVar1 = FUN_000349d0(param_1,1)" identifier = (call_expression "FUN_000349d0(param_1,1)" identifier (argument_list "(param_1,1)" ( identifier , number_literal )))) ;) (if_statement "if ((uVar1 & 1) == 0) {\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = 0;\n  }" if (parenthesized_expression "((uVar1 & 1) == 0)" ( (binary_expression "(uVar1 & 1) == 0" (parenthesized_expression "(uVar1 & 1)" ( (binary_expression "uVar1 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }" { (expression_statement "iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);" (assignment_expression "iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2)" identifier = (call_expression "FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2)" identifier (argument_list "(*param_2,param_2[1] * 4 + 4,param_2 + 2)" ( (pointer_expression "*param_2" * identifier) , (binary_expression "param_2[1] * 4 + 4" (binary_expression "param_2[1] * 4" (subscript_expression "param_2[1]" identifier [ number_literal ]) * number_literal) + number_literal) , (binary_expression "param_2 + 2" identifier + number_literal) )))) ;) (if_statement "if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }" { (expression_statement "*param_2 = iVar2;" (assignment_expression "*param_2 = iVar2" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "*(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;" (assignment_expression "*(undefined4 *)(iVar2 + param_2[1] * 4) = param_1" (pointer_expression "*(undefined4 *)(iVar2 + param_2[1] * 4)" * (cast_expression "(undefined4 *)(iVar2 + param_2[1] * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + param_2[1] * 4)" ( (binary_expression "iVar2 + param_2[1] * 4" identifier + (binary_expression "param_2[1] * 4" (subscript_expression "param_2[1]" identifier [ number_literal ]) * number_literal)) )))) = identifier) ;) (expression_statement "param_2[1] = param_2[1] + 1;" (assignment_expression "param_2[1] = param_2[1] + 1" (subscript_expression "param_2[1]" identifier [ number_literal ]) = (binary_expression "param_2[1] + 1" (subscript_expression "param_2[1]" identifier [ number_literal ]) + number_literal)) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "uVar3 = 0xffffffff;" (assignment_expression "uVar3 = 0xffffffff" identifier = number_literal) ;) }) (else_clause "else {\n    uVar3 = 0;\n  }" else (compound_statement "{\n    uVar3 = 0;\n  }" { (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) }))) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint remember_fd_if_non_cloexec(int fd,void *context)\n\n{\n  uint uVar1;\n  void *pvVar2;\n  int iVar3;\n  \n  uVar1 = rpl_fcntl(fd,1);\n  if ((uVar1 & 1) == 0) {\n                    /* WARNING: Load size is inaccurate */\n    pvVar2 = extendbuf(*context,*(int *)((int)context + 4) * 4 + 4,(size_t *)((int)context + 8));\n    if (pvVar2 != (void *)0x0) {\n      *(void **)context = pvVar2;\n      *(int *)((int)pvVar2 + *(int *)((int)context + 4) * 4) = fd;\n      *(int *)((int)context + 4) = *(int *)((int)context + 4) + 1;\n      return 0;\n    }\n    iVar3 = -1;\n  }\n  else {\n    iVar3 = 0;\n  }\n  return iVar3;\n}\n\n" comment comment (function_definition "int remember_fd_if_non_cloexec(int fd,void *context)\n\n{\n  uint uVar1;\n  void *pvVar2;\n  int iVar3;\n  \n  uVar1 = rpl_fcntl(fd,1);\n  if ((uVar1 & 1) == 0) {\n                    /* WARNING: Load size is inaccurate */\n    pvVar2 = extendbuf(*context,*(int *)((int)context + 4) * 4 + 4,(size_t *)((int)context + 8));\n    if (pvVar2 != (void *)0x0) {\n      *(void **)context = pvVar2;\n      *(int *)((int)pvVar2 + *(int *)((int)context + 4) * 4) = fd;\n      *(int *)((int)context + 4) = *(int *)((int)context + 4) + 1;\n      return 0;\n    }\n    iVar3 = -1;\n  }\n  else {\n    iVar3 = 0;\n  }\n  return iVar3;\n}" primitive_type (function_declarator "remember_fd_if_non_cloexec(int fd,void *context)" identifier (parameter_list "(int fd,void *context)" ( (parameter_declaration "int fd" primitive_type identifier) , (parameter_declaration "void *context" primitive_type (pointer_declarator "*context" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  void *pvVar2;\n  int iVar3;\n  \n  uVar1 = rpl_fcntl(fd,1);\n  if ((uVar1 & 1) == 0) {\n                    /* WARNING: Load size is inaccurate */\n    pvVar2 = extendbuf(*context,*(int *)((int)context + 4) * 4 + 4,(size_t *)((int)context + 8));\n    if (pvVar2 != (void *)0x0) {\n      *(void **)context = pvVar2;\n      *(int *)((int)pvVar2 + *(int *)((int)context + 4) * 4) = fd;\n      *(int *)((int)context + 4) = *(int *)((int)context + 4) + 1;\n      return 0;\n    }\n    iVar3 = -1;\n  }\n  else {\n    iVar3 = 0;\n  }\n  return iVar3;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "void *pvVar2;" primitive_type (pointer_declarator "*pvVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "uVar1 = rpl_fcntl(fd,1);" (assignment_expression "uVar1 = rpl_fcntl(fd,1)" identifier = (call_expression "rpl_fcntl(fd,1)" identifier (argument_list "(fd,1)" ( identifier , number_literal )))) ;) (if_statement "if ((uVar1 & 1) == 0) {\n                    /* WARNING: Load size is inaccurate */\n    pvVar2 = extendbuf(*context,*(int *)((int)context + 4) * 4 + 4,(size_t *)((int)context + 8));\n    if (pvVar2 != (void *)0x0) {\n      *(void **)context = pvVar2;\n      *(int *)((int)pvVar2 + *(int *)((int)context + 4) * 4) = fd;\n      *(int *)((int)context + 4) = *(int *)((int)context + 4) + 1;\n      return 0;\n    }\n    iVar3 = -1;\n  }\n  else {\n    iVar3 = 0;\n  }" if (parenthesized_expression "((uVar1 & 1) == 0)" ( (binary_expression "(uVar1 & 1) == 0" (parenthesized_expression "(uVar1 & 1)" ( (binary_expression "uVar1 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n                    /* WARNING: Load size is inaccurate */\n    pvVar2 = extendbuf(*context,*(int *)((int)context + 4) * 4 + 4,(size_t *)((int)context + 8));\n    if (pvVar2 != (void *)0x0) {\n      *(void **)context = pvVar2;\n      *(int *)((int)pvVar2 + *(int *)((int)context + 4) * 4) = fd;\n      *(int *)((int)context + 4) = *(int *)((int)context + 4) + 1;\n      return 0;\n    }\n    iVar3 = -1;\n  }" { comment (expression_statement "pvVar2 = extendbuf(*context,*(int *)((int)context + 4) * 4 + 4,(size_t *)((int)context + 8));" (assignment_expression "pvVar2 = extendbuf(*context,*(int *)((int)context + 4) * 4 + 4,(size_t *)((int)context + 8))" identifier = (call_expression "extendbuf(*context,*(int *)((int)context + 4) * 4 + 4,(size_t *)((int)context + 8))" identifier (argument_list "(*context,*(int *)((int)context + 4) * 4 + 4,(size_t *)((int)context + 8))" ( (pointer_expression "*context" * identifier) , (binary_expression "*(int *)((int)context + 4) * 4 + 4" (binary_expression "*(int *)((int)context + 4) * 4" (pointer_expression "*(int *)((int)context + 4)" * (cast_expression "(int *)((int)context + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)context + 4)" ( (binary_expression "(int)context + 4" (cast_expression "(int)context" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) * number_literal) + number_literal) , (cast_expression "(size_t *)((int)context + 8)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)context + 8)" ( (binary_expression "(int)context + 8" (cast_expression "(int)context" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))) )))) ;) (if_statement "if (pvVar2 != (void *)0x0) {\n      *(void **)context = pvVar2;\n      *(int *)((int)pvVar2 + *(int *)((int)context + 4) * 4) = fd;\n      *(int *)((int)context + 4) = *(int *)((int)context + 4) + 1;\n      return 0;\n    }" if (parenthesized_expression "(pvVar2 != (void *)0x0)" ( (binary_expression "pvVar2 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *(void **)context = pvVar2;\n      *(int *)((int)pvVar2 + *(int *)((int)context + 4) * 4) = fd;\n      *(int *)((int)context + 4) = *(int *)((int)context + 4) + 1;\n      return 0;\n    }" { (expression_statement "*(void **)context = pvVar2;" (assignment_expression "*(void **)context = pvVar2" (pointer_expression "*(void **)context" * (cast_expression "(void **)context" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) (expression_statement "*(int *)((int)pvVar2 + *(int *)((int)context + 4) * 4) = fd;" (assignment_expression "*(int *)((int)pvVar2 + *(int *)((int)context + 4) * 4) = fd" (pointer_expression "*(int *)((int)pvVar2 + *(int *)((int)context + 4) * 4)" * (cast_expression "(int *)((int)pvVar2 + *(int *)((int)context + 4) * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)pvVar2 + *(int *)((int)context + 4) * 4)" ( (binary_expression "(int)pvVar2 + *(int *)((int)context + 4) * 4" (cast_expression "(int)pvVar2" ( (type_descriptor "int" primitive_type) ) identifier) + (binary_expression "*(int *)((int)context + 4) * 4" (pointer_expression "*(int *)((int)context + 4)" * (cast_expression "(int *)((int)context + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)context + 4)" ( (binary_expression "(int)context + 4" (cast_expression "(int)context" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) * number_literal)) )))) = identifier) ;) (expression_statement "*(int *)((int)context + 4) = *(int *)((int)context + 4) + 1;" (assignment_expression "*(int *)((int)context + 4) = *(int *)((int)context + 4) + 1" (pointer_expression "*(int *)((int)context + 4)" * (cast_expression "(int *)((int)context + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)context + 4)" ( (binary_expression "(int)context + 4" (cast_expression "(int)context" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) = (binary_expression "*(int *)((int)context + 4) + 1" (pointer_expression "*(int *)((int)context + 4)" * (cast_expression "(int *)((int)context + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)context + 4)" ( (binary_expression "(int)context + 4" (cast_expression "(int)context" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) + number_literal)) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar3 = -1;" (assignment_expression "iVar3 = -1" identifier = number_literal) ;) }) (else_clause "else {\n    iVar3 = 0;\n  }" else (compound_statement "{\n    iVar3 = 0;\n  }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) }))) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit "undefined4 FUN_000230e0(undefined4 param_1,int *param_2)\n\n{\n  uint uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = FUN_000349d0(param_1,1);\n  if ((uVar1 & 1) == 0) {\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = 0;\n  }\n  return uVar3;\n}\n\n" (function_definition "undefined4 FUN_000230e0(undefined4 param_1,int *param_2)\n\n{\n  uint uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = FUN_000349d0(param_1,1);\n  if ((uVar1 & 1) == 0) {\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = 0;\n  }\n  return uVar3;\n}" type_identifier (function_declarator "FUN_000230e0(undefined4 param_1,int *param_2)" identifier (parameter_list "(undefined4 param_1,int *param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = FUN_000349d0(param_1,1);\n  if ((uVar1 & 1) == 0) {\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = 0;\n  }\n  return uVar3;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (expression_statement "uVar1 = FUN_000349d0(param_1,1);" (assignment_expression "uVar1 = FUN_000349d0(param_1,1)" identifier = (call_expression "FUN_000349d0(param_1,1)" identifier (argument_list "(param_1,1)" ( identifier , number_literal )))) ;) (if_statement "if ((uVar1 & 1) == 0) {\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = 0;\n  }" if (parenthesized_expression "((uVar1 & 1) == 0)" ( (binary_expression "(uVar1 & 1) == 0" (parenthesized_expression "(uVar1 & 1)" ( (binary_expression "uVar1 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }" { (expression_statement "iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);" (assignment_expression "iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2)" identifier = (call_expression "FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2)" identifier (argument_list "(*param_2,param_2[1] * 4 + 4,param_2 + 2)" ( (pointer_expression "*param_2" * identifier) , (binary_expression "param_2[1] * 4 + 4" (binary_expression "param_2[1] * 4" (subscript_expression "param_2[1]" identifier [ number_literal ]) * number_literal) + number_literal) , (binary_expression "param_2 + 2" identifier + number_literal) )))) ;) (if_statement "if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }" { (expression_statement "*param_2 = iVar2;" (assignment_expression "*param_2 = iVar2" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "*(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;" (assignment_expression "*(undefined4 *)(iVar2 + param_2[1] * 4) = param_1" (pointer_expression "*(undefined4 *)(iVar2 + param_2[1] * 4)" * (cast_expression "(undefined4 *)(iVar2 + param_2[1] * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + param_2[1] * 4)" ( (binary_expression "iVar2 + param_2[1] * 4" identifier + (binary_expression "param_2[1] * 4" (subscript_expression "param_2[1]" identifier [ number_literal ]) * number_literal)) )))) = identifier) ;) (expression_statement "param_2[1] = param_2[1] + 1;" (assignment_expression "param_2[1] = param_2[1] + 1" (subscript_expression "param_2[1]" identifier [ number_literal ]) = (binary_expression "param_2[1] + 1" (subscript_expression "param_2[1]" identifier [ number_literal ]) + number_literal)) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "uVar3 = 0xffffffff;" (assignment_expression "uVar3 = 0xffffffff" identifier = number_literal) ;) }) (else_clause "else {\n    uVar3 = 0;\n  }" else (compound_statement "{\n    uVar3 = 0;\n  }" { (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) }))) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) , (binary_expression (binary_expression (subscript_expression IDENT [ LIT ]) * LIT) + LIT) , (binary_expression IDENT + LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression (subscript_expression IDENT [ LIT ]) * LIT)) )))) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) + LIT)) ;) (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }))) (return_statement return IDENT ;) })))
(function_definition "undefined4 FUN_000230e0(undefined4 param_1,int *param_2)\n\n{\n  uint uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = FUN_000349d0(param_1,1);\n  if ((uVar1 & 1) == 0) {\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = 0;\n  }\n  return uVar3;\n}" (type_identifier "undefined4") (function_declarator "FUN_000230e0(undefined4 param_1,int *param_2)" (identifier "FUN_000230e0") (parameter_list "(undefined4 param_1,int *param_2)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = FUN_000349d0(param_1,1);\n  if ((uVar1 & 1) == 0) {\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = 0;\n  }\n  return uVar3;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined4 uVar3;" (type_identifier "undefined4") (identifier "uVar3") (; ";")) (expression_statement "uVar1 = FUN_000349d0(param_1,1);" (assignment_expression "uVar1 = FUN_000349d0(param_1,1)" (identifier "uVar1") (= "=") (call_expression "FUN_000349d0(param_1,1)" (identifier "FUN_000349d0") (argument_list "(param_1,1)" (( "(") (identifier "param_1") (, ",") (number_literal "1") () ")")))) (; ";")) (if_statement "if ((uVar1 & 1) == 0) {\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = 0;\n  }" (if "if") (parenthesized_expression "((uVar1 & 1) == 0)" (( "(") (binary_expression "(uVar1 & 1) == 0" (parenthesized_expression "(uVar1 & 1)" (( "(") (binary_expression "uVar1 & 1" (identifier "uVar1") (& "&") (number_literal "1")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);\n    if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }\n    uVar3 = 0xffffffff;\n  }" ({ "{") (expression_statement "iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);" (assignment_expression "iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2)" (identifier "iVar2") (= "=") (call_expression "FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2)" (identifier "FUN_00022e90") (argument_list "(*param_2,param_2[1] * 4 + 4,param_2 + 2)" (( "(") (pointer_expression "*param_2" (* "*") (identifier "param_2")) (, ",") (binary_expression "param_2[1] * 4 + 4" (binary_expression "param_2[1] * 4" (subscript_expression "param_2[1]" (identifier "param_2") ([ "[") (number_literal "1") (] "]")) (* "*") (number_literal "4")) (+ "+") (number_literal "4")) (, ",") (binary_expression "param_2 + 2" (identifier "param_2") (+ "+") (number_literal "2")) () ")")))) (; ";")) (if_statement "if (iVar2 != 0) {\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      *param_2 = iVar2;\n      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;\n      param_2[1] = param_2[1] + 1;\n      return 0;\n    }" ({ "{") (expression_statement "*param_2 = iVar2;" (assignment_expression "*param_2 = iVar2" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "iVar2")) (; ";")) (expression_statement "*(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;" (assignment_expression "*(undefined4 *)(iVar2 + param_2[1] * 4) = param_1" (pointer_expression "*(undefined4 *)(iVar2 + param_2[1] * 4)" (* "*") (cast_expression "(undefined4 *)(iVar2 + param_2[1] * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + param_2[1] * 4)" (( "(") (binary_expression "iVar2 + param_2[1] * 4" (identifier "iVar2") (+ "+") (binary_expression "param_2[1] * 4" (subscript_expression "param_2[1]" (identifier "param_2") ([ "[") (number_literal "1") (] "]")) (* "*") (number_literal "4"))) () ")")))) (= "=") (identifier "param_1")) (; ";")) (expression_statement "param_2[1] = param_2[1] + 1;" (assignment_expression "param_2[1] = param_2[1] + 1" (subscript_expression "param_2[1]" (identifier "param_2") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "param_2[1] + 1" (subscript_expression "param_2[1]" (identifier "param_2") ([ "[") (number_literal "1") (] "]")) (+ "+") (number_literal "1"))) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "uVar3 = 0xffffffff;" (assignment_expression "uVar3 = 0xffffffff" (identifier "uVar3") (= "=") (number_literal "0xffffffff")) (; ";")) (} "}")) (else_clause "else {\n    uVar3 = 0;\n  }" (else "else") (compound_statement "{\n    uVar3 = 0;\n  }" ({ "{") (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" (identifier "uVar3") (= "=") (number_literal "0")) (; ";")) (} "}")))) (return_statement "return uVar3;" (return "return") (identifier "uVar3") (; ";")) (} "}")))

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

int function_1(int fd,void *context)

{
  type_1 var_2;
  void *var_4;
  int iVar3;
  
  var_2 = var_1(fd,1);
  if ((var_2 & 1) == 0) {
                    /* WARNING: Load size is inaccurate */
    var_4 = var_3(*context,*(int *)((int)context + 4) * 4 + 4,(size_t *)((int)context + 8));
    if (var_4 != (void *)0x0) {
      *(void **)context = var_4;
      *(int *)((int)var_4 + *(int *)((int)context + 4) * 4) = fd;
      *(int *)((int)context + 4) = *(int *)((int)context + 4) + 1;
      return 0;
    }
    iVar3 = -1;
  }
  else {
    iVar3 = 0;
  }
  return iVar3;
}


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

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

undefined4 MASKED(undefined4 param_1,int *param_2)

{
  uint uVar1;
  int iVar2;
  undefined4 uVar3;
  
  uVar1 = FUN_000349d0(param_1,1);
  if ((uVar1 & 1) == 0) {
    iVar2 = FUN_00022e90(*param_2,param_2[1] * 4 + 4,param_2 + 2);
    if (iVar2 != 0) {
      *param_2 = iVar2;
      *(undefined4 *)(iVar2 + param_2[1] * 4) = param_1;
      param_2[1] = param_2[1] + 1;
      return 0;
    }
    uVar3 = 0xffffffff;
  }
  else {
    uVar3 = 0;
  }
  return uVar3;
}

