
int opendb(char *name)

{
  int fd;
  int iVar1;
  
  fd = (*(code *)PTR_open64_0004b3b4)(name,0x2000);
  if ((-1 < fd) && (iVar1 = rpl_fcntl(fd,2,1), iVar1 != 0)) {
    (*(code *)PTR_close_0004b2e4)(fd);
    fd = -1;
  }
  return fd;
}



int FUN_0001331c(undefined4 param_1)

{
  int iVar1;
  int iVar2;
  
  iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);
  if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {
    (*(code *)PTR_close_0004b2e4)(iVar1);
    iVar1 = -1;
  }
  return iVar1;
}


lui gp,0x4
addiu gp,gp,-0x1cc
addu gp,gp,t9
addiu sp,sp,-0x20
lw t9,-0x7d9c(gp)
sw gp,0x10(sp)
sw s0,0x18(sp)
sw ra,0x1c(sp)
jalr t9
_li a1,0x2000
lw gp,0x10(sp)
bgez v0,0x00013364
_or s0,v0,zero
lw ra,0x1c(sp)
or v0,s0,zero
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x20
lw t9,-0x7fc4(gp)
li a2,0x1
li a1,0x2
bal 0x0001ea70
_or a0,v0,zero
beq v0,zero,0x00013350
_lw gp,0x10(sp)
lw t9,-0x7e6c(gp)
or a0,s0,zero
jalr t9
_li s0,-0x1
b 0x00013354
_lw ra,0x1c(sp)
(translation_unit "int FUN_0001331c(undefined4 param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);\n  if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }\n  return iVar1;\n}\n\n" (function_definition "int FUN_0001331c(undefined4 param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);\n  if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }\n  return iVar1;\n}" primitive_type (function_declarator "FUN_0001331c(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  \n  iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);\n  if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);" (assignment_expression "iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000)" identifier = (call_expression "(*(code *)PTR_open64_0004b3b4)(param_1,0x2000)" (parenthesized_expression "(*(code *)PTR_open64_0004b3b4)" ( (pointer_expression "*(code *)PTR_open64_0004b3b4" * (cast_expression "(code *)PTR_open64_0004b3b4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0x2000)" ( identifier , number_literal )))) ;) (if_statement "if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }" if (parenthesized_expression "((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0))" ( (binary_expression "(-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)" (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) && (parenthesized_expression "(iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)" ( (comma_expression "iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0" (assignment_expression "iVar2 = rpl_fcntl(iVar1,2,1)" identifier = (call_expression "rpl_fcntl(iVar1,2,1)" identifier (argument_list "(iVar1,2,1)" ( identifier , number_literal , number_literal )))) , (binary_expression "iVar2 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }" { (expression_statement "(*(code *)PTR_close_0004b2e4)(iVar1);" (call_expression "(*(code *)PTR_close_0004b2e4)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0004b2e4)" ( (pointer_expression "*(code *)PTR_close_0004b2e4" * (cast_expression "(code *)PTR_close_0004b2e4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) })) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "int opendb(char *name)\n\n{\n  int fd;\n  int iVar1;\n  \n  fd = (*(code *)PTR_open64_0004b3b4)(name,0x2000);\n  if ((-1 < fd) && (iVar1 = rpl_fcntl(fd,2,1), iVar1 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(fd);\n    fd = -1;\n  }\n  return fd;\n}\n\n" (function_definition "int opendb(char *name)\n\n{\n  int fd;\n  int iVar1;\n  \n  fd = (*(code *)PTR_open64_0004b3b4)(name,0x2000);\n  if ((-1 < fd) && (iVar1 = rpl_fcntl(fd,2,1), iVar1 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(fd);\n    fd = -1;\n  }\n  return fd;\n}" primitive_type (function_declarator "opendb(char *name)" identifier (parameter_list "(char *name)" ( (parameter_declaration "char *name" primitive_type (pointer_declarator "*name" * identifier)) ))) (compound_statement "{\n  int fd;\n  int iVar1;\n  \n  fd = (*(code *)PTR_open64_0004b3b4)(name,0x2000);\n  if ((-1 < fd) && (iVar1 = rpl_fcntl(fd,2,1), iVar1 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(fd);\n    fd = -1;\n  }\n  return fd;\n}" { (declaration "int fd;" primitive_type identifier ;) (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "fd = (*(code *)PTR_open64_0004b3b4)(name,0x2000);" (assignment_expression "fd = (*(code *)PTR_open64_0004b3b4)(name,0x2000)" identifier = (call_expression "(*(code *)PTR_open64_0004b3b4)(name,0x2000)" (parenthesized_expression "(*(code *)PTR_open64_0004b3b4)" ( (pointer_expression "*(code *)PTR_open64_0004b3b4" * (cast_expression "(code *)PTR_open64_0004b3b4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(name,0x2000)" ( identifier , number_literal )))) ;) (if_statement "if ((-1 < fd) && (iVar1 = rpl_fcntl(fd,2,1), iVar1 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(fd);\n    fd = -1;\n  }" if (parenthesized_expression "((-1 < fd) && (iVar1 = rpl_fcntl(fd,2,1), iVar1 != 0))" ( (binary_expression "(-1 < fd) && (iVar1 = rpl_fcntl(fd,2,1), iVar1 != 0)" (parenthesized_expression "(-1 < fd)" ( (binary_expression "-1 < fd" number_literal < identifier) )) && (parenthesized_expression "(iVar1 = rpl_fcntl(fd,2,1), iVar1 != 0)" ( (comma_expression "iVar1 = rpl_fcntl(fd,2,1), iVar1 != 0" (assignment_expression "iVar1 = rpl_fcntl(fd,2,1)" identifier = (call_expression "rpl_fcntl(fd,2,1)" identifier (argument_list "(fd,2,1)" ( identifier , number_literal , number_literal )))) , (binary_expression "iVar1 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n    (*(code *)PTR_close_0004b2e4)(fd);\n    fd = -1;\n  }" { (expression_statement "(*(code *)PTR_close_0004b2e4)(fd);" (call_expression "(*(code *)PTR_close_0004b2e4)(fd)" (parenthesized_expression "(*(code *)PTR_close_0004b2e4)" ( (pointer_expression "*(code *)PTR_close_0004b2e4" * (cast_expression "(code *)PTR_close_0004b2e4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(fd)" ( identifier ))) ;) (expression_statement "fd = -1;" (assignment_expression "fd = -1" identifier = number_literal) ;) })) (return_statement "return fd;" return identifier ;) })))
(translation_unit "int FUN_0001331c(undefined4 param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);\n  if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }\n  return iVar1;\n}\n\n" (function_definition "int FUN_0001331c(undefined4 param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);\n  if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }\n  return iVar1;\n}" primitive_type (function_declarator "FUN_0001331c(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  \n  iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);\n  if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);" (assignment_expression "iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000)" identifier = (call_expression "(*(code *)PTR_open64_0004b3b4)(param_1,0x2000)" (parenthesized_expression "(*(code *)PTR_open64_0004b3b4)" ( (pointer_expression "*(code *)PTR_open64_0004b3b4" * (cast_expression "(code *)PTR_open64_0004b3b4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,0x2000)" ( identifier , number_literal )))) ;) (if_statement "if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }" if (parenthesized_expression "((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0))" ( (binary_expression "(-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)" (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) && (parenthesized_expression "(iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)" ( (comma_expression "iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0" (assignment_expression "iVar2 = rpl_fcntl(iVar1,2,1)" identifier = (call_expression "rpl_fcntl(iVar1,2,1)" identifier (argument_list "(iVar1,2,1)" ( identifier , number_literal , number_literal )))) , (binary_expression "iVar2 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }" { (expression_statement "(*(code *)PTR_close_0004b2e4)(iVar1);" (call_expression "(*(code *)PTR_close_0004b2e4)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0004b2e4)" ( (pointer_expression "*(code *)PTR_close_0004b2e4" * (cast_expression "(code *)PTR_close_0004b2e4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) })) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit (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 (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , LIT )))) , (binary_expression IDENT != LIT)) ))) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) })) (return_statement return IDENT ;) })))
(function_definition "int FUN_0001331c(undefined4 param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);\n  if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }\n  return iVar1;\n}" (primitive_type "int") (function_declarator "FUN_0001331c(undefined4 param_1)" (identifier "FUN_0001331c") (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  \n  iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);\n  if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }\n  return iVar1;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (expression_statement "iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);" (assignment_expression "iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_open64_0004b3b4)(param_1,0x2000)" (parenthesized_expression "(*(code *)PTR_open64_0004b3b4)" (( "(") (pointer_expression "*(code *)PTR_open64_0004b3b4" (* "*") (cast_expression "(code *)PTR_open64_0004b3b4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_open64_0004b3b4"))) () ")")) (argument_list "(param_1,0x2000)" (( "(") (identifier "param_1") (, ",") (number_literal "0x2000") () ")")))) (; ";")) (if_statement "if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }" (if "if") (parenthesized_expression "((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0))" (( "(") (binary_expression "(-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)" (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (&& "&&") (parenthesized_expression "(iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)" (( "(") (comma_expression "iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0" (assignment_expression "iVar2 = rpl_fcntl(iVar1,2,1)" (identifier "iVar2") (= "=") (call_expression "rpl_fcntl(iVar1,2,1)" (identifier "rpl_fcntl") (argument_list "(iVar1,2,1)" (( "(") (identifier "iVar1") (, ",") (number_literal "2") (, ",") (number_literal "1") () ")")))) (, ",") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n    (*(code *)PTR_close_0004b2e4)(iVar1);\n    iVar1 = -1;\n  }" ({ "{") (expression_statement "(*(code *)PTR_close_0004b2e4)(iVar1);" (call_expression "(*(code *)PTR_close_0004b2e4)(iVar1)" (parenthesized_expression "(*(code *)PTR_close_0004b2e4)" (( "(") (pointer_expression "*(code *)PTR_close_0004b2e4" (* "*") (cast_expression "(code *)PTR_close_0004b2e4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_close_0004b2e4"))) () ")")) (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" (identifier "iVar1") (= "=") (number_literal "-1")) (; ";")) (} "}"))) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}")))
(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)) (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: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (number_literal)))) right: (binary_expression left: (identifier) right: (number_literal)))))) consequence: (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))))) (return_statement (identifier)))))

int MASKED(undefined4 param_1)

{
  int iVar1;
  int iVar2;
  
  iVar1 = (*(code *)PTR_open64_0004b3b4)(param_1,0x2000);
  if ((-1 < iVar1) && (iVar2 = rpl_fcntl(iVar1,2,1), iVar2 != 0)) {
    (*(code *)PTR_close_0004b2e4)(iVar1);
    iVar1 = -1;
  }
  return iVar1;
}

