
int history_search_pos(char *string,int dir,int pos)

{
  int pos_00;
  int iVar1;
  
  pos_00 = where_history();
  history_set_pos(pos);
  iVar1 = history_search_internal(string,dir,0);
  if (iVar1 == -1) {
    history_set_pos(pos_00);
    iVar1 = -1;
  }
  else {
    iVar1 = where_history();
    history_set_pos(pos_00);
  }
  return iVar1;
}



undefined4 history_search_pos(undefined4 param_1,undefined4 param_2,undefined4 param_3)

{
  undefined4 uVar1;
  int iVar2;
  undefined4 uVar3;
  
  uVar1 = where_history();
  history_set_pos(param_3);
  iVar2 = FUN_0010f460(param_1,param_2,0);
  if (iVar2 == -1) {
    history_set_pos(uVar1);
    uVar3 = 0xffffffff;
  }
  else {
    uVar3 = where_history();
    history_set_pos(uVar1);
  }
  return uVar3;
}


lui gp,0x4
addiu gp,gp,-0x33e0
addu gp,gp,t9
addiu sp,sp,-0x28
lw t9,-0x75b8(gp)
sw ra,0x24(sp)
sw gp,0x10(sp)
sw a1,0x2c(sp)
sw s1,0x20(sp)
or s1,a2,zero
sw s0,0x1c(sp)
bal 0x00109dcc
_or s0,a0,zero
or a0,s1,zero
lw gp,0x10(sp)
lw t9,-0x706c(gp)
bal 0x00109de4
_or s1,v0,zero
or a2,zero,zero
lw gp,0x10(sp)
or a0,s0,zero
lw t9,-0x7fc8(gp)
addiu t9,t9,-0xba0
bal 0x0010f460
_lw a1,0x2c(sp)
li v1,-0x1
beq v0,v1,0x0010f9c8
_lw gp,0x10(sp)
lw t9,-0x75b8(gp)
bal 0x00109dcc
_nop
or a0,s1,zero
lw gp,0x10(sp)
lw t9,-0x706c(gp)
bal 0x00109de4
_or s0,v0,zero
lw ra,0x24(sp)
or v0,s0,zero
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x28
lw t9,-0x706c(gp)
or a0,s1,zero
bal 0x00109de4
_or s0,v0,zero
b 0x0010f9b4
_lw ra,0x24(sp)
(translation_unit "undefined4 history_search_pos(undefined4 param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = where_history();\n  history_set_pos(param_3);\n  iVar2 = FUN_0010f460(param_1,param_2,0);\n  if (iVar2 == -1) {\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }\n  return uVar3;\n}\n\n" (function_definition "undefined4 history_search_pos(undefined4 param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = where_history();\n  history_set_pos(param_3);\n  iVar2 = FUN_0010f460(param_1,param_2,0);\n  if (iVar2 == -1) {\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }\n  return uVar3;\n}" type_identifier (function_declarator "history_search_pos(undefined4 param_1,undefined4 param_2,undefined4 param_3)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined4 uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = where_history();\n  history_set_pos(param_3);\n  iVar2 = FUN_0010f460(param_1,param_2,0);\n  if (iVar2 == -1) {\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }\n  return uVar3;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (expression_statement "uVar1 = where_history();" (assignment_expression "uVar1 = where_history()" identifier = (call_expression "where_history()" identifier (argument_list "()" ( )))) ;) (expression_statement "history_set_pos(param_3);" (call_expression "history_set_pos(param_3)" identifier (argument_list "(param_3)" ( identifier ))) ;) (expression_statement "iVar2 = FUN_0010f460(param_1,param_2,0);" (assignment_expression "iVar2 = FUN_0010f460(param_1,param_2,0)" identifier = (call_expression "FUN_0010f460(param_1,param_2,0)" identifier (argument_list "(param_1,param_2,0)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar2 == -1) {\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }" { (expression_statement "history_set_pos(uVar1);" (call_expression "history_set_pos(uVar1)" identifier (argument_list "(uVar1)" ( identifier ))) ;) (expression_statement "uVar3 = 0xffffffff;" (assignment_expression "uVar3 = 0xffffffff" identifier = number_literal) ;) }) (else_clause "else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }" else (compound_statement "{\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }" { (expression_statement "uVar3 = where_history();" (assignment_expression "uVar3 = where_history()" identifier = (call_expression "where_history()" identifier (argument_list "()" ( )))) ;) (expression_statement "history_set_pos(uVar1);" (call_expression "history_set_pos(uVar1)" identifier (argument_list "(uVar1)" ( identifier ))) ;) }))) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit "int history_search_pos(char *string,int dir,int pos)\n\n{\n  int pos_00;\n  int iVar1;\n  \n  pos_00 = where_history();\n  history_set_pos(pos);\n  iVar1 = history_search_internal(string,dir,0);\n  if (iVar1 == -1) {\n    history_set_pos(pos_00);\n    iVar1 = -1;\n  }\n  else {\n    iVar1 = where_history();\n    history_set_pos(pos_00);\n  }\n  return iVar1;\n}\n\n" (function_definition "int history_search_pos(char *string,int dir,int pos)\n\n{\n  int pos_00;\n  int iVar1;\n  \n  pos_00 = where_history();\n  history_set_pos(pos);\n  iVar1 = history_search_internal(string,dir,0);\n  if (iVar1 == -1) {\n    history_set_pos(pos_00);\n    iVar1 = -1;\n  }\n  else {\n    iVar1 = where_history();\n    history_set_pos(pos_00);\n  }\n  return iVar1;\n}" primitive_type (function_declarator "history_search_pos(char *string,int dir,int pos)" identifier (parameter_list "(char *string,int dir,int pos)" ( (parameter_declaration "char *string" primitive_type (pointer_declarator "*string" * identifier)) , (parameter_declaration "int dir" primitive_type identifier) , (parameter_declaration "int pos" primitive_type identifier) ))) (compound_statement "{\n  int pos_00;\n  int iVar1;\n  \n  pos_00 = where_history();\n  history_set_pos(pos);\n  iVar1 = history_search_internal(string,dir,0);\n  if (iVar1 == -1) {\n    history_set_pos(pos_00);\n    iVar1 = -1;\n  }\n  else {\n    iVar1 = where_history();\n    history_set_pos(pos_00);\n  }\n  return iVar1;\n}" { (declaration "int pos_00;" primitive_type identifier ;) (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "pos_00 = where_history();" (assignment_expression "pos_00 = where_history()" identifier = (call_expression "where_history()" identifier (argument_list "()" ( )))) ;) (expression_statement "history_set_pos(pos);" (call_expression "history_set_pos(pos)" identifier (argument_list "(pos)" ( identifier ))) ;) (expression_statement "iVar1 = history_search_internal(string,dir,0);" (assignment_expression "iVar1 = history_search_internal(string,dir,0)" identifier = (call_expression "history_search_internal(string,dir,0)" identifier (argument_list "(string,dir,0)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar1 == -1) {\n    history_set_pos(pos_00);\n    iVar1 = -1;\n  }\n  else {\n    iVar1 = where_history();\n    history_set_pos(pos_00);\n  }" if (parenthesized_expression "(iVar1 == -1)" ( (binary_expression "iVar1 == -1" identifier == number_literal) )) (compound_statement "{\n    history_set_pos(pos_00);\n    iVar1 = -1;\n  }" { (expression_statement "history_set_pos(pos_00);" (call_expression "history_set_pos(pos_00)" identifier (argument_list "(pos_00)" ( identifier ))) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }) (else_clause "else {\n    iVar1 = where_history();\n    history_set_pos(pos_00);\n  }" else (compound_statement "{\n    iVar1 = where_history();\n    history_set_pos(pos_00);\n  }" { (expression_statement "iVar1 = where_history();" (assignment_expression "iVar1 = where_history()" identifier = (call_expression "where_history()" identifier (argument_list "()" ( )))) ;) (expression_statement "history_set_pos(pos_00);" (call_expression "history_set_pos(pos_00)" identifier (argument_list "(pos_00)" ( identifier ))) ;) }))) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "undefined4 history_search_pos(undefined4 param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = where_history();\n  history_set_pos(param_3);\n  iVar2 = FUN_0010f460(param_1,param_2,0);\n  if (iVar2 == -1) {\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }\n  return uVar3;\n}\n\n" (function_definition "undefined4 history_search_pos(undefined4 param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = where_history();\n  history_set_pos(param_3);\n  iVar2 = FUN_0010f460(param_1,param_2,0);\n  if (iVar2 == -1) {\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }\n  return uVar3;\n}" type_identifier (function_declarator "history_search_pos(undefined4 param_1,undefined4 param_2,undefined4 param_3)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined4 uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = where_history();\n  history_set_pos(param_3);\n  iVar2 = FUN_0010f460(param_1,param_2,0);\n  if (iVar2 == -1) {\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }\n  return uVar3;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (expression_statement "uVar1 = where_history();" (assignment_expression "uVar1 = where_history()" identifier = (call_expression "where_history()" identifier (argument_list "()" ( )))) ;) (expression_statement "history_set_pos(param_3);" (call_expression "history_set_pos(param_3)" identifier (argument_list "(param_3)" ( identifier ))) ;) (expression_statement "iVar2 = FUN_0010f460(param_1,param_2,0);" (assignment_expression "iVar2 = FUN_0010f460(param_1,param_2,0)" identifier = (call_expression "FUN_0010f460(param_1,param_2,0)" identifier (argument_list "(param_1,param_2,0)" ( identifier , identifier , number_literal )))) ;) (if_statement "if (iVar2 == -1) {\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }" { (expression_statement "history_set_pos(uVar1);" (call_expression "history_set_pos(uVar1)" identifier (argument_list "(uVar1)" ( identifier ))) ;) (expression_statement "uVar3 = 0xffffffff;" (assignment_expression "uVar3 = 0xffffffff" identifier = number_literal) ;) }) (else_clause "else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }" else (compound_statement "{\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }" { (expression_statement "uVar3 = where_history();" (assignment_expression "uVar3 = where_history()" identifier = (call_expression "where_history()" identifier (argument_list "()" ( )))) ;) (expression_statement "history_set_pos(uVar1);" (call_expression "history_set_pos(uVar1)" identifier (argument_list "(uVar1)" ( identifier ))) ;) }))) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }))) (return_statement return IDENT ;) })))
(function_definition "undefined4 history_search_pos(undefined4 param_1,undefined4 param_2,undefined4 param_3)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = where_history();\n  history_set_pos(param_3);\n  iVar2 = FUN_0010f460(param_1,param_2,0);\n  if (iVar2 == -1) {\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }\n  return uVar3;\n}" (type_identifier "undefined4") (function_declarator "history_search_pos(undefined4 param_1,undefined4 param_2,undefined4 param_3)" (identifier "history_search_pos") (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 param_3)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) () ")"))) (compound_statement "{\n  undefined4 uVar1;\n  int iVar2;\n  undefined4 uVar3;\n  \n  uVar1 = where_history();\n  history_set_pos(param_3);\n  iVar2 = FUN_0010f460(param_1,param_2,0);\n  if (iVar2 == -1) {\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }\n  return uVar3;\n}" ({ "{") (declaration "undefined4 uVar1;" (type_identifier "undefined4") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined4 uVar3;" (type_identifier "undefined4") (identifier "uVar3") (; ";")) (expression_statement "uVar1 = where_history();" (assignment_expression "uVar1 = where_history()" (identifier "uVar1") (= "=") (call_expression "where_history()" (identifier "where_history") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "history_set_pos(param_3);" (call_expression "history_set_pos(param_3)" (identifier "history_set_pos") (argument_list "(param_3)" (( "(") (identifier "param_3") () ")"))) (; ";")) (expression_statement "iVar2 = FUN_0010f460(param_1,param_2,0);" (assignment_expression "iVar2 = FUN_0010f460(param_1,param_2,0)" (identifier "iVar2") (= "=") (call_expression "FUN_0010f460(param_1,param_2,0)" (identifier "FUN_0010f460") (argument_list "(param_1,param_2,0)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if (iVar2 == -1) {\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }\n  else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }" (if "if") (parenthesized_expression "(iVar2 == -1)" (( "(") (binary_expression "iVar2 == -1" (identifier "iVar2") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n    history_set_pos(uVar1);\n    uVar3 = 0xffffffff;\n  }" ({ "{") (expression_statement "history_set_pos(uVar1);" (call_expression "history_set_pos(uVar1)" (identifier "history_set_pos") (argument_list "(uVar1)" (( "(") (identifier "uVar1") () ")"))) (; ";")) (expression_statement "uVar3 = 0xffffffff;" (assignment_expression "uVar3 = 0xffffffff" (identifier "uVar3") (= "=") (number_literal "0xffffffff")) (; ";")) (} "}")) (else_clause "else {\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }" (else "else") (compound_statement "{\n    uVar3 = where_history();\n    history_set_pos(uVar1);\n  }" ({ "{") (expression_statement "uVar3 = where_history();" (assignment_expression "uVar3 = where_history()" (identifier "uVar3") (= "=") (call_expression "where_history()" (identifier "where_history") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "history_set_pos(uVar1);" (call_expression "history_set_pos(uVar1)" (identifier "history_set_pos") (argument_list "(uVar1)" (( "(") (identifier "uVar1") () ")"))) (; ";")) (} "}")))) (return_statement "return uVar3;" (return "return") (identifier "uVar3") (; ";")) (} "}")))
(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (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)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))))) (return_statement (identifier)))))

undefined4 MASKED(undefined4 param_1,undefined4 param_2,undefined4 param_3)

{
  undefined4 uVar1;
  int iVar2;
  undefined4 uVar3;
  
  uVar1 = where_history();
  history_set_pos(param_3);
  iVar2 = FUN_0010f460(param_1,param_2,0);
  if (iVar2 == -1) {
    history_set_pos(uVar1);
    uVar3 = 0xffffffff;
  }
  else {
    uVar3 = where_history();
    history_set_pos(uVar1);
  }
  return uVar3;
}

