
/* WARNING: Unknown calling convention */

int open_readfd(char *file)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  
  iVar1 = (*(code *)PTR_open64_004b2284)(file,0);
  if (iVar1 < 0) {
    iVar4 = -1;
  }
  else {
    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);
    iVar4 = iVar1;
    if (iVar2 != 0) {
      iVar4 = -1;
      (*(code *)PTR_close_004b2174)(iVar1);
      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();
      *puVar3 = 0x15;
    }
  }
  return iVar4;
}



int FUN_00434adc(undefined4 param_1)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  
  iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);
  if (iVar1 < 0) {
    iVar4 = -1;
  }
  else {
    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);
    iVar4 = iVar1;
    if (iVar2 != 0) {
      iVar4 = -1;
      (*(code *)PTR_close_004b2174)(iVar1);
      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();
      *puVar3 = 0x15;
    }
  }
  return iVar4;
}


lui gp,0x4c
addiu sp,sp,-0x20
addiu gp,gp,-0x64e0
or a1,zero,zero
sw gp,0x10(sp)
sw ra,0x1c(sp)
lw t9,-0x789c(gp)
jalr t9
_sw s0,0x18(sp)
bltz v0,0x00434b34
_lw gp,0x10(sp)
lw t9,-0x7e74(gp)
or a0,v0,zero
jalr t9
_or s0,v0,zero
bne v0,zero,0x00434b3c
_lw gp,0x10(sp)
lw ra,0x1c(sp)
or v0,s0,zero
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x20
b 0x00434b20
_li s0,-0x1
lw t9,-0x79ac(gp)
or a0,s0,zero
jalr t9
_li s0,-0x1
lw gp,0x10(sp)
lw t9,-0x78d0(gp)
jalr t9
_nop
li v1,0x15
b 0x00434b20
_sw v1,0x0(v0)
(translation_unit "int FUN_00434adc(undefined4 param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  \n  iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);\n  if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }\n  return iVar4;\n}\n\n" (function_definition "int FUN_00434adc(undefined4 param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  \n  iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);\n  if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }\n  return iVar4;\n}" primitive_type (function_declarator "FUN_00434adc(undefined4 param_1)" identifier (parameter_list "(undefined4 param_1)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  \n  iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);\n  if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }\n  return iVar4;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (expression_statement "iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0)" identifier = (call_expression "(*(code *)PTR_open64_004b2284)(param_1,0)" (parenthesized_expression "(*(code *)PTR_open64_004b2284)" ( (pointer_expression "*(code *)PTR_open64_004b2284" * (cast_expression "(code *)PTR_open64_004b2284" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar4 = -1;\n  }" { (expression_statement "iVar4 = -1;" (assignment_expression "iVar4 = -1" identifier = number_literal) ;) }) (else_clause "else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }" else (compound_statement "{\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }" { (expression_statement "iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);" (assignment_expression "iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1)" identifier = (call_expression "(*(code *)PTR_os_isdir_004b1cac)(iVar1)" (parenthesized_expression "(*(code *)PTR_os_isdir_004b1cac)" ( (pointer_expression "*(code *)PTR_os_isdir_004b1cac" * (cast_expression "(code *)PTR_os_isdir_004b1cac" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier )))) ;) (expression_statement "iVar4 = iVar1;" (assignment_expression "iVar4 = iVar1" identifier = identifier) ;) (if_statement "if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }" { (expression_statement "iVar4 = -1;" (assignment_expression "iVar4 = -1" identifier = number_literal) ;) (expression_statement "(*(code *)PTR_close_004b2174)(iVar1);" (call_expression "(*(code *)PTR_close_004b2174)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_004b2174)" ( (pointer_expression "*(code *)PTR_close_004b2174" * (cast_expression "(code *)PTR_close_004b2174" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();" (assignment_expression "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_004b2250)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_004b2250)()" (parenthesized_expression "(*(code *)PTR___errno_location_004b2250)" ( (pointer_expression "*(code *)PTR___errno_location_004b2250" * (cast_expression "(code *)PTR___errno_location_004b2250" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "*puVar3 = 0x15;" (assignment_expression "*puVar3 = 0x15" (pointer_expression "*puVar3" * identifier) = number_literal) ;) })) }))) (return_statement "return iVar4;" return identifier ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nint open_readfd(char *file)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  \n  iVar1 = (*(code *)PTR_open64_004b2284)(file,0);\n  if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }\n  return iVar4;\n}\n\n" comment (function_definition "int open_readfd(char *file)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  \n  iVar1 = (*(code *)PTR_open64_004b2284)(file,0);\n  if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }\n  return iVar4;\n}" primitive_type (function_declarator "open_readfd(char *file)" identifier (parameter_list "(char *file)" ( (parameter_declaration "char *file" primitive_type (pointer_declarator "*file" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  \n  iVar1 = (*(code *)PTR_open64_004b2284)(file,0);\n  if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }\n  return iVar4;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (expression_statement "iVar1 = (*(code *)PTR_open64_004b2284)(file,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_004b2284)(file,0)" identifier = (call_expression "(*(code *)PTR_open64_004b2284)(file,0)" (parenthesized_expression "(*(code *)PTR_open64_004b2284)" ( (pointer_expression "*(code *)PTR_open64_004b2284" * (cast_expression "(code *)PTR_open64_004b2284" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(file,0)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar4 = -1;\n  }" { (expression_statement "iVar4 = -1;" (assignment_expression "iVar4 = -1" identifier = number_literal) ;) }) (else_clause "else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }" else (compound_statement "{\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }" { (expression_statement "iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);" (assignment_expression "iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1)" identifier = (call_expression "(*(code *)PTR_os_isdir_004b1cac)(iVar1)" (parenthesized_expression "(*(code *)PTR_os_isdir_004b1cac)" ( (pointer_expression "*(code *)PTR_os_isdir_004b1cac" * (cast_expression "(code *)PTR_os_isdir_004b1cac" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier )))) ;) (expression_statement "iVar4 = iVar1;" (assignment_expression "iVar4 = iVar1" identifier = identifier) ;) (if_statement "if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }" { (expression_statement "iVar4 = -1;" (assignment_expression "iVar4 = -1" identifier = number_literal) ;) (expression_statement "(*(code *)PTR_close_004b2174)(iVar1);" (call_expression "(*(code *)PTR_close_004b2174)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_004b2174)" ( (pointer_expression "*(code *)PTR_close_004b2174" * (cast_expression "(code *)PTR_close_004b2174" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();" (assignment_expression "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_004b2250)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_004b2250)()" (parenthesized_expression "(*(code *)PTR___errno_location_004b2250)" ( (pointer_expression "*(code *)PTR___errno_location_004b2250" * (cast_expression "(code *)PTR___errno_location_004b2250" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "*puVar3 = 0x15;" (assignment_expression "*puVar3 = 0x15" (pointer_expression "*puVar3" * identifier) = number_literal) ;) })) }))) (return_statement "return iVar4;" return identifier ;) })))
(translation_unit "int FUN_00434adc(undefined4 param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  \n  iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);\n  if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }\n  return iVar4;\n}\n\n" (function_definition "int FUN_00434adc(undefined4 param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  \n  iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);\n  if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }\n  return iVar4;\n}" primitive_type (function_declarator "FUN_00434adc(undefined4 param_1)" identifier (parameter_list "(undefined4 param_1)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  \n  iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);\n  if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }\n  return iVar4;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (expression_statement "iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0)" identifier = (call_expression "(*(code *)PTR_open64_004b2284)(param_1,0)" (parenthesized_expression "(*(code *)PTR_open64_004b2284)" ( (pointer_expression "*(code *)PTR_open64_004b2284" * (cast_expression "(code *)PTR_open64_004b2284" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar4 = -1;\n  }" { (expression_statement "iVar4 = -1;" (assignment_expression "iVar4 = -1" identifier = number_literal) ;) }) (else_clause "else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }" else (compound_statement "{\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }" { (expression_statement "iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);" (assignment_expression "iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1)" identifier = (call_expression "(*(code *)PTR_os_isdir_004b1cac)(iVar1)" (parenthesized_expression "(*(code *)PTR_os_isdir_004b1cac)" ( (pointer_expression "*(code *)PTR_os_isdir_004b1cac" * (cast_expression "(code *)PTR_os_isdir_004b1cac" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier )))) ;) (expression_statement "iVar4 = iVar1;" (assignment_expression "iVar4 = iVar1" identifier = identifier) ;) (if_statement "if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }" { (expression_statement "iVar4 = -1;" (assignment_expression "iVar4 = -1" identifier = number_literal) ;) (expression_statement "(*(code *)PTR_close_004b2174)(iVar1);" (call_expression "(*(code *)PTR_close_004b2174)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_004b2174)" ( (pointer_expression "*(code *)PTR_close_004b2174" * (cast_expression "(code *)PTR_close_004b2174" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();" (assignment_expression "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)()" identifier = (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_004b2250)()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_004b2250)()" (parenthesized_expression "(*(code *)PTR___errno_location_004b2250)" ( (pointer_expression "*(code *)PTR___errno_location_004b2250" * (cast_expression "(code *)PTR___errno_location_004b2250" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) (expression_statement "*puVar3 = 0x15;" (assignment_expression "*puVar3 = 0x15" (pointer_expression "*puVar3" * identifier) = number_literal) ;) })) }))) (return_statement "return iVar4;" 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) ;) (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 ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (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 = (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 (pointer_expression * IDENT) = LIT) ;) })) }))) (return_statement return IDENT ;) })))
(function_definition "int FUN_00434adc(undefined4 param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  \n  iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);\n  if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }\n  return iVar4;\n}" (primitive_type "int") (function_declarator "FUN_00434adc(undefined4 param_1)" (identifier "FUN_00434adc") (parameter_list "(undefined4 param_1)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int iVar4;\n  \n  iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);\n  if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }\n  return iVar4;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined4 *puVar3;" (type_identifier "undefined4") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (expression_statement "iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_open64_004b2284)(param_1,0)" (parenthesized_expression "(*(code *)PTR_open64_004b2284)" (( "(") (pointer_expression "*(code *)PTR_open64_004b2284" (* "*") (cast_expression "(code *)PTR_open64_004b2284" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_open64_004b2284"))) () ")")) (argument_list "(param_1,0)" (( "(") (identifier "param_1") (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\n    iVar4 = -1;\n  }\n  else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    iVar4 = -1;\n  }" ({ "{") (expression_statement "iVar4 = -1;" (assignment_expression "iVar4 = -1" (identifier "iVar4") (= "=") (number_literal "-1")) (; ";")) (} "}")) (else_clause "else {\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }" (else "else") (compound_statement "{\n    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);\n    iVar4 = iVar1;\n    if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }\n  }" ({ "{") (expression_statement "iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);" (assignment_expression "iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_os_isdir_004b1cac)(iVar1)" (parenthesized_expression "(*(code *)PTR_os_isdir_004b1cac)" (( "(") (pointer_expression "*(code *)PTR_os_isdir_004b1cac" (* "*") (cast_expression "(code *)PTR_os_isdir_004b1cac" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_os_isdir_004b1cac"))) () ")")) (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (; ";")) (expression_statement "iVar4 = iVar1;" (assignment_expression "iVar4 = iVar1" (identifier "iVar4") (= "=") (identifier "iVar1")) (; ";")) (if_statement "if (iVar2 != 0) {\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      iVar4 = -1;\n      (*(code *)PTR_close_004b2174)(iVar1);\n      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();\n      *puVar3 = 0x15;\n    }" ({ "{") (expression_statement "iVar4 = -1;" (assignment_expression "iVar4 = -1" (identifier "iVar4") (= "=") (number_literal "-1")) (; ";")) (expression_statement "(*(code *)PTR_close_004b2174)(iVar1);" (call_expression "(*(code *)PTR_close_004b2174)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_004b2174)" (( "(") (pointer_expression "*(code *)PTR_close_004b2174" (* "*") (cast_expression "(code *)PTR_close_004b2174" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_004b2174"))) () ")")) (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (expression_statement "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();" (assignment_expression "puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)()" (identifier "puVar3") (= "=") (cast_expression "(undefined4 *)(*(code *)PTR___errno_location_004b2250)()" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_004b2250)()" (parenthesized_expression "(*(code *)PTR___errno_location_004b2250)" (( "(") (pointer_expression "*(code *)PTR___errno_location_004b2250" (* "*") (cast_expression "(code *)PTR___errno_location_004b2250" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_004b2250"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "*puVar3 = 0x15;" (assignment_expression "*puVar3 = 0x15" (pointer_expression "*puVar3" (* "*") (identifier "puVar3")) (= "=") (number_literal "0x15")) (; ";")) (} "}"))) (} "}")))) (return_statement "return iVar4;" (return "return") (identifier "iVar4") (; ";")) (} "}")))

/* WARNING: Unknown calling convention */

int function_1(char *file)

{
  int var_1;
  int var_2;
  type_1 *puVar3;
  int iVar4;
  
  var_1 = (*(type_2 *)PTR_open64_004b2284)(file,0);
  if (var_1 < 0) {
    iVar4 = -1;
  }
  else {
    var_2 = (*(type_2 *)PTR_os_isdir_004b1cac)(var_1);
    iVar4 = var_1;
    if (var_2 != 0) {
      iVar4 = -1;
      (*(type_2 *)PTR_close_004b2174)(var_1);
      puVar3 = (type_1 *)(*(type_2 *)PTR___errno_location_004b2250)();
      *puVar3 = 0x15;
    }
  }
  return iVar4;
}


(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: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) 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 (identifier) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (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 (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: (number_literal))) (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: (cast_expression type: (type_descriptor type: (type_identifier) 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: (pointer_expression argument: (identifier)) right: (number_literal)))))))) (return_statement (identifier)))))

int MASKED(undefined4 param_1)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  
  iVar1 = (*(code *)PTR_open64_004b2284)(param_1,0);
  if (iVar1 < 0) {
    iVar4 = -1;
  }
  else {
    iVar2 = (*(code *)PTR_os_isdir_004b1cac)(iVar1);
    iVar4 = iVar1;
    if (iVar2 != 0) {
      iVar4 = -1;
      (*(code *)PTR_close_004b2174)(iVar1);
      puVar3 = (undefined4 *)(*(code *)PTR___errno_location_004b2250)();
      *puVar3 = 0x15;
    }
  }
  return iVar4;
}

