
int read_to_buf(char *filename,void *buf)

{
  int iVar1;
  int iVar2;
  
  iVar1 = (*(code *)PTR_open64_00131f1c)(filename,0);
  iVar2 = -1;
  if (-1 < iVar1) {
    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,buf,0x3ff);
    (*(code *)PTR_close_00131ca8)(iVar1);
  }
  iVar1 = iVar2;
  if (iVar2 < 0) {
    iVar1 = 0;
  }
  *(undefined1 *)((int)buf + iVar1) = 0;
  return iVar2;
}



int FUN_000fb07c(undefined4 param_1,int param_2)

{
  int iVar1;
  int iVar2;
  
  iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);
  iVar2 = -1;
  if (-1 < iVar1) {
    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);
    (*(code *)PTR_close_00131ca8)(iVar1);
  }
  iVar1 = iVar2;
  if (iVar2 < 0) {
    iVar1 = 0;
  }
  *(undefined1 *)(param_2 + iVar1) = 0;
  return iVar2;
}


lui gp,0x4
addiu gp,gp,-0x1f2c
addu gp,gp,t9
addiu sp,sp,-0x28
sw ra,0x24(sp)
sw s2,0x20(sp)
sw s1,0x1c(sp)
sw s0,0x18(sp)
sw gp,0x10(sp)
or s1,a1,zero
or a1,zero,zero
lw t9,-0x7234(gp)
jalr t9
_nop
lw gp,0x10(sp)
bltz v0,0x000fb0f8
_li s0,-0x1
or s2,v0,zero
li a2,0x3ff
or a1,s1,zero
or a0,v0,zero
lw t9,-0x6f88(gp)
jalr t9
_nop
lw gp,0x10(sp)
or s0,v0,zero
or a0,s2,zero
lw t9,-0x74a8(gp)
jalr t9
_nop
lw gp,0x10(sp)
slti v0,s0,0x0
or v1,s0,zero
movn v1,zero,v0
addu s1,s1,v1
sb zero,0x0(s1)
or v0,s0,zero
lw ra,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x28
(translation_unit "int FUN_000fb07c(undefined4 param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);\n  iVar2 = -1;\n  if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }\n  iVar1 = iVar2;\n  if (iVar2 < 0) {\n    iVar1 = 0;\n  }\n  *(undefined1 *)(param_2 + iVar1) = 0;\n  return iVar2;\n}\n\n" (function_definition "int FUN_000fb07c(undefined4 param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);\n  iVar2 = -1;\n  if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }\n  iVar1 = iVar2;\n  if (iVar2 < 0) {\n    iVar1 = 0;\n  }\n  *(undefined1 *)(param_2 + iVar1) = 0;\n  return iVar2;\n}" primitive_type (function_declarator "FUN_000fb07c(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  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);\n  iVar2 = -1;\n  if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }\n  iVar1 = iVar2;\n  if (iVar2 < 0) {\n    iVar1 = 0;\n  }\n  *(undefined1 *)(param_2 + iVar1) = 0;\n  return iVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0)" identifier = (call_expression "(*(code *)PTR_open64_00131f1c)(param_1,0)" (parenthesized_expression "(*(code *)PTR_open64_00131f1c)" ( (pointer_expression "*(code *)PTR_open64_00131f1c" * (cast_expression "(code *)PTR_open64_00131f1c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0)" ( identifier , number_literal )))) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (if_statement "if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }" { (expression_statement "iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);" (assignment_expression "iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff)" identifier = (call_expression "(*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff)" (parenthesized_expression "(*(code *)PTR_read_001321c8)" ( (pointer_expression "*(code *)PTR_read_001321c8" * (cast_expression "(code *)PTR_read_001321c8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1,param_2,0x3ff)" ( identifier , identifier , number_literal )))) ;) (expression_statement "(*(code *)PTR_close_00131ca8)(iVar1);" (call_expression "(*(code *)PTR_close_00131ca8)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_00131ca8)" ( (pointer_expression "*(code *)PTR_close_00131ca8" * (cast_expression "(code *)PTR_close_00131ca8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) })) (expression_statement "iVar1 = iVar2;" (assignment_expression "iVar1 = iVar2" identifier = identifier) ;) (if_statement "if (iVar2 < 0) {\n    iVar1 = 0;\n  }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar1 = 0;\n  }" { (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) })) (expression_statement "*(undefined1 *)(param_2 + iVar1) = 0;" (assignment_expression "*(undefined1 *)(param_2 + iVar1) = 0" (pointer_expression "*(undefined1 *)(param_2 + iVar1)" * (cast_expression "(undefined1 *)(param_2 + iVar1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + iVar1)" ( (binary_expression "param_2 + iVar1" identifier + identifier) )))) = number_literal) ;) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "int read_to_buf(char *filename,void *buf)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00131f1c)(filename,0);\n  iVar2 = -1;\n  if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,buf,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }\n  iVar1 = iVar2;\n  if (iVar2 < 0) {\n    iVar1 = 0;\n  }\n  *(undefined1 *)((int)buf + iVar1) = 0;\n  return iVar2;\n}\n\n" (function_definition "int read_to_buf(char *filename,void *buf)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00131f1c)(filename,0);\n  iVar2 = -1;\n  if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,buf,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }\n  iVar1 = iVar2;\n  if (iVar2 < 0) {\n    iVar1 = 0;\n  }\n  *(undefined1 *)((int)buf + iVar1) = 0;\n  return iVar2;\n}" primitive_type (function_declarator "read_to_buf(char *filename,void *buf)" identifier (parameter_list "(char *filename,void *buf)" ( (parameter_declaration "char *filename" primitive_type (pointer_declarator "*filename" * identifier)) , (parameter_declaration "void *buf" primitive_type (pointer_declarator "*buf" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00131f1c)(filename,0);\n  iVar2 = -1;\n  if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,buf,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }\n  iVar1 = iVar2;\n  if (iVar2 < 0) {\n    iVar1 = 0;\n  }\n  *(undefined1 *)((int)buf + iVar1) = 0;\n  return iVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "iVar1 = (*(code *)PTR_open64_00131f1c)(filename,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_00131f1c)(filename,0)" identifier = (call_expression "(*(code *)PTR_open64_00131f1c)(filename,0)" (parenthesized_expression "(*(code *)PTR_open64_00131f1c)" ( (pointer_expression "*(code *)PTR_open64_00131f1c" * (cast_expression "(code *)PTR_open64_00131f1c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(filename,0)" ( identifier , number_literal )))) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (if_statement "if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,buf,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,buf,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }" { (expression_statement "iVar2 = (*(code *)PTR_read_001321c8)(iVar1,buf,0x3ff);" (assignment_expression "iVar2 = (*(code *)PTR_read_001321c8)(iVar1,buf,0x3ff)" identifier = (call_expression "(*(code *)PTR_read_001321c8)(iVar1,buf,0x3ff)" (parenthesized_expression "(*(code *)PTR_read_001321c8)" ( (pointer_expression "*(code *)PTR_read_001321c8" * (cast_expression "(code *)PTR_read_001321c8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1,buf,0x3ff)" ( identifier , identifier , number_literal )))) ;) (expression_statement "(*(code *)PTR_close_00131ca8)(iVar1);" (call_expression "(*(code *)PTR_close_00131ca8)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_00131ca8)" ( (pointer_expression "*(code *)PTR_close_00131ca8" * (cast_expression "(code *)PTR_close_00131ca8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) })) (expression_statement "iVar1 = iVar2;" (assignment_expression "iVar1 = iVar2" identifier = identifier) ;) (if_statement "if (iVar2 < 0) {\n    iVar1 = 0;\n  }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar1 = 0;\n  }" { (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) })) (expression_statement "*(undefined1 *)((int)buf + iVar1) = 0;" (assignment_expression "*(undefined1 *)((int)buf + iVar1) = 0" (pointer_expression "*(undefined1 *)((int)buf + iVar1)" * (cast_expression "(undefined1 *)((int)buf + iVar1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)buf + iVar1)" ( (binary_expression "(int)buf + iVar1" (cast_expression "(int)buf" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) )))) = number_literal) ;) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "int FUN_000fb07c(undefined4 param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);\n  iVar2 = -1;\n  if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }\n  iVar1 = iVar2;\n  if (iVar2 < 0) {\n    iVar1 = 0;\n  }\n  *(undefined1 *)(param_2 + iVar1) = 0;\n  return iVar2;\n}\n\n" (function_definition "int FUN_000fb07c(undefined4 param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);\n  iVar2 = -1;\n  if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }\n  iVar1 = iVar2;\n  if (iVar2 < 0) {\n    iVar1 = 0;\n  }\n  *(undefined1 *)(param_2 + iVar1) = 0;\n  return iVar2;\n}" primitive_type (function_declarator "FUN_000fb07c(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  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);\n  iVar2 = -1;\n  if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }\n  iVar1 = iVar2;\n  if (iVar2 < 0) {\n    iVar1 = 0;\n  }\n  *(undefined1 *)(param_2 + iVar1) = 0;\n  return iVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0)" identifier = (call_expression "(*(code *)PTR_open64_00131f1c)(param_1,0)" (parenthesized_expression "(*(code *)PTR_open64_00131f1c)" ( (pointer_expression "*(code *)PTR_open64_00131f1c" * (cast_expression "(code *)PTR_open64_00131f1c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0)" ( identifier , number_literal )))) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (if_statement "if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }" { (expression_statement "iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);" (assignment_expression "iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff)" identifier = (call_expression "(*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff)" (parenthesized_expression "(*(code *)PTR_read_001321c8)" ( (pointer_expression "*(code *)PTR_read_001321c8" * (cast_expression "(code *)PTR_read_001321c8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1,param_2,0x3ff)" ( identifier , identifier , number_literal )))) ;) (expression_statement "(*(code *)PTR_close_00131ca8)(iVar1);" (call_expression "(*(code *)PTR_close_00131ca8)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_00131ca8)" ( (pointer_expression "*(code *)PTR_close_00131ca8" * (cast_expression "(code *)PTR_close_00131ca8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) })) (expression_statement "iVar1 = iVar2;" (assignment_expression "iVar1 = iVar2" identifier = identifier) ;) (if_statement "if (iVar2 < 0) {\n    iVar1 = 0;\n  }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar1 = 0;\n  }" { (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) })) (expression_statement "*(undefined1 *)(param_2 + iVar1) = 0;" (assignment_expression "*(undefined1 *)(param_2 + iVar1) = 0" (pointer_expression "*(undefined1 *)(param_2 + iVar1)" * (cast_expression "(undefined1 *)(param_2 + iVar1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + iVar1)" ( (binary_expression "param_2 + iVar1" identifier + identifier) )))) = number_literal) ;) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE 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 )))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (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 , 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 = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) = LIT) ;) (return_statement return IDENT ;) })))
(function_definition "int FUN_000fb07c(undefined4 param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);\n  iVar2 = -1;\n  if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }\n  iVar1 = iVar2;\n  if (iVar2 < 0) {\n    iVar1 = 0;\n  }\n  *(undefined1 *)(param_2 + iVar1) = 0;\n  return iVar2;\n}" (primitive_type "int") (function_declarator "FUN_000fb07c(undefined4 param_1,int param_2)" (identifier "FUN_000fb07c") (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  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);\n  iVar2 = -1;\n  if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }\n  iVar1 = iVar2;\n  if (iVar2 < 0) {\n    iVar1 = 0;\n  }\n  *(undefined1 *)(param_2 + iVar1) = 0;\n  return iVar2;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (expression_statement "iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_open64_00131f1c)(param_1,0)" (parenthesized_expression "(*(code *)PTR_open64_00131f1c)" (( "(") (pointer_expression "*(code *)PTR_open64_00131f1c" (* "*") (cast_expression "(code *)PTR_open64_00131f1c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_open64_00131f1c"))) () ")")) (argument_list "(param_1,0)" (( "(") (identifier "param_1") (, ",") (number_literal "0") () ")")))) (; ";")) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (if_statement "if (-1 < iVar1) {\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }" (if "if") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);\n    (*(code *)PTR_close_00131ca8)(iVar1);\n  }" ({ "{") (expression_statement "iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);" (assignment_expression "iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff)" (parenthesized_expression "(*(code *)PTR_read_001321c8)" (( "(") (pointer_expression "*(code *)PTR_read_001321c8" (* "*") (cast_expression "(code *)PTR_read_001321c8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_read_001321c8"))) () ")")) (argument_list "(iVar1,param_2,0x3ff)" (( "(") (identifier "iVar1") (, ",") (identifier "param_2") (, ",") (number_literal "0x3ff") () ")")))) (; ";")) (expression_statement "(*(code *)PTR_close_00131ca8)(iVar1);" (call_expression "(*(code *)PTR_close_00131ca8)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_00131ca8)" (( "(") (pointer_expression "*(code *)PTR_close_00131ca8" (* "*") (cast_expression "(code *)PTR_close_00131ca8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_00131ca8"))) () ")")) (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (} "}"))) (expression_statement "iVar1 = iVar2;" (assignment_expression "iVar1 = iVar2" (identifier "iVar1") (= "=") (identifier "iVar2")) (; ";")) (if_statement "if (iVar2 < 0) {\n    iVar1 = 0;\n  }" (if "if") (parenthesized_expression "(iVar2 < 0)" (( "(") (binary_expression "iVar2 < 0" (identifier "iVar2") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    iVar1 = 0;\n  }" ({ "{") (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" (identifier "iVar1") (= "=") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "*(undefined1 *)(param_2 + iVar1) = 0;" (assignment_expression "*(undefined1 *)(param_2 + iVar1) = 0" (pointer_expression "*(undefined1 *)(param_2 + iVar1)" (* "*") (cast_expression "(undefined1 *)(param_2 + iVar1)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 + iVar1)" (( "(") (binary_expression "param_2 + iVar1" (identifier "param_2") (+ "+") (identifier "iVar1")) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))

int function_1(char *filename,void *buf)

{
  int var_1;
  int var_2;
  
  var_1 = (*(type_1 *)PTR_open64_00131f1c)(filename,0);
  var_2 = -1;
  if (-1 < var_1) {
    var_2 = (*(type_1 *)PTR_read_001321c8)(var_1,buf,0x3ff);
    (*(type_1 *)PTR_close_00131ca8)(var_1);
  }
  var_1 = var_2;
  if (var_2 < 0) {
    var_1 = 0;
  }
  *(type_2 *)((int)buf + var_1) = 0;
  return var_2;
}


(translation_unit (function_definition type: (primitive_type) 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: (primitive_type) 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))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) 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) (identifier) (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: (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 (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))) right: (number_literal))) (return_statement (identifier)))))

int MASKED(undefined4 param_1,int param_2)

{
  int iVar1;
  int iVar2;
  
  iVar1 = (*(code *)PTR_open64_00131f1c)(param_1,0);
  iVar2 = -1;
  if (-1 < iVar1) {
    iVar2 = (*(code *)PTR_read_001321c8)(iVar1,param_2,0x3ff);
    (*(code *)PTR_close_00131ca8)(iVar1);
  }
  iVar1 = iVar2;
  if (iVar2 < 0) {
    iVar1 = 0;
  }
  *(undefined1 *)(param_2 + iVar1) = 0;
  return iVar2;
}

