
WFile * open_new_file(char *name,long perms)

{
  undefined *puVar1;
  int iVar2;
  WFile *pWVar3;
  char *pcVar4;
  
  if (perms == 0) {
    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,0x1b6);
  }
  else {
    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,perms);
  }
  if (-1 < iVar2) {
    pWVar3 = (WFile *)(*(code *)PTR_safemalloc_000b01e8)(1,8);
    puVar1 = PTR_dupstr_000b01f0;
    pWVar3->fd = iVar2;
    pcVar4 = (char *)(*(code *)puVar1)(name);
    pWVar3->name = pcVar4;
    return pWVar3;
  }
  return (WFile *)0x0;
}



int * open_new_file(undefined4 param_1,int param_2)

{
  undefined *puVar1;
  int iVar2;
  int *piVar3;
  
  if (param_2 == 0) {
    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);
  }
  else {
    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);
  }
  if (-1 < iVar2) {
    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);
    puVar1 = PTR_dupstr_000b01f0;
    *piVar3 = iVar2;
    iVar2 = (*(code *)puVar1)(param_1);
    piVar3[1] = iVar2;
    return piVar3;
  }
  return (int *)0x0;
}


lui gp,0x3
addiu gp,gp,0x1bb4
addu gp,gp,t9
addiu sp,sp,-0x28
sw gp,0x10(sp)
sw s0,0x1c(sp)
or s0,a0,zero
sw ra,0x24(sp)
bne a1,zero,0x00086628
_sw s1,0x20(sp)
lw t9,-0x7578(gp)
li a2,0x1b6
li a1,0x301
jalr t9
_or a0,s0,zero
lw gp,0x10(sp)
bltz v0,0x00086648
_or s1,v0,zero
lw t9,-0x7f68(gp)
li a1,0x8
jalr t9
_li a0,0x1
or a0,s0,zero
lw gp,0x10(sp)
or s0,v0,zero
lw t9,-0x7f60(gp)
jalr t9
_sw s1,0x0(v0)
lw ra,0x24(sp)
lw s1,0x20(sp)
sw v0,0x4(s0)
or v0,s0,zero
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x28
lw t9,-0x7578(gp)
or a2,a1,zero
li a1,0x301
jalr t9
_or a0,s0,zero
lw gp,0x10(sp)
bgez v0,0x000865e4
_or s1,v0,zero
lw ra,0x24(sp)
or s0,zero,zero
lw s1,0x20(sp)
or v0,s0,zero
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x28
(translation_unit "int * open_new_file(undefined4 param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_2 == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }\n  if (-1 < iVar2) {\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }\n  return (int *)0x0;\n}\n\n" (function_definition "int * open_new_file(undefined4 param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_2 == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }\n  if (-1 < iVar2) {\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }\n  return (int *)0x0;\n}" primitive_type (pointer_declarator "* open_new_file(undefined4 param_1,int param_2)" * (function_declarator "open_new_file(undefined4 param_1,int param_2)" identifier (parameter_list "(undefined4 param_1,int param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) )))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_2 == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }\n  if (-1 < iVar2) {\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }\n  return (int *)0x0;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (if_statement "if (param_2 == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }" { (expression_statement "iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);" (assignment_expression "iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6)" identifier = (call_expression "(*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6)" (parenthesized_expression "(*(code *)PTR_open64_000b0bd8)" ( (pointer_expression "*(code *)PTR_open64_000b0bd8" * (cast_expression "(code *)PTR_open64_000b0bd8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0x301,0x1b6)" ( identifier , number_literal , number_literal )))) ;) }) (else_clause "else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }" else (compound_statement "{\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }" { (expression_statement "iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);" (assignment_expression "iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2)" identifier = (call_expression "(*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2)" (parenthesized_expression "(*(code *)PTR_open64_000b0bd8)" ( (pointer_expression "*(code *)PTR_open64_000b0bd8" * (cast_expression "(code *)PTR_open64_000b0bd8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0x301,param_2)" ( identifier , number_literal , identifier )))) ;) }))) (if_statement "if (-1 < iVar2) {\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }" { (expression_statement "piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);" (assignment_expression "piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8)" identifier = (cast_expression "(int *)(*(code *)PTR_safemalloc_000b01e8)(1,8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_safemalloc_000b01e8)(1,8)" (parenthesized_expression "(*(code *)PTR_safemalloc_000b01e8)" ( (pointer_expression "*(code *)PTR_safemalloc_000b01e8" * (cast_expression "(code *)PTR_safemalloc_000b01e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(1,8)" ( number_literal , number_literal ))))) ;) (expression_statement "puVar1 = PTR_dupstr_000b01f0;" (assignment_expression "puVar1 = PTR_dupstr_000b01f0" identifier = identifier) ;) (expression_statement "*piVar3 = iVar2;" (assignment_expression "*piVar3 = iVar2" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar2 = (*(code *)puVar1)(param_1);" (assignment_expression "iVar2 = (*(code *)puVar1)(param_1)" identifier = (call_expression "(*(code *)puVar1)(param_1)" (parenthesized_expression "(*(code *)puVar1)" ( (pointer_expression "*(code *)puVar1" * (cast_expression "(code *)puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "piVar3[1] = iVar2;" (assignment_expression "piVar3[1] = iVar2" (subscript_expression "piVar3[1]" identifier [ number_literal ]) = identifier) ;) (return_statement "return piVar3;" return identifier ;) })) (return_statement "return (int *)0x0;" return (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "WFile * open_new_file(char *name,long perms)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  WFile *pWVar3;\n  char *pcVar4;\n  \n  if (perms == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,perms);\n  }\n  if (-1 < iVar2) {\n    pWVar3 = (WFile *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    pWVar3->fd = iVar2;\n    pcVar4 = (char *)(*(code *)puVar1)(name);\n    pWVar3->name = pcVar4;\n    return pWVar3;\n  }\n  return (WFile *)0x0;\n}\n\n" (function_definition "WFile * open_new_file(char *name,long perms)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  WFile *pWVar3;\n  char *pcVar4;\n  \n  if (perms == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,perms);\n  }\n  if (-1 < iVar2) {\n    pWVar3 = (WFile *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    pWVar3->fd = iVar2;\n    pcVar4 = (char *)(*(code *)puVar1)(name);\n    pWVar3->name = pcVar4;\n    return pWVar3;\n  }\n  return (WFile *)0x0;\n}" type_identifier (pointer_declarator "* open_new_file(char *name,long perms)" * (function_declarator "open_new_file(char *name,long perms)" identifier (parameter_list "(char *name,long perms)" ( (parameter_declaration "char *name" primitive_type (pointer_declarator "*name" * identifier)) , (parameter_declaration "long perms" (sized_type_specifier "long" long) identifier) )))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  WFile *pWVar3;\n  char *pcVar4;\n  \n  if (perms == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,perms);\n  }\n  if (-1 < iVar2) {\n    pWVar3 = (WFile *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    pWVar3->fd = iVar2;\n    pcVar4 = (char *)(*(code *)puVar1)(name);\n    pWVar3->name = pcVar4;\n    return pWVar3;\n  }\n  return (WFile *)0x0;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "WFile *pWVar3;" type_identifier (pointer_declarator "*pWVar3" * identifier) ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (if_statement "if (perms == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,perms);\n  }" if (parenthesized_expression "(perms == 0)" ( (binary_expression "perms == 0" identifier == number_literal) )) (compound_statement "{\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,0x1b6);\n  }" { (expression_statement "iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,0x1b6);" (assignment_expression "iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,0x1b6)" identifier = (call_expression "(*(code *)PTR_open64_000b0bd8)(name,0x301,0x1b6)" (parenthesized_expression "(*(code *)PTR_open64_000b0bd8)" ( (pointer_expression "*(code *)PTR_open64_000b0bd8" * (cast_expression "(code *)PTR_open64_000b0bd8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(name,0x301,0x1b6)" ( identifier , number_literal , number_literal )))) ;) }) (else_clause "else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,perms);\n  }" else (compound_statement "{\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,perms);\n  }" { (expression_statement "iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,perms);" (assignment_expression "iVar2 = (*(code *)PTR_open64_000b0bd8)(name,0x301,perms)" identifier = (call_expression "(*(code *)PTR_open64_000b0bd8)(name,0x301,perms)" (parenthesized_expression "(*(code *)PTR_open64_000b0bd8)" ( (pointer_expression "*(code *)PTR_open64_000b0bd8" * (cast_expression "(code *)PTR_open64_000b0bd8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(name,0x301,perms)" ( identifier , number_literal , identifier )))) ;) }))) (if_statement "if (-1 < iVar2) {\n    pWVar3 = (WFile *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    pWVar3->fd = iVar2;\n    pcVar4 = (char *)(*(code *)puVar1)(name);\n    pWVar3->name = pcVar4;\n    return pWVar3;\n  }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n    pWVar3 = (WFile *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    pWVar3->fd = iVar2;\n    pcVar4 = (char *)(*(code *)puVar1)(name);\n    pWVar3->name = pcVar4;\n    return pWVar3;\n  }" { (expression_statement "pWVar3 = (WFile *)(*(code *)PTR_safemalloc_000b01e8)(1,8);" (assignment_expression "pWVar3 = (WFile *)(*(code *)PTR_safemalloc_000b01e8)(1,8)" identifier = (cast_expression "(WFile *)(*(code *)PTR_safemalloc_000b01e8)(1,8)" ( (type_descriptor "WFile *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_safemalloc_000b01e8)(1,8)" (parenthesized_expression "(*(code *)PTR_safemalloc_000b01e8)" ( (pointer_expression "*(code *)PTR_safemalloc_000b01e8" * (cast_expression "(code *)PTR_safemalloc_000b01e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(1,8)" ( number_literal , number_literal ))))) ;) (expression_statement "puVar1 = PTR_dupstr_000b01f0;" (assignment_expression "puVar1 = PTR_dupstr_000b01f0" identifier = identifier) ;) (expression_statement "pWVar3->fd = iVar2;" (assignment_expression "pWVar3->fd = iVar2" (field_expression "pWVar3->fd" identifier -> field_identifier) = identifier) ;) (expression_statement "pcVar4 = (char *)(*(code *)puVar1)(name);" (assignment_expression "pcVar4 = (char *)(*(code *)puVar1)(name)" identifier = (cast_expression "(char *)(*(code *)puVar1)(name)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)puVar1)(name)" (parenthesized_expression "(*(code *)puVar1)" ( (pointer_expression "*(code *)puVar1" * (cast_expression "(code *)puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(name)" ( identifier ))))) ;) (expression_statement "pWVar3->name = pcVar4;" (assignment_expression "pWVar3->name = pcVar4" (field_expression "pWVar3->name" identifier -> field_identifier) = identifier) ;) (return_statement "return pWVar3;" return identifier ;) })) (return_statement "return (WFile *)0x0;" return (cast_expression "(WFile *)0x0" ( (type_descriptor "WFile *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "int * open_new_file(undefined4 param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_2 == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }\n  if (-1 < iVar2) {\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }\n  return (int *)0x0;\n}\n\n" (function_definition "int * open_new_file(undefined4 param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_2 == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }\n  if (-1 < iVar2) {\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }\n  return (int *)0x0;\n}" primitive_type (pointer_declarator "* open_new_file(undefined4 param_1,int param_2)" * (function_declarator "open_new_file(undefined4 param_1,int param_2)" identifier (parameter_list "(undefined4 param_1,int param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) )))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_2 == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }\n  if (-1 < iVar2) {\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }\n  return (int *)0x0;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (if_statement "if (param_2 == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }" { (expression_statement "iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);" (assignment_expression "iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6)" identifier = (call_expression "(*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6)" (parenthesized_expression "(*(code *)PTR_open64_000b0bd8)" ( (pointer_expression "*(code *)PTR_open64_000b0bd8" * (cast_expression "(code *)PTR_open64_000b0bd8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0x301,0x1b6)" ( identifier , number_literal , number_literal )))) ;) }) (else_clause "else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }" else (compound_statement "{\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }" { (expression_statement "iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);" (assignment_expression "iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2)" identifier = (call_expression "(*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2)" (parenthesized_expression "(*(code *)PTR_open64_000b0bd8)" ( (pointer_expression "*(code *)PTR_open64_000b0bd8" * (cast_expression "(code *)PTR_open64_000b0bd8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0x301,param_2)" ( identifier , number_literal , identifier )))) ;) }))) (if_statement "if (-1 < iVar2) {\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }" { (expression_statement "piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);" (assignment_expression "piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8)" identifier = (cast_expression "(int *)(*(code *)PTR_safemalloc_000b01e8)(1,8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_safemalloc_000b01e8)(1,8)" (parenthesized_expression "(*(code *)PTR_safemalloc_000b01e8)" ( (pointer_expression "*(code *)PTR_safemalloc_000b01e8" * (cast_expression "(code *)PTR_safemalloc_000b01e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(1,8)" ( number_literal , number_literal ))))) ;) (expression_statement "puVar1 = PTR_dupstr_000b01f0;" (assignment_expression "puVar1 = PTR_dupstr_000b01f0" identifier = identifier) ;) (expression_statement "*piVar3 = iVar2;" (assignment_expression "*piVar3 = iVar2" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "iVar2 = (*(code *)puVar1)(param_1);" (assignment_expression "iVar2 = (*(code *)puVar1)(param_1)" identifier = (call_expression "(*(code *)puVar1)(param_1)" (parenthesized_expression "(*(code *)puVar1)" ( (pointer_expression "*(code *)puVar1" * (cast_expression "(code *)puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "piVar3[1] = iVar2;" (assignment_expression "piVar3[1] = iVar2" (subscript_expression "piVar3[1]" identifier [ number_literal ]) = identifier) ;) (return_statement "return piVar3;" return identifier ;) })) (return_statement "return (int *)0x0;" return (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (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 , LIT , 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 , LIT , IDENT )))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (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 ( LIT , LIT ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (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 (subscript_expression IDENT [ LIT ]) = IDENT) ;) (return_statement return IDENT ;) })) (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })))
(function_definition "int * open_new_file(undefined4 param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_2 == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }\n  if (-1 < iVar2) {\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }\n  return (int *)0x0;\n}" (primitive_type "int") (pointer_declarator "* open_new_file(undefined4 param_1,int param_2)" (* "*") (function_declarator "open_new_file(undefined4 param_1,int param_2)" (identifier "open_new_file") (parameter_list "(undefined4 param_1,int param_2)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")")))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_2 == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }\n  if (-1 < iVar2) {\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }\n  return (int *)0x0;\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (if_statement "if (param_2 == 0) {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }\n  else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);\n  }" ({ "{") (expression_statement "iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);" (assignment_expression "iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6)" (parenthesized_expression "(*(code *)PTR_open64_000b0bd8)" (( "(") (pointer_expression "*(code *)PTR_open64_000b0bd8" (* "*") (cast_expression "(code *)PTR_open64_000b0bd8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_open64_000b0bd8"))) () ")")) (argument_list "(param_1,0x301,0x1b6)" (( "(") (identifier "param_1") (, ",") (number_literal "0x301") (, ",") (number_literal "0x1b6") () ")")))) (; ";")) (} "}")) (else_clause "else {\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }" (else "else") (compound_statement "{\n    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);\n  }" ({ "{") (expression_statement "iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);" (assignment_expression "iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2)" (parenthesized_expression "(*(code *)PTR_open64_000b0bd8)" (( "(") (pointer_expression "*(code *)PTR_open64_000b0bd8" (* "*") (cast_expression "(code *)PTR_open64_000b0bd8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_open64_000b0bd8"))) () ")")) (argument_list "(param_1,0x301,param_2)" (( "(") (identifier "param_1") (, ",") (number_literal "0x301") (, ",") (identifier "param_2") () ")")))) (; ";")) (} "}")))) (if_statement "if (-1 < iVar2) {\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }" (if "if") (parenthesized_expression "(-1 < iVar2)" (( "(") (binary_expression "-1 < iVar2" (number_literal "-1") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);\n    puVar1 = PTR_dupstr_000b01f0;\n    *piVar3 = iVar2;\n    iVar2 = (*(code *)puVar1)(param_1);\n    piVar3[1] = iVar2;\n    return piVar3;\n  }" ({ "{") (expression_statement "piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);" (assignment_expression "piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8)" (identifier "piVar3") (= "=") (cast_expression "(int *)(*(code *)PTR_safemalloc_000b01e8)(1,8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR_safemalloc_000b01e8)(1,8)" (parenthesized_expression "(*(code *)PTR_safemalloc_000b01e8)" (( "(") (pointer_expression "*(code *)PTR_safemalloc_000b01e8" (* "*") (cast_expression "(code *)PTR_safemalloc_000b01e8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_safemalloc_000b01e8"))) () ")")) (argument_list "(1,8)" (( "(") (number_literal "1") (, ",") (number_literal "8") () ")"))))) (; ";")) (expression_statement "puVar1 = PTR_dupstr_000b01f0;" (assignment_expression "puVar1 = PTR_dupstr_000b01f0" (identifier "puVar1") (= "=") (identifier "PTR_dupstr_000b01f0")) (; ";")) (expression_statement "*piVar3 = iVar2;" (assignment_expression "*piVar3 = iVar2" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "iVar2")) (; ";")) (expression_statement "iVar2 = (*(code *)puVar1)(param_1);" (assignment_expression "iVar2 = (*(code *)puVar1)(param_1)" (identifier "iVar2") (= "=") (call_expression "(*(code *)puVar1)(param_1)" (parenthesized_expression "(*(code *)puVar1)" (( "(") (pointer_expression "*(code *)puVar1" (* "*") (cast_expression "(code *)puVar1" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar1"))) () ")")) (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (expression_statement "piVar3[1] = iVar2;" (assignment_expression "piVar3[1] = iVar2" (subscript_expression "piVar3[1]" (identifier "piVar3") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "iVar2")) (; ";")) (return_statement "return piVar3;" (return "return") (identifier "piVar3") (; ";")) (} "}"))) (return_statement "return (int *)0x0;" (return "return") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}")))

type_1 * function_1(char *name,long var_1)

{
  type_2 *puVar1;
  int var_2;
  type_1 *pWVar3;
  char *pcVar4;
  
  if (var_1 == 0) {
    var_2 = (*(type_3 *)PTR_open64_000b0bd8)(name,0x301,0x1b6);
  }
  else {
    var_2 = (*(type_3 *)PTR_open64_000b0bd8)(name,0x301,var_1);
  }
  if (-1 < var_2) {
    pWVar3 = (type_1 *)(*(type_3 *)PTR_safemalloc_000b01e8)(1,8);
    puVar1 = PTR_dupstr_000b01f0;
    pWVar3->fd = var_2;
    pcVar4 = (char *)(*(type_3 *)puVar1)(name);
    pWVar3->name = pcVar4;
    return pWVar3;
  }
  return (type_1 *)0x0;
}


(translation_unit (function_definition type: (primitive_type) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier))))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (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: (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) (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) (number_literal) (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) 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 (number_literal) (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (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))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (return_statement (identifier)))) (return_statement (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal))))))

int * MASKED(undefined4 param_1,int param_2)

{
  undefined *puVar1;
  int iVar2;
  int *piVar3;
  
  if (param_2 == 0) {
    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,0x1b6);
  }
  else {
    iVar2 = (*(code *)PTR_open64_000b0bd8)(param_1,0x301,param_2);
  }
  if (-1 < iVar2) {
    piVar3 = (int *)(*(code *)PTR_safemalloc_000b01e8)(1,8);
    puVar1 = PTR_dupstr_000b01f0;
    *piVar3 = iVar2;
    iVar2 = (*(code *)puVar1)(param_1);
    piVar3[1] = iVar2;
    return piVar3;
  }
  return (int *)0x0;
}

