
int parse_regex_delim(char *cmdstr,char **match,char **replace)

{
  int iVar1;
  char *cmdstr_ptr;
  char *pcVar2;
  char *str;
  uint delimiter;
  
  delimiter = (uint)(byte)*cmdstr;
  if (delimiter == 0) {
    cmdstr = PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0x2fc4;
    (*(code *)PTR_bb_error_msg_and_die_0012a1e4)();
  }
  pcVar2 = cmdstr + 1;
  iVar1 = index_of_next_unescaped_regexp_delim(delimiter,pcVar2);
  str = pcVar2 + iVar1 + 1;
  pcVar2 = copy_parsing_escapes(pcVar2,iVar1);
  *match = pcVar2;
  iVar1 = index_of_next_unescaped_regexp_delim(-delimiter,str);
  pcVar2 = copy_parsing_escapes(str,iVar1);
  *replace = pcVar2;
  return (int)(str + (iVar1 - (int)cmdstr));
}



byte * FUN_000d5b38(byte *param_1,undefined4 *param_2,undefined4 *param_3)

{
  int iVar1;
  undefined4 uVar2;
  byte *pbVar3;
  byte *pbVar4;
  uint uVar5;
  
  uVar5 = (uint)*param_1;
  if (uVar5 == 0) {
    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;
    (*(code *)PTR_FUN_0012a1e4)(param_1);
  }
  pbVar3 = param_1 + 1;
  iVar1 = FUN_000d55f0(uVar5,pbVar3);
  pbVar4 = pbVar3 + iVar1 + 1;
  uVar2 = FUN_000d5880(pbVar3,iVar1);
  *param_2 = uVar2;
  iVar1 = FUN_000d55f0(-uVar5,pbVar4);
  uVar2 = FUN_000d5880(pbVar4,iVar1);
  *param_3 = uVar2;
  return pbVar4 + (iVar1 - (int)param_1);
}


lui gp,0x6
addiu gp,gp,-0x39e8
addu gp,gp,t9
addiu sp,sp,-0x40
sw gp,0x10(sp)
sw ra,0x3c(sp)
sw s7,0x38(sp)
sw s6,0x34(sp)
sw s5,0x30(sp)
sw s4,0x2c(sp)
sw s3,0x28(sp)
sw s2,0x24(sp)
sw s1,0x20(sp)
sw s0,0x1c(sp)
lbu s5,0x0(a0)
bne s5,zero,0x000d5b88
_lw t9,-0x7f6c(gp)
lw a0,-0x7fa8(gp)
jalr t9
_addiu a0,a0,-0x2fc4
lw s2,-0x759c(gp)
addiu s0,a0,0x1
or s4,a0,zero
or s7,a1,zero
addiu s2,s2,0x55f0
or a0,s5,zero
or a1,s0,zero
or t9,s2,zero
bal 0x000d55f0
_or s6,a2,zero
lw gp,0x10(sp)
or s3,v0,zero
addiu s3,s3,0x1
or a0,s0,zero
or a1,v0,zero
lw s1,-0x759c(gp)
addiu s1,s1,0x5880
or t9,s1,zero
bal 0x000d5880
_addu s0,s0,s3
subu a0,zero,s5
or a1,s0,zero
or t9,s2,zero
bal 0x000d55f0
_sw v0,0x0(s7)
or a0,s0,zero
or t9,s1,zero
or a1,v0,zero
bal 0x000d5880
_or s2,v0,zero
lw ra,0x3c(sp)
subu s0,s0,s4
lw s7,0x38(sp)
lw s5,0x30(sp)
lw s4,0x2c(sp)
lw s3,0x28(sp)
lw s1,0x20(sp)
sw v0,0x0(s6)
addu v0,s0,s2
lw s6,0x34(sp)
lw s2,0x24(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x40
(translation_unit "byte * FUN_000d5b38(byte *param_1,undefined4 *param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  byte *pbVar3;\n  byte *pbVar4;\n  uint uVar5;\n  \n  uVar5 = (uint)*param_1;\n  if (uVar5 == 0) {\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }\n  pbVar3 = param_1 + 1;\n  iVar1 = FUN_000d55f0(uVar5,pbVar3);\n  pbVar4 = pbVar3 + iVar1 + 1;\n  uVar2 = FUN_000d5880(pbVar3,iVar1);\n  *param_2 = uVar2;\n  iVar1 = FUN_000d55f0(-uVar5,pbVar4);\n  uVar2 = FUN_000d5880(pbVar4,iVar1);\n  *param_3 = uVar2;\n  return pbVar4 + (iVar1 - (int)param_1);\n}\n\n" (function_definition "byte * FUN_000d5b38(byte *param_1,undefined4 *param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  byte *pbVar3;\n  byte *pbVar4;\n  uint uVar5;\n  \n  uVar5 = (uint)*param_1;\n  if (uVar5 == 0) {\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }\n  pbVar3 = param_1 + 1;\n  iVar1 = FUN_000d55f0(uVar5,pbVar3);\n  pbVar4 = pbVar3 + iVar1 + 1;\n  uVar2 = FUN_000d5880(pbVar3,iVar1);\n  *param_2 = uVar2;\n  iVar1 = FUN_000d55f0(-uVar5,pbVar4);\n  uVar2 = FUN_000d5880(pbVar4,iVar1);\n  *param_3 = uVar2;\n  return pbVar4 + (iVar1 - (int)param_1);\n}" type_identifier (pointer_declarator "* FUN_000d5b38(byte *param_1,undefined4 *param_2,undefined4 *param_3)" * (function_declarator "FUN_000d5b38(byte *param_1,undefined4 *param_2,undefined4 *param_3)" identifier (parameter_list "(byte *param_1,undefined4 *param_2,undefined4 *param_3)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  byte *pbVar3;\n  byte *pbVar4;\n  uint uVar5;\n  \n  uVar5 = (uint)*param_1;\n  if (uVar5 == 0) {\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }\n  pbVar3 = param_1 + 1;\n  iVar1 = FUN_000d55f0(uVar5,pbVar3);\n  pbVar4 = pbVar3 + iVar1 + 1;\n  uVar2 = FUN_000d5880(pbVar3,iVar1);\n  *param_2 = uVar2;\n  iVar1 = FUN_000d55f0(-uVar5,pbVar4);\n  uVar2 = FUN_000d5880(pbVar4,iVar1);\n  *param_3 = uVar2;\n  return pbVar4 + (iVar1 - (int)param_1);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "byte *pbVar3;" type_identifier (pointer_declarator "*pbVar3" * identifier) ;) (declaration "byte *pbVar4;" type_identifier (pointer_declarator "*pbVar4" * identifier) ;) (declaration "uint uVar5;" type_identifier identifier ;) (expression_statement "uVar5 = (uint)*param_1;" (assignment_expression "uVar5 = (uint)*param_1" identifier = (binary_expression "(uint)*param_1" (parenthesized_expression "(uint)" ( identifier )) * identifier)) ;) (if_statement "if (uVar5 == 0) {\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }" if (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) (compound_statement "{\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }" { (expression_statement "param_1 = PTR_FUN_0012a1a8 + -0x2fc4;" (assignment_expression "param_1 = PTR_FUN_0012a1a8 + -0x2fc4" identifier = (binary_expression "PTR_FUN_0012a1a8 + -0x2fc4" identifier + number_literal)) ;) (expression_statement "(*(code *)PTR_FUN_0012a1e4)(param_1);" (call_expression "(*(code *)PTR_FUN_0012a1e4)(param_1)" (parenthesized_expression "(*(code *)PTR_FUN_0012a1e4)" ( (pointer_expression "*(code *)PTR_FUN_0012a1e4" * (cast_expression "(code *)PTR_FUN_0012a1e4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1)" ( identifier ))) ;) })) (expression_statement "pbVar3 = param_1 + 1;" (assignment_expression "pbVar3 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (expression_statement "iVar1 = FUN_000d55f0(uVar5,pbVar3);" (assignment_expression "iVar1 = FUN_000d55f0(uVar5,pbVar3)" identifier = (call_expression "FUN_000d55f0(uVar5,pbVar3)" identifier (argument_list "(uVar5,pbVar3)" ( identifier , identifier )))) ;) (expression_statement "pbVar4 = pbVar3 + iVar1 + 1;" (assignment_expression "pbVar4 = pbVar3 + iVar1 + 1" identifier = (binary_expression "pbVar3 + iVar1 + 1" (binary_expression "pbVar3 + iVar1" identifier + identifier) + number_literal)) ;) (expression_statement "uVar2 = FUN_000d5880(pbVar3,iVar1);" (assignment_expression "uVar2 = FUN_000d5880(pbVar3,iVar1)" identifier = (call_expression "FUN_000d5880(pbVar3,iVar1)" identifier (argument_list "(pbVar3,iVar1)" ( identifier , identifier )))) ;) (expression_statement "*param_2 = uVar2;" (assignment_expression "*param_2 = uVar2" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "iVar1 = FUN_000d55f0(-uVar5,pbVar4);" (assignment_expression "iVar1 = FUN_000d55f0(-uVar5,pbVar4)" identifier = (call_expression "FUN_000d55f0(-uVar5,pbVar4)" identifier (argument_list "(-uVar5,pbVar4)" ( (unary_expression "-uVar5" - identifier) , identifier )))) ;) (expression_statement "uVar2 = FUN_000d5880(pbVar4,iVar1);" (assignment_expression "uVar2 = FUN_000d5880(pbVar4,iVar1)" identifier = (call_expression "FUN_000d5880(pbVar4,iVar1)" identifier (argument_list "(pbVar4,iVar1)" ( identifier , identifier )))) ;) (expression_statement "*param_3 = uVar2;" (assignment_expression "*param_3 = uVar2" (pointer_expression "*param_3" * identifier) = identifier) ;) (return_statement "return pbVar4 + (iVar1 - (int)param_1);" return (binary_expression "pbVar4 + (iVar1 - (int)param_1)" identifier + (parenthesized_expression "(iVar1 - (int)param_1)" ( (binary_expression "iVar1 - (int)param_1" identifier - (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ;) })))
(translation_unit "int parse_regex_delim(char *cmdstr,char **match,char **replace)\n\n{\n  int iVar1;\n  char *cmdstr_ptr;\n  char *pcVar2;\n  char *str;\n  uint delimiter;\n  \n  delimiter = (uint)(byte)*cmdstr;\n  if (delimiter == 0) {\n    cmdstr = PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_bb_error_msg_and_die_0012a1e4)();\n  }\n  pcVar2 = cmdstr + 1;\n  iVar1 = index_of_next_unescaped_regexp_delim(delimiter,pcVar2);\n  str = pcVar2 + iVar1 + 1;\n  pcVar2 = copy_parsing_escapes(pcVar2,iVar1);\n  *match = pcVar2;\n  iVar1 = index_of_next_unescaped_regexp_delim(-delimiter,str);\n  pcVar2 = copy_parsing_escapes(str,iVar1);\n  *replace = pcVar2;\n  return (int)(str + (iVar1 - (int)cmdstr));\n}\n\n" (function_definition "int parse_regex_delim(char *cmdstr,char **match,char **replace)\n\n{\n  int iVar1;\n  char *cmdstr_ptr;\n  char *pcVar2;\n  char *str;\n  uint delimiter;\n  \n  delimiter = (uint)(byte)*cmdstr;\n  if (delimiter == 0) {\n    cmdstr = PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_bb_error_msg_and_die_0012a1e4)();\n  }\n  pcVar2 = cmdstr + 1;\n  iVar1 = index_of_next_unescaped_regexp_delim(delimiter,pcVar2);\n  str = pcVar2 + iVar1 + 1;\n  pcVar2 = copy_parsing_escapes(pcVar2,iVar1);\n  *match = pcVar2;\n  iVar1 = index_of_next_unescaped_regexp_delim(-delimiter,str);\n  pcVar2 = copy_parsing_escapes(str,iVar1);\n  *replace = pcVar2;\n  return (int)(str + (iVar1 - (int)cmdstr));\n}" primitive_type (function_declarator "parse_regex_delim(char *cmdstr,char **match,char **replace)" identifier (parameter_list "(char *cmdstr,char **match,char **replace)" ( (parameter_declaration "char *cmdstr" primitive_type (pointer_declarator "*cmdstr" * identifier)) , (parameter_declaration "char **match" primitive_type (pointer_declarator "**match" * (pointer_declarator "*match" * identifier))) , (parameter_declaration "char **replace" primitive_type (pointer_declarator "**replace" * (pointer_declarator "*replace" * identifier))) ))) (compound_statement "{\n  int iVar1;\n  char *cmdstr_ptr;\n  char *pcVar2;\n  char *str;\n  uint delimiter;\n  \n  delimiter = (uint)(byte)*cmdstr;\n  if (delimiter == 0) {\n    cmdstr = PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_bb_error_msg_and_die_0012a1e4)();\n  }\n  pcVar2 = cmdstr + 1;\n  iVar1 = index_of_next_unescaped_regexp_delim(delimiter,pcVar2);\n  str = pcVar2 + iVar1 + 1;\n  pcVar2 = copy_parsing_escapes(pcVar2,iVar1);\n  *match = pcVar2;\n  iVar1 = index_of_next_unescaped_regexp_delim(-delimiter,str);\n  pcVar2 = copy_parsing_escapes(str,iVar1);\n  *replace = pcVar2;\n  return (int)(str + (iVar1 - (int)cmdstr));\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *cmdstr_ptr;" primitive_type (pointer_declarator "*cmdstr_ptr" * identifier) ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "char *str;" primitive_type (pointer_declarator "*str" * identifier) ;) (declaration "uint delimiter;" type_identifier identifier ;) (expression_statement "delimiter = (uint)(byte)*cmdstr;" (assignment_expression "delimiter = (uint)(byte)*cmdstr" identifier = (binary_expression "(uint)(byte)*cmdstr" (call_expression "(uint)(byte)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(byte)" ( identifier ))) * identifier)) ;) (if_statement "if (delimiter == 0) {\n    cmdstr = PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_bb_error_msg_and_die_0012a1e4)();\n  }" if (parenthesized_expression "(delimiter == 0)" ( (binary_expression "delimiter == 0" identifier == number_literal) )) (compound_statement "{\n    cmdstr = PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_bb_error_msg_and_die_0012a1e4)();\n  }" { (expression_statement "cmdstr = PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0x2fc4;" (binary_expression "cmdstr = PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0x2fc4" (assignment_expression "cmdstr = PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P" identifier = (binary_expression "PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P" (binary_expression "PTR_s_<_W_q_v1_HxLJ_" identifier < identifier) & identifier)) (ERROR ")9__f_l_0012a1a8" ) number_literal identifier) + number_literal) ;) (expression_statement "(*(code *)PTR_bb_error_msg_and_die_0012a1e4)();" (call_expression "(*(code *)PTR_bb_error_msg_and_die_0012a1e4)()" (parenthesized_expression "(*(code *)PTR_bb_error_msg_and_die_0012a1e4)" ( (pointer_expression "*(code *)PTR_bb_error_msg_and_die_0012a1e4" * (cast_expression "(code *)PTR_bb_error_msg_and_die_0012a1e4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) })) (expression_statement "pcVar2 = cmdstr + 1;" (assignment_expression "pcVar2 = cmdstr + 1" identifier = (binary_expression "cmdstr + 1" identifier + number_literal)) ;) (expression_statement "iVar1 = index_of_next_unescaped_regexp_delim(delimiter,pcVar2);" (assignment_expression "iVar1 = index_of_next_unescaped_regexp_delim(delimiter,pcVar2)" identifier = (call_expression "index_of_next_unescaped_regexp_delim(delimiter,pcVar2)" identifier (argument_list "(delimiter,pcVar2)" ( identifier , identifier )))) ;) (expression_statement "str = pcVar2 + iVar1 + 1;" (assignment_expression "str = pcVar2 + iVar1 + 1" identifier = (binary_expression "pcVar2 + iVar1 + 1" (binary_expression "pcVar2 + iVar1" identifier + identifier) + number_literal)) ;) (expression_statement "pcVar2 = copy_parsing_escapes(pcVar2,iVar1);" (assignment_expression "pcVar2 = copy_parsing_escapes(pcVar2,iVar1)" identifier = (call_expression "copy_parsing_escapes(pcVar2,iVar1)" identifier (argument_list "(pcVar2,iVar1)" ( identifier , identifier )))) ;) (expression_statement "*match = pcVar2;" (assignment_expression "*match = pcVar2" (pointer_expression "*match" * identifier) = identifier) ;) (expression_statement "iVar1 = index_of_next_unescaped_regexp_delim(-delimiter,str);" (assignment_expression "iVar1 = index_of_next_unescaped_regexp_delim(-delimiter,str)" identifier = (call_expression "index_of_next_unescaped_regexp_delim(-delimiter,str)" identifier (argument_list "(-delimiter,str)" ( (unary_expression "-delimiter" - identifier) , identifier )))) ;) (expression_statement "pcVar2 = copy_parsing_escapes(str,iVar1);" (assignment_expression "pcVar2 = copy_parsing_escapes(str,iVar1)" identifier = (call_expression "copy_parsing_escapes(str,iVar1)" identifier (argument_list "(str,iVar1)" ( identifier , identifier )))) ;) (expression_statement "*replace = pcVar2;" (assignment_expression "*replace = pcVar2" (pointer_expression "*replace" * identifier) = identifier) ;) (return_statement "return (int)(str + (iVar1 - (int)cmdstr));" return (cast_expression "(int)(str + (iVar1 - (int)cmdstr))" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(str + (iVar1 - (int)cmdstr))" ( (binary_expression "str + (iVar1 - (int)cmdstr)" identifier + (parenthesized_expression "(iVar1 - (int)cmdstr)" ( (binary_expression "iVar1 - (int)cmdstr" identifier - (cast_expression "(int)cmdstr" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ))) ;) })))
(translation_unit "byte * FUN_000d5b38(byte *param_1,undefined4 *param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  byte *pbVar3;\n  byte *pbVar4;\n  uint uVar5;\n  \n  uVar5 = (uint)*param_1;\n  if (uVar5 == 0) {\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }\n  pbVar3 = param_1 + 1;\n  iVar1 = FUN_000d55f0(uVar5,pbVar3);\n  pbVar4 = pbVar3 + iVar1 + 1;\n  uVar2 = FUN_000d5880(pbVar3,iVar1);\n  *param_2 = uVar2;\n  iVar1 = FUN_000d55f0(-uVar5,pbVar4);\n  uVar2 = FUN_000d5880(pbVar4,iVar1);\n  *param_3 = uVar2;\n  return pbVar4 + (iVar1 - (int)param_1);\n}\n\n" (function_definition "byte * FUN_000d5b38(byte *param_1,undefined4 *param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  byte *pbVar3;\n  byte *pbVar4;\n  uint uVar5;\n  \n  uVar5 = (uint)*param_1;\n  if (uVar5 == 0) {\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }\n  pbVar3 = param_1 + 1;\n  iVar1 = FUN_000d55f0(uVar5,pbVar3);\n  pbVar4 = pbVar3 + iVar1 + 1;\n  uVar2 = FUN_000d5880(pbVar3,iVar1);\n  *param_2 = uVar2;\n  iVar1 = FUN_000d55f0(-uVar5,pbVar4);\n  uVar2 = FUN_000d5880(pbVar4,iVar1);\n  *param_3 = uVar2;\n  return pbVar4 + (iVar1 - (int)param_1);\n}" type_identifier (pointer_declarator "* FUN_000d5b38(byte *param_1,undefined4 *param_2,undefined4 *param_3)" * (function_declarator "FUN_000d5b38(byte *param_1,undefined4 *param_2,undefined4 *param_3)" identifier (parameter_list "(byte *param_1,undefined4 *param_2,undefined4 *param_3)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  byte *pbVar3;\n  byte *pbVar4;\n  uint uVar5;\n  \n  uVar5 = (uint)*param_1;\n  if (uVar5 == 0) {\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }\n  pbVar3 = param_1 + 1;\n  iVar1 = FUN_000d55f0(uVar5,pbVar3);\n  pbVar4 = pbVar3 + iVar1 + 1;\n  uVar2 = FUN_000d5880(pbVar3,iVar1);\n  *param_2 = uVar2;\n  iVar1 = FUN_000d55f0(-uVar5,pbVar4);\n  uVar2 = FUN_000d5880(pbVar4,iVar1);\n  *param_3 = uVar2;\n  return pbVar4 + (iVar1 - (int)param_1);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "byte *pbVar3;" type_identifier (pointer_declarator "*pbVar3" * identifier) ;) (declaration "byte *pbVar4;" type_identifier (pointer_declarator "*pbVar4" * identifier) ;) (declaration "uint uVar5;" type_identifier identifier ;) (expression_statement "uVar5 = (uint)*param_1;" (assignment_expression "uVar5 = (uint)*param_1" identifier = (binary_expression "(uint)*param_1" (parenthesized_expression "(uint)" ( identifier )) * identifier)) ;) (if_statement "if (uVar5 == 0) {\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }" if (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) (compound_statement "{\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }" { (expression_statement "param_1 = PTR_FUN_0012a1a8 + -0x2fc4;" (assignment_expression "param_1 = PTR_FUN_0012a1a8 + -0x2fc4" identifier = (binary_expression "PTR_FUN_0012a1a8 + -0x2fc4" identifier + number_literal)) ;) (expression_statement "(*(code *)PTR_FUN_0012a1e4)(param_1);" (call_expression "(*(code *)PTR_FUN_0012a1e4)(param_1)" (parenthesized_expression "(*(code *)PTR_FUN_0012a1e4)" ( (pointer_expression "*(code *)PTR_FUN_0012a1e4" * (cast_expression "(code *)PTR_FUN_0012a1e4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1)" ( identifier ))) ;) })) (expression_statement "pbVar3 = param_1 + 1;" (assignment_expression "pbVar3 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (expression_statement "iVar1 = FUN_000d55f0(uVar5,pbVar3);" (assignment_expression "iVar1 = FUN_000d55f0(uVar5,pbVar3)" identifier = (call_expression "FUN_000d55f0(uVar5,pbVar3)" identifier (argument_list "(uVar5,pbVar3)" ( identifier , identifier )))) ;) (expression_statement "pbVar4 = pbVar3 + iVar1 + 1;" (assignment_expression "pbVar4 = pbVar3 + iVar1 + 1" identifier = (binary_expression "pbVar3 + iVar1 + 1" (binary_expression "pbVar3 + iVar1" identifier + identifier) + number_literal)) ;) (expression_statement "uVar2 = FUN_000d5880(pbVar3,iVar1);" (assignment_expression "uVar2 = FUN_000d5880(pbVar3,iVar1)" identifier = (call_expression "FUN_000d5880(pbVar3,iVar1)" identifier (argument_list "(pbVar3,iVar1)" ( identifier , identifier )))) ;) (expression_statement "*param_2 = uVar2;" (assignment_expression "*param_2 = uVar2" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "iVar1 = FUN_000d55f0(-uVar5,pbVar4);" (assignment_expression "iVar1 = FUN_000d55f0(-uVar5,pbVar4)" identifier = (call_expression "FUN_000d55f0(-uVar5,pbVar4)" identifier (argument_list "(-uVar5,pbVar4)" ( (unary_expression "-uVar5" - identifier) , identifier )))) ;) (expression_statement "uVar2 = FUN_000d5880(pbVar4,iVar1);" (assignment_expression "uVar2 = FUN_000d5880(pbVar4,iVar1)" identifier = (call_expression "FUN_000d5880(pbVar4,iVar1)" identifier (argument_list "(pbVar4,iVar1)" ( identifier , identifier )))) ;) (expression_statement "*param_3 = uVar2;" (assignment_expression "*param_3 = uVar2" (pointer_expression "*param_3" * identifier) = identifier) ;) (return_statement "return pbVar4 + (iVar1 - (int)param_1);" return (binary_expression "pbVar4 + (iVar1 - (int)param_1)" identifier + (parenthesized_expression "(iVar1 - (int)param_1)" ( (binary_expression "iVar1 - (int)param_1" identifier - (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( IDENT )) * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT ))) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + IDENT) + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (unary_expression - IDENT) , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return (binary_expression IDENT + (parenthesized_expression ( (binary_expression IDENT - (cast_expression ( (type_descriptor TYPE) ) IDENT)) ))) ;) })))
(function_definition "byte * FUN_000d5b38(byte *param_1,undefined4 *param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  byte *pbVar3;\n  byte *pbVar4;\n  uint uVar5;\n  \n  uVar5 = (uint)*param_1;\n  if (uVar5 == 0) {\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }\n  pbVar3 = param_1 + 1;\n  iVar1 = FUN_000d55f0(uVar5,pbVar3);\n  pbVar4 = pbVar3 + iVar1 + 1;\n  uVar2 = FUN_000d5880(pbVar3,iVar1);\n  *param_2 = uVar2;\n  iVar1 = FUN_000d55f0(-uVar5,pbVar4);\n  uVar2 = FUN_000d5880(pbVar4,iVar1);\n  *param_3 = uVar2;\n  return pbVar4 + (iVar1 - (int)param_1);\n}" (type_identifier "byte") (pointer_declarator "* FUN_000d5b38(byte *param_1,undefined4 *param_2,undefined4 *param_3)" (* "*") (function_declarator "FUN_000d5b38(byte *param_1,undefined4 *param_2,undefined4 *param_3)" (identifier "FUN_000d5b38") (parameter_list "(byte *param_1,undefined4 *param_2,undefined4 *param_3)" (( "(") (parameter_declaration "byte *param_1" (type_identifier "byte") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 *param_2" (type_identifier "undefined4") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "undefined4 *param_3" (type_identifier "undefined4") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")")))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  byte *pbVar3;\n  byte *pbVar4;\n  uint uVar5;\n  \n  uVar5 = (uint)*param_1;\n  if (uVar5 == 0) {\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }\n  pbVar3 = param_1 + 1;\n  iVar1 = FUN_000d55f0(uVar5,pbVar3);\n  pbVar4 = pbVar3 + iVar1 + 1;\n  uVar2 = FUN_000d5880(pbVar3,iVar1);\n  *param_2 = uVar2;\n  iVar1 = FUN_000d55f0(-uVar5,pbVar4);\n  uVar2 = FUN_000d5880(pbVar4,iVar1);\n  *param_3 = uVar2;\n  return pbVar4 + (iVar1 - (int)param_1);\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (declaration "byte *pbVar3;" (type_identifier "byte") (pointer_declarator "*pbVar3" (* "*") (identifier "pbVar3")) (; ";")) (declaration "byte *pbVar4;" (type_identifier "byte") (pointer_declarator "*pbVar4" (* "*") (identifier "pbVar4")) (; ";")) (declaration "uint uVar5;" (type_identifier "uint") (identifier "uVar5") (; ";")) (expression_statement "uVar5 = (uint)*param_1;" (assignment_expression "uVar5 = (uint)*param_1" (identifier "uVar5") (= "=") (binary_expression "(uint)*param_1" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (* "*") (identifier "param_1"))) (; ";")) (if_statement "if (uVar5 == 0) {\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }" (if "if") (parenthesized_expression "(uVar5 == 0)" (( "(") (binary_expression "uVar5 == 0" (identifier "uVar5") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;\n    (*(code *)PTR_FUN_0012a1e4)(param_1);\n  }" ({ "{") (expression_statement "param_1 = PTR_FUN_0012a1a8 + -0x2fc4;" (assignment_expression "param_1 = PTR_FUN_0012a1a8 + -0x2fc4" (identifier "param_1") (= "=") (binary_expression "PTR_FUN_0012a1a8 + -0x2fc4" (identifier "PTR_FUN_0012a1a8") (+ "+") (number_literal "-0x2fc4"))) (; ";")) (expression_statement "(*(code *)PTR_FUN_0012a1e4)(param_1);" (call_expression "(*(code *)PTR_FUN_0012a1e4)(param_1)" (parenthesized_expression "(*(code *)PTR_FUN_0012a1e4)" (( "(") (pointer_expression "*(code *)PTR_FUN_0012a1e4" (* "*") (cast_expression "(code *)PTR_FUN_0012a1e4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_FUN_0012a1e4"))) () ")")) (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (} "}"))) (expression_statement "pbVar3 = param_1 + 1;" (assignment_expression "pbVar3 = param_1 + 1" (identifier "pbVar3") (= "=") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "iVar1 = FUN_000d55f0(uVar5,pbVar3);" (assignment_expression "iVar1 = FUN_000d55f0(uVar5,pbVar3)" (identifier "iVar1") (= "=") (call_expression "FUN_000d55f0(uVar5,pbVar3)" (identifier "FUN_000d55f0") (argument_list "(uVar5,pbVar3)" (( "(") (identifier "uVar5") (, ",") (identifier "pbVar3") () ")")))) (; ";")) (expression_statement "pbVar4 = pbVar3 + iVar1 + 1;" (assignment_expression "pbVar4 = pbVar3 + iVar1 + 1" (identifier "pbVar4") (= "=") (binary_expression "pbVar3 + iVar1 + 1" (binary_expression "pbVar3 + iVar1" (identifier "pbVar3") (+ "+") (identifier "iVar1")) (+ "+") (number_literal "1"))) (; ";")) (expression_statement "uVar2 = FUN_000d5880(pbVar3,iVar1);" (assignment_expression "uVar2 = FUN_000d5880(pbVar3,iVar1)" (identifier "uVar2") (= "=") (call_expression "FUN_000d5880(pbVar3,iVar1)" (identifier "FUN_000d5880") (argument_list "(pbVar3,iVar1)" (( "(") (identifier "pbVar3") (, ",") (identifier "iVar1") () ")")))) (; ";")) (expression_statement "*param_2 = uVar2;" (assignment_expression "*param_2 = uVar2" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "uVar2")) (; ";")) (expression_statement "iVar1 = FUN_000d55f0(-uVar5,pbVar4);" (assignment_expression "iVar1 = FUN_000d55f0(-uVar5,pbVar4)" (identifier "iVar1") (= "=") (call_expression "FUN_000d55f0(-uVar5,pbVar4)" (identifier "FUN_000d55f0") (argument_list "(-uVar5,pbVar4)" (( "(") (unary_expression "-uVar5" (- "-") (identifier "uVar5")) (, ",") (identifier "pbVar4") () ")")))) (; ";")) (expression_statement "uVar2 = FUN_000d5880(pbVar4,iVar1);" (assignment_expression "uVar2 = FUN_000d5880(pbVar4,iVar1)" (identifier "uVar2") (= "=") (call_expression "FUN_000d5880(pbVar4,iVar1)" (identifier "FUN_000d5880") (argument_list "(pbVar4,iVar1)" (( "(") (identifier "pbVar4") (, ",") (identifier "iVar1") () ")")))) (; ";")) (expression_statement "*param_3 = uVar2;" (assignment_expression "*param_3 = uVar2" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (= "=") (identifier "uVar2")) (; ";")) (return_statement "return pbVar4 + (iVar1 - (int)param_1);" (return "return") (binary_expression "pbVar4 + (iVar1 - (int)param_1)" (identifier "pbVar4") (+ "+") (parenthesized_expression "(iVar1 - (int)param_1)" (( "(") (binary_expression "iVar1 - (int)param_1" (identifier "iVar1") (- "-") (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1"))) () ")"))) (; ";")) (} "}")))
(translation_unit (function_definition type: (type_identifier) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier)))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (identifier)) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (unary_expression argument: (identifier)) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (return_statement (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))))))))

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

{
  int iVar1;
  undefined4 uVar2;
  byte *pbVar3;
  byte *pbVar4;
  uint uVar5;
  
  uVar5 = (uint)*param_1;
  if (uVar5 == 0) {
    param_1 = PTR_FUN_0012a1a8 + -0x2fc4;
    (*(code *)PTR_FUN_0012a1e4)(param_1);
  }
  pbVar3 = param_1 + 1;
  iVar1 = FUN_000d55f0(uVar5,pbVar3);
  pbVar4 = pbVar3 + iVar1 + 1;
  uVar2 = FUN_000d5880(pbVar3,iVar1);
  *param_2 = uVar2;
  iVar1 = FUN_000d55f0(-uVar5,pbVar4);
  uVar2 = FUN_000d5880(pbVar4,iVar1);
  *param_3 = uVar2;
  return pbVar4 + (iVar1 - (int)param_1);
}

