
/* WARNING: Unknown calling convention */

int have_controlling_tty(void)

{
  int iVar1;
  int *piVar2;
  
  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);
  if (iVar1 < 0) {
    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();
    iVar1 = 0;
    if (*piVar2 != 6) {
      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);
      iVar1 = (*(code *)PTR_exit_000807b8)(1);
      return iVar1;
    }
  }
  else {
    (*(code *)PTR_close_0008073c)(iVar1);
    iVar1 = 1;
  }
  return iVar1;
}



undefined4 have_controlling_tty(void)

{
  int iVar1;
  int *piVar2;
  undefined4 uVar3;
  
  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);
  if (iVar1 < 0) {
    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();
    uVar3 = 0;
    if (*piVar2 != 6) {
      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);
      uVar3 = (*(code *)PTR_exit_000807b8)(1);
      return uVar3;
    }
  }
  else {
    (*(code *)PTR_close_0008073c)(iVar1);
    uVar3 = 1;
  }
  return uVar3;
}


lui gp,0x3
addiu gp,gp,-0x2d68
addu gp,gp,t9
addiu sp,sp,-0x20
sw ra,0x1c(sp)
sw gp,0x10(sp)
or a1,zero,zero
lw a0,-0x7f3c(gp)
addiu a0,a0,-0x3d4c
lw t9,-0x76f0(gp)
jalr t9
_nop
lw gp,0x10(sp)
bgez v0,0x0005ae64
_lw t9,-0x77b8(gp)
jalr t9
_nop
lw gp,0x10(sp)
lw a0,0x0(v0)
li v1,0x6
bne a0,v1,0x0005ae3c
_or v0,zero,zero
lw ra,0x1c(sp)
jr ra
_addiu sp,sp,0x20
lw a0,-0x7f3c(gp)
addiu a0,a0,-0x29e0
lw t9,-0x78d8(gp)
jalr t9
_nop
lw gp,0x10(sp)
li a0,0x1
lw t9,-0x78b8(gp)
jalr t9
_nop
or a0,v0,zero
lw t9,-0x7934(gp)
jalr t9
_nop
lw gp,0x10(sp)
b 0x0005ae30
_li v0,0x1
(translation_unit "undefined4 have_controlling_tty(void)\n\n{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  \n  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);\n  if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }\n  return uVar3;\n}\n\n" (function_definition "undefined4 have_controlling_tty(void)\n\n{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  \n  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);\n  if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }\n  return uVar3;\n}" type_identifier (function_declarator "have_controlling_tty(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  \n  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);\n  if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }\n  return uVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (expression_statement "iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0)" identifier = (call_expression "(*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0)" (parenthesized_expression "(*(code *)PTR_open64_00080980)" ( (pointer_expression "*(code *)PTR_open64_00080980" * (cast_expression "(code *)PTR_open64_00080980" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_DAT_00080134 + -0x3d4c,0)" ( (binary_expression "PTR_DAT_00080134 + -0x3d4c" identifier + number_literal) , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }" { (expression_statement "piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();" (assignment_expression "piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_000808b8)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_000808b8)()" (parenthesized_expression "(*(code *)PTR___errno_location_000808b8)" ( (pointer_expression "*(code *)PTR___errno_location_000808b8" * (cast_expression "(code *)PTR___errno_location_000808b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) (if_statement "if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }" if (parenthesized_expression "(*piVar2 != 6)" ( (binary_expression "*piVar2 != 6" (pointer_expression "*piVar2" * identifier) != number_literal) )) (compound_statement "{\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }" { (expression_statement "(*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);" (call_expression "(*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0)" (parenthesized_expression "(*(code *)PTR_perror_00080798)" ( (pointer_expression "*(code *)PTR_perror_00080798" * (cast_expression "(code *)PTR_perror_00080798" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_DAT_00080134 + -0x29e0)" ( (binary_expression "PTR_DAT_00080134 + -0x29e0" identifier + number_literal) ))) ;) (expression_statement "uVar3 = (*(code *)PTR_exit_000807b8)(1);" (assignment_expression "uVar3 = (*(code *)PTR_exit_000807b8)(1)" identifier = (call_expression "(*(code *)PTR_exit_000807b8)(1)" (parenthesized_expression "(*(code *)PTR_exit_000807b8)" ( (pointer_expression "*(code *)PTR_exit_000807b8" * (cast_expression "(code *)PTR_exit_000807b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(1)" ( number_literal )))) ;) (return_statement "return uVar3;" return identifier ;) })) }) (else_clause "else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }" else (compound_statement "{\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }" { (expression_statement "(*(code *)PTR_close_0008073c)(iVar1);" (call_expression "(*(code *)PTR_close_0008073c)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0008073c)" ( (pointer_expression "*(code *)PTR_close_0008073c" * (cast_expression "(code *)PTR_close_0008073c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" identifier = number_literal) ;) }))) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nint have_controlling_tty(void)\n\n{\n  int iVar1;\n  int *piVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);\n  if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    iVar1 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      iVar1 = (*(code *)PTR_exit_000807b8)(1);\n      return iVar1;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    iVar1 = 1;\n  }\n  return iVar1;\n}\n\n" comment (function_definition "int have_controlling_tty(void)\n\n{\n  int iVar1;\n  int *piVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);\n  if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    iVar1 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      iVar1 = (*(code *)PTR_exit_000807b8)(1);\n      return iVar1;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    iVar1 = 1;\n  }\n  return iVar1;\n}" primitive_type (function_declarator "have_controlling_tty(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);\n  if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    iVar1 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      iVar1 = (*(code *)PTR_exit_000807b8)(1);\n      return iVar1;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    iVar1 = 1;\n  }\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (expression_statement "iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0)" identifier = (call_expression "(*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0)" (parenthesized_expression "(*(code *)PTR_open64_00080980)" ( (pointer_expression "*(code *)PTR_open64_00080980" * (cast_expression "(code *)PTR_open64_00080980" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_DAT_00080134 + -0x3d4c,0)" ( (binary_expression "PTR_DAT_00080134 + -0x3d4c" identifier + number_literal) , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    iVar1 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      iVar1 = (*(code *)PTR_exit_000807b8)(1);\n      return iVar1;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    iVar1 = 1;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    iVar1 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      iVar1 = (*(code *)PTR_exit_000807b8)(1);\n      return iVar1;\n    }\n  }" { (expression_statement "piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();" (assignment_expression "piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_000808b8)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_000808b8)()" (parenthesized_expression "(*(code *)PTR___errno_location_000808b8)" ( (pointer_expression "*(code *)PTR___errno_location_000808b8" * (cast_expression "(code *)PTR___errno_location_000808b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) (if_statement "if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      iVar1 = (*(code *)PTR_exit_000807b8)(1);\n      return iVar1;\n    }" if (parenthesized_expression "(*piVar2 != 6)" ( (binary_expression "*piVar2 != 6" (pointer_expression "*piVar2" * identifier) != number_literal) )) (compound_statement "{\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      iVar1 = (*(code *)PTR_exit_000807b8)(1);\n      return iVar1;\n    }" { (expression_statement "(*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);" (call_expression "(*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0)" (parenthesized_expression "(*(code *)PTR_perror_00080798)" ( (pointer_expression "*(code *)PTR_perror_00080798" * (cast_expression "(code *)PTR_perror_00080798" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_DAT_00080134 + -0x29e0)" ( (binary_expression "PTR_DAT_00080134 + -0x29e0" identifier + number_literal) ))) ;) (expression_statement "iVar1 = (*(code *)PTR_exit_000807b8)(1);" (assignment_expression "iVar1 = (*(code *)PTR_exit_000807b8)(1)" identifier = (call_expression "(*(code *)PTR_exit_000807b8)(1)" (parenthesized_expression "(*(code *)PTR_exit_000807b8)" ( (pointer_expression "*(code *)PTR_exit_000807b8" * (cast_expression "(code *)PTR_exit_000807b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(1)" ( number_literal )))) ;) (return_statement "return iVar1;" return identifier ;) })) }) (else_clause "else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    iVar1 = 1;\n  }" else (compound_statement "{\n    (*(code *)PTR_close_0008073c)(iVar1);\n    iVar1 = 1;\n  }" { (expression_statement "(*(code *)PTR_close_0008073c)(iVar1);" (call_expression "(*(code *)PTR_close_0008073c)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0008073c)" ( (pointer_expression "*(code *)PTR_close_0008073c" * (cast_expression "(code *)PTR_close_0008073c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "iVar1 = 1;" (assignment_expression "iVar1 = 1" identifier = number_literal) ;) }))) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "undefined4 have_controlling_tty(void)\n\n{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  \n  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);\n  if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }\n  return uVar3;\n}\n\n" (function_definition "undefined4 have_controlling_tty(void)\n\n{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  \n  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);\n  if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }\n  return uVar3;\n}" type_identifier (function_declarator "have_controlling_tty(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  \n  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);\n  if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }\n  return uVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (expression_statement "iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0)" identifier = (call_expression "(*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0)" (parenthesized_expression "(*(code *)PTR_open64_00080980)" ( (pointer_expression "*(code *)PTR_open64_00080980" * (cast_expression "(code *)PTR_open64_00080980" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_DAT_00080134 + -0x3d4c,0)" ( (binary_expression "PTR_DAT_00080134 + -0x3d4c" identifier + number_literal) , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }" { (expression_statement "piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();" (assignment_expression "piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_000808b8)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_000808b8)()" (parenthesized_expression "(*(code *)PTR___errno_location_000808b8)" ( (pointer_expression "*(code *)PTR___errno_location_000808b8" * (cast_expression "(code *)PTR___errno_location_000808b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) (if_statement "if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }" if (parenthesized_expression "(*piVar2 != 6)" ( (binary_expression "*piVar2 != 6" (pointer_expression "*piVar2" * identifier) != number_literal) )) (compound_statement "{\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }" { (expression_statement "(*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);" (call_expression "(*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0)" (parenthesized_expression "(*(code *)PTR_perror_00080798)" ( (pointer_expression "*(code *)PTR_perror_00080798" * (cast_expression "(code *)PTR_perror_00080798" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_DAT_00080134 + -0x29e0)" ( (binary_expression "PTR_DAT_00080134 + -0x29e0" identifier + number_literal) ))) ;) (expression_statement "uVar3 = (*(code *)PTR_exit_000807b8)(1);" (assignment_expression "uVar3 = (*(code *)PTR_exit_000807b8)(1)" identifier = (call_expression "(*(code *)PTR_exit_000807b8)(1)" (parenthesized_expression "(*(code *)PTR_exit_000807b8)" ( (pointer_expression "*(code *)PTR_exit_000807b8" * (cast_expression "(code *)PTR_exit_000807b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(1)" ( number_literal )))) ;) (return_statement "return uVar3;" return identifier ;) })) }) (else_clause "else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }" else (compound_statement "{\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }" { (expression_statement "(*(code *)PTR_close_0008073c)(iVar1);" (call_expression "(*(code *)PTR_close_0008073c)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0008073c)" ( (pointer_expression "*(code *)PTR_close_0008073c" * (cast_expression "(code *)PTR_close_0008073c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" identifier = number_literal) ;) }))) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + LIT) , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + LIT) ))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( LIT )))) ;) (return_statement return IDENT ;) })) }) (else_clause else (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }))) (return_statement return IDENT ;) })))
(function_definition "undefined4 have_controlling_tty(void)\n\n{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  \n  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);\n  if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }\n  return uVar3;\n}" (type_identifier "undefined4") (function_declarator "have_controlling_tty(void)" (identifier "have_controlling_tty") (parameter_list "(void)" (( "(") (parameter_declaration "void" (primitive_type "void")) () ")"))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  undefined4 uVar3;\n  \n  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);\n  if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }\n  return uVar3;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "undefined4 uVar3;" (type_identifier "undefined4") (identifier "uVar3") (; ";")) (expression_statement "iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0)" (parenthesized_expression "(*(code *)PTR_open64_00080980)" (( "(") (pointer_expression "*(code *)PTR_open64_00080980" (* "*") (cast_expression "(code *)PTR_open64_00080980" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_open64_00080980"))) () ")")) (argument_list "(PTR_DAT_00080134 + -0x3d4c,0)" (( "(") (binary_expression "PTR_DAT_00080134 + -0x3d4c" (identifier "PTR_DAT_00080134") (+ "+") (number_literal "-0x3d4c")) (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }\n  else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();\n    uVar3 = 0;\n    if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }\n  }" ({ "{") (expression_statement "piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();" (assignment_expression "piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)()" (identifier "piVar2") (= "=") (cast_expression "(int *)(*(code *)PTR___errno_location_000808b8)()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_000808b8)()" (parenthesized_expression "(*(code *)PTR___errno_location_000808b8)" (( "(") (pointer_expression "*(code *)PTR___errno_location_000808b8" (* "*") (cast_expression "(code *)PTR___errno_location_000808b8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_000808b8"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" (identifier "uVar3") (= "=") (number_literal "0")) (; ";")) (if_statement "if (*piVar2 != 6) {\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }" (if "if") (parenthesized_expression "(*piVar2 != 6)" (( "(") (binary_expression "*piVar2 != 6" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (!= "!=") (number_literal "6")) () ")")) (compound_statement "{\n      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);\n      uVar3 = (*(code *)PTR_exit_000807b8)(1);\n      return uVar3;\n    }" ({ "{") (expression_statement "(*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);" (call_expression "(*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0)" (parenthesized_expression "(*(code *)PTR_perror_00080798)" (( "(") (pointer_expression "*(code *)PTR_perror_00080798" (* "*") (cast_expression "(code *)PTR_perror_00080798" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_perror_00080798"))) () ")")) (argument_list "(PTR_DAT_00080134 + -0x29e0)" (( "(") (binary_expression "PTR_DAT_00080134 + -0x29e0" (identifier "PTR_DAT_00080134") (+ "+") (number_literal "-0x29e0")) () ")"))) (; ";")) (expression_statement "uVar3 = (*(code *)PTR_exit_000807b8)(1);" (assignment_expression "uVar3 = (*(code *)PTR_exit_000807b8)(1)" (identifier "uVar3") (= "=") (call_expression "(*(code *)PTR_exit_000807b8)(1)" (parenthesized_expression "(*(code *)PTR_exit_000807b8)" (( "(") (pointer_expression "*(code *)PTR_exit_000807b8" (* "*") (cast_expression "(code *)PTR_exit_000807b8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_exit_000807b8"))) () ")")) (argument_list "(1)" (( "(") (number_literal "1") () ")")))) (; ";")) (return_statement "return uVar3;" (return "return") (identifier "uVar3") (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }" (else "else") (compound_statement "{\n    (*(code *)PTR_close_0008073c)(iVar1);\n    uVar3 = 1;\n  }" ({ "{") (expression_statement "(*(code *)PTR_close_0008073c)(iVar1);" (call_expression "(*(code *)PTR_close_0008073c)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0008073c)" (( "(") (pointer_expression "*(code *)PTR_close_0008073c" (* "*") (cast_expression "(code *)PTR_close_0008073c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_0008073c"))) () ")")) (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" (identifier "uVar3") (= "=") (number_literal "1")) (; ";")) (} "}")))) (return_statement "return uVar3;" (return "return") (identifier "uVar3") (; ";")) (} "}")))

/* WARNING: Unknown calling convention */

int function_1(void)

{
  int var_2;
  int *piVar2;
  
  var_2 = (*(type_1 *)PTR_open64_00080980)(var_1 + -0x3d4c,0);
  if (var_2 < 0) {
    piVar2 = (int *)(*(type_1 *)PTR___errno_location_000808b8)();
    var_2 = 0;
    if (*piVar2 != 6) {
      (*(type_1 *)PTR_perror_00080798)(var_1 + -0x29e0);
      var_2 = (*(type_1 *)PTR_exit_000807b8)(1);
      return var_2;
    }
  }
  else {
    (*(type_1 *)PTR_close_0008073c)(var_2);
    var_2 = 1;
  }
  return var_2;
}


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

undefined4 MASKED(void)

{
  int iVar1;
  int *piVar2;
  undefined4 uVar3;
  
  iVar1 = (*(code *)PTR_open64_00080980)(PTR_DAT_00080134 + -0x3d4c,0);
  if (iVar1 < 0) {
    piVar2 = (int *)(*(code *)PTR___errno_location_000808b8)();
    uVar3 = 0;
    if (*piVar2 != 6) {
      (*(code *)PTR_perror_00080798)(PTR_DAT_00080134 + -0x29e0);
      uVar3 = (*(code *)PTR_exit_000807b8)(1);
      return uVar3;
    }
  }
  else {
    (*(code *)PTR_close_0008073c)(iVar1);
    uVar3 = 1;
  }
  return uVar3;
}

