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

void cloexec(int fd)

{
  uint uVar1;
  int iVar2;
  char *pcVar3;
  int *piVar4;
  char *pcVar5;
  
  uVar1 = fcntl64(fd,1);
  if ((int)uVar1 < 0) {
    piVar4 = __errno_location();
    pcVar5 = strerror(*piVar4);
    pcVar3 = "%d: fcntl(F_GETFD): %s\n";
  }
  else {
    iVar2 = fcntl64(fd,2,uVar1 | 1);
    if (-1 < iVar2) {
      return;
    }
    piVar4 = __errno_location();
    pcVar5 = strerror(*piVar4);
    pcVar3 = "%d: fcntl(F_SETFD): %s\n";
  }
  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,fd,pcVar5);
                    /* WARNING: Subroutine does not return */
  exit(1);
}



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

void FUN_00057d20(undefined4 param_1)

{
  uint uVar1;
  int iVar2;
  char *pcVar3;
  int *piVar4;
  char *pcVar5;
  
  uVar1 = fcntl64(param_1,1);
  if ((int)uVar1 < 0) {
    piVar4 = __errno_location();
    pcVar5 = strerror(*piVar4);
    pcVar3 = "%d: fcntl(F_GETFD): %s\n";
  }
  else {
    iVar2 = fcntl64(param_1,2,uVar1 | 1);
    if (-1 < iVar2) {
      return;
    }
    piVar4 = __errno_location();
    pcVar5 = strerror(*piVar4);
    pcVar3 = "%d: fcntl(F_SETFD): %s\n";
  }
  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);
                    /* WARNING: Subroutine does not return */
  exit(1);
}


PUSH ESI
PUSH EBX
CALL 0x0001a360
ADD EBX,0x49abd
SUB ESP,0xc
MOV ESI,dword ptr [ESP + 0x18]
PUSH 0x1
PUSH ESI
CALL 0x00019950
ADD ESP,0x10
TEST EAX,EAX
JS 0x00057d5f
SUB ESP,0x4
OR EAX,0x1
PUSH EAX
PUSH 0x2
PUSH ESI
CALL 0x00019950
ADD ESP,0x10
TEST EAX,EAX
JS 0x00057d92
ADD ESP,0x4
POP EBX
POP ESI
RET
CALL 0x00018bd0
SUB ESP,0xc
PUSH dword ptr [EAX]
CALL 0x000196f0
MOV dword ptr [ESP],EAX
LEA EAX,[EBX + 0xfffd8d63]
PUSH ESI
PUSH EAX
MOV EAX,dword ptr [EBX + 0x810]
PUSH 0x1
PUSH dword ptr [EAX]
CALL 0x000199e0
ADD ESP,0x14
PUSH 0x1
CALL 0x00019690
CALL 0x00018bd0
SUB ESP,0xc
PUSH dword ptr [EAX]
CALL 0x000196f0
MOV dword ptr [ESP],EAX
LEA EAX,[EBX + 0xfffd8d7b]
PUSH ESI
JMP 0x00057d78
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_00057d20(undefined4 param_1)\n\n{\n  uint uVar1;\n  int iVar2;\n  char *pcVar3;\n  int *piVar4;\n  char *pcVar5;\n  \n  uVar1 = fcntl64(param_1,1);\n  if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }\n  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);\n                    /* WARNING: Subroutine does not return */\n  exit(1);\n}\n\n" comment (function_definition "void FUN_00057d20(undefined4 param_1)\n\n{\n  uint uVar1;\n  int iVar2;\n  char *pcVar3;\n  int *piVar4;\n  char *pcVar5;\n  \n  uVar1 = fcntl64(param_1,1);\n  if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }\n  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);\n                    /* WARNING: Subroutine does not return */\n  exit(1);\n}" primitive_type (function_declarator "FUN_00057d20(undefined4 param_1)" identifier (parameter_list "(undefined4 param_1)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  char *pcVar3;\n  int *piVar4;\n  char *pcVar5;\n  \n  uVar1 = fcntl64(param_1,1);\n  if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }\n  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);\n                    /* WARNING: Subroutine does not return */\n  exit(1);\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (expression_statement "uVar1 = fcntl64(param_1,1);" (assignment_expression "uVar1 = fcntl64(param_1,1)" identifier = (call_expression "fcntl64(param_1,1)" identifier (argument_list "(param_1,1)" ( identifier , number_literal )))) ;) (if_statement "if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }" if (parenthesized_expression "((int)uVar1 < 0)" ( (binary_expression "(int)uVar1 < 0" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }" { (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar5 = strerror(*piVar4);" (assignment_expression "pcVar5 = strerror(*piVar4)" identifier = (call_expression "strerror(*piVar4)" identifier (argument_list "(*piVar4)" ( (pointer_expression "*piVar4" * identifier) )))) ;) (expression_statement "pcVar3 = "%d: fcntl(F_GETFD): %s\n";" (assignment_expression "pcVar3 = "%d: fcntl(F_GETFD): %s\n"" identifier = (string_literal ""%d: fcntl(F_GETFD): %s\n"" " string_content escape_sequence ")) ;) }) (else_clause "else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }" else (compound_statement "{\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }" { (expression_statement "iVar2 = fcntl64(param_1,2,uVar1 | 1);" (assignment_expression "iVar2 = fcntl64(param_1,2,uVar1 | 1)" identifier = (call_expression "fcntl64(param_1,2,uVar1 | 1)" identifier (argument_list "(param_1,2,uVar1 | 1)" ( identifier , number_literal , (binary_expression "uVar1 | 1" identifier | number_literal) )))) ;) (if_statement "if (-1 < iVar2) {\n      return;\n    }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n      return;\n    }" { (return_statement "return;" return ;) })) (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar5 = strerror(*piVar4);" (assignment_expression "pcVar5 = strerror(*piVar4)" identifier = (call_expression "strerror(*piVar4)" identifier (argument_list "(*piVar4)" ( (pointer_expression "*piVar4" * identifier) )))) ;) (expression_statement "pcVar3 = "%d: fcntl(F_SETFD): %s\n";" (assignment_expression "pcVar3 = "%d: fcntl(F_SETFD): %s\n"" identifier = (string_literal ""%d: fcntl(F_SETFD): %s\n"" " string_content escape_sequence ")) ;) }))) (expression_statement "__fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);" (call_expression "__fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5)" identifier (argument_list "(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5)" ( (pointer_expression "*(undefined4 *)PTR_stderr_000a1ff4" * (cast_expression "(undefined4 *)PTR_stderr_000a1ff4" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) , number_literal , identifier , identifier , identifier ))) ;) comment (expression_statement "exit(1);" (call_expression "exit(1)" identifier (argument_list "(1)" ( number_literal ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nvoid cloexec(int fd)\n\n{\n  uint uVar1;\n  int iVar2;\n  char *pcVar3;\n  int *piVar4;\n  char *pcVar5;\n  \n  uVar1 = fcntl64(fd,1);\n  if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(fd,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }\n  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,fd,pcVar5);\n                    /* WARNING: Subroutine does not return */\n  exit(1);\n}\n\n" comment comment (function_definition "void cloexec(int fd)\n\n{\n  uint uVar1;\n  int iVar2;\n  char *pcVar3;\n  int *piVar4;\n  char *pcVar5;\n  \n  uVar1 = fcntl64(fd,1);\n  if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(fd,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }\n  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,fd,pcVar5);\n                    /* WARNING: Subroutine does not return */\n  exit(1);\n}" primitive_type (function_declarator "cloexec(int fd)" identifier (parameter_list "(int fd)" ( (parameter_declaration "int fd" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  char *pcVar3;\n  int *piVar4;\n  char *pcVar5;\n  \n  uVar1 = fcntl64(fd,1);\n  if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(fd,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }\n  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,fd,pcVar5);\n                    /* WARNING: Subroutine does not return */\n  exit(1);\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (expression_statement "uVar1 = fcntl64(fd,1);" (assignment_expression "uVar1 = fcntl64(fd,1)" identifier = (call_expression "fcntl64(fd,1)" identifier (argument_list "(fd,1)" ( identifier , number_literal )))) ;) (if_statement "if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(fd,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }" if (parenthesized_expression "((int)uVar1 < 0)" ( (binary_expression "(int)uVar1 < 0" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }" { (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar5 = strerror(*piVar4);" (assignment_expression "pcVar5 = strerror(*piVar4)" identifier = (call_expression "strerror(*piVar4)" identifier (argument_list "(*piVar4)" ( (pointer_expression "*piVar4" * identifier) )))) ;) (expression_statement "pcVar3 = "%d: fcntl(F_GETFD): %s\n";" (assignment_expression "pcVar3 = "%d: fcntl(F_GETFD): %s\n"" identifier = (string_literal ""%d: fcntl(F_GETFD): %s\n"" " string_content escape_sequence ")) ;) }) (else_clause "else {\n    iVar2 = fcntl64(fd,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }" else (compound_statement "{\n    iVar2 = fcntl64(fd,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }" { (expression_statement "iVar2 = fcntl64(fd,2,uVar1 | 1);" (assignment_expression "iVar2 = fcntl64(fd,2,uVar1 | 1)" identifier = (call_expression "fcntl64(fd,2,uVar1 | 1)" identifier (argument_list "(fd,2,uVar1 | 1)" ( identifier , number_literal , (binary_expression "uVar1 | 1" identifier | number_literal) )))) ;) (if_statement "if (-1 < iVar2) {\n      return;\n    }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n      return;\n    }" { (return_statement "return;" return ;) })) (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar5 = strerror(*piVar4);" (assignment_expression "pcVar5 = strerror(*piVar4)" identifier = (call_expression "strerror(*piVar4)" identifier (argument_list "(*piVar4)" ( (pointer_expression "*piVar4" * identifier) )))) ;) (expression_statement "pcVar3 = "%d: fcntl(F_SETFD): %s\n";" (assignment_expression "pcVar3 = "%d: fcntl(F_SETFD): %s\n"" identifier = (string_literal ""%d: fcntl(F_SETFD): %s\n"" " string_content escape_sequence ")) ;) }))) (expression_statement "__fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,fd,pcVar5);" (call_expression "__fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,fd,pcVar5)" identifier (argument_list "(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,fd,pcVar5)" ( (pointer_expression "*(undefined4 *)PTR_stderr_000a1ff4" * (cast_expression "(undefined4 *)PTR_stderr_000a1ff4" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) , number_literal , identifier , identifier , identifier ))) ;) comment (expression_statement "exit(1);" (call_expression "exit(1)" identifier (argument_list "(1)" ( number_literal ))) ;) })))
(translation_unit "void FUN_00057d20(undefined4 param_1)\n\n{\n  uint uVar1;\n  int iVar2;\n  char *pcVar3;\n  int *piVar4;\n  char *pcVar5;\n  \n  uVar1 = fcntl64(param_1,1);\n  if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }\n  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);\n                    \n  exit(1);\n}\n\n" (function_definition "void FUN_00057d20(undefined4 param_1)\n\n{\n  uint uVar1;\n  int iVar2;\n  char *pcVar3;\n  int *piVar4;\n  char *pcVar5;\n  \n  uVar1 = fcntl64(param_1,1);\n  if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }\n  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);\n                    \n  exit(1);\n}" primitive_type (function_declarator "FUN_00057d20(undefined4 param_1)" identifier (parameter_list "(undefined4 param_1)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  char *pcVar3;\n  int *piVar4;\n  char *pcVar5;\n  \n  uVar1 = fcntl64(param_1,1);\n  if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }\n  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);\n                    \n  exit(1);\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (expression_statement "uVar1 = fcntl64(param_1,1);" (assignment_expression "uVar1 = fcntl64(param_1,1)" identifier = (call_expression "fcntl64(param_1,1)" identifier (argument_list "(param_1,1)" ( identifier , number_literal )))) ;) (if_statement "if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }" if (parenthesized_expression "((int)uVar1 < 0)" ( (binary_expression "(int)uVar1 < 0" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }" { (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar5 = strerror(*piVar4);" (assignment_expression "pcVar5 = strerror(*piVar4)" identifier = (call_expression "strerror(*piVar4)" identifier (argument_list "(*piVar4)" ( (pointer_expression "*piVar4" * identifier) )))) ;) (expression_statement "pcVar3 = "%d: fcntl(F_GETFD): %s\n";" (assignment_expression "pcVar3 = "%d: fcntl(F_GETFD): %s\n"" identifier = (string_literal ""%d: fcntl(F_GETFD): %s\n"" " string_content escape_sequence ")) ;) }) (else_clause "else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }" else (compound_statement "{\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }" { (expression_statement "iVar2 = fcntl64(param_1,2,uVar1 | 1);" (assignment_expression "iVar2 = fcntl64(param_1,2,uVar1 | 1)" identifier = (call_expression "fcntl64(param_1,2,uVar1 | 1)" identifier (argument_list "(param_1,2,uVar1 | 1)" ( identifier , number_literal , (binary_expression "uVar1 | 1" identifier | number_literal) )))) ;) (if_statement "if (-1 < iVar2) {\n      return;\n    }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n      return;\n    }" { (return_statement "return;" return ;) })) (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "pcVar5 = strerror(*piVar4);" (assignment_expression "pcVar5 = strerror(*piVar4)" identifier = (call_expression "strerror(*piVar4)" identifier (argument_list "(*piVar4)" ( (pointer_expression "*piVar4" * identifier) )))) ;) (expression_statement "pcVar3 = "%d: fcntl(F_SETFD): %s\n";" (assignment_expression "pcVar3 = "%d: fcntl(F_SETFD): %s\n"" identifier = (string_literal ""%d: fcntl(F_SETFD): %s\n"" " string_content escape_sequence ")) ;) }))) (expression_statement "__fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);" (call_expression "__fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5)" identifier (argument_list "(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5)" ( (pointer_expression "*(undefined4 *)PTR_stderr_000a1ff4" * (cast_expression "(undefined4 *)PTR_stderr_000a1ff4" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) , number_literal , identifier , identifier , identifier ))) ;) (expression_statement "exit(1);" (call_expression "exit(1)" identifier (argument_list "(1)" ( number_literal ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (string_literal " string_content escape_sequence ")) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , (binary_expression IDENT | LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (string_literal " string_content escape_sequence ")) ;) }))) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) , LIT , IDENT , IDENT , IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) })))
(function_definition "void FUN_00057d20(undefined4 param_1)\n\n{\n  uint uVar1;\n  int iVar2;\n  char *pcVar3;\n  int *piVar4;\n  char *pcVar5;\n  \n  uVar1 = fcntl64(param_1,1);\n  if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }\n  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);\n                    \n  exit(1);\n}" (primitive_type "void") (function_declarator "FUN_00057d20(undefined4 param_1)" (identifier "FUN_00057d20") (parameter_list "(undefined4 param_1)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) () ")"))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  char *pcVar3;\n  int *piVar4;\n  char *pcVar5;\n  \n  uVar1 = fcntl64(param_1,1);\n  if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }\n  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);\n                    \n  exit(1);\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "char *pcVar3;" (primitive_type "char") (pointer_declarator "*pcVar3" (* "*") (identifier "pcVar3")) (; ";")) (declaration "int *piVar4;" (primitive_type "int") (pointer_declarator "*piVar4" (* "*") (identifier "piVar4")) (; ";")) (declaration "char *pcVar5;" (primitive_type "char") (pointer_declarator "*pcVar5" (* "*") (identifier "pcVar5")) (; ";")) (expression_statement "uVar1 = fcntl64(param_1,1);" (assignment_expression "uVar1 = fcntl64(param_1,1)" (identifier "uVar1") (= "=") (call_expression "fcntl64(param_1,1)" (identifier "fcntl64") (argument_list "(param_1,1)" (( "(") (identifier "param_1") (, ",") (number_literal "1") () ")")))) (; ";")) (if_statement "if ((int)uVar1 < 0) {\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }\n  else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }" (if "if") (parenthesized_expression "((int)uVar1 < 0)" (( "(") (binary_expression "(int)uVar1 < 0" (cast_expression "(int)uVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar1")) (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_GETFD): %s\n";\n  }" ({ "{") (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" (identifier "piVar4") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "pcVar5 = strerror(*piVar4);" (assignment_expression "pcVar5 = strerror(*piVar4)" (identifier "pcVar5") (= "=") (call_expression "strerror(*piVar4)" (identifier "strerror") (argument_list "(*piVar4)" (( "(") (pointer_expression "*piVar4" (* "*") (identifier "piVar4")) () ")")))) (; ";")) (expression_statement "pcVar3 = "%d: fcntl(F_GETFD): %s\n";" (assignment_expression "pcVar3 = "%d: fcntl(F_GETFD): %s\n"" (identifier "pcVar3") (= "=") (string_literal ""%d: fcntl(F_GETFD): %s\n"" (" """) (string_content "%d: fcntl(F_GETFD): %s") (escape_sequence "\n") (" """))) (; ";")) (} "}")) (else_clause "else {\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }" (else "else") (compound_statement "{\n    iVar2 = fcntl64(param_1,2,uVar1 | 1);\n    if (-1 < iVar2) {\n      return;\n    }\n    piVar4 = __errno_location();\n    pcVar5 = strerror(*piVar4);\n    pcVar3 = "%d: fcntl(F_SETFD): %s\n";\n  }" ({ "{") (expression_statement "iVar2 = fcntl64(param_1,2,uVar1 | 1);" (assignment_expression "iVar2 = fcntl64(param_1,2,uVar1 | 1)" (identifier "iVar2") (= "=") (call_expression "fcntl64(param_1,2,uVar1 | 1)" (identifier "fcntl64") (argument_list "(param_1,2,uVar1 | 1)" (( "(") (identifier "param_1") (, ",") (number_literal "2") (, ",") (binary_expression "uVar1 | 1" (identifier "uVar1") (| "|") (number_literal "1")) () ")")))) (; ";")) (if_statement "if (-1 < iVar2) {\n      return;\n    }" (if "if") (parenthesized_expression "(-1 < iVar2)" (( "(") (binary_expression "-1 < iVar2" (number_literal "-1") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n      return;\n    }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" (identifier "piVar4") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "pcVar5 = strerror(*piVar4);" (assignment_expression "pcVar5 = strerror(*piVar4)" (identifier "pcVar5") (= "=") (call_expression "strerror(*piVar4)" (identifier "strerror") (argument_list "(*piVar4)" (( "(") (pointer_expression "*piVar4" (* "*") (identifier "piVar4")) () ")")))) (; ";")) (expression_statement "pcVar3 = "%d: fcntl(F_SETFD): %s\n";" (assignment_expression "pcVar3 = "%d: fcntl(F_SETFD): %s\n"" (identifier "pcVar3") (= "=") (string_literal ""%d: fcntl(F_SETFD): %s\n"" (" """) (string_content "%d: fcntl(F_SETFD): %s") (escape_sequence "\n") (" """))) (; ";")) (} "}")))) (expression_statement "__fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);" (call_expression "__fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5)" (identifier "__fprintf_chk") (argument_list "(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5)" (( "(") (pointer_expression "*(undefined4 *)PTR_stderr_000a1ff4" (* "*") (cast_expression "(undefined4 *)PTR_stderr_000a1ff4" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_stderr_000a1ff4"))) (, ",") (number_literal "1") (, ",") (identifier "pcVar3") (, ",") (identifier "param_1") (, ",") (identifier "pcVar5") () ")"))) (; ";")) (expression_statement "exit(1);" (call_expression "exit(1)" (identifier "exit") (argument_list "(1)" (( "(") (number_literal "1") () ")"))) (; ";")) (} "}")))

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

void function_1(int fd)

{
  type_1 var_4;
  int var_5;
  char *pcVar3;
  int *piVar4;
  char *pcVar5;
  
  var_4 = var_1(fd,1);
  if ((int)var_4 < 0) {
    piVar4 = var_2();
    pcVar5 = var_3(*piVar4);
    pcVar3 = "%d: fcntl(F_GETFD): %s\n";
  }
  else {
    var_5 = var_1(fd,2,var_4 | 1);
    if (-1 < var_5) {
      return;
    }
    piVar4 = var_2();
    pcVar5 = var_3(*piVar4);
    pcVar3 = "%d: fcntl(F_SETFD): %s\n";
  }
  var_6(*(type_2 *)PTR_stderr_000a1ff4,1,pcVar3,fd,pcVar5);
                    /* WARNING: Subroutine does not return */
  var_7(1);
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) 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: (pointer_declarator 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: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (string_literal (string_content) (escape_sequence))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (binary_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (return_statement))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (string_literal (string_content) (escape_sequence))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier))) (number_literal) (identifier) (identifier) (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal)))))))

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

void MASKED(undefined4 param_1)

{
  uint uVar1;
  int iVar2;
  char *pcVar3;
  int *piVar4;
  char *pcVar5;
  
  uVar1 = fcntl64(param_1,1);
  if ((int)uVar1 < 0) {
    piVar4 = __errno_location();
    pcVar5 = strerror(*piVar4);
    pcVar3 = "%d: fcntl(F_GETFD): %s\n";
  }
  else {
    iVar2 = fcntl64(param_1,2,uVar1 | 1);
    if (-1 < iVar2) {
      return;
    }
    piVar4 = __errno_location();
    pcVar5 = strerror(*piVar4);
    pcVar3 = "%d: fcntl(F_SETFD): %s\n";
  }
  __fprintf_chk(*(undefined4 *)PTR_stderr_000a1ff4,1,pcVar3,param_1,pcVar5);
                    /* WARNING: Subroutine does not return */
  exit(1);
}

