
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void __regparm3 string_need(string *s,int n)

{
  char *pcVar1;
  size_t sVar2;
  int iVar3;
  
  pcVar1 = s->b;
  if (pcVar1 == (char *)0x0) {
    sVar2 = 0x20;
    if (0x1f < n) {
      sVar2 = n;
    }
    pcVar1 = (char *)xmalloc(sVar2);
    s->b = pcVar1;
    s->p = pcVar1;
    s->e = pcVar1 + sVar2;
    return;
  }
  if (n <= (int)s->e - (int)s->p) {
    return;
  }
  iVar3 = (int)s->p - (int)pcVar1;
  sVar2 = (n + iVar3) * 2;
  pcVar1 = (char *)xrealloc(pcVar1,sVar2);
  s->b = pcVar1;
  s->p = pcVar1 + iVar3;
  s->e = pcVar1 + sVar2;
  return;
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void __regparm3 FUN_001e1dd0(int *param_1,int param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar1 = *param_1;
  if (iVar1 == 0) {
    iVar1 = 0x20;
    if (0x1f < param_2) {
      iVar1 = param_2;
    }
    iVar2 = FUN_001e4cc0(iVar1);
    *param_1 = iVar2;
    param_1[1] = iVar2;
    param_1[2] = iVar2 + iVar1;
    return;
  }
  if (param_2 <= param_1[2] - param_1[1]) {
    return;
  }
  iVar3 = param_1[1] - iVar1;
  iVar2 = (param_2 + iVar3) * 2;
  iVar1 = FUN_001e4d50(iVar1,iVar2);
  *param_1 = iVar1;
  param_1[1] = iVar3 + iVar1;
  param_1[2] = iVar1 + iVar2;
  return;
}


PUSH EBP
PUSH EDI
PUSH ESI
MOV ESI,EAX
PUSH EBX
CALL 0x00035840
ADD EBX,0x1ad225
SUB ESP,0xc
MOV EAX,dword ptr [EAX]
TEST EAX,EAX
JZ 0x001e1e30
MOV EBP,dword ptr [ESI + 0x4]
MOV ECX,dword ptr [ESI + 0x8]
SUB ECX,EBP
CMP ECX,EDX
JL 0x001e1e00
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB EBP,EAX
SUB ESP,0x8
ADD EDX,EBP
LEA EDI,[EDX + EDX*0x1]
PUSH EDI
PUSH EAX
CALL 0x001e4d50
ADD ESP,0x10
MOV dword ptr [ESI],EAX
ADD EBP,EAX
ADD EAX,EDI
MOV dword ptr [ESI + 0x4],EBP
MOV dword ptr [ESI + 0x8],EAX
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
CMP EDX,0x20
MOV EAX,0x20
CMOVGE EAX,EDX
SUB ESP,0xc
PUSH EAX
MOV EDI,EAX
CALL 0x001e4cc0
ADD ESP,0x10
MOV dword ptr [ESI],EAX
MOV dword ptr [ESI + 0x4],EAX
ADD EAX,EDI
MOV dword ptr [ESI + 0x8],EAX
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 FUN_001e1dd0(int *param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }\n  if (param_2 <= param_1[2] - param_1[1]) {\n    return;\n  }\n  iVar3 = param_1[1] - iVar1;\n  iVar2 = (param_2 + iVar3) * 2;\n  iVar1 = FUN_001e4d50(iVar1,iVar2);\n  *param_1 = iVar1;\n  param_1[1] = iVar3 + iVar1;\n  param_1[2] = iVar1 + iVar2;\n  return;\n}\n\n" comment (function_definition "void __regparm3 FUN_001e1dd0(int *param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }\n  if (param_2 <= param_1[2] - param_1[1]) {\n    return;\n  }\n  iVar3 = param_1[1] - iVar1;\n  iVar2 = (param_2 + iVar3) * 2;\n  iVar1 = FUN_001e4d50(iVar1,iVar2);\n  *param_1 = iVar1;\n  param_1[1] = iVar3 + iVar1;\n  param_1[2] = iVar1 + iVar2;\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_001e1dd0(int *param_1,int param_2)" identifier (parameter_list "(int *param_1,int param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }\n  if (param_2 <= param_1[2] - param_1[1]) {\n    return;\n  }\n  iVar3 = param_1[1] - iVar1;\n  iVar2 = (param_2 + iVar3) * 2;\n  iVar1 = FUN_001e4d50(iVar1,iVar2);\n  *param_1 = iVar1;\n  param_1[1] = iVar3 + iVar1;\n  param_1[2] = iVar1 + iVar2;\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (iVar1 == 0) {\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }" { (expression_statement "iVar1 = 0x20;" (assignment_expression "iVar1 = 0x20" identifier = number_literal) ;) (if_statement "if (0x1f < param_2) {\n      iVar1 = param_2;\n    }" if (parenthesized_expression "(0x1f < param_2)" ( (binary_expression "0x1f < param_2" number_literal < identifier) )) (compound_statement "{\n      iVar1 = param_2;\n    }" { (expression_statement "iVar1 = param_2;" (assignment_expression "iVar1 = param_2" identifier = identifier) ;) })) (expression_statement "iVar2 = FUN_001e4cc0(iVar1);" (assignment_expression "iVar2 = FUN_001e4cc0(iVar1)" identifier = (call_expression "FUN_001e4cc0(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (expression_statement "*param_1 = iVar2;" (assignment_expression "*param_1 = iVar2" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1[1] = iVar2;" (assignment_expression "param_1[1] = iVar2" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "param_1[2] = iVar2 + iVar1;" (assignment_expression "param_1[2] = iVar2 + iVar1" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "iVar2 + iVar1" identifier + identifier)) ;) (return_statement "return;" return ;) })) (if_statement "if (param_2 <= param_1[2] - param_1[1]) {\n    return;\n  }" if (parenthesized_expression "(param_2 <= param_1[2] - param_1[1])" ( (binary_expression "param_2 <= param_1[2] - param_1[1]" identifier <= (binary_expression "param_1[2] - param_1[1]" (subscript_expression "param_1[2]" identifier [ number_literal ]) - (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "iVar3 = param_1[1] - iVar1;" (assignment_expression "iVar3 = param_1[1] - iVar1" identifier = (binary_expression "param_1[1] - iVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) - identifier)) ;) (expression_statement "iVar2 = (param_2 + iVar3) * 2;" (assignment_expression "iVar2 = (param_2 + iVar3) * 2" identifier = (binary_expression "(param_2 + iVar3) * 2" (parenthesized_expression "(param_2 + iVar3)" ( (binary_expression "param_2 + iVar3" identifier + identifier) )) * number_literal)) ;) (expression_statement "iVar1 = FUN_001e4d50(iVar1,iVar2);" (assignment_expression "iVar1 = FUN_001e4d50(iVar1,iVar2)" identifier = (call_expression "FUN_001e4d50(iVar1,iVar2)" identifier (argument_list "(iVar1,iVar2)" ( identifier , identifier )))) ;) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1[1] = iVar3 + iVar1;" (assignment_expression "param_1[1] = iVar3 + iVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "iVar3 + iVar1" identifier + identifier)) ;) (expression_statement "param_1[2] = iVar1 + iVar2;" (assignment_expression "param_1[2] = iVar1 + iVar2" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "iVar1 + iVar2" identifier + identifier)) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 string_need(string *s,int n)\n\n{\n  char *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  \n  pcVar1 = s->b;\n  if (pcVar1 == (char *)0x0) {\n    sVar2 = 0x20;\n    if (0x1f < n) {\n      sVar2 = n;\n    }\n    pcVar1 = (char *)xmalloc(sVar2);\n    s->b = pcVar1;\n    s->p = pcVar1;\n    s->e = pcVar1 + sVar2;\n    return;\n  }\n  if (n <= (int)s->e - (int)s->p) {\n    return;\n  }\n  iVar3 = (int)s->p - (int)pcVar1;\n  sVar2 = (n + iVar3) * 2;\n  pcVar1 = (char *)xrealloc(pcVar1,sVar2);\n  s->b = pcVar1;\n  s->p = pcVar1 + iVar3;\n  s->e = pcVar1 + sVar2;\n  return;\n}\n\n" comment (function_definition "void __regparm3 string_need(string *s,int n)\n\n{\n  char *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  \n  pcVar1 = s->b;\n  if (pcVar1 == (char *)0x0) {\n    sVar2 = 0x20;\n    if (0x1f < n) {\n      sVar2 = n;\n    }\n    pcVar1 = (char *)xmalloc(sVar2);\n    s->b = pcVar1;\n    s->p = pcVar1;\n    s->e = pcVar1 + sVar2;\n    return;\n  }\n  if (n <= (int)s->e - (int)s->p) {\n    return;\n  }\n  iVar3 = (int)s->p - (int)pcVar1;\n  sVar2 = (n + iVar3) * 2;\n  pcVar1 = (char *)xrealloc(pcVar1,sVar2);\n  s->b = pcVar1;\n  s->p = pcVar1 + iVar3;\n  s->e = pcVar1 + sVar2;\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "string_need(string *s,int n)" identifier (parameter_list "(string *s,int n)" ( (parameter_declaration "string *s" type_identifier (pointer_declarator "*s" * identifier)) , (parameter_declaration "int n" primitive_type identifier) ))) (compound_statement "{\n  char *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  \n  pcVar1 = s->b;\n  if (pcVar1 == (char *)0x0) {\n    sVar2 = 0x20;\n    if (0x1f < n) {\n      sVar2 = n;\n    }\n    pcVar1 = (char *)xmalloc(sVar2);\n    s->b = pcVar1;\n    s->p = pcVar1;\n    s->e = pcVar1 + sVar2;\n    return;\n  }\n  if (n <= (int)s->e - (int)s->p) {\n    return;\n  }\n  iVar3 = (int)s->p - (int)pcVar1;\n  sVar2 = (n + iVar3) * 2;\n  pcVar1 = (char *)xrealloc(pcVar1,sVar2);\n  s->b = pcVar1;\n  s->p = pcVar1 + iVar3;\n  s->e = pcVar1 + sVar2;\n  return;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "pcVar1 = s->b;" (assignment_expression "pcVar1 = s->b" identifier = (field_expression "s->b" identifier -> field_identifier)) ;) (if_statement "if (pcVar1 == (char *)0x0) {\n    sVar2 = 0x20;\n    if (0x1f < n) {\n      sVar2 = n;\n    }\n    pcVar1 = (char *)xmalloc(sVar2);\n    s->b = pcVar1;\n    s->p = pcVar1;\n    s->e = pcVar1 + sVar2;\n    return;\n  }" if (parenthesized_expression "(pcVar1 == (char *)0x0)" ( (binary_expression "pcVar1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    sVar2 = 0x20;\n    if (0x1f < n) {\n      sVar2 = n;\n    }\n    pcVar1 = (char *)xmalloc(sVar2);\n    s->b = pcVar1;\n    s->p = pcVar1;\n    s->e = pcVar1 + sVar2;\n    return;\n  }" { (expression_statement "sVar2 = 0x20;" (assignment_expression "sVar2 = 0x20" identifier = number_literal) ;) (if_statement "if (0x1f < n) {\n      sVar2 = n;\n    }" if (parenthesized_expression "(0x1f < n)" ( (binary_expression "0x1f < n" number_literal < identifier) )) (compound_statement "{\n      sVar2 = n;\n    }" { (expression_statement "sVar2 = n;" (assignment_expression "sVar2 = n" identifier = identifier) ;) })) (expression_statement "pcVar1 = (char *)xmalloc(sVar2);" (assignment_expression "pcVar1 = (char *)xmalloc(sVar2)" identifier = (cast_expression "(char *)xmalloc(sVar2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(sVar2)" identifier (argument_list "(sVar2)" ( identifier ))))) ;) (expression_statement "s->b = pcVar1;" (assignment_expression "s->b = pcVar1" (field_expression "s->b" identifier -> field_identifier) = identifier) ;) (expression_statement "s->p = pcVar1;" (assignment_expression "s->p = pcVar1" (field_expression "s->p" identifier -> field_identifier) = identifier) ;) (expression_statement "s->e = pcVar1 + sVar2;" (assignment_expression "s->e = pcVar1 + sVar2" (field_expression "s->e" identifier -> field_identifier) = (binary_expression "pcVar1 + sVar2" identifier + identifier)) ;) (return_statement "return;" return ;) })) (if_statement "if (n <= (int)s->e - (int)s->p) {\n    return;\n  }" if (parenthesized_expression "(n <= (int)s->e - (int)s->p)" ( (binary_expression "n <= (int)s->e - (int)s->p" identifier <= (binary_expression "(int)s->e - (int)s->p" (cast_expression "(int)s->e" ( (type_descriptor "int" primitive_type) ) (field_expression "s->e" identifier -> field_identifier)) - (cast_expression "(int)s->p" ( (type_descriptor "int" primitive_type) ) (field_expression "s->p" identifier -> field_identifier)))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "iVar3 = (int)s->p - (int)pcVar1;" (assignment_expression "iVar3 = (int)s->p - (int)pcVar1" identifier = (binary_expression "(int)s->p - (int)pcVar1" (cast_expression "(int)s->p" ( (type_descriptor "int" primitive_type) ) (field_expression "s->p" identifier -> field_identifier)) - (cast_expression "(int)pcVar1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "sVar2 = (n + iVar3) * 2;" (assignment_expression "sVar2 = (n + iVar3) * 2" identifier = (binary_expression "(n + iVar3) * 2" (parenthesized_expression "(n + iVar3)" ( (binary_expression "n + iVar3" identifier + identifier) )) * number_literal)) ;) (expression_statement "pcVar1 = (char *)xrealloc(pcVar1,sVar2);" (assignment_expression "pcVar1 = (char *)xrealloc(pcVar1,sVar2)" identifier = (cast_expression "(char *)xrealloc(pcVar1,sVar2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xrealloc(pcVar1,sVar2)" identifier (argument_list "(pcVar1,sVar2)" ( identifier , identifier ))))) ;) (expression_statement "s->b = pcVar1;" (assignment_expression "s->b = pcVar1" (field_expression "s->b" identifier -> field_identifier) = identifier) ;) (expression_statement "s->p = pcVar1 + iVar3;" (assignment_expression "s->p = pcVar1 + iVar3" (field_expression "s->p" identifier -> field_identifier) = (binary_expression "pcVar1 + iVar3" identifier + identifier)) ;) (expression_statement "s->e = pcVar1 + sVar2;" (assignment_expression "s->e = pcVar1 + sVar2" (field_expression "s->e" identifier -> field_identifier) = (binary_expression "pcVar1 + sVar2" identifier + identifier)) ;) (return_statement "return;" return ;) })))
(translation_unit "void __regparm3 FUN_001e1dd0(int *param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }\n  if (param_2 <= param_1[2] - param_1[1]) {\n    return;\n  }\n  iVar3 = param_1[1] - iVar1;\n  iVar2 = (param_2 + iVar3) * 2;\n  iVar1 = FUN_001e4d50(iVar1,iVar2);\n  *param_1 = iVar1;\n  param_1[1] = iVar3 + iVar1;\n  param_1[2] = iVar1 + iVar2;\n  return;\n}\n\n" (function_definition "void __regparm3 FUN_001e1dd0(int *param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }\n  if (param_2 <= param_1[2] - param_1[1]) {\n    return;\n  }\n  iVar3 = param_1[1] - iVar1;\n  iVar2 = (param_2 + iVar3) * 2;\n  iVar1 = FUN_001e4d50(iVar1,iVar2);\n  *param_1 = iVar1;\n  param_1[1] = iVar3 + iVar1;\n  param_1[2] = iVar1 + iVar2;\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_001e1dd0(int *param_1,int param_2)" identifier (parameter_list "(int *param_1,int param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }\n  if (param_2 <= param_1[2] - param_1[1]) {\n    return;\n  }\n  iVar3 = param_1[1] - iVar1;\n  iVar2 = (param_2 + iVar3) * 2;\n  iVar1 = FUN_001e4d50(iVar1,iVar2);\n  *param_1 = iVar1;\n  param_1[1] = iVar3 + iVar1;\n  param_1[2] = iVar1 + iVar2;\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (iVar1 == 0) {\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }" { (expression_statement "iVar1 = 0x20;" (assignment_expression "iVar1 = 0x20" identifier = number_literal) ;) (if_statement "if (0x1f < param_2) {\n      iVar1 = param_2;\n    }" if (parenthesized_expression "(0x1f < param_2)" ( (binary_expression "0x1f < param_2" number_literal < identifier) )) (compound_statement "{\n      iVar1 = param_2;\n    }" { (expression_statement "iVar1 = param_2;" (assignment_expression "iVar1 = param_2" identifier = identifier) ;) })) (expression_statement "iVar2 = FUN_001e4cc0(iVar1);" (assignment_expression "iVar2 = FUN_001e4cc0(iVar1)" identifier = (call_expression "FUN_001e4cc0(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (expression_statement "*param_1 = iVar2;" (assignment_expression "*param_1 = iVar2" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1[1] = iVar2;" (assignment_expression "param_1[1] = iVar2" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "param_1[2] = iVar2 + iVar1;" (assignment_expression "param_1[2] = iVar2 + iVar1" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "iVar2 + iVar1" identifier + identifier)) ;) (return_statement "return;" return ;) })) (if_statement "if (param_2 <= param_1[2] - param_1[1]) {\n    return;\n  }" if (parenthesized_expression "(param_2 <= param_1[2] - param_1[1])" ( (binary_expression "param_2 <= param_1[2] - param_1[1]" identifier <= (binary_expression "param_1[2] - param_1[1]" (subscript_expression "param_1[2]" identifier [ number_literal ]) - (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "iVar3 = param_1[1] - iVar1;" (assignment_expression "iVar3 = param_1[1] - iVar1" identifier = (binary_expression "param_1[1] - iVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) - identifier)) ;) (expression_statement "iVar2 = (param_2 + iVar3) * 2;" (assignment_expression "iVar2 = (param_2 + iVar3) * 2" identifier = (binary_expression "(param_2 + iVar3) * 2" (parenthesized_expression "(param_2 + iVar3)" ( (binary_expression "param_2 + iVar3" identifier + identifier) )) * number_literal)) ;) (expression_statement "iVar1 = FUN_001e4d50(iVar1,iVar2);" (assignment_expression "iVar1 = FUN_001e4d50(iVar1,iVar2)" identifier = (call_expression "FUN_001e4d50(iVar1,iVar2)" identifier (argument_list "(iVar1,iVar2)" ( identifier , identifier )))) ;) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1[1] = iVar3 + iVar1;" (assignment_expression "param_1[1] = iVar3 + iVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "iVar3 + iVar1" identifier + identifier)) ;) (expression_statement "param_1[2] = iVar1 + iVar2;" (assignment_expression "param_1[2] = iVar1 + iVar2" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "iVar1 + iVar2" identifier + identifier)) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + IDENT)) ;) (return_statement return ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (binary_expression (subscript_expression IDENT [ LIT ]) - (subscript_expression IDENT [ LIT ]))) )) (compound_statement { (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) - IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_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 (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + IDENT)) ;) (return_statement return ;) })))
(function_definition "void __regparm3 FUN_001e1dd0(int *param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }\n  if (param_2 <= param_1[2] - param_1[1]) {\n    return;\n  }\n  iVar3 = param_1[1] - iVar1;\n  iVar2 = (param_2 + iVar3) * 2;\n  iVar1 = FUN_001e4d50(iVar1,iVar2);\n  *param_1 = iVar1;\n  param_1[1] = iVar3 + iVar1;\n  param_1[2] = iVar1 + iVar2;\n  return;\n}" (primitive_type "void") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_001e1dd0(int *param_1,int param_2)" (identifier "FUN_001e1dd0") (parameter_list "(int *param_1,int param_2)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }\n  if (param_2 <= param_1[2] - param_1[1]) {\n    return;\n  }\n  iVar3 = param_1[1] - iVar1;\n  iVar2 = (param_2 + iVar3) * 2;\n  iVar1 = FUN_001e4d50(iVar1,iVar2);\n  *param_1 = iVar1;\n  param_1[1] = iVar3 + iVar1;\n  param_1[2] = iVar1 + iVar2;\n  return;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" (identifier "iVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if (iVar1 == 0) {\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    iVar1 = 0x20;\n    if (0x1f < param_2) {\n      iVar1 = param_2;\n    }\n    iVar2 = FUN_001e4cc0(iVar1);\n    *param_1 = iVar2;\n    param_1[1] = iVar2;\n    param_1[2] = iVar2 + iVar1;\n    return;\n  }" ({ "{") (expression_statement "iVar1 = 0x20;" (assignment_expression "iVar1 = 0x20" (identifier "iVar1") (= "=") (number_literal "0x20")) (; ";")) (if_statement "if (0x1f < param_2) {\n      iVar1 = param_2;\n    }" (if "if") (parenthesized_expression "(0x1f < param_2)" (( "(") (binary_expression "0x1f < param_2" (number_literal "0x1f") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n      iVar1 = param_2;\n    }" ({ "{") (expression_statement "iVar1 = param_2;" (assignment_expression "iVar1 = param_2" (identifier "iVar1") (= "=") (identifier "param_2")) (; ";")) (} "}"))) (expression_statement "iVar2 = FUN_001e4cc0(iVar1);" (assignment_expression "iVar2 = FUN_001e4cc0(iVar1)" (identifier "iVar2") (= "=") (call_expression "FUN_001e4cc0(iVar1)" (identifier "FUN_001e4cc0") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (; ";")) (expression_statement "*param_1 = iVar2;" (assignment_expression "*param_1 = iVar2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "iVar2")) (; ";")) (expression_statement "param_1[1] = iVar2;" (assignment_expression "param_1[1] = iVar2" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "iVar2")) (; ";")) (expression_statement "param_1[2] = iVar2 + iVar1;" (assignment_expression "param_1[2] = iVar2 + iVar1" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "iVar2 + iVar1" (identifier "iVar2") (+ "+") (identifier "iVar1"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (if_statement "if (param_2 <= param_1[2] - param_1[1]) {\n    return;\n  }" (if "if") (parenthesized_expression "(param_2 <= param_1[2] - param_1[1])" (( "(") (binary_expression "param_2 <= param_1[2] - param_1[1]" (identifier "param_2") (<= "<=") (binary_expression "param_1[2] - param_1[1]" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (- "-") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "iVar3 = param_1[1] - iVar1;" (assignment_expression "iVar3 = param_1[1] - iVar1" (identifier "iVar3") (= "=") (binary_expression "param_1[1] - iVar1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (identifier "iVar1"))) (; ";")) (expression_statement "iVar2 = (param_2 + iVar3) * 2;" (assignment_expression "iVar2 = (param_2 + iVar3) * 2" (identifier "iVar2") (= "=") (binary_expression "(param_2 + iVar3) * 2" (parenthesized_expression "(param_2 + iVar3)" (( "(") (binary_expression "param_2 + iVar3" (identifier "param_2") (+ "+") (identifier "iVar3")) () ")")) (* "*") (number_literal "2"))) (; ";")) (expression_statement "iVar1 = FUN_001e4d50(iVar1,iVar2);" (assignment_expression "iVar1 = FUN_001e4d50(iVar1,iVar2)" (identifier "iVar1") (= "=") (call_expression "FUN_001e4d50(iVar1,iVar2)" (identifier "FUN_001e4d50") (argument_list "(iVar1,iVar2)" (( "(") (identifier "iVar1") (, ",") (identifier "iVar2") () ")")))) (; ";")) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "iVar1")) (; ";")) (expression_statement "param_1[1] = iVar3 + iVar1;" (assignment_expression "param_1[1] = iVar3 + iVar1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "iVar3 + iVar1" (identifier "iVar3") (+ "+") (identifier "iVar1"))) (; ";")) (expression_statement "param_1[2] = iVar1 + iVar2;" (assignment_expression "param_1[2] = iVar1 + iVar2" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "iVar1 + iVar2" (identifier "iVar1") (+ "+") (identifier "iVar2"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void __regparm3 function_1(type_1 *s,int var_2)

{
  char *var_1;
  size_t var_4;
  int var_5;
  
  var_1 = s->b;
  if (var_1 == (char *)0x0) {
    var_4 = 0x20;
    if (0x1f < var_2) {
      var_4 = var_2;
    }
    var_1 = (char *)var_3(var_4);
    s->b = var_1;
    s->p = var_1;
    s->e = var_1 + var_4;
    return;
  }
  if (var_2 <= (int)s->e - (int)s->p) {
    return;
  }
  var_5 = (int)s->p - (int)var_1;
  var_4 = (var_2 + var_5) * 2;
  var_1 = (char *)var_6(var_1,var_4);
  s->b = var_1;
  s->p = var_1 + var_5;
  s->e = var_1 + var_4;
  return;
}


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

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void __regparm3 MASKED(int *param_1,int param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar1 = *param_1;
  if (iVar1 == 0) {
    iVar1 = 0x20;
    if (0x1f < param_2) {
      iVar1 = param_2;
    }
    iVar2 = FUN_001e4cc0(iVar1);
    *param_1 = iVar2;
    param_1[1] = iVar2;
    param_1[2] = iVar2 + iVar1;
    return;
  }
  if (param_2 <= param_1[2] - param_1[1]) {
    return;
  }
  iVar3 = param_1[1] - iVar1;
  iVar2 = (param_2 + iVar3) * 2;
  iVar1 = FUN_001e4d50(iVar1,iVar2);
  *param_1 = iVar1;
  param_1[1] = iVar3 + iVar1;
  param_1[2] = iVar1 + iVar2;
  return;
}

