
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::wstring::_M_append(wchar_t const*, unsigned int) */

wstring * __thiscall std::wstring::_M_append(wstring *this,wchar_t *param_1,uint param_2)

{
  uint uVar1;
  uint uVar2;
  wstring *pwVar3;
  uint uVar4;
  
  uVar2 = *(uint *)(this + 4);
  pwVar3 = *(wstring **)this;
  uVar1 = uVar2 + param_2;
  if (pwVar3 == this + 8) {
    uVar4 = 3;
  }
  else {
    uVar4 = *(uint *)(this + 8);
  }
  if (uVar4 < uVar1) {
    _M_mutate(this,uVar2,0,param_1,param_2);
    pwVar3 = *(wstring **)this;
  }
  else if (param_2 != 0) {
    if (param_2 == 1) {
      *(wchar_t *)(pwVar3 + uVar2 * 4) = *param_1;
    }
    else {
      wmemcpy((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2);
      pwVar3 = *(wstring **)this;
    }
  }
  *(uint *)(this + 4) = uVar1;
  *(undefined4 *)(pwVar3 + uVar1 * 4) = 0;
  return this;
}



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

int * FUN_001ecc70(int *param_1,wchar_t *param_2,size_t param_3)

{
  uint uVar1;
  int iVar2;
  int *piVar3;
  uint uVar4;
  
  iVar2 = param_1[1];
  piVar3 = (int *)*param_1;
  uVar1 = iVar2 + param_3;
  if (piVar3 == param_1 + 2) {
    uVar4 = 3;
  }
  else {
    uVar4 = param_1[2];
  }
  if (uVar4 < uVar1) {
    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);
    piVar3 = (int *)*param_1;
  }
  else if (param_3 != 0) {
    if (param_3 == 1) {
      piVar3[iVar2] = *param_2;
    }
    else {
      wmemcpy(piVar3 + iVar2,param_2,param_3);
      piVar3 = (int *)*param_1;
    }
  }
  param_1[1] = uVar1;
  *(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;
  return param_1;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00035840
ADD EBX,0x1a2387
SUB ESP,0xc
MOV ESI,dword ptr [ESP + 0x20]
MOV EDX,dword ptr [ESP + 0x28]
MOV ECX,dword ptr [ESI + 0x4]
MOV EAX,dword ptr [ESI]
LEA EBP,[ESI + 0x8]
LEA EDI,[ECX + EDX*0x1]
CMP EAX,EBP
JZ 0x001eccf0
MOV EBP,dword ptr [ESI + 0x8]
CMP EDI,EBP
JA 0x001eccd8
TEST EDX,EDX
JZ 0x001eccbf
LEA ECX,[EAX + ECX*0x4]
CMP EDX,0x1
JZ 0x001ecd00
SUB ESP,0x4
PUSH EDX
PUSH dword ptr [ESP + 0x2c]
PUSH ECX
CALL 0x00029370
MOV EAX,dword ptr [ESI]
ADD ESP,0x10
MOV dword ptr [ESI + 0x4],EDI
MOV dword ptr [EAX + EDI*0x4],0x0
ADD ESP,0xc
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH EDX
PUSH dword ptr [ESP + 0x34]
PUSH 0x0
PUSH ECX
PUSH ESI
CALL 0x001eb0a0
MOV EAX,dword ptr [ESI]
ADD ESP,0x20
JMP 0x001eccbf
MOV EBP,0x3
JMP 0x001ecc9c
MOV EBX,dword ptr [ESP + 0x24]
MOV EDX,dword ptr [EBX]
MOV dword ptr [ECX],EDX
JMP 0x001eccbf
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint * FUN_001ecc70(int *param_1,wchar_t *param_2,size_t param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  iVar2 = param_1[1];\n  piVar3 = (int *)*param_1;\n  uVar1 = iVar2 + param_3;\n  if (piVar3 == param_1 + 2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;\n  return param_1;\n}\n\n" comment (function_definition "int * FUN_001ecc70(int *param_1,wchar_t *param_2,size_t param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  iVar2 = param_1[1];\n  piVar3 = (int *)*param_1;\n  uVar1 = iVar2 + param_3;\n  if (piVar3 == param_1 + 2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;\n  return param_1;\n}" primitive_type (pointer_declarator "* FUN_001ecc70(int *param_1,wchar_t *param_2,size_t param_3)" * (function_declarator "FUN_001ecc70(int *param_1,wchar_t *param_2,size_t param_3)" identifier (parameter_list "(int *param_1,wchar_t *param_2,size_t param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "wchar_t *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) )))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  iVar2 = param_1[1];\n  piVar3 = (int *)*param_1;\n  uVar1 = iVar2 + param_3;\n  if (piVar3 == param_1 + 2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;\n  return param_1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "iVar2 = param_1[1];" (assignment_expression "iVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "piVar3 = (int *)*param_1;" (assignment_expression "piVar3 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "uVar1 = iVar2 + param_3;" (assignment_expression "uVar1 = iVar2 + param_3" identifier = (binary_expression "iVar2 + param_3" identifier + identifier)) ;) (if_statement "if (piVar3 == param_1 + 2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }" if (parenthesized_expression "(piVar3 == param_1 + 2)" ( (binary_expression "piVar3 == param_1 + 2" identifier == (binary_expression "param_1 + 2" identifier + number_literal)) )) (compound_statement "{\n    uVar4 = 3;\n  }" { (expression_statement "uVar4 = 3;" (assignment_expression "uVar4 = 3" identifier = number_literal) ;) }) (else_clause "else {\n    uVar4 = param_1[2];\n  }" else (compound_statement "{\n    uVar4 = param_1[2];\n  }" { (expression_statement "uVar4 = param_1[2];" (assignment_expression "uVar4 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar4 < uVar1) {\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }" if (parenthesized_expression "(uVar4 < uVar1)" ( (binary_expression "uVar4 < uVar1" identifier < identifier) )) (compound_statement "{\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }" { (expression_statement "FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);" (call_expression "FUN_001eb0a0(param_1,iVar2,0,param_2,param_3)" identifier (argument_list "(param_1,iVar2,0,param_2,param_3)" ( identifier , identifier , number_literal , identifier , identifier ))) ;) (expression_statement "piVar3 = (int *)*param_1;" (assignment_expression "piVar3 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }" else (if_statement "if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }" { (if_statement "if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n      piVar3[iVar2] = *param_2;\n    }" { (expression_statement "piVar3[iVar2] = *param_2;" (assignment_expression "piVar3[iVar2] = *param_2" (subscript_expression "piVar3[iVar2]" identifier [ identifier ]) = (pointer_expression "*param_2" * identifier)) ;) }) (else_clause "else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }" else (compound_statement "{\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }" { (expression_statement "wmemcpy(piVar3 + iVar2,param_2,param_3);" (call_expression "wmemcpy(piVar3 + iVar2,param_2,param_3)" identifier (argument_list "(piVar3 + iVar2,param_2,param_3)" ( (binary_expression "piVar3 + iVar2" identifier + identifier) , identifier , identifier ))) ;) (expression_statement "piVar3 = (int *)*param_1;" (assignment_expression "piVar3 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })))) (expression_statement "param_1[1] = uVar1;" (assignment_expression "param_1[1] = uVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;" (assignment_expression "*(undefined4 *)((int)piVar3 + uVar1 * 4) = 0" (pointer_expression "*(undefined4 *)((int)piVar3 + uVar1 * 4)" * (cast_expression "(undefined4 *)((int)piVar3 + uVar1 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar3 + uVar1 * 4)" ( (binary_expression "(int)piVar3 + uVar1 * 4" (cast_expression "(int)piVar3" ( (type_descriptor "int" primitive_type) ) identifier) + (binary_expression "uVar1 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::wstring::_M_append(wchar_t const*, unsigned int) */\n\nwstring * __thiscall std::wstring::_M_append(wstring *this,wchar_t *param_1,uint param_2)\n\n{\n  uint uVar1;\n  uint uVar2;\n  wstring *pwVar3;\n  uint uVar4;\n  \n  uVar2 = *(uint *)(this + 4);\n  pwVar3 = *(wstring **)this;\n  uVar1 = uVar2 + param_2;\n  if (pwVar3 == this + 8) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = *(uint *)(this + 8);\n  }\n  if (uVar4 < uVar1) {\n    _M_mutate(this,uVar2,0,param_1,param_2);\n    pwVar3 = *(wstring **)this;\n  }\n  else if (param_2 != 0) {\n    if (param_2 == 1) {\n      *(wchar_t *)(pwVar3 + uVar2 * 4) = *param_1;\n    }\n    else {\n      wmemcpy((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2);\n      pwVar3 = *(wstring **)this;\n    }\n  }\n  *(uint *)(this + 4) = uVar1;\n  *(undefined4 *)(pwVar3 + uVar1 * 4) = 0;\n  return this;\n}\n\n" comment comment (ERROR "wstring * __thiscall std::wstring::_M_append(wstring *this,wchar_t *param_1,uint param_2)" (binary_expression "wstring * __thiscall std::wstring::_M_append(wstring *this" (binary_expression "wstring * __thiscall" identifier * identifier) (ERROR "std::wstring::_M_append(wstring" identifier : : identifier : : identifier ( identifier) * identifier) , type_identifier (pointer_declarator "*param_1" * identifier) , identifier identifier )) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  wstring *pwVar3;\n  uint uVar4;\n  \n  uVar2 = *(uint *)(this + 4);\n  pwVar3 = *(wstring **)this;\n  uVar1 = uVar2 + param_2;\n  if (pwVar3 == this + 8) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = *(uint *)(this + 8);\n  }\n  if (uVar4 < uVar1) {\n    _M_mutate(this,uVar2,0,param_1,param_2);\n    pwVar3 = *(wstring **)this;\n  }\n  else if (param_2 != 0) {\n    if (param_2 == 1) {\n      *(wchar_t *)(pwVar3 + uVar2 * 4) = *param_1;\n    }\n    else {\n      wmemcpy((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2);\n      pwVar3 = *(wstring **)this;\n    }\n  }\n  *(uint *)(this + 4) = uVar1;\n  *(undefined4 *)(pwVar3 + uVar1 * 4) = 0;\n  return this;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "wstring *pwVar3;" type_identifier (pointer_declarator "*pwVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "uVar2 = *(uint *)(this + 4);" (assignment_expression "uVar2 = *(uint *)(this + 4)" identifier = (pointer_expression "*(uint *)(this + 4)" * (cast_expression "(uint *)(this + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) ))))) ;) (expression_statement "pwVar3 = *(wstring **)this;" (assignment_expression "pwVar3 = *(wstring **)this" identifier = (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "uVar1 = uVar2 + param_2;" (assignment_expression "uVar1 = uVar2 + param_2" identifier = (binary_expression "uVar2 + param_2" identifier + identifier)) ;) (if_statement "if (pwVar3 == this + 8) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = *(uint *)(this + 8);\n  }" if (parenthesized_expression "(pwVar3 == this + 8)" ( (binary_expression "pwVar3 == this + 8" identifier == (binary_expression "this + 8" identifier + number_literal)) )) (compound_statement "{\n    uVar4 = 3;\n  }" { (expression_statement "uVar4 = 3;" (assignment_expression "uVar4 = 3" identifier = number_literal) ;) }) (else_clause "else {\n    uVar4 = *(uint *)(this + 8);\n  }" else (compound_statement "{\n    uVar4 = *(uint *)(this + 8);\n  }" { (expression_statement "uVar4 = *(uint *)(this + 8);" (assignment_expression "uVar4 = *(uint *)(this + 8)" identifier = (pointer_expression "*(uint *)(this + 8)" * (cast_expression "(uint *)(this + 8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))) ;) }))) (if_statement "if (uVar4 < uVar1) {\n    _M_mutate(this,uVar2,0,param_1,param_2);\n    pwVar3 = *(wstring **)this;\n  }\n  else if (param_2 != 0) {\n    if (param_2 == 1) {\n      *(wchar_t *)(pwVar3 + uVar2 * 4) = *param_1;\n    }\n    else {\n      wmemcpy((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2);\n      pwVar3 = *(wstring **)this;\n    }\n  }" if (parenthesized_expression "(uVar4 < uVar1)" ( (binary_expression "uVar4 < uVar1" identifier < identifier) )) (compound_statement "{\n    _M_mutate(this,uVar2,0,param_1,param_2);\n    pwVar3 = *(wstring **)this;\n  }" { (expression_statement "_M_mutate(this,uVar2,0,param_1,param_2);" (call_expression "_M_mutate(this,uVar2,0,param_1,param_2)" identifier (argument_list "(this,uVar2,0,param_1,param_2)" ( identifier , identifier , number_literal , identifier , identifier ))) ;) (expression_statement "pwVar3 = *(wstring **)this;" (assignment_expression "pwVar3 = *(wstring **)this" identifier = (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }) (else_clause "else if (param_2 != 0) {\n    if (param_2 == 1) {\n      *(wchar_t *)(pwVar3 + uVar2 * 4) = *param_1;\n    }\n    else {\n      wmemcpy((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2);\n      pwVar3 = *(wstring **)this;\n    }\n  }" else (if_statement "if (param_2 != 0) {\n    if (param_2 == 1) {\n      *(wchar_t *)(pwVar3 + uVar2 * 4) = *param_1;\n    }\n    else {\n      wmemcpy((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2);\n      pwVar3 = *(wstring **)this;\n    }\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_2 == 1) {\n      *(wchar_t *)(pwVar3 + uVar2 * 4) = *param_1;\n    }\n    else {\n      wmemcpy((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2);\n      pwVar3 = *(wstring **)this;\n    }\n  }" { (if_statement "if (param_2 == 1) {\n      *(wchar_t *)(pwVar3 + uVar2 * 4) = *param_1;\n    }\n    else {\n      wmemcpy((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2);\n      pwVar3 = *(wstring **)this;\n    }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n      *(wchar_t *)(pwVar3 + uVar2 * 4) = *param_1;\n    }" { (expression_statement "*(wchar_t *)(pwVar3 + uVar2 * 4) = *param_1;" (assignment_expression "*(wchar_t *)(pwVar3 + uVar2 * 4) = *param_1" (pointer_expression "*(wchar_t *)(pwVar3 + uVar2 * 4)" * (cast_expression "(wchar_t *)(pwVar3 + uVar2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar3 + uVar2 * 4)" ( (binary_expression "pwVar3 + uVar2 * 4" identifier + (binary_expression "uVar2 * 4" identifier * number_literal)) )))) = (pointer_expression "*param_1" * identifier)) ;) }) (else_clause "else {\n      wmemcpy((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2);\n      pwVar3 = *(wstring **)this;\n    }" else (compound_statement "{\n      wmemcpy((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2);\n      pwVar3 = *(wstring **)this;\n    }" { (expression_statement "wmemcpy((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2);" (call_expression "wmemcpy((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2)" identifier (argument_list "((wchar_t *)(pwVar3 + uVar2 * 4),param_1,param_2)" ( (cast_expression "(wchar_t *)(pwVar3 + uVar2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar3 + uVar2 * 4)" ( (binary_expression "pwVar3 + uVar2 * 4" identifier + (binary_expression "uVar2 * 4" identifier * number_literal)) ))) , identifier , identifier ))) ;) (expression_statement "pwVar3 = *(wstring **)this;" (assignment_expression "pwVar3 = *(wstring **)this" identifier = (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }))) })))) (expression_statement "*(uint *)(this + 4) = uVar1;" (assignment_expression "*(uint *)(this + 4) = uVar1" (pointer_expression "*(uint *)(this + 4)" * (cast_expression "(uint *)(this + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(pwVar3 + uVar1 * 4) = 0;" (assignment_expression "*(undefined4 *)(pwVar3 + uVar1 * 4) = 0" (pointer_expression "*(undefined4 *)(pwVar3 + uVar1 * 4)" * (cast_expression "(undefined4 *)(pwVar3 + uVar1 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar3 + uVar1 * 4)" ( (binary_expression "pwVar3 + uVar1 * 4" identifier + (binary_expression "uVar1 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return this;" return identifier ;) }))
(translation_unit "int * FUN_001ecc70(int *param_1,wchar_t *param_2,size_t param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  iVar2 = param_1[1];\n  piVar3 = (int *)*param_1;\n  uVar1 = iVar2 + param_3;\n  if (piVar3 == param_1 + 2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;\n  return param_1;\n}\n\n" (function_definition "int * FUN_001ecc70(int *param_1,wchar_t *param_2,size_t param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  iVar2 = param_1[1];\n  piVar3 = (int *)*param_1;\n  uVar1 = iVar2 + param_3;\n  if (piVar3 == param_1 + 2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;\n  return param_1;\n}" primitive_type (pointer_declarator "* FUN_001ecc70(int *param_1,wchar_t *param_2,size_t param_3)" * (function_declarator "FUN_001ecc70(int *param_1,wchar_t *param_2,size_t param_3)" identifier (parameter_list "(int *param_1,wchar_t *param_2,size_t param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "wchar_t *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) )))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  iVar2 = param_1[1];\n  piVar3 = (int *)*param_1;\n  uVar1 = iVar2 + param_3;\n  if (piVar3 == param_1 + 2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;\n  return param_1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "iVar2 = param_1[1];" (assignment_expression "iVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "piVar3 = (int *)*param_1;" (assignment_expression "piVar3 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "uVar1 = iVar2 + param_3;" (assignment_expression "uVar1 = iVar2 + param_3" identifier = (binary_expression "iVar2 + param_3" identifier + identifier)) ;) (if_statement "if (piVar3 == param_1 + 2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }" if (parenthesized_expression "(piVar3 == param_1 + 2)" ( (binary_expression "piVar3 == param_1 + 2" identifier == (binary_expression "param_1 + 2" identifier + number_literal)) )) (compound_statement "{\n    uVar4 = 3;\n  }" { (expression_statement "uVar4 = 3;" (assignment_expression "uVar4 = 3" identifier = number_literal) ;) }) (else_clause "else {\n    uVar4 = param_1[2];\n  }" else (compound_statement "{\n    uVar4 = param_1[2];\n  }" { (expression_statement "uVar4 = param_1[2];" (assignment_expression "uVar4 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar4 < uVar1) {\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }" if (parenthesized_expression "(uVar4 < uVar1)" ( (binary_expression "uVar4 < uVar1" identifier < identifier) )) (compound_statement "{\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }" { (expression_statement "FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);" (call_expression "FUN_001eb0a0(param_1,iVar2,0,param_2,param_3)" identifier (argument_list "(param_1,iVar2,0,param_2,param_3)" ( identifier , identifier , number_literal , identifier , identifier ))) ;) (expression_statement "piVar3 = (int *)*param_1;" (assignment_expression "piVar3 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }" else (if_statement "if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }" { (if_statement "if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n      piVar3[iVar2] = *param_2;\n    }" { (expression_statement "piVar3[iVar2] = *param_2;" (assignment_expression "piVar3[iVar2] = *param_2" (subscript_expression "piVar3[iVar2]" identifier [ identifier ]) = (pointer_expression "*param_2" * identifier)) ;) }) (else_clause "else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }" else (compound_statement "{\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }" { (expression_statement "wmemcpy(piVar3 + iVar2,param_2,param_3);" (call_expression "wmemcpy(piVar3 + iVar2,param_2,param_3)" identifier (argument_list "(piVar3 + iVar2,param_2,param_3)" ( (binary_expression "piVar3 + iVar2" identifier + identifier) , identifier , identifier ))) ;) (expression_statement "piVar3 = (int *)*param_1;" (assignment_expression "piVar3 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })))) (expression_statement "param_1[1] = uVar1;" (assignment_expression "param_1[1] = uVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;" (assignment_expression "*(undefined4 *)((int)piVar3 + uVar1 * 4) = 0" (pointer_expression "*(undefined4 *)((int)piVar3 + uVar1 * 4)" * (cast_expression "(undefined4 *)((int)piVar3 + uVar1 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar3 + uVar1 * 4)" ( (binary_expression "(int)piVar3 + uVar1 * 4" (cast_expression "(int)piVar3" ( (type_descriptor "int" primitive_type) ) identifier) + (binary_expression "uVar1 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return param_1;" return 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 IDENT) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (binary_expression IDENT + LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (pointer_expression * IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + IDENT) , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }))) })))) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (binary_expression IDENT * LIT)) )))) = LIT) ;) (return_statement return IDENT ;) })))
(function_definition "int * FUN_001ecc70(int *param_1,wchar_t *param_2,size_t param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  iVar2 = param_1[1];\n  piVar3 = (int *)*param_1;\n  uVar1 = iVar2 + param_3;\n  if (piVar3 == param_1 + 2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;\n  return param_1;\n}" (primitive_type "int") (pointer_declarator "* FUN_001ecc70(int *param_1,wchar_t *param_2,size_t param_3)" (* "*") (function_declarator "FUN_001ecc70(int *param_1,wchar_t *param_2,size_t param_3)" (identifier "FUN_001ecc70") (parameter_list "(int *param_1,wchar_t *param_2,size_t param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "wchar_t *param_2" (type_identifier "wchar_t") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "size_t param_3" (primitive_type "size_t") (identifier "param_3")) () ")")))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  iVar2 = param_1[1];\n  piVar3 = (int *)*param_1;\n  uVar1 = iVar2 + param_3;\n  if (piVar3 == param_1 + 2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;\n  return param_1;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (expression_statement "iVar2 = param_1[1];" (assignment_expression "iVar2 = param_1[1]" (identifier "iVar2") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "piVar3 = (int *)*param_1;" (assignment_expression "piVar3 = (int *)*param_1" (identifier "piVar3") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "uVar1 = iVar2 + param_3;" (assignment_expression "uVar1 = iVar2 + param_3" (identifier "uVar1") (= "=") (binary_expression "iVar2 + param_3" (identifier "iVar2") (+ "+") (identifier "param_3"))) (; ";")) (if_statement "if (piVar3 == param_1 + 2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }" (if "if") (parenthesized_expression "(piVar3 == param_1 + 2)" (( "(") (binary_expression "piVar3 == param_1 + 2" (identifier "piVar3") (== "==") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2"))) () ")")) (compound_statement "{\n    uVar4 = 3;\n  }" ({ "{") (expression_statement "uVar4 = 3;" (assignment_expression "uVar4 = 3" (identifier "uVar4") (= "=") (number_literal "3")) (; ";")) (} "}")) (else_clause "else {\n    uVar4 = param_1[2];\n  }" (else "else") (compound_statement "{\n    uVar4 = param_1[2];\n  }" ({ "{") (expression_statement "uVar4 = param_1[2];" (assignment_expression "uVar4 = param_1[2]" (identifier "uVar4") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (} "}")))) (if_statement "if (uVar4 < uVar1) {\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }" (if "if") (parenthesized_expression "(uVar4 < uVar1)" (( "(") (binary_expression "uVar4 < uVar1" (identifier "uVar4") (< "<") (identifier "uVar1")) () ")")) (compound_statement "{\n    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);\n    piVar3 = (int *)*param_1;\n  }" ({ "{") (expression_statement "FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);" (call_expression "FUN_001eb0a0(param_1,iVar2,0,param_2,param_3)" (identifier "FUN_001eb0a0") (argument_list "(param_1,iVar2,0,param_2,param_3)" (( "(") (identifier "param_1") (, ",") (identifier "iVar2") (, ",") (number_literal "0") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")"))) (; ";")) (expression_statement "piVar3 = (int *)*param_1;" (assignment_expression "piVar3 = (int *)*param_1" (identifier "piVar3") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }" (else "else") (if_statement "if (param_3 != 0) {\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }" (if "if") (parenthesized_expression "(param_3 != 0)" (( "(") (binary_expression "param_3 != 0" (identifier "param_3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }\n  }" ({ "{") (if_statement "if (param_3 == 1) {\n      piVar3[iVar2] = *param_2;\n    }\n    else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }" (if "if") (parenthesized_expression "(param_3 == 1)" (( "(") (binary_expression "param_3 == 1" (identifier "param_3") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      piVar3[iVar2] = *param_2;\n    }" ({ "{") (expression_statement "piVar3[iVar2] = *param_2;" (assignment_expression "piVar3[iVar2] = *param_2" (subscript_expression "piVar3[iVar2]" (identifier "piVar3") ([ "[") (identifier "iVar2") (] "]")) (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (} "}")) (else_clause "else {\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }" (else "else") (compound_statement "{\n      wmemcpy(piVar3 + iVar2,param_2,param_3);\n      piVar3 = (int *)*param_1;\n    }" ({ "{") (expression_statement "wmemcpy(piVar3 + iVar2,param_2,param_3);" (call_expression "wmemcpy(piVar3 + iVar2,param_2,param_3)" (identifier "wmemcpy") (argument_list "(piVar3 + iVar2,param_2,param_3)" (( "(") (binary_expression "piVar3 + iVar2" (identifier "piVar3") (+ "+") (identifier "iVar2")) (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")"))) (; ";")) (expression_statement "piVar3 = (int *)*param_1;" (assignment_expression "piVar3 = (int *)*param_1" (identifier "piVar3") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")))) (} "}"))))) (expression_statement "param_1[1] = uVar1;" (assignment_expression "param_1[1] = uVar1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "uVar1")) (; ";")) (expression_statement "*(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;" (assignment_expression "*(undefined4 *)((int)piVar3 + uVar1 * 4) = 0" (pointer_expression "*(undefined4 *)((int)piVar3 + uVar1 * 4)" (* "*") (cast_expression "(undefined4 *)((int)piVar3 + uVar1 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)piVar3 + uVar1 * 4)" (( "(") (binary_expression "(int)piVar3 + uVar1 * 4" (cast_expression "(int)piVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar3")) (+ "+") (binary_expression "uVar1 * 4" (identifier "uVar1") (* "*") (number_literal "4"))) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::wstring::_M_append(wchar_t const*, unsigned int) */

type_2 * __thiscall std::type_2::_M_append(type_2 *var_1,type_3 *param_1,type_1 var_3)

{
  type_1 var_6;
  type_1 var_2;
  type_2 *var_4;
  type_1 var_5;
  
  var_2 = *(type_1 *)(var_1 + 4);
  var_4 = *(type_2 **)var_1;
  var_6 = var_2 + var_3;
  if (var_4 == var_1 + 8) {
    var_5 = 3;
  }
  else {
    var_5 = *(type_1 *)(var_1 + 8);
  }
  if (var_5 < var_6) {
    var_7(var_1,var_2,0,param_1,var_3);
    var_4 = *(type_2 **)var_1;
  }
  else if (var_3 != 0) {
    if (var_3 == 1) {
      *(type_3 *)(var_4 + var_2 * 4) = *param_1;
    }
    else {
      var_8((type_3 *)(var_4 + var_2 * 4),param_1,var_3);
      var_4 = *(type_2 **)var_1;
    }
  }
  *(type_1 *)(var_1 + 4) = var_6;
  *(type_4 *)(var_4 + var_6 * 4) = 0;
  return var_1;
}


(translation_unit (function_definition type: (primitive_type) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier))))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (number_literal) (identifier) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier)))))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (pointer_expression argument: (identifier))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)) (identifier) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier)))))))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (binary_expression left: (identifier) right: (number_literal)))))) right: (number_literal))) (return_statement (identifier)))))

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

int * MASKED(int *param_1,wchar_t *param_2,size_t param_3)

{
  uint uVar1;
  int iVar2;
  int *piVar3;
  uint uVar4;
  
  iVar2 = param_1[1];
  piVar3 = (int *)*param_1;
  uVar1 = iVar2 + param_3;
  if (piVar3 == param_1 + 2) {
    uVar4 = 3;
  }
  else {
    uVar4 = param_1[2];
  }
  if (uVar4 < uVar1) {
    FUN_001eb0a0(param_1,iVar2,0,param_2,param_3);
    piVar3 = (int *)*param_1;
  }
  else if (param_3 != 0) {
    if (param_3 == 1) {
      piVar3[iVar2] = *param_2;
    }
    else {
      wmemcpy(piVar3 + iVar2,param_2,param_3);
      piVar3 = (int *)*param_1;
    }
  }
  param_1[1] = uVar1;
  *(undefined4 *)((int)piVar3 + uVar1 * 4) = 0;
  return param_1;
}

