
BUFFERED_STREAM * open_buffered_stream(char *file)

{
  int fd;
  BUFFERED_STREAM *pBVar1;
  undefined4 in_a2;
  undefined4 in_a3;
  int in_t9;
  
  fd = (**(code **)(in_t9 + 0xc6a20))(file,0,in_a2,in_a3,in_t9 + 0xccb34);
  if (fd < 0) {
    pBVar1 = (BUFFERED_STREAM *)0x0;
  }
  else {
    pBVar1 = fd_to_buffered_stream(fd);
  }
  return pBVar1;
}



undefined4 open_buffered_stream(undefined4 param_1)

{
  int iVar1;
  undefined4 uVar2;
  
  iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);
  if (iVar1 < 0) {
    uVar2 = 0;
  }
  else {
    uVar2 = fd_to_buffered_stream(iVar1);
  }
  return uVar2;
}


lui gp,0xd
addiu gp,gp,-0x34cc
addu gp,gp,t9
addiu sp,sp,-0x20
sw ra,0x1c(sp)
sw gp,0x10(sp)
or a1,zero,zero
lw t9,-0x6114(gp)
jalr t9
_nop
lw gp,0x10(sp)
bltz v0,0x00091a5c
_or a0,v0,zero
lw t9,-0x7104(gp)
bal 0x00091858
_nop
lw gp,0x10(sp)
lw ra,0x1c(sp)
jr ra
_addiu sp,sp,0x20
b 0x00091a50
_or v0,zero,zero
(translation_unit "undefined4 open_buffered_stream(undefined4 param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);\n  if (iVar1 < 0) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }\n  return uVar2;\n}\n\n" (function_definition "undefined4 open_buffered_stream(undefined4 param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);\n  if (iVar1 < 0) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }\n  return uVar2;\n}" type_identifier (function_declarator "open_buffered_stream(undefined4 param_1)" identifier (parameter_list "(undefined4 param_1)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);\n  if (iVar1 < 0) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (expression_statement "iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0)" identifier = (call_expression "(*(code *)PTR_open64_0015842c)(param_1,0)" (parenthesized_expression "(*(code *)PTR_open64_0015842c)" ( (pointer_expression "*(code *)PTR_open64_0015842c" * (cast_expression "(code *)PTR_open64_0015842c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    uVar2 = 0;\n  }" { (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }" else (compound_statement "{\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }" { (expression_statement "uVar2 = fd_to_buffered_stream(iVar1);" (assignment_expression "uVar2 = fd_to_buffered_stream(iVar1)" identifier = (call_expression "fd_to_buffered_stream(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) }))) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "BUFFERED_STREAM * open_buffered_stream(char *file)\n\n{\n  int fd;\n  BUFFERED_STREAM *pBVar1;\n  undefined4 in_a2;\n  undefined4 in_a3;\n  int in_t9;\n  \n  fd = (**(code **)(in_t9 + 0xc6a20))(file,0,in_a2,in_a3,in_t9 + 0xccb34);\n  if (fd < 0) {\n    pBVar1 = (BUFFERED_STREAM *)0x0;\n  }\n  else {\n    pBVar1 = fd_to_buffered_stream(fd);\n  }\n  return pBVar1;\n}\n\n" (function_definition "BUFFERED_STREAM * open_buffered_stream(char *file)\n\n{\n  int fd;\n  BUFFERED_STREAM *pBVar1;\n  undefined4 in_a2;\n  undefined4 in_a3;\n  int in_t9;\n  \n  fd = (**(code **)(in_t9 + 0xc6a20))(file,0,in_a2,in_a3,in_t9 + 0xccb34);\n  if (fd < 0) {\n    pBVar1 = (BUFFERED_STREAM *)0x0;\n  }\n  else {\n    pBVar1 = fd_to_buffered_stream(fd);\n  }\n  return pBVar1;\n}" type_identifier (pointer_declarator "* open_buffered_stream(char *file)" * (function_declarator "open_buffered_stream(char *file)" identifier (parameter_list "(char *file)" ( (parameter_declaration "char *file" primitive_type (pointer_declarator "*file" * identifier)) )))) (compound_statement "{\n  int fd;\n  BUFFERED_STREAM *pBVar1;\n  undefined4 in_a2;\n  undefined4 in_a3;\n  int in_t9;\n  \n  fd = (**(code **)(in_t9 + 0xc6a20))(file,0,in_a2,in_a3,in_t9 + 0xccb34);\n  if (fd < 0) {\n    pBVar1 = (BUFFERED_STREAM *)0x0;\n  }\n  else {\n    pBVar1 = fd_to_buffered_stream(fd);\n  }\n  return pBVar1;\n}" { (declaration "int fd;" primitive_type identifier ;) (declaration "BUFFERED_STREAM *pBVar1;" type_identifier (pointer_declarator "*pBVar1" * identifier) ;) (declaration "undefined4 in_a2;" type_identifier identifier ;) (declaration "undefined4 in_a3;" type_identifier identifier ;) (declaration "int in_t9;" primitive_type identifier ;) (expression_statement "fd = (**(code **)(in_t9 + 0xc6a20))(file,0,in_a2,in_a3,in_t9 + 0xccb34);" (assignment_expression "fd = (**(code **)(in_t9 + 0xc6a20))(file,0,in_a2,in_a3,in_t9 + 0xccb34)" identifier = (call_expression "(**(code **)(in_t9 + 0xc6a20))(file,0,in_a2,in_a3,in_t9 + 0xccb34)" (parenthesized_expression "(**(code **)(in_t9 + 0xc6a20))" ( (pointer_expression "**(code **)(in_t9 + 0xc6a20)" * (pointer_expression "*(code **)(in_t9 + 0xc6a20)" * (cast_expression "(code **)(in_t9 + 0xc6a20)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(in_t9 + 0xc6a20)" ( (binary_expression "in_t9 + 0xc6a20" identifier + number_literal) ))))) )) (argument_list "(file,0,in_a2,in_a3,in_t9 + 0xccb34)" ( identifier , number_literal , identifier , identifier , (binary_expression "in_t9 + 0xccb34" identifier + number_literal) )))) ;) (if_statement "if (fd < 0) {\n    pBVar1 = (BUFFERED_STREAM *)0x0;\n  }\n  else {\n    pBVar1 = fd_to_buffered_stream(fd);\n  }" if (parenthesized_expression "(fd < 0)" ( (binary_expression "fd < 0" identifier < number_literal) )) (compound_statement "{\n    pBVar1 = (BUFFERED_STREAM *)0x0;\n  }" { (expression_statement "pBVar1 = (BUFFERED_STREAM *)0x0;" (assignment_expression "pBVar1 = (BUFFERED_STREAM *)0x0" identifier = (cast_expression "(BUFFERED_STREAM *)0x0" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n    pBVar1 = fd_to_buffered_stream(fd);\n  }" else (compound_statement "{\n    pBVar1 = fd_to_buffered_stream(fd);\n  }" { (expression_statement "pBVar1 = fd_to_buffered_stream(fd);" (assignment_expression "pBVar1 = fd_to_buffered_stream(fd)" identifier = (call_expression "fd_to_buffered_stream(fd)" identifier (argument_list "(fd)" ( identifier )))) ;) }))) (return_statement "return pBVar1;" return identifier ;) })))
(translation_unit "undefined4 open_buffered_stream(undefined4 param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);\n  if (iVar1 < 0) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }\n  return uVar2;\n}\n\n" (function_definition "undefined4 open_buffered_stream(undefined4 param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);\n  if (iVar1 < 0) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }\n  return uVar2;\n}" type_identifier (function_declarator "open_buffered_stream(undefined4 param_1)" identifier (parameter_list "(undefined4 param_1)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);\n  if (iVar1 < 0) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (expression_statement "iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0)" identifier = (call_expression "(*(code *)PTR_open64_0015842c)(param_1,0)" (parenthesized_expression "(*(code *)PTR_open64_0015842c)" ( (pointer_expression "*(code *)PTR_open64_0015842c" * (cast_expression "(code *)PTR_open64_0015842c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    uVar2 = 0;\n  }" { (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }" else (compound_statement "{\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }" { (expression_statement "uVar2 = fd_to_buffered_stream(iVar1);" (assignment_expression "uVar2 = fd_to_buffered_stream(iVar1)" identifier = (call_expression "fd_to_buffered_stream(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) }))) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (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 IDENT (argument_list ( IDENT )))) ;) }))) (return_statement return IDENT ;) })))
(function_definition "undefined4 open_buffered_stream(undefined4 param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);\n  if (iVar1 < 0) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }\n  return uVar2;\n}" (type_identifier "undefined4") (function_declarator "open_buffered_stream(undefined4 param_1)" (identifier "open_buffered_stream") (parameter_list "(undefined4 param_1)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);\n  if (iVar1 < 0) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }\n  return uVar2;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (expression_statement "iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);" (assignment_expression "iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_open64_0015842c)(param_1,0)" (parenthesized_expression "(*(code *)PTR_open64_0015842c)" (( "(") (pointer_expression "*(code *)PTR_open64_0015842c" (* "*") (cast_expression "(code *)PTR_open64_0015842c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_open64_0015842c"))) () ")")) (argument_list "(param_1,0)" (( "(") (identifier "param_1") (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    uVar2 = 0;\n  }" ({ "{") (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" (identifier "uVar2") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }" (else "else") (compound_statement "{\n    uVar2 = fd_to_buffered_stream(iVar1);\n  }" ({ "{") (expression_statement "uVar2 = fd_to_buffered_stream(iVar1);" (assignment_expression "uVar2 = fd_to_buffered_stream(iVar1)" (identifier "uVar2") (= "=") (call_expression "fd_to_buffered_stream(iVar1)" (identifier "fd_to_buffered_stream") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (; ";")) (} "}")))) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))

type_1 * function_1(char *file)

{
  int var_2;
  type_1 *pBVar1;
  type_2 in_a2;
  type_2 in_a3;
  int var_1;
  
  var_2 = (**(type_3 **)(var_1 + 0xc6a20))(file,0,in_a2,in_a3,var_1 + 0xccb34);
  if (var_2 < 0) {
    pBVar1 = (type_1 *)0x0;
  }
  else {
    pBVar1 = var_3(var_2);
  }
  return pBVar1;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (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: (identifier) arguments: (argument_list (identifier)))))))) (return_statement (identifier)))))

undefined4 MASKED(undefined4 param_1)

{
  int iVar1;
  undefined4 uVar2;
  
  iVar1 = (*(code *)PTR_open64_0015842c)(param_1,0);
  if (iVar1 < 0) {
    uVar2 = 0;
  }
  else {
    uVar2 = fd_to_buffered_stream(iVar1);
  }
  return uVar2;
}

