
int fd_safer(int fd)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  
  iVar2 = fd;
  if ((uint)fd < 3) {
    iVar2 = dup_safer(fd);
    piVar3 = __errno_location();
    iVar1 = *piVar3;
    close(fd);
    *piVar3 = iVar1;
  }
  return iVar2;
}



uint FUN_001099d3(uint param_1)

{
  int iVar1;
  uint uVar2;
  int *piVar3;
  
  uVar2 = param_1;
  if (param_1 < 3) {
    uVar2 = FUN_00109ce3();
    piVar3 = __errno_location();
    iVar1 = *piVar3;
    close(param_1);
    *piVar3 = iVar1;
  }
  return uVar2;
}


PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x8
MOV EBX,EDI
CMP EDI,0x2
JBE 0x001099f1
MOV EAX,EBX
ADD RSP,0x8
POP RBX
POP RBP
POP R12
POP R13
RET
CALL 0x00109ce3
MOV R12D,EAX
CALL 0x00102040
MOV RBP,RAX
MOV R13D,dword ptr [RAX]
MOV EDI,EBX
CALL 0x00102190
MOV dword ptr [RBP],R13D
MOV EBX,R12D
JMP 0x001099e4
(translation_unit "uint FUN_001099d3(uint param_1)\n\n{\n  int iVar1;\n  uint uVar2;\n  int *piVar3;\n  \n  uVar2 = param_1;\n  if (param_1 < 3) {\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }\n  return uVar2;\n}\n\n" (function_definition "uint FUN_001099d3(uint param_1)\n\n{\n  int iVar1;\n  uint uVar2;\n  int *piVar3;\n  \n  uVar2 = param_1;\n  if (param_1 < 3) {\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_001099d3(uint param_1)" identifier (parameter_list "(uint param_1)" ( (parameter_declaration "uint param_1" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  int *piVar3;\n  \n  uVar2 = param_1;\n  if (param_1 < 3) {\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (expression_statement "uVar2 = param_1;" (assignment_expression "uVar2 = param_1" identifier = identifier) ;) (if_statement "if (param_1 < 3) {\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }" if (parenthesized_expression "(param_1 < 3)" ( (binary_expression "param_1 < 3" identifier < number_literal) )) (compound_statement "{\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }" { (expression_statement "uVar2 = FUN_00109ce3();" (assignment_expression "uVar2 = FUN_00109ce3()" identifier = (call_expression "FUN_00109ce3()" identifier (argument_list "()" ( )))) ;) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "close(param_1);" (call_expression "close(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) })) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "int fd_safer(int fd)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  \n  iVar2 = fd;\n  if ((uint)fd < 3) {\n    iVar2 = dup_safer(fd);\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(fd);\n    *piVar3 = iVar1;\n  }\n  return iVar2;\n}\n\n" (function_definition "int fd_safer(int fd)\n\n{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  \n  iVar2 = fd;\n  if ((uint)fd < 3) {\n    iVar2 = dup_safer(fd);\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(fd);\n    *piVar3 = iVar1;\n  }\n  return iVar2;\n}" primitive_type (function_declarator "fd_safer(int fd)" identifier (parameter_list "(int fd)" ( (parameter_declaration "int fd" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int *piVar3;\n  \n  iVar2 = fd;\n  if ((uint)fd < 3) {\n    iVar2 = dup_safer(fd);\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(fd);\n    *piVar3 = iVar1;\n  }\n  return iVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (expression_statement "iVar2 = fd;" (assignment_expression "iVar2 = fd" identifier = identifier) ;) (if_statement "if ((uint)fd < 3) {\n    iVar2 = dup_safer(fd);\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(fd);\n    *piVar3 = iVar1;\n  }" if (parenthesized_expression "((uint)fd < 3)" ( (binary_expression "(uint)fd < 3" (cast_expression "(uint)fd" ( (type_descriptor "uint" type_identifier) ) identifier) < number_literal) )) (compound_statement "{\n    iVar2 = dup_safer(fd);\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(fd);\n    *piVar3 = iVar1;\n  }" { (expression_statement "iVar2 = dup_safer(fd);" (assignment_expression "iVar2 = dup_safer(fd)" identifier = (call_expression "dup_safer(fd)" identifier (argument_list "(fd)" ( identifier )))) ;) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "close(fd);" (call_expression "close(fd)" identifier (argument_list "(fd)" ( identifier ))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "uint FUN_001099d3(uint param_1)\n\n{\n  int iVar1;\n  uint uVar2;\n  int *piVar3;\n  \n  uVar2 = param_1;\n  if (param_1 < 3) {\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }\n  return uVar2;\n}\n\n" (function_definition "uint FUN_001099d3(uint param_1)\n\n{\n  int iVar1;\n  uint uVar2;\n  int *piVar3;\n  \n  uVar2 = param_1;\n  if (param_1 < 3) {\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_001099d3(uint param_1)" identifier (parameter_list "(uint param_1)" ( (parameter_declaration "uint param_1" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  int *piVar3;\n  \n  uVar2 = param_1;\n  if (param_1 < 3) {\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (expression_statement "uVar2 = param_1;" (assignment_expression "uVar2 = param_1" identifier = identifier) ;) (if_statement "if (param_1 < 3) {\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }" if (parenthesized_expression "(param_1 < 3)" ( (binary_expression "param_1 < 3" identifier < number_literal) )) (compound_statement "{\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }" { (expression_statement "uVar2 = FUN_00109ce3();" (assignment_expression "uVar2 = FUN_00109ce3()" identifier = (call_expression "FUN_00109ce3()" identifier (argument_list "()" ( )))) ;) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "close(param_1);" (call_expression "close(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) })) (return_statement "return uVar2;" return identifier ;) })))
(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) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) })) (return_statement return IDENT ;) })))
(function_definition "uint FUN_001099d3(uint param_1)\n\n{\n  int iVar1;\n  uint uVar2;\n  int *piVar3;\n  \n  uVar2 = param_1;\n  if (param_1 < 3) {\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }\n  return uVar2;\n}" (type_identifier "uint") (function_declarator "FUN_001099d3(uint param_1)" (identifier "FUN_001099d3") (parameter_list "(uint param_1)" (( "(") (parameter_declaration "uint param_1" (type_identifier "uint") (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  int *piVar3;\n  \n  uVar2 = param_1;\n  if (param_1 < 3) {\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }\n  return uVar2;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (expression_statement "uVar2 = param_1;" (assignment_expression "uVar2 = param_1" (identifier "uVar2") (= "=") (identifier "param_1")) (; ";")) (if_statement "if (param_1 < 3) {\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }" (if "if") (parenthesized_expression "(param_1 < 3)" (( "(") (binary_expression "param_1 < 3" (identifier "param_1") (< "<") (number_literal "3")) () ")")) (compound_statement "{\n    uVar2 = FUN_00109ce3();\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    close(param_1);\n    *piVar3 = iVar1;\n  }" ({ "{") (expression_statement "uVar2 = FUN_00109ce3();" (assignment_expression "uVar2 = FUN_00109ce3()" (identifier "uVar2") (= "=") (call_expression "FUN_00109ce3()" (identifier "FUN_00109ce3") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" (identifier "iVar1") (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (expression_statement "close(param_1);" (call_expression "close(param_1)" (identifier "close") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "iVar1")) (; ";")) (} "}"))) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))

int function_1(int fd)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  
  iVar2 = fd;
  if ((type_1)fd < 3) {
    iVar2 = var_1(fd);
    piVar3 = var_2();
    iVar1 = *piVar3;
    var_3(fd);
    *piVar3 = iVar1;
  }
  return iVar2;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (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)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))))) (return_statement (identifier)))))

uint MASKED(uint param_1)

{
  int iVar1;
  uint uVar2;
  int *piVar3;
  
  uVar2 = param_1;
  if (param_1 < 3) {
    uVar2 = FUN_00109ce3();
    piVar3 = __errno_location();
    iVar1 = *piVar3;
    close(param_1);
    *piVar3 = iVar1;
  }
  return uVar2;
}

