
int _hs_history_patsearch(char *string,int direction,int flags)

{
  char cVar1;
  int iVar2;
  char *string_00;
  char *pcVar3;
  int iVar4;
  int iVar5;
  
  iVar2 = (*(code *)PTR_strlen_00146390)();
  iVar5 = iVar2 + -1;
  if (string[iVar5] == '\\') {
    if ((0 < iVar5) && (iVar4 = 1, string[iVar2 + -2] == '\\')) {
      pcVar3 = string + iVar2 + -3;
      do {
        iVar4 = 1 - iVar4;
        if (string + -1 == pcVar3) break;
        cVar1 = *pcVar3;
        pcVar3 = pcVar3 + -1;
      } while (cVar1 == '\\');
      if (iVar4 == 0) goto LAB_0010f7d4;
    }
    iVar5 = -1;
  }
  else {
LAB_0010f7d4:
    string_00 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);
    pcVar3 = string_00;
    iVar4 = iVar2;
    if (((flags & 1U) == 0) && (*string != '*')) {
      *string_00 = '*';
      pcVar3 = string_00 + 1;
      iVar4 = iVar2 + 1;
      iVar5 = iVar2;
    }
    (*(code *)PTR_strcpy_00146418)(pcVar3,string);
    if (string_00[iVar5] != '*') {
      string_00[iVar4] = '*';
      (string_00 + iVar4)[1] = '\0';
    }
    iVar5 = history_search_internal(string_00,direction,flags | 2);
    if (string != string_00) {
      (*(code *)PTR_free_001464fc)(string_00);
    }
  }
  return iVar5;
}



undefined4 _hs_history_patsearch(char *param_1,undefined4 param_2,uint param_3)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  undefined4 uVar4;
  char *pcVar5;
  int iVar6;
  int iVar7;
  
  iVar2 = (*(code *)PTR_strlen_00146390)();
  iVar7 = iVar2 + -1;
  if (param_1[iVar7] == '\\') {
    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {
      pcVar5 = param_1 + iVar2 + -3;
      do {
        iVar6 = 1 - iVar6;
        if (param_1 + -1 == pcVar5) break;
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + -1;
      } while (cVar1 == '\\');
      if (iVar6 == 0) goto LAB_0010f7d4;
    }
    uVar4 = 0xffffffff;
  }
  else {
LAB_0010f7d4:
    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);
    pcVar5 = pcVar3;
    iVar6 = iVar2;
    if (((param_3 & 1) == 0) && (*param_1 != '*')) {
      *pcVar3 = '*';
      pcVar5 = pcVar3 + 1;
      iVar6 = iVar2 + 1;
      iVar7 = iVar2;
    }
    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);
    if (pcVar3[iVar7] != '*') {
      pcVar3[iVar6] = '*';
      (pcVar3 + iVar6)[1] = '\0';
    }
    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);
    if (param_1 != pcVar3) {
      (*(code *)PTR_free_001464fc)(pcVar3);
    }
  }
  return uVar4;
}


lui gp,0x4
addiu gp,gp,-0x3230
addu gp,gp,t9
addiu sp,sp,-0x40
lw t9,-0x61b0(gp)
sw gp,0x10(sp)
sw s5,0x38(sp)
sw s4,0x34(sp)
or s4,a1,zero
sw s3,0x30(sp)
or s3,a2,zero
sw s2,0x2c(sp)
or s2,a0,zero
sw s0,0x24(sp)
sw ra,0x3c(sp)
jalr t9
_sw s1,0x28(sp)
li v1,0x5c
addiu s5,v0,-0x1
or s0,v0,zero
addu v0,s2,s5
lb v0,0x0(v0)
beq v0,v1,0x0010f894
_lw gp,0x10(sp)
lw t9,-0x7f90(gp)
jalr t9
_addiu a0,s0,0x3
andi v1,s3,0x1
lw gp,0x10(sp)
beq v1,zero,0x0010f874
_or s1,v0,zero
or a0,s1,zero
lw t9,-0x6128(gp)
addu s5,s1,s5
jalr t9
_or a1,s2,zero
li v0,0x2a
lb v1,0x0(s5)
beq v1,v0,0x0010f81c
_lw gp,0x10(sp)
addu s0,s1,s0
sb v0,0x0(s0)
sb zero,0x1(s0)
lw t9,-0x7fc8(gp)
ori a2,s3,0x2
or a1,s4,zero
addiu t9,t9,-0xba0
bal 0x0010f460
_or a0,s1,zero
beq s2,s1,0x0010f850
_lw gp,0x10(sp)
lw t9,-0x6044(gp)
or a0,s1,zero
jalr t9
_sw v0,0x1c(sp)
lw v0,0x1c(sp)
lw ra,0x3c(sp)
lw s5,0x38(sp)
lw s4,0x34(sp)
lw s3,0x30(sp)
lw s2,0x2c(sp)
lw s1,0x28(sp)
lw s0,0x24(sp)
jr ra
_addiu sp,sp,0x40
lb v1,0x0(s2)
li v0,0x2a
beq v1,v0,0x0010f7ec
_addiu a0,s1,0x1
or s5,s0,zero
sb v0,0x0(s1)
b 0x0010f7f0
_addiu s0,s0,0x1
blez s5,0x0010f8e0
_addu v1,s2,s0
lb v1,-0x2(v1)
bne v1,v0,0x0010f8e0
_li v1,0x1
addiu v0,s0,-0x3
addiu a2,s2,-0x1
addu v0,s2,v0
li a1,0x1
b 0x0010f8d0
_li a3,0x5c
addiu v0,v0,-0x1
lb a0,0x1(v0)
bne a0,a3,0x0010f8d8
_nop
bne a2,v0,0x0010f8c0
_subu v1,a1,v1
beq v1,zero,0x0010f7d4
_lw t9,-0x7f90(gp)
b 0x0010f850
_li v0,-0x1
(translation_unit "undefined4 _hs_history_patsearch(char *param_1,undefined4 param_2,uint param_3)\n\n{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  undefined4 uVar4;\n  char *pcVar5;\n  int iVar6;\n  int iVar7;\n  \n  iVar2 = (*(code *)PTR_strlen_00146390)();\n  iVar7 = iVar2 + -1;\n  if (param_1[iVar7] == '\\') {\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }\n  else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }\n  return uVar4;\n}\n\n" (function_definition "undefined4 _hs_history_patsearch(char *param_1,undefined4 param_2,uint param_3)\n\n{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  undefined4 uVar4;\n  char *pcVar5;\n  int iVar6;\n  int iVar7;\n  \n  iVar2 = (*(code *)PTR_strlen_00146390)();\n  iVar7 = iVar2 + -1;\n  if (param_1[iVar7] == '\\') {\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }\n  else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }\n  return uVar4;\n}" type_identifier (function_declarator "_hs_history_patsearch(char *param_1,undefined4 param_2,uint param_3)" identifier (parameter_list "(char *param_1,undefined4 param_2,uint param_3)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  undefined4 uVar4;\n  char *pcVar5;\n  int iVar6;\n  int iVar7;\n  \n  iVar2 = (*(code *)PTR_strlen_00146390)();\n  iVar7 = iVar2 + -1;\n  if (param_1[iVar7] == '\\') {\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }\n  else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }\n  return uVar4;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (expression_statement "iVar2 = (*(code *)PTR_strlen_00146390)();" (assignment_expression "iVar2 = (*(code *)PTR_strlen_00146390)()" identifier = (call_expression "(*(code *)PTR_strlen_00146390)()" (parenthesized_expression "(*(code *)PTR_strlen_00146390)" ( (pointer_expression "*(code *)PTR_strlen_00146390" * (cast_expression "(code *)PTR_strlen_00146390" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (expression_statement "iVar7 = iVar2 + -1;" (assignment_expression "iVar7 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if (param_1[iVar7] == '\\') {\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }\n  else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }" if (parenthesized_expression "(param_1[iVar7] == '\\')" ( (binary_expression "param_1[iVar7] == '\\'" (subscript_expression "param_1[iVar7]" identifier [ identifier ]) == (char_literal "'\\'" ' escape_sequence ')) )) (compound_statement "{\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }" { (if_statement "if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }" if (parenthesized_expression "((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\'))" ( (binary_expression "(0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')" (parenthesized_expression "(0 < iVar7)" ( (binary_expression "0 < iVar7" number_literal < identifier) )) && (parenthesized_expression "(iVar6 = 1, param_1[iVar2 + -2] == '\\')" ( (comma_expression "iVar6 = 1, param_1[iVar2 + -2] == '\\'" (assignment_expression "iVar6 = 1" identifier = number_literal) , (binary_expression "param_1[iVar2 + -2] == '\\'" (subscript_expression "param_1[iVar2 + -2]" identifier [ (binary_expression "iVar2 + -2" identifier + number_literal) ]) == (char_literal "'\\'" ' escape_sequence '))) ))) )) (compound_statement "{\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }" { (expression_statement "pcVar5 = param_1 + iVar2 + -3;" (assignment_expression "pcVar5 = param_1 + iVar2 + -3" identifier = (binary_expression "param_1 + iVar2 + -3" (binary_expression "param_1 + iVar2" identifier + identifier) + number_literal)) ;) (do_statement "do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');" do (compound_statement "{\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      }" { (expression_statement "iVar6 = 1 - iVar6;" (assignment_expression "iVar6 = 1 - iVar6" identifier = (binary_expression "1 - iVar6" number_literal - identifier)) ;) (if_statement "if (param_1 + -1 == pcVar5) break;" if (parenthesized_expression "(param_1 + -1 == pcVar5)" ( (binary_expression "param_1 + -1 == pcVar5" (binary_expression "param_1 + -1" identifier + number_literal) == identifier) )) (break_statement "break;" break ;)) (expression_statement "cVar1 = *pcVar5;" (assignment_expression "cVar1 = *pcVar5" identifier = (pointer_expression "*pcVar5" * identifier)) ;) (expression_statement "pcVar5 = pcVar5 + -1;" (assignment_expression "pcVar5 = pcVar5 + -1" identifier = (binary_expression "pcVar5 + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(cVar1 == '\\')" ( (binary_expression "cVar1 == '\\'" identifier == (char_literal "'\\'" ' escape_sequence ')) )) ;) (if_statement "if (iVar6 == 0) goto LAB_0010f7d4;" if (parenthesized_expression "(iVar6 == 0)" ( (binary_expression "iVar6 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0010f7d4;" goto statement_identifier ;)) })) (expression_statement "uVar4 = 0xffffffff;" (assignment_expression "uVar4 = 0xffffffff" identifier = number_literal) ;) }) (else_clause "else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }" else (compound_statement "{\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }" { (labeled_statement "LAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);" statement_identifier : (expression_statement "pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);" (assignment_expression "pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3)" identifier = (cast_expression "(char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3)" (parenthesized_expression "(*(code *)PTR_xmalloc_001445b0)" ( (pointer_expression "*(code *)PTR_xmalloc_001445b0" * (cast_expression "(code *)PTR_xmalloc_001445b0" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2 + 3)" ( (binary_expression "iVar2 + 3" identifier + number_literal) ))))) ;)) (expression_statement "pcVar5 = pcVar3;" (assignment_expression "pcVar5 = pcVar3" identifier = identifier) ;) (expression_statement "iVar6 = iVar2;" (assignment_expression "iVar6 = iVar2" identifier = identifier) ;) (if_statement "if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }" if (parenthesized_expression "(((param_3 & 1) == 0) && (*param_1 != '*'))" ( (binary_expression "((param_3 & 1) == 0) && (*param_1 != '*')" (parenthesized_expression "((param_3 & 1) == 0)" ( (binary_expression "(param_3 & 1) == 0" (parenthesized_expression "(param_3 & 1)" ( (binary_expression "param_3 & 1" identifier & number_literal) )) == number_literal) )) && (parenthesized_expression "(*param_1 != '*')" ( (binary_expression "*param_1 != '*'" (pointer_expression "*param_1" * identifier) != (char_literal "'*'" ' character ')) ))) )) (compound_statement "{\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }" { (expression_statement "*pcVar3 = '*';" (assignment_expression "*pcVar3 = '*'" (pointer_expression "*pcVar3" * identifier) = (char_literal "'*'" ' character ')) ;) (expression_statement "pcVar5 = pcVar3 + 1;" (assignment_expression "pcVar5 = pcVar3 + 1" identifier = (binary_expression "pcVar3 + 1" identifier + number_literal)) ;) (expression_statement "iVar6 = iVar2 + 1;" (assignment_expression "iVar6 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (expression_statement "iVar7 = iVar2;" (assignment_expression "iVar7 = iVar2" identifier = identifier) ;) })) (expression_statement "(*(code *)PTR_strcpy_00146418)(pcVar5,param_1);" (call_expression "(*(code *)PTR_strcpy_00146418)(pcVar5,param_1)" (parenthesized_expression "(*(code *)PTR_strcpy_00146418)" ( (pointer_expression "*(code *)PTR_strcpy_00146418" * (cast_expression "(code *)PTR_strcpy_00146418" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar5,param_1)" ( identifier , identifier ))) ;) (if_statement "if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }" if (parenthesized_expression "(pcVar3[iVar7] != '*')" ( (binary_expression "pcVar3[iVar7] != '*'" (subscript_expression "pcVar3[iVar7]" identifier [ identifier ]) != (char_literal "'*'" ' character ')) )) (compound_statement "{\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }" { (expression_statement "pcVar3[iVar6] = '*';" (assignment_expression "pcVar3[iVar6] = '*'" (subscript_expression "pcVar3[iVar6]" identifier [ identifier ]) = (char_literal "'*'" ' character ')) ;) (expression_statement "(pcVar3 + iVar6)[1] = '\0';" (assignment_expression "(pcVar3 + iVar6)[1] = '\0'" (subscript_expression "(pcVar3 + iVar6)[1]" (parenthesized_expression "(pcVar3 + iVar6)" ( (binary_expression "pcVar3 + iVar6" identifier + identifier) )) [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) })) (expression_statement "uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);" (assignment_expression "uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2)" identifier = (call_expression "FUN_0010f460(pcVar3,param_2,param_3 | 2)" identifier (argument_list "(pcVar3,param_2,param_3 | 2)" ( identifier , identifier , (binary_expression "param_3 | 2" identifier | number_literal) )))) ;) (if_statement "if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }" if (parenthesized_expression "(param_1 != pcVar3)" ( (binary_expression "param_1 != pcVar3" identifier != identifier) )) (compound_statement "{\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }" { (expression_statement "(*(code *)PTR_free_001464fc)(pcVar3);" (call_expression "(*(code *)PTR_free_001464fc)(pcVar3)" (parenthesized_expression "(*(code *)PTR_free_001464fc)" ( (pointer_expression "*(code *)PTR_free_001464fc" * (cast_expression "(code *)PTR_free_001464fc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar3)" ( identifier ))) ;) })) }))) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit "int _hs_history_patsearch(char *string,int direction,int flags)\n\n{\n  char cVar1;\n  int iVar2;\n  char *string_00;\n  char *pcVar3;\n  int iVar4;\n  int iVar5;\n  \n  iVar2 = (*(code *)PTR_strlen_00146390)();\n  iVar5 = iVar2 + -1;\n  if (string[iVar5] == '\\') {\n    if ((0 < iVar5) && (iVar4 = 1, string[iVar2 + -2] == '\\')) {\n      pcVar3 = string + iVar2 + -3;\n      do {\n        iVar4 = 1 - iVar4;\n        if (string + -1 == pcVar3) break;\n        cVar1 = *pcVar3;\n        pcVar3 = pcVar3 + -1;\n      } while (cVar1 == '\\');\n      if (iVar4 == 0) goto LAB_0010f7d4;\n    }\n    iVar5 = -1;\n  }\n  else {\nLAB_0010f7d4:\n    string_00 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar3 = string_00;\n    iVar4 = iVar2;\n    if (((flags & 1U) == 0) && (*string != '*')) {\n      *string_00 = '*';\n      pcVar3 = string_00 + 1;\n      iVar4 = iVar2 + 1;\n      iVar5 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar3,string);\n    if (string_00[iVar5] != '*') {\n      string_00[iVar4] = '*';\n      (string_00 + iVar4)[1] = '\0';\n    }\n    iVar5 = history_search_internal(string_00,direction,flags | 2);\n    if (string != string_00) {\n      (*(code *)PTR_free_001464fc)(string_00);\n    }\n  }\n  return iVar5;\n}\n\n" (function_definition "int _hs_history_patsearch(char *string,int direction,int flags)\n\n{\n  char cVar1;\n  int iVar2;\n  char *string_00;\n  char *pcVar3;\n  int iVar4;\n  int iVar5;\n  \n  iVar2 = (*(code *)PTR_strlen_00146390)();\n  iVar5 = iVar2 + -1;\n  if (string[iVar5] == '\\') {\n    if ((0 < iVar5) && (iVar4 = 1, string[iVar2 + -2] == '\\')) {\n      pcVar3 = string + iVar2 + -3;\n      do {\n        iVar4 = 1 - iVar4;\n        if (string + -1 == pcVar3) break;\n        cVar1 = *pcVar3;\n        pcVar3 = pcVar3 + -1;\n      } while (cVar1 == '\\');\n      if (iVar4 == 0) goto LAB_0010f7d4;\n    }\n    iVar5 = -1;\n  }\n  else {\nLAB_0010f7d4:\n    string_00 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar3 = string_00;\n    iVar4 = iVar2;\n    if (((flags & 1U) == 0) && (*string != '*')) {\n      *string_00 = '*';\n      pcVar3 = string_00 + 1;\n      iVar4 = iVar2 + 1;\n      iVar5 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar3,string);\n    if (string_00[iVar5] != '*') {\n      string_00[iVar4] = '*';\n      (string_00 + iVar4)[1] = '\0';\n    }\n    iVar5 = history_search_internal(string_00,direction,flags | 2);\n    if (string != string_00) {\n      (*(code *)PTR_free_001464fc)(string_00);\n    }\n  }\n  return iVar5;\n}" primitive_type (function_declarator "_hs_history_patsearch(char *string,int direction,int flags)" identifier (parameter_list "(char *string,int direction,int flags)" ( (parameter_declaration "char *string" primitive_type (pointer_declarator "*string" * identifier)) , (parameter_declaration "int direction" primitive_type identifier) , (parameter_declaration "int flags" primitive_type identifier) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  char *string_00;\n  char *pcVar3;\n  int iVar4;\n  int iVar5;\n  \n  iVar2 = (*(code *)PTR_strlen_00146390)();\n  iVar5 = iVar2 + -1;\n  if (string[iVar5] == '\\') {\n    if ((0 < iVar5) && (iVar4 = 1, string[iVar2 + -2] == '\\')) {\n      pcVar3 = string + iVar2 + -3;\n      do {\n        iVar4 = 1 - iVar4;\n        if (string + -1 == pcVar3) break;\n        cVar1 = *pcVar3;\n        pcVar3 = pcVar3 + -1;\n      } while (cVar1 == '\\');\n      if (iVar4 == 0) goto LAB_0010f7d4;\n    }\n    iVar5 = -1;\n  }\n  else {\nLAB_0010f7d4:\n    string_00 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar3 = string_00;\n    iVar4 = iVar2;\n    if (((flags & 1U) == 0) && (*string != '*')) {\n      *string_00 = '*';\n      pcVar3 = string_00 + 1;\n      iVar4 = iVar2 + 1;\n      iVar5 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar3,string);\n    if (string_00[iVar5] != '*') {\n      string_00[iVar4] = '*';\n      (string_00 + iVar4)[1] = '\0';\n    }\n    iVar5 = history_search_internal(string_00,direction,flags | 2);\n    if (string != string_00) {\n      (*(code *)PTR_free_001464fc)(string_00);\n    }\n  }\n  return iVar5;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *string_00;" primitive_type (pointer_declarator "*string_00" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (expression_statement "iVar2 = (*(code *)PTR_strlen_00146390)();" (assignment_expression "iVar2 = (*(code *)PTR_strlen_00146390)()" identifier = (call_expression "(*(code *)PTR_strlen_00146390)()" (parenthesized_expression "(*(code *)PTR_strlen_00146390)" ( (pointer_expression "*(code *)PTR_strlen_00146390" * (cast_expression "(code *)PTR_strlen_00146390" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (expression_statement "iVar5 = iVar2 + -1;" (assignment_expression "iVar5 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if (string[iVar5] == '\\') {\n    if ((0 < iVar5) && (iVar4 = 1, string[iVar2 + -2] == '\\')) {\n      pcVar3 = string + iVar2 + -3;\n      do {\n        iVar4 = 1 - iVar4;\n        if (string + -1 == pcVar3) break;\n        cVar1 = *pcVar3;\n        pcVar3 = pcVar3 + -1;\n      } while (cVar1 == '\\');\n      if (iVar4 == 0) goto LAB_0010f7d4;\n    }\n    iVar5 = -1;\n  }\n  else {\nLAB_0010f7d4:\n    string_00 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar3 = string_00;\n    iVar4 = iVar2;\n    if (((flags & 1U) == 0) && (*string != '*')) {\n      *string_00 = '*';\n      pcVar3 = string_00 + 1;\n      iVar4 = iVar2 + 1;\n      iVar5 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar3,string);\n    if (string_00[iVar5] != '*') {\n      string_00[iVar4] = '*';\n      (string_00 + iVar4)[1] = '\0';\n    }\n    iVar5 = history_search_internal(string_00,direction,flags | 2);\n    if (string != string_00) {\n      (*(code *)PTR_free_001464fc)(string_00);\n    }\n  }" if (parenthesized_expression "(string[iVar5] == '\\')" ( (binary_expression "string[iVar5] == '\\'" (subscript_expression "string[iVar5]" identifier [ identifier ]) == (char_literal "'\\'" ' escape_sequence ')) )) (compound_statement "{\n    if ((0 < iVar5) && (iVar4 = 1, string[iVar2 + -2] == '\\')) {\n      pcVar3 = string + iVar2 + -3;\n      do {\n        iVar4 = 1 - iVar4;\n        if (string + -1 == pcVar3) break;\n        cVar1 = *pcVar3;\n        pcVar3 = pcVar3 + -1;\n      } while (cVar1 == '\\');\n      if (iVar4 == 0) goto LAB_0010f7d4;\n    }\n    iVar5 = -1;\n  }" { (if_statement "if ((0 < iVar5) && (iVar4 = 1, string[iVar2 + -2] == '\\')) {\n      pcVar3 = string + iVar2 + -3;\n      do {\n        iVar4 = 1 - iVar4;\n        if (string + -1 == pcVar3) break;\n        cVar1 = *pcVar3;\n        pcVar3 = pcVar3 + -1;\n      } while (cVar1 == '\\');\n      if (iVar4 == 0) goto LAB_0010f7d4;\n    }" if (parenthesized_expression "((0 < iVar5) && (iVar4 = 1, string[iVar2 + -2] == '\\'))" ( (binary_expression "(0 < iVar5) && (iVar4 = 1, string[iVar2 + -2] == '\\')" (parenthesized_expression "(0 < iVar5)" ( (binary_expression "0 < iVar5" number_literal < identifier) )) && (parenthesized_expression "(iVar4 = 1, string[iVar2 + -2] == '\\')" ( (comma_expression "iVar4 = 1, string[iVar2 + -2] == '\\'" (assignment_expression "iVar4 = 1" identifier = number_literal) , (binary_expression "string[iVar2 + -2] == '\\'" (subscript_expression "string[iVar2 + -2]" identifier [ (binary_expression "iVar2 + -2" identifier + number_literal) ]) == (char_literal "'\\'" ' escape_sequence '))) ))) )) (compound_statement "{\n      pcVar3 = string + iVar2 + -3;\n      do {\n        iVar4 = 1 - iVar4;\n        if (string + -1 == pcVar3) break;\n        cVar1 = *pcVar3;\n        pcVar3 = pcVar3 + -1;\n      } while (cVar1 == '\\');\n      if (iVar4 == 0) goto LAB_0010f7d4;\n    }" { (expression_statement "pcVar3 = string + iVar2 + -3;" (assignment_expression "pcVar3 = string + iVar2 + -3" identifier = (binary_expression "string + iVar2 + -3" (binary_expression "string + iVar2" identifier + identifier) + number_literal)) ;) (do_statement "do {\n        iVar4 = 1 - iVar4;\n        if (string + -1 == pcVar3) break;\n        cVar1 = *pcVar3;\n        pcVar3 = pcVar3 + -1;\n      } while (cVar1 == '\\');" do (compound_statement "{\n        iVar4 = 1 - iVar4;\n        if (string + -1 == pcVar3) break;\n        cVar1 = *pcVar3;\n        pcVar3 = pcVar3 + -1;\n      }" { (expression_statement "iVar4 = 1 - iVar4;" (assignment_expression "iVar4 = 1 - iVar4" identifier = (binary_expression "1 - iVar4" number_literal - identifier)) ;) (if_statement "if (string + -1 == pcVar3) break;" if (parenthesized_expression "(string + -1 == pcVar3)" ( (binary_expression "string + -1 == pcVar3" (binary_expression "string + -1" identifier + number_literal) == identifier) )) (break_statement "break;" break ;)) (expression_statement "cVar1 = *pcVar3;" (assignment_expression "cVar1 = *pcVar3" identifier = (pointer_expression "*pcVar3" * identifier)) ;) (expression_statement "pcVar3 = pcVar3 + -1;" (assignment_expression "pcVar3 = pcVar3 + -1" identifier = (binary_expression "pcVar3 + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(cVar1 == '\\')" ( (binary_expression "cVar1 == '\\'" identifier == (char_literal "'\\'" ' escape_sequence ')) )) ;) (if_statement "if (iVar4 == 0) goto LAB_0010f7d4;" if (parenthesized_expression "(iVar4 == 0)" ( (binary_expression "iVar4 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0010f7d4;" goto statement_identifier ;)) })) (expression_statement "iVar5 = -1;" (assignment_expression "iVar5 = -1" identifier = number_literal) ;) }) (else_clause "else {\nLAB_0010f7d4:\n    string_00 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar3 = string_00;\n    iVar4 = iVar2;\n    if (((flags & 1U) == 0) && (*string != '*')) {\n      *string_00 = '*';\n      pcVar3 = string_00 + 1;\n      iVar4 = iVar2 + 1;\n      iVar5 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar3,string);\n    if (string_00[iVar5] != '*') {\n      string_00[iVar4] = '*';\n      (string_00 + iVar4)[1] = '\0';\n    }\n    iVar5 = history_search_internal(string_00,direction,flags | 2);\n    if (string != string_00) {\n      (*(code *)PTR_free_001464fc)(string_00);\n    }\n  }" else (compound_statement "{\nLAB_0010f7d4:\n    string_00 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar3 = string_00;\n    iVar4 = iVar2;\n    if (((flags & 1U) == 0) && (*string != '*')) {\n      *string_00 = '*';\n      pcVar3 = string_00 + 1;\n      iVar4 = iVar2 + 1;\n      iVar5 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar3,string);\n    if (string_00[iVar5] != '*') {\n      string_00[iVar4] = '*';\n      (string_00 + iVar4)[1] = '\0';\n    }\n    iVar5 = history_search_internal(string_00,direction,flags | 2);\n    if (string != string_00) {\n      (*(code *)PTR_free_001464fc)(string_00);\n    }\n  }" { (labeled_statement "LAB_0010f7d4:\n    string_00 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);" statement_identifier : (expression_statement "string_00 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);" (assignment_expression "string_00 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3)" identifier = (cast_expression "(char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3)" (parenthesized_expression "(*(code *)PTR_xmalloc_001445b0)" ( (pointer_expression "*(code *)PTR_xmalloc_001445b0" * (cast_expression "(code *)PTR_xmalloc_001445b0" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2 + 3)" ( (binary_expression "iVar2 + 3" identifier + number_literal) ))))) ;)) (expression_statement "pcVar3 = string_00;" (assignment_expression "pcVar3 = string_00" identifier = identifier) ;) (expression_statement "iVar4 = iVar2;" (assignment_expression "iVar4 = iVar2" identifier = identifier) ;) (if_statement "if (((flags & 1U) == 0) && (*string != '*')) {\n      *string_00 = '*';\n      pcVar3 = string_00 + 1;\n      iVar4 = iVar2 + 1;\n      iVar5 = iVar2;\n    }" if (parenthesized_expression "(((flags & 1U) == 0) && (*string != '*'))" ( (binary_expression "((flags & 1U) == 0) && (*string != '*')" (parenthesized_expression "((flags & 1U) == 0)" ( (binary_expression "(flags & 1U) == 0" (parenthesized_expression "(flags & 1U)" ( (binary_expression "flags & 1U" identifier & number_literal) )) == number_literal) )) && (parenthesized_expression "(*string != '*')" ( (binary_expression "*string != '*'" (pointer_expression "*string" * identifier) != (char_literal "'*'" ' character ')) ))) )) (compound_statement "{\n      *string_00 = '*';\n      pcVar3 = string_00 + 1;\n      iVar4 = iVar2 + 1;\n      iVar5 = iVar2;\n    }" { (expression_statement "*string_00 = '*';" (assignment_expression "*string_00 = '*'" (pointer_expression "*string_00" * identifier) = (char_literal "'*'" ' character ')) ;) (expression_statement "pcVar3 = string_00 + 1;" (assignment_expression "pcVar3 = string_00 + 1" identifier = (binary_expression "string_00 + 1" identifier + number_literal)) ;) (expression_statement "iVar4 = iVar2 + 1;" (assignment_expression "iVar4 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (expression_statement "iVar5 = iVar2;" (assignment_expression "iVar5 = iVar2" identifier = identifier) ;) })) (expression_statement "(*(code *)PTR_strcpy_00146418)(pcVar3,string);" (call_expression "(*(code *)PTR_strcpy_00146418)(pcVar3,string)" (parenthesized_expression "(*(code *)PTR_strcpy_00146418)" ( (pointer_expression "*(code *)PTR_strcpy_00146418" * (cast_expression "(code *)PTR_strcpy_00146418" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar3,string)" ( identifier , identifier ))) ;) (if_statement "if (string_00[iVar5] != '*') {\n      string_00[iVar4] = '*';\n      (string_00 + iVar4)[1] = '\0';\n    }" if (parenthesized_expression "(string_00[iVar5] != '*')" ( (binary_expression "string_00[iVar5] != '*'" (subscript_expression "string_00[iVar5]" identifier [ identifier ]) != (char_literal "'*'" ' character ')) )) (compound_statement "{\n      string_00[iVar4] = '*';\n      (string_00 + iVar4)[1] = '\0';\n    }" { (expression_statement "string_00[iVar4] = '*';" (assignment_expression "string_00[iVar4] = '*'" (subscript_expression "string_00[iVar4]" identifier [ identifier ]) = (char_literal "'*'" ' character ')) ;) (expression_statement "(string_00 + iVar4)[1] = '\0';" (assignment_expression "(string_00 + iVar4)[1] = '\0'" (subscript_expression "(string_00 + iVar4)[1]" (parenthesized_expression "(string_00 + iVar4)" ( (binary_expression "string_00 + iVar4" identifier + identifier) )) [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) })) (expression_statement "iVar5 = history_search_internal(string_00,direction,flags | 2);" (assignment_expression "iVar5 = history_search_internal(string_00,direction,flags | 2)" identifier = (call_expression "history_search_internal(string_00,direction,flags | 2)" identifier (argument_list "(string_00,direction,flags | 2)" ( identifier , identifier , (binary_expression "flags | 2" identifier | number_literal) )))) ;) (if_statement "if (string != string_00) {\n      (*(code *)PTR_free_001464fc)(string_00);\n    }" if (parenthesized_expression "(string != string_00)" ( (binary_expression "string != string_00" identifier != identifier) )) (compound_statement "{\n      (*(code *)PTR_free_001464fc)(string_00);\n    }" { (expression_statement "(*(code *)PTR_free_001464fc)(string_00);" (call_expression "(*(code *)PTR_free_001464fc)(string_00)" (parenthesized_expression "(*(code *)PTR_free_001464fc)" ( (pointer_expression "*(code *)PTR_free_001464fc" * (cast_expression "(code *)PTR_free_001464fc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(string_00)" ( identifier ))) ;) })) }))) (return_statement "return iVar5;" return identifier ;) })))
(translation_unit "undefined4 _hs_history_patsearch(char *param_1,undefined4 param_2,uint param_3)\n\n{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  undefined4 uVar4;\n  char *pcVar5;\n  int iVar6;\n  int iVar7;\n  \n  iVar2 = (*(code *)PTR_strlen_00146390)();\n  iVar7 = iVar2 + -1;\n  if (param_1[iVar7] == '\\') {\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }\n  else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }\n  return uVar4;\n}\n\n" (function_definition "undefined4 _hs_history_patsearch(char *param_1,undefined4 param_2,uint param_3)\n\n{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  undefined4 uVar4;\n  char *pcVar5;\n  int iVar6;\n  int iVar7;\n  \n  iVar2 = (*(code *)PTR_strlen_00146390)();\n  iVar7 = iVar2 + -1;\n  if (param_1[iVar7] == '\\') {\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }\n  else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }\n  return uVar4;\n}" type_identifier (function_declarator "_hs_history_patsearch(char *param_1,undefined4 param_2,uint param_3)" identifier (parameter_list "(char *param_1,undefined4 param_2,uint param_3)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  undefined4 uVar4;\n  char *pcVar5;\n  int iVar6;\n  int iVar7;\n  \n  iVar2 = (*(code *)PTR_strlen_00146390)();\n  iVar7 = iVar2 + -1;\n  if (param_1[iVar7] == '\\') {\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }\n  else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }\n  return uVar4;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (expression_statement "iVar2 = (*(code *)PTR_strlen_00146390)();" (assignment_expression "iVar2 = (*(code *)PTR_strlen_00146390)()" identifier = (call_expression "(*(code *)PTR_strlen_00146390)()" (parenthesized_expression "(*(code *)PTR_strlen_00146390)" ( (pointer_expression "*(code *)PTR_strlen_00146390" * (cast_expression "(code *)PTR_strlen_00146390" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (expression_statement "iVar7 = iVar2 + -1;" (assignment_expression "iVar7 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if (param_1[iVar7] == '\\') {\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }\n  else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }" if (parenthesized_expression "(param_1[iVar7] == '\\')" ( (binary_expression "param_1[iVar7] == '\\'" (subscript_expression "param_1[iVar7]" identifier [ identifier ]) == (char_literal "'\\'" ' escape_sequence ')) )) (compound_statement "{\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }" { (if_statement "if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }" if (parenthesized_expression "((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\'))" ( (binary_expression "(0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')" (parenthesized_expression "(0 < iVar7)" ( (binary_expression "0 < iVar7" number_literal < identifier) )) && (parenthesized_expression "(iVar6 = 1, param_1[iVar2 + -2] == '\\')" ( (comma_expression "iVar6 = 1, param_1[iVar2 + -2] == '\\'" (assignment_expression "iVar6 = 1" identifier = number_literal) , (binary_expression "param_1[iVar2 + -2] == '\\'" (subscript_expression "param_1[iVar2 + -2]" identifier [ (binary_expression "iVar2 + -2" identifier + number_literal) ]) == (char_literal "'\\'" ' escape_sequence '))) ))) )) (compound_statement "{\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }" { (expression_statement "pcVar5 = param_1 + iVar2 + -3;" (assignment_expression "pcVar5 = param_1 + iVar2 + -3" identifier = (binary_expression "param_1 + iVar2 + -3" (binary_expression "param_1 + iVar2" identifier + identifier) + number_literal)) ;) (do_statement "do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');" do (compound_statement "{\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      }" { (expression_statement "iVar6 = 1 - iVar6;" (assignment_expression "iVar6 = 1 - iVar6" identifier = (binary_expression "1 - iVar6" number_literal - identifier)) ;) (if_statement "if (param_1 + -1 == pcVar5) break;" if (parenthesized_expression "(param_1 + -1 == pcVar5)" ( (binary_expression "param_1 + -1 == pcVar5" (binary_expression "param_1 + -1" identifier + number_literal) == identifier) )) (break_statement "break;" break ;)) (expression_statement "cVar1 = *pcVar5;" (assignment_expression "cVar1 = *pcVar5" identifier = (pointer_expression "*pcVar5" * identifier)) ;) (expression_statement "pcVar5 = pcVar5 + -1;" (assignment_expression "pcVar5 = pcVar5 + -1" identifier = (binary_expression "pcVar5 + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(cVar1 == '\\')" ( (binary_expression "cVar1 == '\\'" identifier == (char_literal "'\\'" ' escape_sequence ')) )) ;) (if_statement "if (iVar6 == 0) goto LAB_0010f7d4;" if (parenthesized_expression "(iVar6 == 0)" ( (binary_expression "iVar6 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0010f7d4;" goto statement_identifier ;)) })) (expression_statement "uVar4 = 0xffffffff;" (assignment_expression "uVar4 = 0xffffffff" identifier = number_literal) ;) }) (else_clause "else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }" else (compound_statement "{\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }" { (labeled_statement "LAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);" statement_identifier : (expression_statement "pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);" (assignment_expression "pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3)" identifier = (cast_expression "(char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3)" (parenthesized_expression "(*(code *)PTR_xmalloc_001445b0)" ( (pointer_expression "*(code *)PTR_xmalloc_001445b0" * (cast_expression "(code *)PTR_xmalloc_001445b0" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2 + 3)" ( (binary_expression "iVar2 + 3" identifier + number_literal) ))))) ;)) (expression_statement "pcVar5 = pcVar3;" (assignment_expression "pcVar5 = pcVar3" identifier = identifier) ;) (expression_statement "iVar6 = iVar2;" (assignment_expression "iVar6 = iVar2" identifier = identifier) ;) (if_statement "if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }" if (parenthesized_expression "(((param_3 & 1) == 0) && (*param_1 != '*'))" ( (binary_expression "((param_3 & 1) == 0) && (*param_1 != '*')" (parenthesized_expression "((param_3 & 1) == 0)" ( (binary_expression "(param_3 & 1) == 0" (parenthesized_expression "(param_3 & 1)" ( (binary_expression "param_3 & 1" identifier & number_literal) )) == number_literal) )) && (parenthesized_expression "(*param_1 != '*')" ( (binary_expression "*param_1 != '*'" (pointer_expression "*param_1" * identifier) != (char_literal "'*'" ' character ')) ))) )) (compound_statement "{\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }" { (expression_statement "*pcVar3 = '*';" (assignment_expression "*pcVar3 = '*'" (pointer_expression "*pcVar3" * identifier) = (char_literal "'*'" ' character ')) ;) (expression_statement "pcVar5 = pcVar3 + 1;" (assignment_expression "pcVar5 = pcVar3 + 1" identifier = (binary_expression "pcVar3 + 1" identifier + number_literal)) ;) (expression_statement "iVar6 = iVar2 + 1;" (assignment_expression "iVar6 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (expression_statement "iVar7 = iVar2;" (assignment_expression "iVar7 = iVar2" identifier = identifier) ;) })) (expression_statement "(*(code *)PTR_strcpy_00146418)(pcVar5,param_1);" (call_expression "(*(code *)PTR_strcpy_00146418)(pcVar5,param_1)" (parenthesized_expression "(*(code *)PTR_strcpy_00146418)" ( (pointer_expression "*(code *)PTR_strcpy_00146418" * (cast_expression "(code *)PTR_strcpy_00146418" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar5,param_1)" ( identifier , identifier ))) ;) (if_statement "if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }" if (parenthesized_expression "(pcVar3[iVar7] != '*')" ( (binary_expression "pcVar3[iVar7] != '*'" (subscript_expression "pcVar3[iVar7]" identifier [ identifier ]) != (char_literal "'*'" ' character ')) )) (compound_statement "{\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }" { (expression_statement "pcVar3[iVar6] = '*';" (assignment_expression "pcVar3[iVar6] = '*'" (subscript_expression "pcVar3[iVar6]" identifier [ identifier ]) = (char_literal "'*'" ' character ')) ;) (expression_statement "(pcVar3 + iVar6)[1] = '\0';" (assignment_expression "(pcVar3 + iVar6)[1] = '\0'" (subscript_expression "(pcVar3 + iVar6)[1]" (parenthesized_expression "(pcVar3 + iVar6)" ( (binary_expression "pcVar3 + iVar6" identifier + identifier) )) [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) })) (expression_statement "uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);" (assignment_expression "uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2)" identifier = (call_expression "FUN_0010f460(pcVar3,param_2,param_3 | 2)" identifier (argument_list "(pcVar3,param_2,param_3 | 2)" ( identifier , identifier , (binary_expression "param_3 | 2" identifier | number_literal) )))) ;) (if_statement "if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }" if (parenthesized_expression "(param_1 != pcVar3)" ( (binary_expression "param_1 != pcVar3" identifier != identifier) )) (compound_statement "{\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }" { (expression_statement "(*(code *)PTR_free_001464fc)(pcVar3);" (call_expression "(*(code *)PTR_free_001464fc)(pcVar3)" (parenthesized_expression "(*(code *)PTR_free_001464fc)" ( (pointer_expression "*(code *)PTR_free_001464fc" * (cast_expression "(code *)PTR_free_001464fc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar3)" ( identifier ))) ;) })) }))) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (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 ( )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ IDENT ]) == (char_literal ' escape_sequence ')) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = LIT) , (binary_expression (subscript_expression IDENT [ (binary_expression IDENT + LIT) ]) == (char_literal ' escape_sequence '))) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + IDENT) + LIT)) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression LIT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) == IDENT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) })) (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (labeled_statement statement_identifier : (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 ( (binary_expression IDENT + LIT) ))))) ;)) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) && (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != (char_literal ' character ')) ))) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (char_literal ' character ')) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ IDENT ]) != (char_literal ' character ')) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (char_literal ' character ')) ;) (expression_statement (assignment_expression (subscript_expression (parenthesized_expression ( (binary_expression IDENT + IDENT) )) [ LIT ]) = (char_literal ' escape_sequence ')) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , (binary_expression IDENT | LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != IDENT) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) })) }))) (return_statement return IDENT ;) })))
(function_definition "undefined4 _hs_history_patsearch(char *param_1,undefined4 param_2,uint param_3)\n\n{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  undefined4 uVar4;\n  char *pcVar5;\n  int iVar6;\n  int iVar7;\n  \n  iVar2 = (*(code *)PTR_strlen_00146390)();\n  iVar7 = iVar2 + -1;\n  if (param_1[iVar7] == '\\') {\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }\n  else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }\n  return uVar4;\n}" (type_identifier "undefined4") (function_declarator "_hs_history_patsearch(char *param_1,undefined4 param_2,uint param_3)" (identifier "_hs_history_patsearch") (parameter_list "(char *param_1,undefined4 param_2,uint param_3)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")"))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  undefined4 uVar4;\n  char *pcVar5;\n  int iVar6;\n  int iVar7;\n  \n  iVar2 = (*(code *)PTR_strlen_00146390)();\n  iVar7 = iVar2 + -1;\n  if (param_1[iVar7] == '\\') {\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }\n  else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }\n  return uVar4;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "char *pcVar3;" (primitive_type "char") (pointer_declarator "*pcVar3" (* "*") (identifier "pcVar3")) (; ";")) (declaration "undefined4 uVar4;" (type_identifier "undefined4") (identifier "uVar4") (; ";")) (declaration "char *pcVar5;" (primitive_type "char") (pointer_declarator "*pcVar5" (* "*") (identifier "pcVar5")) (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (declaration "int iVar7;" (primitive_type "int") (identifier "iVar7") (; ";")) (expression_statement "iVar2 = (*(code *)PTR_strlen_00146390)();" (assignment_expression "iVar2 = (*(code *)PTR_strlen_00146390)()" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_strlen_00146390)()" (parenthesized_expression "(*(code *)PTR_strlen_00146390)" (( "(") (pointer_expression "*(code *)PTR_strlen_00146390" (* "*") (cast_expression "(code *)PTR_strlen_00146390" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_strlen_00146390"))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar7 = iVar2 + -1;" (assignment_expression "iVar7 = iVar2 + -1" (identifier "iVar7") (= "=") (binary_expression "iVar2 + -1" (identifier "iVar2") (+ "+") (number_literal "-1"))) (; ";")) (if_statement "if (param_1[iVar7] == '\\') {\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }\n  else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }" (if "if") (parenthesized_expression "(param_1[iVar7] == '\\')" (( "(") (binary_expression "param_1[iVar7] == '\\'" (subscript_expression "param_1[iVar7]" (identifier "param_1") ([ "[") (identifier "iVar7") (] "]")) (== "==") (char_literal "'\\'" (' "'") (escape_sequence "\\") (' "'"))) () ")")) (compound_statement "{\n    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }\n    uVar4 = 0xffffffff;\n  }" ({ "{") (if_statement "if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }" (if "if") (parenthesized_expression "((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\'))" (( "(") (binary_expression "(0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')" (parenthesized_expression "(0 < iVar7)" (( "(") (binary_expression "0 < iVar7" (number_literal "0") (< "<") (identifier "iVar7")) () ")")) (&& "&&") (parenthesized_expression "(iVar6 = 1, param_1[iVar2 + -2] == '\\')" (( "(") (comma_expression "iVar6 = 1, param_1[iVar2 + -2] == '\\'" (assignment_expression "iVar6 = 1" (identifier "iVar6") (= "=") (number_literal "1")) (, ",") (binary_expression "param_1[iVar2 + -2] == '\\'" (subscript_expression "param_1[iVar2 + -2]" (identifier "param_1") ([ "[") (binary_expression "iVar2 + -2" (identifier "iVar2") (+ "+") (number_literal "-2")) (] "]")) (== "==") (char_literal "'\\'" (' "'") (escape_sequence "\\") (' "'")))) () ")"))) () ")")) (compound_statement "{\n      pcVar5 = param_1 + iVar2 + -3;\n      do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');\n      if (iVar6 == 0) goto LAB_0010f7d4;\n    }" ({ "{") (expression_statement "pcVar5 = param_1 + iVar2 + -3;" (assignment_expression "pcVar5 = param_1 + iVar2 + -3" (identifier "pcVar5") (= "=") (binary_expression "param_1 + iVar2 + -3" (binary_expression "param_1 + iVar2" (identifier "param_1") (+ "+") (identifier "iVar2")) (+ "+") (number_literal "-3"))) (; ";")) (do_statement "do {\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      } while (cVar1 == '\\');" (do "do") (compound_statement "{\n        iVar6 = 1 - iVar6;\n        if (param_1 + -1 == pcVar5) break;\n        cVar1 = *pcVar5;\n        pcVar5 = pcVar5 + -1;\n      }" ({ "{") (expression_statement "iVar6 = 1 - iVar6;" (assignment_expression "iVar6 = 1 - iVar6" (identifier "iVar6") (= "=") (binary_expression "1 - iVar6" (number_literal "1") (- "-") (identifier "iVar6"))) (; ";")) (if_statement "if (param_1 + -1 == pcVar5) break;" (if "if") (parenthesized_expression "(param_1 + -1 == pcVar5)" (( "(") (binary_expression "param_1 + -1 == pcVar5" (binary_expression "param_1 + -1" (identifier "param_1") (+ "+") (number_literal "-1")) (== "==") (identifier "pcVar5")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "cVar1 = *pcVar5;" (assignment_expression "cVar1 = *pcVar5" (identifier "cVar1") (= "=") (pointer_expression "*pcVar5" (* "*") (identifier "pcVar5"))) (; ";")) (expression_statement "pcVar5 = pcVar5 + -1;" (assignment_expression "pcVar5 = pcVar5 + -1" (identifier "pcVar5") (= "=") (binary_expression "pcVar5 + -1" (identifier "pcVar5") (+ "+") (number_literal "-1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(cVar1 == '\\')" (( "(") (binary_expression "cVar1 == '\\'" (identifier "cVar1") (== "==") (char_literal "'\\'" (' "'") (escape_sequence "\\") (' "'"))) () ")")) (; ";")) (if_statement "if (iVar6 == 0) goto LAB_0010f7d4;" (if "if") (parenthesized_expression "(iVar6 == 0)" (( "(") (binary_expression "iVar6 == 0" (identifier "iVar6") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_0010f7d4;" (goto "goto") (statement_identifier "LAB_0010f7d4") (; ";"))) (} "}"))) (expression_statement "uVar4 = 0xffffffff;" (assignment_expression "uVar4 = 0xffffffff" (identifier "uVar4") (= "=") (number_literal "0xffffffff")) (; ";")) (} "}")) (else_clause "else {\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }" (else "else") (compound_statement "{\nLAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);\n    pcVar5 = pcVar3;\n    iVar6 = iVar2;\n    if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }\n    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);\n    if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }\n    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);\n    if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }\n  }" ({ "{") (labeled_statement "LAB_0010f7d4:\n    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);" (statement_identifier "LAB_0010f7d4") (: ":") (expression_statement "pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);" (assignment_expression "pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3)" (identifier "pcVar3") (= "=") (cast_expression "(char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3)" (parenthesized_expression "(*(code *)PTR_xmalloc_001445b0)" (( "(") (pointer_expression "*(code *)PTR_xmalloc_001445b0" (* "*") (cast_expression "(code *)PTR_xmalloc_001445b0" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_xmalloc_001445b0"))) () ")")) (argument_list "(iVar2 + 3)" (( "(") (binary_expression "iVar2 + 3" (identifier "iVar2") (+ "+") (number_literal "3")) () ")"))))) (; ";"))) (expression_statement "pcVar5 = pcVar3;" (assignment_expression "pcVar5 = pcVar3" (identifier "pcVar5") (= "=") (identifier "pcVar3")) (; ";")) (expression_statement "iVar6 = iVar2;" (assignment_expression "iVar6 = iVar2" (identifier "iVar6") (= "=") (identifier "iVar2")) (; ";")) (if_statement "if (((param_3 & 1) == 0) && (*param_1 != '*')) {\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }" (if "if") (parenthesized_expression "(((param_3 & 1) == 0) && (*param_1 != '*'))" (( "(") (binary_expression "((param_3 & 1) == 0) && (*param_1 != '*')" (parenthesized_expression "((param_3 & 1) == 0)" (( "(") (binary_expression "(param_3 & 1) == 0" (parenthesized_expression "(param_3 & 1)" (( "(") (binary_expression "param_3 & 1" (identifier "param_3") (& "&") (number_literal "1")) () ")")) (== "==") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(*param_1 != '*')" (( "(") (binary_expression "*param_1 != '*'" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (!= "!=") (char_literal "'*'" (' "'") (character "*") (' "'"))) () ")"))) () ")")) (compound_statement "{\n      *pcVar3 = '*';\n      pcVar5 = pcVar3 + 1;\n      iVar6 = iVar2 + 1;\n      iVar7 = iVar2;\n    }" ({ "{") (expression_statement "*pcVar3 = '*';" (assignment_expression "*pcVar3 = '*'" (pointer_expression "*pcVar3" (* "*") (identifier "pcVar3")) (= "=") (char_literal "'*'" (' "'") (character "*") (' "'"))) (; ";")) (expression_statement "pcVar5 = pcVar3 + 1;" (assignment_expression "pcVar5 = pcVar3 + 1" (identifier "pcVar5") (= "=") (binary_expression "pcVar3 + 1" (identifier "pcVar3") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "iVar6 = iVar2 + 1;" (assignment_expression "iVar6 = iVar2 + 1" (identifier "iVar6") (= "=") (binary_expression "iVar2 + 1" (identifier "iVar2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "iVar7 = iVar2;" (assignment_expression "iVar7 = iVar2" (identifier "iVar7") (= "=") (identifier "iVar2")) (; ";")) (} "}"))) (expression_statement "(*(code *)PTR_strcpy_00146418)(pcVar5,param_1);" (call_expression "(*(code *)PTR_strcpy_00146418)(pcVar5,param_1)" (parenthesized_expression "(*(code *)PTR_strcpy_00146418)" (( "(") (pointer_expression "*(code *)PTR_strcpy_00146418" (* "*") (cast_expression "(code *)PTR_strcpy_00146418" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_strcpy_00146418"))) () ")")) (argument_list "(pcVar5,param_1)" (( "(") (identifier "pcVar5") (, ",") (identifier "param_1") () ")"))) (; ";")) (if_statement "if (pcVar3[iVar7] != '*') {\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }" (if "if") (parenthesized_expression "(pcVar3[iVar7] != '*')" (( "(") (binary_expression "pcVar3[iVar7] != '*'" (subscript_expression "pcVar3[iVar7]" (identifier "pcVar3") ([ "[") (identifier "iVar7") (] "]")) (!= "!=") (char_literal "'*'" (' "'") (character "*") (' "'"))) () ")")) (compound_statement "{\n      pcVar3[iVar6] = '*';\n      (pcVar3 + iVar6)[1] = '\0';\n    }" ({ "{") (expression_statement "pcVar3[iVar6] = '*';" (assignment_expression "pcVar3[iVar6] = '*'" (subscript_expression "pcVar3[iVar6]" (identifier "pcVar3") ([ "[") (identifier "iVar6") (] "]")) (= "=") (char_literal "'*'" (' "'") (character "*") (' "'"))) (; ";")) (expression_statement "(pcVar3 + iVar6)[1] = '\0';" (assignment_expression "(pcVar3 + iVar6)[1] = '\0'" (subscript_expression "(pcVar3 + iVar6)[1]" (parenthesized_expression "(pcVar3 + iVar6)" (( "(") (binary_expression "pcVar3 + iVar6" (identifier "pcVar3") (+ "+") (identifier "iVar6")) () ")")) ([ "[") (number_literal "1") (] "]")) (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (} "}"))) (expression_statement "uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);" (assignment_expression "uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2)" (identifier "uVar4") (= "=") (call_expression "FUN_0010f460(pcVar3,param_2,param_3 | 2)" (identifier "FUN_0010f460") (argument_list "(pcVar3,param_2,param_3 | 2)" (( "(") (identifier "pcVar3") (, ",") (identifier "param_2") (, ",") (binary_expression "param_3 | 2" (identifier "param_3") (| "|") (number_literal "2")) () ")")))) (; ";")) (if_statement "if (param_1 != pcVar3) {\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }" (if "if") (parenthesized_expression "(param_1 != pcVar3)" (( "(") (binary_expression "param_1 != pcVar3" (identifier "param_1") (!= "!=") (identifier "pcVar3")) () ")")) (compound_statement "{\n      (*(code *)PTR_free_001464fc)(pcVar3);\n    }" ({ "{") (expression_statement "(*(code *)PTR_free_001464fc)(pcVar3);" (call_expression "(*(code *)PTR_free_001464fc)(pcVar3)" (parenthesized_expression "(*(code *)PTR_free_001464fc)" (( "(") (pointer_expression "*(code *)PTR_free_001464fc" (* "*") (cast_expression "(code *)PTR_free_001464fc" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_free_001464fc"))) () ")")) (argument_list "(pcVar3)" (( "(") (identifier "pcVar3") () ")"))) (; ";")) (} "}"))) (} "}")))) (return_statement "return uVar4;" (return "return") (identifier "uVar4") (; ";")) (} "}")))
(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (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)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (char_literal (escape_sequence)))) consequence: (compound_statement (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: (number_literal)) right: (binary_expression left: (subscript_expression argument: (identifier) index: (binary_expression left: (identifier) right: (number_literal))) right: (char_literal (escape_sequence))))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (number_literal)))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (number_literal) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier))) consequence: (break_statement)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (labeled_statement label: (statement_identifier) (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 (binary_expression left: (identifier) right: (number_literal)))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (char_literal (character)))))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (char_literal (character)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (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) (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (char_literal (character)))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (char_literal (character)))) (expression_statement (assignment_expression left: (subscript_expression argument: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) index: (number_literal)) right: (char_literal (escape_sequence)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) 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))))))))) (return_statement (identifier)))))

undefined4 MASKED(char *param_1,undefined4 param_2,uint param_3)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  undefined4 uVar4;
  char *pcVar5;
  int iVar6;
  int iVar7;
  
  iVar2 = (*(code *)PTR_strlen_00146390)();
  iVar7 = iVar2 + -1;
  if (param_1[iVar7] == '\\') {
    if ((0 < iVar7) && (iVar6 = 1, param_1[iVar2 + -2] == '\\')) {
      pcVar5 = param_1 + iVar2 + -3;
      do {
        iVar6 = 1 - iVar6;
        if (param_1 + -1 == pcVar5) break;
        cVar1 = *pcVar5;
        pcVar5 = pcVar5 + -1;
      } while (cVar1 == '\\');
      if (iVar6 == 0) goto LAB_0010f7d4;
    }
    uVar4 = 0xffffffff;
  }
  else {
LAB_0010f7d4:
    pcVar3 = (char *)(*(code *)PTR_xmalloc_001445b0)(iVar2 + 3);
    pcVar5 = pcVar3;
    iVar6 = iVar2;
    if (((param_3 & 1) == 0) && (*param_1 != '*')) {
      *pcVar3 = '*';
      pcVar5 = pcVar3 + 1;
      iVar6 = iVar2 + 1;
      iVar7 = iVar2;
    }
    (*(code *)PTR_strcpy_00146418)(pcVar5,param_1);
    if (pcVar3[iVar7] != '*') {
      pcVar3[iVar6] = '*';
      (pcVar3 + iVar6)[1] = '\0';
    }
    uVar4 = FUN_0010f460(pcVar3,param_2,param_3 | 2);
    if (param_1 != pcVar3) {
      (*(code *)PTR_free_001464fc)(pcVar3);
    }
  }
  return uVar4;
}

