
char * ansiexpand(char *string,int start,int end,int *lenp)

{
  char *pcVar1;
  char *pcVar2;
  char *pcVar3;
  int len;
  
  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((end - start) + 1);
  pcVar2 = string + start;
  if (start < end) {
    pcVar3 = pcVar1;
    do {
      *pcVar3 = *pcVar2;
      pcVar2 = pcVar2 + 1;
      pcVar3 = pcVar3 + 1;
    } while (pcVar2 != string + end);
    len = end - start;
  }
  else {
    len = 0;
  }
  pcVar1[len] = '\0';
  if (*pcVar1 == '\0') {
    if (lenp != (int *)0x0) {
      *lenp = 0;
    }
    return pcVar1;
  }
  ansicstr(pcVar1,len,2,(int *)0x0,lenp);
  pcVar1 = (char *)(*(code *)PTR_free_001585ac)(pcVar1);
  return pcVar1;
}



char * ansiexpand(int param_1,int param_2,int param_3,undefined4 *param_4)

{
  char *pcVar1;
  char *pcVar2;
  char *pcVar3;
  
  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);
  pcVar2 = (char *)(param_1 + param_2);
  if (param_2 < param_3) {
    pcVar3 = pcVar1;
    do {
      *pcVar3 = *pcVar2;
      pcVar2 = pcVar2 + 1;
      pcVar3 = pcVar3 + 1;
    } while (pcVar2 != (char *)(param_1 + param_3));
    param_3 = param_3 - param_2;
  }
  else {
    param_3 = 0;
  }
  pcVar1[param_3] = '\0';
  if (*pcVar1 == '\0') {
    pcVar2 = pcVar1;
    if (param_4 != (undefined4 *)0x0) {
      *param_4 = 0;
    }
  }
  else {
    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);
    (*(code *)PTR_free_001585ac)(pcVar1);
  }
  return pcVar2;
}


lui gp,0x7
addiu gp,gp,0x30cc
addu gp,gp,t9
addiu sp,sp,-0x38
sw ra,0x34(sp)
sw s4,0x30(sp)
sw s3,0x2c(sp)
sw s2,0x28(sp)
sw s1,0x24(sp)
sw s0,0x20(sp)
sw gp,0x18(sp)
or s0,a0,zero
or s4,a1,zero
or s1,a2,zero
or s3,a3,zero
subu a0,a2,a1
addiu a0,a0,0x1
lw t9,-0x7f88(gp)
jalr t9
_nop
lw gp,0x18(sp)
or s2,v0,zero
slt v0,s4,s1
beq v0,zero,0x000eb53c
_addu v0,s0,s4
or v1,s2,zero
addu a0,s0,s1
lb a2,0x0(v0)
sb a2,0x0(v1)
addiu v0,v0,0x1
bne v0,a0,0x000eb4e0
_addiu v1,v1,0x1
subu a1,s1,s4
addu v0,s2,a1
sb zero,0x0(v0)
lb v0,0x0(s2)
bne v0,zero,0x000eb544
_or a3,zero,zero
beq s3,zero,0x000eb51c
_or v0,s2,zero
sw zero,0x0(s3)
or v0,s2,zero
lw ra,0x34(sp)
lw s4,0x30(sp)
lw s3,0x2c(sp)
lw s2,0x28(sp)
lw s1,0x24(sp)
lw s0,0x20(sp)
jr ra
_addiu sp,sp,0x38
b 0x000eb4f8
_or a1,zero,zero
sw s3,0x10(sp)
li a2,0x2
or a0,s2,zero
lw t9,-0x6b80(gp)
bal 0x000ea980
_nop
lw gp,0x18(sp)
or s0,v0,zero
or a0,s2,zero
lw t9,-0x5f94(gp)
jalr t9
_nop
lw gp,0x18(sp)
b 0x000eb518
_or s2,s0,zero
(translation_unit "char * ansiexpand(int param_1,int param_2,int param_3,undefined4 *param_4)\n\n{\n  char *pcVar1;\n  char *pcVar2;\n  char *pcVar3;\n  \n  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);\n  pcVar2 = (char *)(param_1 + param_2);\n  if (param_2 < param_3) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }\n  else {\n    param_3 = 0;\n  }\n  pcVar1[param_3] = '\0';\n  if (*pcVar1 == '\0') {\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }\n  else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }\n  return pcVar2;\n}\n\n" (function_definition "char * ansiexpand(int param_1,int param_2,int param_3,undefined4 *param_4)\n\n{\n  char *pcVar1;\n  char *pcVar2;\n  char *pcVar3;\n  \n  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);\n  pcVar2 = (char *)(param_1 + param_2);\n  if (param_2 < param_3) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }\n  else {\n    param_3 = 0;\n  }\n  pcVar1[param_3] = '\0';\n  if (*pcVar1 == '\0') {\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }\n  else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }\n  return pcVar2;\n}" primitive_type (pointer_declarator "* ansiexpand(int param_1,int param_2,int param_3,undefined4 *param_4)" * (function_declarator "ansiexpand(int param_1,int param_2,int param_3,undefined4 *param_4)" identifier (parameter_list "(int param_1,int param_2,int param_3,undefined4 *param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "undefined4 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) )))) (compound_statement "{\n  char *pcVar1;\n  char *pcVar2;\n  char *pcVar3;\n  \n  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);\n  pcVar2 = (char *)(param_1 + param_2);\n  if (param_2 < param_3) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }\n  else {\n    param_3 = 0;\n  }\n  pcVar1[param_3] = '\0';\n  if (*pcVar1 == '\0') {\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }\n  else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }\n  return pcVar2;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (expression_statement "pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);" (assignment_expression "pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1)" identifier = (cast_expression "(char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1)" (parenthesized_expression "(*(code *)PTR_xmalloc_001565b8)" ( (pointer_expression "*(code *)PTR_xmalloc_001565b8" * (cast_expression "(code *)PTR_xmalloc_001565b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "((param_3 - param_2) + 1)" ( (binary_expression "(param_3 - param_2) + 1" (parenthesized_expression "(param_3 - param_2)" ( (binary_expression "param_3 - param_2" identifier - identifier) )) + number_literal) ))))) ;) (expression_statement "pcVar2 = (char *)(param_1 + param_2);" (assignment_expression "pcVar2 = (char *)(param_1 + param_2)" identifier = (cast_expression "(char *)(param_1 + param_2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + param_2)" ( (binary_expression "param_1 + param_2" identifier + identifier) )))) ;) (if_statement "if (param_2 < param_3) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }\n  else {\n    param_3 = 0;\n  }" if (parenthesized_expression "(param_2 < param_3)" ( (binary_expression "param_2 < param_3" identifier < identifier) )) (compound_statement "{\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }" { (expression_statement "pcVar3 = pcVar1;" (assignment_expression "pcVar3 = pcVar1" identifier = identifier) ;) (do_statement "do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));" do (compound_statement "{\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    }" { (expression_statement "*pcVar3 = *pcVar2;" (assignment_expression "*pcVar3 = *pcVar2" (pointer_expression "*pcVar3" * identifier) = (pointer_expression "*pcVar2" * identifier)) ;) (expression_statement "pcVar2 = pcVar2 + 1;" (assignment_expression "pcVar2 = pcVar2 + 1" identifier = (binary_expression "pcVar2 + 1" identifier + number_literal)) ;) (expression_statement "pcVar3 = pcVar3 + 1;" (assignment_expression "pcVar3 = pcVar3 + 1" identifier = (binary_expression "pcVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(pcVar2 != (char *)(param_1 + param_3))" ( (binary_expression "pcVar2 != (char *)(param_1 + param_3)" identifier != (cast_expression "(char *)(param_1 + param_3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + param_3)" ( (binary_expression "param_1 + param_3" identifier + identifier) )))) )) ;) (expression_statement "param_3 = param_3 - param_2;" (assignment_expression "param_3 = param_3 - param_2" identifier = (binary_expression "param_3 - param_2" identifier - identifier)) ;) }) (else_clause "else {\n    param_3 = 0;\n  }" else (compound_statement "{\n    param_3 = 0;\n  }" { (expression_statement "param_3 = 0;" (assignment_expression "param_3 = 0" identifier = number_literal) ;) }))) (expression_statement "pcVar1[param_3] = '\0';" (assignment_expression "pcVar1[param_3] = '\0'" (subscript_expression "pcVar1[param_3]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (if_statement "if (*pcVar1 == '\0') {\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }\n  else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }" if (parenthesized_expression "(*pcVar1 == '\0')" ( (binary_expression "*pcVar1 == '\0'" (pointer_expression "*pcVar1" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }" { (expression_statement "pcVar2 = pcVar1;" (assignment_expression "pcVar2 = pcVar1" identifier = identifier) ;) (if_statement "if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }" if (parenthesized_expression "(param_4 != (undefined4 *)0x0)" ( (binary_expression "param_4 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *param_4 = 0;\n    }" { (expression_statement "*param_4 = 0;" (assignment_expression "*param_4 = 0" (pointer_expression "*param_4" * identifier) = number_literal) ;) })) }) (else_clause "else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }" else (compound_statement "{\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }" { (expression_statement "pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);" (assignment_expression "pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4)" identifier = (cast_expression "(char *)ansicstr(pcVar1,param_3,2,0,param_4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "ansicstr(pcVar1,param_3,2,0,param_4)" identifier (argument_list "(pcVar1,param_3,2,0,param_4)" ( identifier , identifier , number_literal , number_literal , identifier ))))) ;) (expression_statement "(*(code *)PTR_free_001585ac)(pcVar1);" (call_expression "(*(code *)PTR_free_001585ac)(pcVar1)" (parenthesized_expression "(*(code *)PTR_free_001585ac)" ( (pointer_expression "*(code *)PTR_free_001585ac" * (cast_expression "(code *)PTR_free_001585ac" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar1)" ( identifier ))) ;) }))) (return_statement "return pcVar2;" return identifier ;) })))
(translation_unit "char * ansiexpand(char *string,int start,int end,int *lenp)\n\n{\n  char *pcVar1;\n  char *pcVar2;\n  char *pcVar3;\n  int len;\n  \n  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((end - start) + 1);\n  pcVar2 = string + start;\n  if (start < end) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != string + end);\n    len = end - start;\n  }\n  else {\n    len = 0;\n  }\n  pcVar1[len] = '\0';\n  if (*pcVar1 == '\0') {\n    if (lenp != (int *)0x0) {\n      *lenp = 0;\n    }\n    return pcVar1;\n  }\n  ansicstr(pcVar1,len,2,(int *)0x0,lenp);\n  pcVar1 = (char *)(*(code *)PTR_free_001585ac)(pcVar1);\n  return pcVar1;\n}\n\n" (function_definition "char * ansiexpand(char *string,int start,int end,int *lenp)\n\n{\n  char *pcVar1;\n  char *pcVar2;\n  char *pcVar3;\n  int len;\n  \n  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((end - start) + 1);\n  pcVar2 = string + start;\n  if (start < end) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != string + end);\n    len = end - start;\n  }\n  else {\n    len = 0;\n  }\n  pcVar1[len] = '\0';\n  if (*pcVar1 == '\0') {\n    if (lenp != (int *)0x0) {\n      *lenp = 0;\n    }\n    return pcVar1;\n  }\n  ansicstr(pcVar1,len,2,(int *)0x0,lenp);\n  pcVar1 = (char *)(*(code *)PTR_free_001585ac)(pcVar1);\n  return pcVar1;\n}" primitive_type (pointer_declarator "* ansiexpand(char *string,int start,int end,int *lenp)" * (function_declarator "ansiexpand(char *string,int start,int end,int *lenp)" identifier (parameter_list "(char *string,int start,int end,int *lenp)" ( (parameter_declaration "char *string" primitive_type (pointer_declarator "*string" * identifier)) , (parameter_declaration "int start" primitive_type identifier) , (parameter_declaration "int end" primitive_type identifier) , (parameter_declaration "int *lenp" primitive_type (pointer_declarator "*lenp" * identifier)) )))) (compound_statement "{\n  char *pcVar1;\n  char *pcVar2;\n  char *pcVar3;\n  int len;\n  \n  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((end - start) + 1);\n  pcVar2 = string + start;\n  if (start < end) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != string + end);\n    len = end - start;\n  }\n  else {\n    len = 0;\n  }\n  pcVar1[len] = '\0';\n  if (*pcVar1 == '\0') {\n    if (lenp != (int *)0x0) {\n      *lenp = 0;\n    }\n    return pcVar1;\n  }\n  ansicstr(pcVar1,len,2,(int *)0x0,lenp);\n  pcVar1 = (char *)(*(code *)PTR_free_001585ac)(pcVar1);\n  return pcVar1;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "int len;" primitive_type identifier ;) (expression_statement "pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((end - start) + 1);" (assignment_expression "pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((end - start) + 1)" identifier = (cast_expression "(char *)(*(code *)PTR_xmalloc_001565b8)((end - start) + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_xmalloc_001565b8)((end - start) + 1)" (parenthesized_expression "(*(code *)PTR_xmalloc_001565b8)" ( (pointer_expression "*(code *)PTR_xmalloc_001565b8" * (cast_expression "(code *)PTR_xmalloc_001565b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "((end - start) + 1)" ( (binary_expression "(end - start) + 1" (parenthesized_expression "(end - start)" ( (binary_expression "end - start" identifier - identifier) )) + number_literal) ))))) ;) (expression_statement "pcVar2 = string + start;" (assignment_expression "pcVar2 = string + start" identifier = (binary_expression "string + start" identifier + identifier)) ;) (if_statement "if (start < end) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != string + end);\n    len = end - start;\n  }\n  else {\n    len = 0;\n  }" if (parenthesized_expression "(start < end)" ( (binary_expression "start < end" identifier < identifier) )) (compound_statement "{\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != string + end);\n    len = end - start;\n  }" { (expression_statement "pcVar3 = pcVar1;" (assignment_expression "pcVar3 = pcVar1" identifier = identifier) ;) (do_statement "do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != string + end);" do (compound_statement "{\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    }" { (expression_statement "*pcVar3 = *pcVar2;" (assignment_expression "*pcVar3 = *pcVar2" (pointer_expression "*pcVar3" * identifier) = (pointer_expression "*pcVar2" * identifier)) ;) (expression_statement "pcVar2 = pcVar2 + 1;" (assignment_expression "pcVar2 = pcVar2 + 1" identifier = (binary_expression "pcVar2 + 1" identifier + number_literal)) ;) (expression_statement "pcVar3 = pcVar3 + 1;" (assignment_expression "pcVar3 = pcVar3 + 1" identifier = (binary_expression "pcVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(pcVar2 != string + end)" ( (binary_expression "pcVar2 != string + end" identifier != (binary_expression "string + end" identifier + identifier)) )) ;) (expression_statement "len = end - start;" (assignment_expression "len = end - start" identifier = (binary_expression "end - start" identifier - identifier)) ;) }) (else_clause "else {\n    len = 0;\n  }" else (compound_statement "{\n    len = 0;\n  }" { (expression_statement "len = 0;" (assignment_expression "len = 0" identifier = number_literal) ;) }))) (expression_statement "pcVar1[len] = '\0';" (assignment_expression "pcVar1[len] = '\0'" (subscript_expression "pcVar1[len]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (if_statement "if (*pcVar1 == '\0') {\n    if (lenp != (int *)0x0) {\n      *lenp = 0;\n    }\n    return pcVar1;\n  }" if (parenthesized_expression "(*pcVar1 == '\0')" ( (binary_expression "*pcVar1 == '\0'" (pointer_expression "*pcVar1" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    if (lenp != (int *)0x0) {\n      *lenp = 0;\n    }\n    return pcVar1;\n  }" { (if_statement "if (lenp != (int *)0x0) {\n      *lenp = 0;\n    }" if (parenthesized_expression "(lenp != (int *)0x0)" ( (binary_expression "lenp != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *lenp = 0;\n    }" { (expression_statement "*lenp = 0;" (assignment_expression "*lenp = 0" (pointer_expression "*lenp" * identifier) = number_literal) ;) })) (return_statement "return pcVar1;" return identifier ;) })) (expression_statement "ansicstr(pcVar1,len,2,(int *)0x0,lenp);" (call_expression "ansicstr(pcVar1,len,2,(int *)0x0,lenp)" identifier (argument_list "(pcVar1,len,2,(int *)0x0,lenp)" ( identifier , identifier , number_literal , (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , identifier ))) ;) (expression_statement "pcVar1 = (char *)(*(code *)PTR_free_001585ac)(pcVar1);" (assignment_expression "pcVar1 = (char *)(*(code *)PTR_free_001585ac)(pcVar1)" identifier = (cast_expression "(char *)(*(code *)PTR_free_001585ac)(pcVar1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_free_001585ac)(pcVar1)" (parenthesized_expression "(*(code *)PTR_free_001585ac)" ( (pointer_expression "*(code *)PTR_free_001585ac" * (cast_expression "(code *)PTR_free_001585ac" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar1)" ( identifier ))))) ;) (return_statement "return pcVar1;" return identifier ;) })))
(translation_unit "char * ansiexpand(int param_1,int param_2,int param_3,undefined4 *param_4)\n\n{\n  char *pcVar1;\n  char *pcVar2;\n  char *pcVar3;\n  \n  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);\n  pcVar2 = (char *)(param_1 + param_2);\n  if (param_2 < param_3) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }\n  else {\n    param_3 = 0;\n  }\n  pcVar1[param_3] = '\0';\n  if (*pcVar1 == '\0') {\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }\n  else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }\n  return pcVar2;\n}\n\n" (function_definition "char * ansiexpand(int param_1,int param_2,int param_3,undefined4 *param_4)\n\n{\n  char *pcVar1;\n  char *pcVar2;\n  char *pcVar3;\n  \n  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);\n  pcVar2 = (char *)(param_1 + param_2);\n  if (param_2 < param_3) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }\n  else {\n    param_3 = 0;\n  }\n  pcVar1[param_3] = '\0';\n  if (*pcVar1 == '\0') {\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }\n  else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }\n  return pcVar2;\n}" primitive_type (pointer_declarator "* ansiexpand(int param_1,int param_2,int param_3,undefined4 *param_4)" * (function_declarator "ansiexpand(int param_1,int param_2,int param_3,undefined4 *param_4)" identifier (parameter_list "(int param_1,int param_2,int param_3,undefined4 *param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "undefined4 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) )))) (compound_statement "{\n  char *pcVar1;\n  char *pcVar2;\n  char *pcVar3;\n  \n  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);\n  pcVar2 = (char *)(param_1 + param_2);\n  if (param_2 < param_3) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }\n  else {\n    param_3 = 0;\n  }\n  pcVar1[param_3] = '\0';\n  if (*pcVar1 == '\0') {\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }\n  else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }\n  return pcVar2;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (expression_statement "pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);" (assignment_expression "pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1)" identifier = (cast_expression "(char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1)" (parenthesized_expression "(*(code *)PTR_xmalloc_001565b8)" ( (pointer_expression "*(code *)PTR_xmalloc_001565b8" * (cast_expression "(code *)PTR_xmalloc_001565b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "((param_3 - param_2) + 1)" ( (binary_expression "(param_3 - param_2) + 1" (parenthesized_expression "(param_3 - param_2)" ( (binary_expression "param_3 - param_2" identifier - identifier) )) + number_literal) ))))) ;) (expression_statement "pcVar2 = (char *)(param_1 + param_2);" (assignment_expression "pcVar2 = (char *)(param_1 + param_2)" identifier = (cast_expression "(char *)(param_1 + param_2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + param_2)" ( (binary_expression "param_1 + param_2" identifier + identifier) )))) ;) (if_statement "if (param_2 < param_3) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }\n  else {\n    param_3 = 0;\n  }" if (parenthesized_expression "(param_2 < param_3)" ( (binary_expression "param_2 < param_3" identifier < identifier) )) (compound_statement "{\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }" { (expression_statement "pcVar3 = pcVar1;" (assignment_expression "pcVar3 = pcVar1" identifier = identifier) ;) (do_statement "do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));" do (compound_statement "{\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    }" { (expression_statement "*pcVar3 = *pcVar2;" (assignment_expression "*pcVar3 = *pcVar2" (pointer_expression "*pcVar3" * identifier) = (pointer_expression "*pcVar2" * identifier)) ;) (expression_statement "pcVar2 = pcVar2 + 1;" (assignment_expression "pcVar2 = pcVar2 + 1" identifier = (binary_expression "pcVar2 + 1" identifier + number_literal)) ;) (expression_statement "pcVar3 = pcVar3 + 1;" (assignment_expression "pcVar3 = pcVar3 + 1" identifier = (binary_expression "pcVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(pcVar2 != (char *)(param_1 + param_3))" ( (binary_expression "pcVar2 != (char *)(param_1 + param_3)" identifier != (cast_expression "(char *)(param_1 + param_3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + param_3)" ( (binary_expression "param_1 + param_3" identifier + identifier) )))) )) ;) (expression_statement "param_3 = param_3 - param_2;" (assignment_expression "param_3 = param_3 - param_2" identifier = (binary_expression "param_3 - param_2" identifier - identifier)) ;) }) (else_clause "else {\n    param_3 = 0;\n  }" else (compound_statement "{\n    param_3 = 0;\n  }" { (expression_statement "param_3 = 0;" (assignment_expression "param_3 = 0" identifier = number_literal) ;) }))) (expression_statement "pcVar1[param_3] = '\0';" (assignment_expression "pcVar1[param_3] = '\0'" (subscript_expression "pcVar1[param_3]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (if_statement "if (*pcVar1 == '\0') {\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }\n  else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }" if (parenthesized_expression "(*pcVar1 == '\0')" ( (binary_expression "*pcVar1 == '\0'" (pointer_expression "*pcVar1" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }" { (expression_statement "pcVar2 = pcVar1;" (assignment_expression "pcVar2 = pcVar1" identifier = identifier) ;) (if_statement "if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }" if (parenthesized_expression "(param_4 != (undefined4 *)0x0)" ( (binary_expression "param_4 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *param_4 = 0;\n    }" { (expression_statement "*param_4 = 0;" (assignment_expression "*param_4 = 0" (pointer_expression "*param_4" * identifier) = number_literal) ;) })) }) (else_clause "else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }" else (compound_statement "{\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }" { (expression_statement "pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);" (assignment_expression "pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4)" identifier = (cast_expression "(char *)ansicstr(pcVar1,param_3,2,0,param_4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "ansicstr(pcVar1,param_3,2,0,param_4)" identifier (argument_list "(pcVar1,param_3,2,0,param_4)" ( identifier , identifier , number_literal , number_literal , identifier ))))) ;) (expression_statement "(*(code *)PTR_free_001585ac)(pcVar1);" (call_expression "(*(code *)PTR_free_001585ac)(pcVar1)" (parenthesized_expression "(*(code *)PTR_free_001585ac)" ( (pointer_expression "*(code *)PTR_free_001585ac" * (cast_expression "(code *)PTR_free_001585ac" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar1)" ( identifier ))) ;) }))) (return_statement "return pcVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (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 (parenthesized_expression ( (binary_expression IDENT - IDENT) )) + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) )) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }))) (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (char_literal ' escape_sequence ')) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , IDENT , LIT , LIT , IDENT ))))) ;) (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 "char * ansiexpand(int param_1,int param_2,int param_3,undefined4 *param_4)\n\n{\n  char *pcVar1;\n  char *pcVar2;\n  char *pcVar3;\n  \n  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);\n  pcVar2 = (char *)(param_1 + param_2);\n  if (param_2 < param_3) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }\n  else {\n    param_3 = 0;\n  }\n  pcVar1[param_3] = '\0';\n  if (*pcVar1 == '\0') {\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }\n  else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }\n  return pcVar2;\n}" (primitive_type "char") (pointer_declarator "* ansiexpand(int param_1,int param_2,int param_3,undefined4 *param_4)" (* "*") (function_declarator "ansiexpand(int param_1,int param_2,int param_3,undefined4 *param_4)" (identifier "ansiexpand") (parameter_list "(int param_1,int param_2,int param_3,undefined4 *param_4)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 *param_4" (type_identifier "undefined4") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")")))) (compound_statement "{\n  char *pcVar1;\n  char *pcVar2;\n  char *pcVar3;\n  \n  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);\n  pcVar2 = (char *)(param_1 + param_2);\n  if (param_2 < param_3) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }\n  else {\n    param_3 = 0;\n  }\n  pcVar1[param_3] = '\0';\n  if (*pcVar1 == '\0') {\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }\n  else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }\n  return pcVar2;\n}" ({ "{") (declaration "char *pcVar1;" (primitive_type "char") (pointer_declarator "*pcVar1" (* "*") (identifier "pcVar1")) (; ";")) (declaration "char *pcVar2;" (primitive_type "char") (pointer_declarator "*pcVar2" (* "*") (identifier "pcVar2")) (; ";")) (declaration "char *pcVar3;" (primitive_type "char") (pointer_declarator "*pcVar3" (* "*") (identifier "pcVar3")) (; ";")) (expression_statement "pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);" (assignment_expression "pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1)" (identifier "pcVar1") (= "=") (cast_expression "(char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1)" (parenthesized_expression "(*(code *)PTR_xmalloc_001565b8)" (( "(") (pointer_expression "*(code *)PTR_xmalloc_001565b8" (* "*") (cast_expression "(code *)PTR_xmalloc_001565b8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_xmalloc_001565b8"))) () ")")) (argument_list "((param_3 - param_2) + 1)" (( "(") (binary_expression "(param_3 - param_2) + 1" (parenthesized_expression "(param_3 - param_2)" (( "(") (binary_expression "param_3 - param_2" (identifier "param_3") (- "-") (identifier "param_2")) () ")")) (+ "+") (number_literal "1")) () ")"))))) (; ";")) (expression_statement "pcVar2 = (char *)(param_1 + param_2);" (assignment_expression "pcVar2 = (char *)(param_1 + param_2)" (identifier "pcVar2") (= "=") (cast_expression "(char *)(param_1 + param_2)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + param_2)" (( "(") (binary_expression "param_1 + param_2" (identifier "param_1") (+ "+") (identifier "param_2")) () ")")))) (; ";")) (if_statement "if (param_2 < param_3) {\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }\n  else {\n    param_3 = 0;\n  }" (if "if") (parenthesized_expression "(param_2 < param_3)" (( "(") (binary_expression "param_2 < param_3" (identifier "param_2") (< "<") (identifier "param_3")) () ")")) (compound_statement "{\n    pcVar3 = pcVar1;\n    do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));\n    param_3 = param_3 - param_2;\n  }" ({ "{") (expression_statement "pcVar3 = pcVar1;" (assignment_expression "pcVar3 = pcVar1" (identifier "pcVar3") (= "=") (identifier "pcVar1")) (; ";")) (do_statement "do {\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    } while (pcVar2 != (char *)(param_1 + param_3));" (do "do") (compound_statement "{\n      *pcVar3 = *pcVar2;\n      pcVar2 = pcVar2 + 1;\n      pcVar3 = pcVar3 + 1;\n    }" ({ "{") (expression_statement "*pcVar3 = *pcVar2;" (assignment_expression "*pcVar3 = *pcVar2" (pointer_expression "*pcVar3" (* "*") (identifier "pcVar3")) (= "=") (pointer_expression "*pcVar2" (* "*") (identifier "pcVar2"))) (; ";")) (expression_statement "pcVar2 = pcVar2 + 1;" (assignment_expression "pcVar2 = pcVar2 + 1" (identifier "pcVar2") (= "=") (binary_expression "pcVar2 + 1" (identifier "pcVar2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "pcVar3 = pcVar3 + 1;" (assignment_expression "pcVar3 = pcVar3 + 1" (identifier "pcVar3") (= "=") (binary_expression "pcVar3 + 1" (identifier "pcVar3") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(pcVar2 != (char *)(param_1 + param_3))" (( "(") (binary_expression "pcVar2 != (char *)(param_1 + param_3)" (identifier "pcVar2") (!= "!=") (cast_expression "(char *)(param_1 + param_3)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + param_3)" (( "(") (binary_expression "param_1 + param_3" (identifier "param_1") (+ "+") (identifier "param_3")) () ")")))) () ")")) (; ";")) (expression_statement "param_3 = param_3 - param_2;" (assignment_expression "param_3 = param_3 - param_2" (identifier "param_3") (= "=") (binary_expression "param_3 - param_2" (identifier "param_3") (- "-") (identifier "param_2"))) (; ";")) (} "}")) (else_clause "else {\n    param_3 = 0;\n  }" (else "else") (compound_statement "{\n    param_3 = 0;\n  }" ({ "{") (expression_statement "param_3 = 0;" (assignment_expression "param_3 = 0" (identifier "param_3") (= "=") (number_literal "0")) (; ";")) (} "}")))) (expression_statement "pcVar1[param_3] = '\0';" (assignment_expression "pcVar1[param_3] = '\0'" (subscript_expression "pcVar1[param_3]" (identifier "pcVar1") ([ "[") (identifier "param_3") (] "]")) (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (if_statement "if (*pcVar1 == '\0') {\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }\n  else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }" (if "if") (parenthesized_expression "(*pcVar1 == '\0')" (( "(") (binary_expression "*pcVar1 == '\0'" (pointer_expression "*pcVar1" (* "*") (identifier "pcVar1")) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    pcVar2 = pcVar1;\n    if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }\n  }" ({ "{") (expression_statement "pcVar2 = pcVar1;" (assignment_expression "pcVar2 = pcVar1" (identifier "pcVar2") (= "=") (identifier "pcVar1")) (; ";")) (if_statement "if (param_4 != (undefined4 *)0x0) {\n      *param_4 = 0;\n    }" (if "if") (parenthesized_expression "(param_4 != (undefined4 *)0x0)" (( "(") (binary_expression "param_4 != (undefined4 *)0x0" (identifier "param_4") (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      *param_4 = 0;\n    }" ({ "{") (expression_statement "*param_4 = 0;" (assignment_expression "*param_4 = 0" (pointer_expression "*param_4" (* "*") (identifier "param_4")) (= "=") (number_literal "0")) (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }" (else "else") (compound_statement "{\n    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);\n    (*(code *)PTR_free_001585ac)(pcVar1);\n  }" ({ "{") (expression_statement "pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);" (assignment_expression "pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4)" (identifier "pcVar2") (= "=") (cast_expression "(char *)ansicstr(pcVar1,param_3,2,0,param_4)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "ansicstr(pcVar1,param_3,2,0,param_4)" (identifier "ansicstr") (argument_list "(pcVar1,param_3,2,0,param_4)" (( "(") (identifier "pcVar1") (, ",") (identifier "param_3") (, ",") (number_literal "2") (, ",") (number_literal "0") (, ",") (identifier "param_4") () ")"))))) (; ";")) (expression_statement "(*(code *)PTR_free_001585ac)(pcVar1);" (call_expression "(*(code *)PTR_free_001585ac)(pcVar1)" (parenthesized_expression "(*(code *)PTR_free_001585ac)" (( "(") (pointer_expression "*(code *)PTR_free_001585ac" (* "*") (cast_expression "(code *)PTR_free_001585ac" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_free_001585ac"))) () ")")) (argument_list "(pcVar1)" (( "(") (identifier "pcVar1") () ")"))) (; ";")) (} "}")))) (return_statement "return pcVar2;" (return "return") (identifier "pcVar2") (; ";")) (} "}")))

char * function_1(char *var_3,int var_2,int var_1,int *var_6)

{
  char *pcVar1;
  char *var_4;
  char *var_5;
  int len;
  
  pcVar1 = (char *)(*(type_1 *)PTR_xmalloc_001565b8)((var_1 - var_2) + 1);
  var_4 = var_3 + var_2;
  if (var_2 < var_1) {
    var_5 = pcVar1;
    do {
      *var_5 = *var_4;
      var_4 = var_4 + 1;
      var_5 = var_5 + 1;
    } while (var_4 != var_3 + var_1);
    len = var_1 - var_2;
  }
  else {
    len = 0;
  }
  pcVar1[len] = '\0';
  if (*pcVar1 == '\0') {
    if (var_6 != (int *)0x0) {
      *var_6 = 0;
    }
    return pcVar1;
  }
  var_7(pcVar1,len,2,(int *)0x0,var_6);
  pcVar1 = (char *)(*(type_1 *)PTR_free_001585ac)(pcVar1);
  return pcVar1;
}


(translation_unit (function_definition type: (primitive_type) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier)))))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (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: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (pointer_expression argument: (identifier)))) (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))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (char_literal (escape_sequence)))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (char_literal (escape_sequence)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal)))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (number_literal) (number_literal) (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))))))) (return_statement (identifier)))))

char * MASKED(int param_1,int param_2,int param_3,undefined4 *param_4)

{
  char *pcVar1;
  char *pcVar2;
  char *pcVar3;
  
  pcVar1 = (char *)(*(code *)PTR_xmalloc_001565b8)((param_3 - param_2) + 1);
  pcVar2 = (char *)(param_1 + param_2);
  if (param_2 < param_3) {
    pcVar3 = pcVar1;
    do {
      *pcVar3 = *pcVar2;
      pcVar2 = pcVar2 + 1;
      pcVar3 = pcVar3 + 1;
    } while (pcVar2 != (char *)(param_1 + param_3));
    param_3 = param_3 - param_2;
  }
  else {
    param_3 = 0;
  }
  pcVar1[param_3] = '\0';
  if (*pcVar1 == '\0') {
    pcVar2 = pcVar1;
    if (param_4 != (undefined4 *)0x0) {
      *param_4 = 0;
    }
  }
  else {
    pcVar2 = (char *)ansicstr(pcVar1,param_3,2,0,param_4);
    (*(code *)PTR_free_001585ac)(pcVar1);
  }
  return pcVar2;
}

