
/* std::wstring::append(wchar_t const*, unsigned int) */

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

{
  int iVar1;
  wchar_t *pwVar2;
  undefined4 *puVar3;
  wstring *pwVar4;
  uint uVar5;
  
  if (param_2 == 0) {
    return this;
  }
  pwVar2 = *(wchar_t **)this;
  uVar5 = param_2 + *(int *)(pwVar2 + -6);
  if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {
    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);
    (*(code *)PTR___throw_length_error_00432480)();
    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);
    return pwVar4;
  }
  if (*(uint *)(pwVar2 + -4) < uVar5) {
LAB_00358e24:
    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {
      reserve(this,uVar5);
      iVar1 = *(int *)this;
      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));
      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);
      goto joined_r0x00358e74;
    }
    reserve(this,uVar5);
    iVar1 = *(int *)this;
  }
  else {
    SYNC(0);
    if (0 < *(int *)(pwVar2 + -2)) {
      pwVar2 = *(wchar_t **)this;
      goto LAB_00358e24;
    }
    iVar1 = *(int *)this;
  }
  puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);
joined_r0x00358e74:
  if (param_2 == 1) {
    *puVar3 = *(undefined4 *)param_1;
  }
  else {
    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);
    iVar1 = *(int *)this;
  }
  if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {
    *(undefined4 *)(iVar1 + -4) = 0;
    *(uint *)(iVar1 + -0xc) = uVar5;
    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;
  }
  return this;
}



/* std::wstring::append(wchar_t const*, unsigned int) */

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

{
  int iVar1;
  wchar_t *pwVar2;
  undefined4 *puVar3;
  wstring *pwVar4;
  uint uVar5;
  
  if (param_2 == 0) {
    return this;
  }
  pwVar2 = *(wchar_t **)this;
  uVar5 = param_2 + *(int *)(pwVar2 + -6);
  if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {
    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);
    (*(code *)PTR___throw_length_error_00432480)();
    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);
    return pwVar4;
  }
  if (*(uint *)(pwVar2 + -4) < uVar5) {
LAB_00358e24:
    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {
      reserve(this,uVar5);
      iVar1 = *(int *)this;
      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));
      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);
      goto joined_r0x00358e74;
    }
    reserve(this,uVar5);
    iVar1 = *(int *)this;
  }
  else {
    SYNC(0);
    if (0 < *(int *)(pwVar2 + -2)) {
      pwVar2 = *(wchar_t **)this;
      goto LAB_00358e24;
    }
    iVar1 = *(int *)this;
  }
  puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);
joined_r0x00358e74:
  if (param_2 == 1) {
    *puVar3 = *(undefined4 *)param_1;
  }
  else {
    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);
    iVar1 = *(int *)this;
  }
  if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {
    *(undefined4 *)(iVar1 + -4) = 0;
    *(uint *)(iVar1 + -0xc) = uVar5;
    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;
  }
  return this;
}


lui gp,0xe
addiu gp,gp,0x1408
addu gp,gp,t9
addiu sp,sp,-0x28
sw gp,0x10(sp)
sw s0,0x18(sp)
or s0,a0,zero
sw ra,0x24(sp)
sw s2,0x20(sp)
beq a2,zero,0x00358ea0
_sw s1,0x1c(sp)
lw v1,0x0(a0)
lui v0,0xfff
ori v0,v0,0xfffe
lw s1,-0xc(v1)
subu v0,v0,s1
sltu v0,v0,a2
bne v0,zero,0x00358f30
_addu s1,a2,s1
lw v0,-0x8(v1)
sltu v0,v0,s1
beq v0,zero,0x00358efc
_or s2,a1,zero
sltu v0,s2,v1
bne v0,zero,0x00358e4c
_lw t9,-0x678c(gp)
lw v0,-0xc(v1)
sll v0,v0,0x2
addu v0,v1,v0
sltu v0,v0,s2
beq v0,zero,0x00358ebc
_or a1,s1,zero
lw t9,-0x678c(gp)
or a1,s1,zero
sw a2,0x30(sp)
bal 0x003589e8
_or a0,s0,zero
lw gp,0x10(sp)
lw v0,0x0(s0)
lw a2,0x30(sp)
lw a0,-0xc(v0)
li v1,0x1
sll a0,a0,0x2
beq a2,v1,0x00358ef0
_addu a0,v0,a0
lw t9,-0x39a4(gp)
jalr t9
_or a1,s2,zero
lw gp,0x10(sp)
lw v0,0x0(s0)
lw v1,-0x7f04(gp)
addiu a0,v0,-0xc
bne a0,v1,0x00358f1c
_sll v1,s1,0x2
lw ra,0x24(sp)
or v0,s0,zero
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x28
or a0,s0,zero
sw a2,0x30(sp)
bal 0x003589e8
_subu s2,s2,v1
li v1,0x1
lw v0,0x0(s0)
lw a2,0x30(sp)
lw gp,0x10(sp)
addu s2,v0,s2
lw a0,-0xc(v0)
sll a0,a0,0x2
bne a2,v1,0x00358e7c
_addu a0,v0,a0
lw v1,0x0(s2)
b 0x00358e90
_sw v1,0x0(a0)
lw v0,-0x4(v1)
sync 0x0
blez v0,0x00358f14
_nop
b 0x00358e24
_lw v1,0x0(a0)
b 0x00358e68
_lw v0,0x0(a0)
sw zero,-0x4(v0)
sw s1,-0xc(v0)
addu v0,v0,v1
b 0x00358ea0
_sw zero,0x0(v0)
lw a0,-0x7e1c(gp)
lw t9,-0x7d50(gp)
jalr t9
_addiu a0,a0,-0x6240
(translation_unit "/* std::wstring::append(wchar_t const*, unsigned int) */\n\nwstring * __thiscall std::wstring::append(wstring *this,wchar_t *param_1,uint param_2)\n\n{\n  int iVar1;\n  wchar_t *pwVar2;\n  undefined4 *puVar3;\n  wstring *pwVar4;\n  uint uVar5;\n  \n  if (param_2 == 0) {\n    return this;\n  }\n  pwVar2 = *(wchar_t **)this;\n  uVar5 = param_2 + *(int *)(pwVar2 + -6);\n  if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }\n  if (*(uint *)(pwVar2 + -4) < uVar5) {\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }\n  else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }\n  puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\njoined_r0x00358e74:\n  if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }\n  if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }\n  return this;\n}\n\n" comment (ERROR "wstring * __thiscall std::wstring::append(wstring *this,wchar_t *param_1,uint param_2)" (binary_expression "wstring * __thiscall std::wstring::append(wstring *this" (binary_expression "wstring * __thiscall" identifier * identifier) (ERROR "std::wstring::append(wstring" identifier : : identifier : : identifier ( identifier) * identifier) , type_identifier (pointer_declarator "*param_1" * identifier) , identifier identifier )) (compound_statement "{\n  int iVar1;\n  wchar_t *pwVar2;\n  undefined4 *puVar3;\n  wstring *pwVar4;\n  uint uVar5;\n  \n  if (param_2 == 0) {\n    return this;\n  }\n  pwVar2 = *(wchar_t **)this;\n  uVar5 = param_2 + *(int *)(pwVar2 + -6);\n  if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }\n  if (*(uint *)(pwVar2 + -4) < uVar5) {\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }\n  else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }\n  puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\njoined_r0x00358e74:\n  if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }\n  if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }\n  return this;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "wstring *pwVar4;" type_identifier (pointer_declarator "*pwVar4" * identifier) ;) (declaration "uint uVar5;" type_identifier identifier ;) (if_statement "if (param_2 == 0) {\n    return this;\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    return this;\n  }" { (return_statement "return this;" return identifier ;) })) (expression_statement "pwVar2 = *(wchar_t **)this;" (assignment_expression "pwVar2 = *(wchar_t **)this" identifier = (pointer_expression "*(wchar_t **)this" * (cast_expression "(wchar_t **)this" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "uVar5 = param_2 + *(int *)(pwVar2 + -6);" (assignment_expression "uVar5 = param_2 + *(int *)(pwVar2 + -6)" identifier = (binary_expression "param_2 + *(int *)(pwVar2 + -6)" identifier + (pointer_expression "*(int *)(pwVar2 + -6)" * (cast_expression "(int *)(pwVar2 + -6)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -6)" ( (binary_expression "pwVar2 + -6" identifier + number_literal) )))))) ;) (if_statement "if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }" if (parenthesized_expression "(0xffffffeU - *(int *)(pwVar2 + -6) < param_2)" ( (binary_expression "0xffffffeU - *(int *)(pwVar2 + -6) < param_2" (binary_expression "0xffffffeU - *(int *)(pwVar2 + -6)" number_literal - (pointer_expression "*(int *)(pwVar2 + -6)" * (cast_expression "(int *)(pwVar2 + -6)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -6)" ( (binary_expression "pwVar2 + -6" identifier + number_literal) ))))) < identifier) )) (compound_statement "{\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }" { (expression_statement "pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);" (assignment_expression "pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240)" identifier = (cast_expression "(wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240)" ( (type_descriptor "wstring *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_s_alize_xindex_004323b4 + -0x6240)" ( (binary_expression "PTR_s_alize_xindex_004323b4 + -0x6240" identifier + number_literal) )))) ;) (expression_statement "(*(code *)PTR___throw_length_error_00432480)();" (call_expression "(*(code *)PTR___throw_length_error_00432480)()" (parenthesized_expression "(*(code *)PTR___throw_length_error_00432480)" ( (pointer_expression "*(code *)PTR___throw_length_error_00432480" * (cast_expression "(code *)PTR___throw_length_error_00432480" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "pwVar4 = (wstring *)append(pwVar4,param_1,param_2);" (assignment_expression "pwVar4 = (wstring *)append(pwVar4,param_1,param_2)" identifier = (cast_expression "(wstring *)append(pwVar4,param_1,param_2)" ( (type_descriptor "wstring *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "append(pwVar4,param_1,param_2)" identifier (argument_list "(pwVar4,param_1,param_2)" ( identifier , identifier , identifier ))))) ;) (return_statement "return pwVar4;" return identifier ;) })) (if_statement "if (*(uint *)(pwVar2 + -4) < uVar5) {\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }\n  else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }" if (parenthesized_expression "(*(uint *)(pwVar2 + -4) < uVar5)" ( (binary_expression "*(uint *)(pwVar2 + -4) < uVar5" (pointer_expression "*(uint *)(pwVar2 + -4)" * (cast_expression "(uint *)(pwVar2 + -4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -4)" ( (binary_expression "pwVar2 + -4" identifier + number_literal) )))) < identifier) )) (compound_statement "{\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }" { (labeled_statement "LAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }" statement_identifier : (if_statement "if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }" if (parenthesized_expression "((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2))" ( (binary_expression "(pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)" (parenthesized_expression "(pwVar2 <= param_1)" ( (binary_expression "pwVar2 <= param_1" identifier <= identifier) )) && (parenthesized_expression "(param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)" ( (binary_expression "param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2" identifier <= (binary_expression "pwVar2 + *(int *)(pwVar2 + -6) * 2" identifier + (binary_expression "*(int *)(pwVar2 + -6) * 2" (pointer_expression "*(int *)(pwVar2 + -6)" * (cast_expression "(int *)(pwVar2 + -6)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -6)" ( (binary_expression "pwVar2 + -6" identifier + number_literal) )))) * number_literal))) ))) )) (compound_statement "{\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }" { (expression_statement "reserve(this,uVar5);" (call_expression "reserve(this,uVar5)" identifier (argument_list "(this,uVar5)" ( identifier , identifier ))) ;) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));" (assignment_expression "param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2))" identifier = (cast_expression "(wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2))" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + (iVar1 - (int)pwVar2))" ( (binary_expression "(int)param_1 + (iVar1 - (int)pwVar2)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(iVar1 - (int)pwVar2)" ( (binary_expression "iVar1 - (int)pwVar2" identifier - (cast_expression "(int)pwVar2" ( (type_descriptor "int" primitive_type) ) identifier)) ))) )))) ;) (expression_statement "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);" (assignment_expression "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" identifier = (cast_expression "(undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + *(int *)(iVar1 + -0xc) * 4)" ( (binary_expression "iVar1 + *(int *)(iVar1 + -0xc) * 4" identifier + (binary_expression "*(int *)(iVar1 + -0xc) * 4" (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) * number_literal)) )))) ;) (goto_statement "goto joined_r0x00358e74;" goto statement_identifier ;) }))) (expression_statement "reserve(this,uVar5);" (call_expression "reserve(this,uVar5)" identifier (argument_list "(this,uVar5)" ( identifier , identifier ))) ;) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) }) (else_clause "else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }" else (compound_statement "{\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }" { (expression_statement "SYNC(0);" (call_expression "SYNC(0)" identifier (argument_list "(0)" ( number_literal ))) ;) (if_statement "if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }" if (parenthesized_expression "(0 < *(int *)(pwVar2 + -2))" ( (binary_expression "0 < *(int *)(pwVar2 + -2)" number_literal < (pointer_expression "*(int *)(pwVar2 + -2)" * (cast_expression "(int *)(pwVar2 + -2)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -2)" ( (binary_expression "pwVar2 + -2" identifier + number_literal) ))))) )) (compound_statement "{\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }" { (expression_statement "pwVar2 = *(wchar_t **)this;" (assignment_expression "pwVar2 = *(wchar_t **)this" identifier = (pointer_expression "*(wchar_t **)this" * (cast_expression "(wchar_t **)this" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (goto_statement "goto LAB_00358e24;" goto statement_identifier ;) })) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) }))) (expression_statement "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);" (assignment_expression "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" identifier = (cast_expression "(undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + *(int *)(iVar1 + -0xc) * 4)" ( (binary_expression "iVar1 + *(int *)(iVar1 + -0xc) * 4" identifier + (binary_expression "*(int *)(iVar1 + -0xc) * 4" (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) * number_literal)) )))) ;) (labeled_statement "joined_r0x00358e74:\n  if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" statement_identifier : (if_statement "if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n    *puVar3 = *(undefined4 *)param_1;\n  }" { (expression_statement "*puVar3 = *(undefined4 *)param_1;" (assignment_expression "*puVar3 = *(undefined4 *)param_1" (pointer_expression "*puVar3" * identifier) = (pointer_expression "*(undefined4 *)param_1" * (cast_expression "(undefined4 *)param_1" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier))) ;) }) (else_clause "else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" else (compound_statement "{\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" { (expression_statement "(*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);" (call_expression "(*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1)" (parenthesized_expression "(*(code *)PTR_wmemcpy_0043682c)" ( (pointer_expression "*(code *)PTR_wmemcpy_0043682c" * (cast_expression "(code *)PTR_wmemcpy_0043682c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(puVar3,param_1)" ( identifier , identifier ))) ;) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) })))) (if_statement "if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }" if (parenthesized_expression "((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc)" ( (binary_expression "(undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc" (cast_expression "(undefined *)(iVar1 + -0xc)" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) ))) != identifier) )) (compound_statement "{\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }" { (expression_statement "*(undefined4 *)(iVar1 + -4) = 0;" (assignment_expression "*(undefined4 *)(iVar1 + -4) = 0" (pointer_expression "*(undefined4 *)(iVar1 + -4)" * (cast_expression "(undefined4 *)(iVar1 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -4)" ( (binary_expression "iVar1 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(iVar1 + -0xc) = uVar5;" (assignment_expression "*(uint *)(iVar1 + -0xc) = uVar5" (pointer_expression "*(uint *)(iVar1 + -0xc)" * (cast_expression "(uint *)(iVar1 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(iVar1 + uVar5 * 4) = 0;" (assignment_expression "*(undefined4 *)(iVar1 + uVar5 * 4) = 0" (pointer_expression "*(undefined4 *)(iVar1 + uVar5 * 4)" * (cast_expression "(undefined4 *)(iVar1 + uVar5 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + uVar5 * 4)" ( (binary_expression "iVar1 + uVar5 * 4" identifier + (binary_expression "uVar5 * 4" identifier * number_literal)) )))) = number_literal) ;) })) (return_statement "return this;" return identifier ;) }))
(translation_unit "/* std::wstring::append(wchar_t const*, unsigned int) */\n\nwstring * __thiscall std::wstring::append(wstring *this,wchar_t *param_1,uint param_2)\n\n{\n  int iVar1;\n  wchar_t *pwVar2;\n  undefined4 *puVar3;\n  wstring *pwVar4;\n  uint uVar5;\n  \n  if (param_2 == 0) {\n    return this;\n  }\n  pwVar2 = *(wchar_t **)this;\n  uVar5 = param_2 + *(int *)(pwVar2 + -6);\n  if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }\n  if (*(uint *)(pwVar2 + -4) < uVar5) {\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }\n  else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }\n  puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\njoined_r0x00358e74:\n  if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }\n  if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }\n  return this;\n}\n\n" comment (ERROR "wstring * __thiscall std::wstring::append(wstring *this,wchar_t *param_1,uint param_2)" (binary_expression "wstring * __thiscall std::wstring::append(wstring *this" (binary_expression "wstring * __thiscall" identifier * identifier) (ERROR "std::wstring::append(wstring" identifier : : identifier : : identifier ( identifier) * identifier) , type_identifier (pointer_declarator "*param_1" * identifier) , identifier identifier )) (compound_statement "{\n  int iVar1;\n  wchar_t *pwVar2;\n  undefined4 *puVar3;\n  wstring *pwVar4;\n  uint uVar5;\n  \n  if (param_2 == 0) {\n    return this;\n  }\n  pwVar2 = *(wchar_t **)this;\n  uVar5 = param_2 + *(int *)(pwVar2 + -6);\n  if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }\n  if (*(uint *)(pwVar2 + -4) < uVar5) {\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }\n  else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }\n  puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\njoined_r0x00358e74:\n  if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }\n  if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }\n  return this;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "wstring *pwVar4;" type_identifier (pointer_declarator "*pwVar4" * identifier) ;) (declaration "uint uVar5;" type_identifier identifier ;) (if_statement "if (param_2 == 0) {\n    return this;\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    return this;\n  }" { (return_statement "return this;" return identifier ;) })) (expression_statement "pwVar2 = *(wchar_t **)this;" (assignment_expression "pwVar2 = *(wchar_t **)this" identifier = (pointer_expression "*(wchar_t **)this" * (cast_expression "(wchar_t **)this" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "uVar5 = param_2 + *(int *)(pwVar2 + -6);" (assignment_expression "uVar5 = param_2 + *(int *)(pwVar2 + -6)" identifier = (binary_expression "param_2 + *(int *)(pwVar2 + -6)" identifier + (pointer_expression "*(int *)(pwVar2 + -6)" * (cast_expression "(int *)(pwVar2 + -6)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -6)" ( (binary_expression "pwVar2 + -6" identifier + number_literal) )))))) ;) (if_statement "if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }" if (parenthesized_expression "(0xffffffeU - *(int *)(pwVar2 + -6) < param_2)" ( (binary_expression "0xffffffeU - *(int *)(pwVar2 + -6) < param_2" (binary_expression "0xffffffeU - *(int *)(pwVar2 + -6)" number_literal - (pointer_expression "*(int *)(pwVar2 + -6)" * (cast_expression "(int *)(pwVar2 + -6)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -6)" ( (binary_expression "pwVar2 + -6" identifier + number_literal) ))))) < identifier) )) (compound_statement "{\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }" { (expression_statement "pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);" (assignment_expression "pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240)" identifier = (cast_expression "(wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240)" ( (type_descriptor "wstring *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_s_alize_xindex_004323b4 + -0x6240)" ( (binary_expression "PTR_s_alize_xindex_004323b4 + -0x6240" identifier + number_literal) )))) ;) (expression_statement "(*(code *)PTR___throw_length_error_00432480)();" (call_expression "(*(code *)PTR___throw_length_error_00432480)()" (parenthesized_expression "(*(code *)PTR___throw_length_error_00432480)" ( (pointer_expression "*(code *)PTR___throw_length_error_00432480" * (cast_expression "(code *)PTR___throw_length_error_00432480" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "pwVar4 = (wstring *)append(pwVar4,param_1,param_2);" (assignment_expression "pwVar4 = (wstring *)append(pwVar4,param_1,param_2)" identifier = (cast_expression "(wstring *)append(pwVar4,param_1,param_2)" ( (type_descriptor "wstring *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "append(pwVar4,param_1,param_2)" identifier (argument_list "(pwVar4,param_1,param_2)" ( identifier , identifier , identifier ))))) ;) (return_statement "return pwVar4;" return identifier ;) })) (if_statement "if (*(uint *)(pwVar2 + -4) < uVar5) {\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }\n  else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }" if (parenthesized_expression "(*(uint *)(pwVar2 + -4) < uVar5)" ( (binary_expression "*(uint *)(pwVar2 + -4) < uVar5" (pointer_expression "*(uint *)(pwVar2 + -4)" * (cast_expression "(uint *)(pwVar2 + -4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -4)" ( (binary_expression "pwVar2 + -4" identifier + number_literal) )))) < identifier) )) (compound_statement "{\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }" { (labeled_statement "LAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }" statement_identifier : (if_statement "if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }" if (parenthesized_expression "((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2))" ( (binary_expression "(pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)" (parenthesized_expression "(pwVar2 <= param_1)" ( (binary_expression "pwVar2 <= param_1" identifier <= identifier) )) && (parenthesized_expression "(param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)" ( (binary_expression "param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2" identifier <= (binary_expression "pwVar2 + *(int *)(pwVar2 + -6) * 2" identifier + (binary_expression "*(int *)(pwVar2 + -6) * 2" (pointer_expression "*(int *)(pwVar2 + -6)" * (cast_expression "(int *)(pwVar2 + -6)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -6)" ( (binary_expression "pwVar2 + -6" identifier + number_literal) )))) * number_literal))) ))) )) (compound_statement "{\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }" { (expression_statement "reserve(this,uVar5);" (call_expression "reserve(this,uVar5)" identifier (argument_list "(this,uVar5)" ( identifier , identifier ))) ;) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));" (assignment_expression "param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2))" identifier = (cast_expression "(wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2))" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + (iVar1 - (int)pwVar2))" ( (binary_expression "(int)param_1 + (iVar1 - (int)pwVar2)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(iVar1 - (int)pwVar2)" ( (binary_expression "iVar1 - (int)pwVar2" identifier - (cast_expression "(int)pwVar2" ( (type_descriptor "int" primitive_type) ) identifier)) ))) )))) ;) (expression_statement "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);" (assignment_expression "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" identifier = (cast_expression "(undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + *(int *)(iVar1 + -0xc) * 4)" ( (binary_expression "iVar1 + *(int *)(iVar1 + -0xc) * 4" identifier + (binary_expression "*(int *)(iVar1 + -0xc) * 4" (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) * number_literal)) )))) ;) (goto_statement "goto joined_r0x00358e74;" goto statement_identifier ;) }))) (expression_statement "reserve(this,uVar5);" (call_expression "reserve(this,uVar5)" identifier (argument_list "(this,uVar5)" ( identifier , identifier ))) ;) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) }) (else_clause "else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }" else (compound_statement "{\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }" { (expression_statement "SYNC(0);" (call_expression "SYNC(0)" identifier (argument_list "(0)" ( number_literal ))) ;) (if_statement "if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }" if (parenthesized_expression "(0 < *(int *)(pwVar2 + -2))" ( (binary_expression "0 < *(int *)(pwVar2 + -2)" number_literal < (pointer_expression "*(int *)(pwVar2 + -2)" * (cast_expression "(int *)(pwVar2 + -2)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -2)" ( (binary_expression "pwVar2 + -2" identifier + number_literal) ))))) )) (compound_statement "{\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }" { (expression_statement "pwVar2 = *(wchar_t **)this;" (assignment_expression "pwVar2 = *(wchar_t **)this" identifier = (pointer_expression "*(wchar_t **)this" * (cast_expression "(wchar_t **)this" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (goto_statement "goto LAB_00358e24;" goto statement_identifier ;) })) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) }))) (expression_statement "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);" (assignment_expression "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" identifier = (cast_expression "(undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + *(int *)(iVar1 + -0xc) * 4)" ( (binary_expression "iVar1 + *(int *)(iVar1 + -0xc) * 4" identifier + (binary_expression "*(int *)(iVar1 + -0xc) * 4" (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) * number_literal)) )))) ;) (labeled_statement "joined_r0x00358e74:\n  if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" statement_identifier : (if_statement "if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n    *puVar3 = *(undefined4 *)param_1;\n  }" { (expression_statement "*puVar3 = *(undefined4 *)param_1;" (assignment_expression "*puVar3 = *(undefined4 *)param_1" (pointer_expression "*puVar3" * identifier) = (pointer_expression "*(undefined4 *)param_1" * (cast_expression "(undefined4 *)param_1" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier))) ;) }) (else_clause "else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" else (compound_statement "{\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" { (expression_statement "(*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);" (call_expression "(*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1)" (parenthesized_expression "(*(code *)PTR_wmemcpy_0043682c)" ( (pointer_expression "*(code *)PTR_wmemcpy_0043682c" * (cast_expression "(code *)PTR_wmemcpy_0043682c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(puVar3,param_1)" ( identifier , identifier ))) ;) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) })))) (if_statement "if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }" if (parenthesized_expression "((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc)" ( (binary_expression "(undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc" (cast_expression "(undefined *)(iVar1 + -0xc)" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) ))) != identifier) )) (compound_statement "{\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }" { (expression_statement "*(undefined4 *)(iVar1 + -4) = 0;" (assignment_expression "*(undefined4 *)(iVar1 + -4) = 0" (pointer_expression "*(undefined4 *)(iVar1 + -4)" * (cast_expression "(undefined4 *)(iVar1 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -4)" ( (binary_expression "iVar1 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(iVar1 + -0xc) = uVar5;" (assignment_expression "*(uint *)(iVar1 + -0xc) = uVar5" (pointer_expression "*(uint *)(iVar1 + -0xc)" * (cast_expression "(uint *)(iVar1 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(iVar1 + uVar5 * 4) = 0;" (assignment_expression "*(undefined4 *)(iVar1 + uVar5 * 4) = 0" (pointer_expression "*(undefined4 *)(iVar1 + uVar5 * 4)" * (cast_expression "(undefined4 *)(iVar1 + uVar5 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + uVar5 * 4)" ( (binary_expression "iVar1 + uVar5 * 4" identifier + (binary_expression "uVar5 * 4" identifier * number_literal)) )))) = number_literal) ;) })) (return_statement "return this;" return identifier ;) }))
(translation_unit "wstring * __thiscall std::wstring::append(wstring *this,wchar_t *param_1,uint param_2)\n\n{\n  int iVar1;\n  wchar_t *pwVar2;\n  undefined4 *puVar3;\n  wstring *pwVar4;\n  uint uVar5;\n  \n  if (param_2 == 0) {\n    return this;\n  }\n  pwVar2 = *(wchar_t **)this;\n  uVar5 = param_2 + *(int *)(pwVar2 + -6);\n  if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }\n  if (*(uint *)(pwVar2 + -4) < uVar5) {\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }\n  else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }\n  puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\njoined_r0x00358e74:\n  if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }\n  if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }\n  return this;\n}\n\n" (ERROR "wstring * __thiscall std::wstring::append(wstring *this,wchar_t *param_1,uint param_2)" (binary_expression "wstring * __thiscall std::wstring::append(wstring *this" (binary_expression "wstring * __thiscall" identifier * identifier) (ERROR "std::wstring::append(wstring" identifier : : identifier : : identifier ( identifier) * identifier) , type_identifier (pointer_declarator "*param_1" * identifier) , identifier identifier )) (compound_statement "{\n  int iVar1;\n  wchar_t *pwVar2;\n  undefined4 *puVar3;\n  wstring *pwVar4;\n  uint uVar5;\n  \n  if (param_2 == 0) {\n    return this;\n  }\n  pwVar2 = *(wchar_t **)this;\n  uVar5 = param_2 + *(int *)(pwVar2 + -6);\n  if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }\n  if (*(uint *)(pwVar2 + -4) < uVar5) {\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }\n  else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }\n  puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\njoined_r0x00358e74:\n  if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }\n  if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }\n  return this;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "wstring *pwVar4;" type_identifier (pointer_declarator "*pwVar4" * identifier) ;) (declaration "uint uVar5;" type_identifier identifier ;) (if_statement "if (param_2 == 0) {\n    return this;\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    return this;\n  }" { (return_statement "return this;" return identifier ;) })) (expression_statement "pwVar2 = *(wchar_t **)this;" (assignment_expression "pwVar2 = *(wchar_t **)this" identifier = (pointer_expression "*(wchar_t **)this" * (cast_expression "(wchar_t **)this" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "uVar5 = param_2 + *(int *)(pwVar2 + -6);" (assignment_expression "uVar5 = param_2 + *(int *)(pwVar2 + -6)" identifier = (binary_expression "param_2 + *(int *)(pwVar2 + -6)" identifier + (pointer_expression "*(int *)(pwVar2 + -6)" * (cast_expression "(int *)(pwVar2 + -6)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -6)" ( (binary_expression "pwVar2 + -6" identifier + number_literal) )))))) ;) (if_statement "if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }" if (parenthesized_expression "(0xffffffeU - *(int *)(pwVar2 + -6) < param_2)" ( (binary_expression "0xffffffeU - *(int *)(pwVar2 + -6) < param_2" (binary_expression "0xffffffeU - *(int *)(pwVar2 + -6)" number_literal - (pointer_expression "*(int *)(pwVar2 + -6)" * (cast_expression "(int *)(pwVar2 + -6)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -6)" ( (binary_expression "pwVar2 + -6" identifier + number_literal) ))))) < identifier) )) (compound_statement "{\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }" { (expression_statement "pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);" (assignment_expression "pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240)" identifier = (cast_expression "(wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240)" ( (type_descriptor "wstring *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_s_alize_xindex_004323b4 + -0x6240)" ( (binary_expression "PTR_s_alize_xindex_004323b4 + -0x6240" identifier + number_literal) )))) ;) (expression_statement "(*(code *)PTR___throw_length_error_00432480)();" (call_expression "(*(code *)PTR___throw_length_error_00432480)()" (parenthesized_expression "(*(code *)PTR___throw_length_error_00432480)" ( (pointer_expression "*(code *)PTR___throw_length_error_00432480" * (cast_expression "(code *)PTR___throw_length_error_00432480" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "pwVar4 = (wstring *)append(pwVar4,param_1,param_2);" (assignment_expression "pwVar4 = (wstring *)append(pwVar4,param_1,param_2)" identifier = (cast_expression "(wstring *)append(pwVar4,param_1,param_2)" ( (type_descriptor "wstring *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "append(pwVar4,param_1,param_2)" identifier (argument_list "(pwVar4,param_1,param_2)" ( identifier , identifier , identifier ))))) ;) (return_statement "return pwVar4;" return identifier ;) })) (if_statement "if (*(uint *)(pwVar2 + -4) < uVar5) {\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }\n  else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }" if (parenthesized_expression "(*(uint *)(pwVar2 + -4) < uVar5)" ( (binary_expression "*(uint *)(pwVar2 + -4) < uVar5" (pointer_expression "*(uint *)(pwVar2 + -4)" * (cast_expression "(uint *)(pwVar2 + -4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -4)" ( (binary_expression "pwVar2 + -4" identifier + number_literal) )))) < identifier) )) (compound_statement "{\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }" { (labeled_statement "LAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }" statement_identifier : (if_statement "if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }" if (parenthesized_expression "((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2))" ( (binary_expression "(pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)" (parenthesized_expression "(pwVar2 <= param_1)" ( (binary_expression "pwVar2 <= param_1" identifier <= identifier) )) && (parenthesized_expression "(param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)" ( (binary_expression "param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2" identifier <= (binary_expression "pwVar2 + *(int *)(pwVar2 + -6) * 2" identifier + (binary_expression "*(int *)(pwVar2 + -6) * 2" (pointer_expression "*(int *)(pwVar2 + -6)" * (cast_expression "(int *)(pwVar2 + -6)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -6)" ( (binary_expression "pwVar2 + -6" identifier + number_literal) )))) * number_literal))) ))) )) (compound_statement "{\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }" { (expression_statement "reserve(this,uVar5);" (call_expression "reserve(this,uVar5)" identifier (argument_list "(this,uVar5)" ( identifier , identifier ))) ;) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));" (assignment_expression "param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2))" identifier = (cast_expression "(wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2))" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + (iVar1 - (int)pwVar2))" ( (binary_expression "(int)param_1 + (iVar1 - (int)pwVar2)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(iVar1 - (int)pwVar2)" ( (binary_expression "iVar1 - (int)pwVar2" identifier - (cast_expression "(int)pwVar2" ( (type_descriptor "int" primitive_type) ) identifier)) ))) )))) ;) (expression_statement "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);" (assignment_expression "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" identifier = (cast_expression "(undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + *(int *)(iVar1 + -0xc) * 4)" ( (binary_expression "iVar1 + *(int *)(iVar1 + -0xc) * 4" identifier + (binary_expression "*(int *)(iVar1 + -0xc) * 4" (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) * number_literal)) )))) ;) (goto_statement "goto joined_r0x00358e74;" goto statement_identifier ;) }))) (expression_statement "reserve(this,uVar5);" (call_expression "reserve(this,uVar5)" identifier (argument_list "(this,uVar5)" ( identifier , identifier ))) ;) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) }) (else_clause "else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }" else (compound_statement "{\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }" { (expression_statement "SYNC(0);" (call_expression "SYNC(0)" identifier (argument_list "(0)" ( number_literal ))) ;) (if_statement "if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }" if (parenthesized_expression "(0 < *(int *)(pwVar2 + -2))" ( (binary_expression "0 < *(int *)(pwVar2 + -2)" number_literal < (pointer_expression "*(int *)(pwVar2 + -2)" * (cast_expression "(int *)(pwVar2 + -2)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + -2)" ( (binary_expression "pwVar2 + -2" identifier + number_literal) ))))) )) (compound_statement "{\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }" { (expression_statement "pwVar2 = *(wchar_t **)this;" (assignment_expression "pwVar2 = *(wchar_t **)this" identifier = (pointer_expression "*(wchar_t **)this" * (cast_expression "(wchar_t **)this" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (goto_statement "goto LAB_00358e24;" goto statement_identifier ;) })) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) }))) (expression_statement "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);" (assignment_expression "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" identifier = (cast_expression "(undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + *(int *)(iVar1 + -0xc) * 4)" ( (binary_expression "iVar1 + *(int *)(iVar1 + -0xc) * 4" identifier + (binary_expression "*(int *)(iVar1 + -0xc) * 4" (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) * number_literal)) )))) ;) (labeled_statement "joined_r0x00358e74:\n  if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" statement_identifier : (if_statement "if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n    *puVar3 = *(undefined4 *)param_1;\n  }" { (expression_statement "*puVar3 = *(undefined4 *)param_1;" (assignment_expression "*puVar3 = *(undefined4 *)param_1" (pointer_expression "*puVar3" * identifier) = (pointer_expression "*(undefined4 *)param_1" * (cast_expression "(undefined4 *)param_1" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier))) ;) }) (else_clause "else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" else (compound_statement "{\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" { (expression_statement "(*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);" (call_expression "(*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1)" (parenthesized_expression "(*(code *)PTR_wmemcpy_0043682c)" ( (pointer_expression "*(code *)PTR_wmemcpy_0043682c" * (cast_expression "(code *)PTR_wmemcpy_0043682c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(puVar3,param_1)" ( identifier , identifier ))) ;) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) })))) (if_statement "if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }" if (parenthesized_expression "((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc)" ( (binary_expression "(undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc" (cast_expression "(undefined *)(iVar1 + -0xc)" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) ))) != identifier) )) (compound_statement "{\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }" { (expression_statement "*(undefined4 *)(iVar1 + -4) = 0;" (assignment_expression "*(undefined4 *)(iVar1 + -4) = 0" (pointer_expression "*(undefined4 *)(iVar1 + -4)" * (cast_expression "(undefined4 *)(iVar1 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -4)" ( (binary_expression "iVar1 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(iVar1 + -0xc) = uVar5;" (assignment_expression "*(uint *)(iVar1 + -0xc) = uVar5" (pointer_expression "*(uint *)(iVar1 + -0xc)" * (cast_expression "(uint *)(iVar1 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(iVar1 + uVar5 * 4) = 0;" (assignment_expression "*(undefined4 *)(iVar1 + uVar5 * 4) = 0" (pointer_expression "*(undefined4 *)(iVar1 + uVar5 * 4)" * (cast_expression "(undefined4 *)(iVar1 + uVar5 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + uVar5 * 4)" ( (binary_expression "iVar1 + uVar5 * 4" identifier + (binary_expression "uVar5 * 4" identifier * number_literal)) )))) = number_literal) ;) })) (return_statement "return this;" return identifier ;) }))
(translation_unit (ERROR (binary_expression (binary_expression IDENT * IDENT) (ERROR IDENT : : IDENT : : IDENT ( IDENT) * IDENT) , TYPE (pointer_declarator * IDENT) , IDENT IDENT )) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression LIT - (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))))) ;) (return_statement return IDENT ;) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) < IDENT) )) (compound_statement { (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) && (parenthesized_expression ( (binary_expression IDENT <= (binary_expression IDENT + (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) * LIT))) ))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (parenthesized_expression ( (binary_expression IDENT - (cast_expression ( (type_descriptor TYPE) ) IDENT)) ))) )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) * LIT)) )))) ;) (goto_statement goto statement_identifier ;) }))) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) IDENT))) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) }))) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) * LIT)) )))) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) })))) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))) != IDENT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) = LIT) ;) })) (return_statement return IDENT ;) }))
(ERROR "wstring * __thiscall std::wstring::append(wstring *this,wchar_t *param_1,uint param_2)" (binary_expression "wstring * __thiscall std::wstring::append(wstring *this" (binary_expression "wstring * __thiscall" (identifier "wstring") (* "*") (identifier "__thiscall")) (ERROR "std::wstring::append(wstring" (identifier "std") (: ":") (: ":") (identifier "wstring") (: ":") (: ":") (identifier "append") (( "(") (identifier "wstring")) (* "*") (identifier "this")) (, ",") (type_identifier "wchar_t") (pointer_declarator "*param_1" (* "*") (identifier "param_1")) (, ",") (identifier "uint") (identifier "param_2") () ")")) (compound_statement "{\n  int iVar1;\n  wchar_t *pwVar2;\n  undefined4 *puVar3;\n  wstring *pwVar4;\n  uint uVar5;\n  \n  if (param_2 == 0) {\n    return this;\n  }\n  pwVar2 = *(wchar_t **)this;\n  uVar5 = param_2 + *(int *)(pwVar2 + -6);\n  if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }\n  if (*(uint *)(pwVar2 + -4) < uVar5) {\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }\n  else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }\n  puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\njoined_r0x00358e74:\n  if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }\n  if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }\n  return this;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "wchar_t *pwVar2;" (type_identifier "wchar_t") (pointer_declarator "*pwVar2" (* "*") (identifier "pwVar2")) (; ";")) (declaration "undefined4 *puVar3;" (type_identifier "undefined4") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "wstring *pwVar4;" (type_identifier "wstring") (pointer_declarator "*pwVar4" (* "*") (identifier "pwVar4")) (; ";")) (declaration "uint uVar5;" (type_identifier "uint") (identifier "uVar5") (; ";")) (if_statement "if (param_2 == 0) {\n    return this;\n  }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    return this;\n  }" ({ "{") (return_statement "return this;" (return "return") (identifier "this") (; ";")) (} "}"))) (expression_statement "pwVar2 = *(wchar_t **)this;" (assignment_expression "pwVar2 = *(wchar_t **)this" (identifier "pwVar2") (= "=") (pointer_expression "*(wchar_t **)this" (* "*") (cast_expression "(wchar_t **)this" (( "(") (type_descriptor "wchar_t **" (type_identifier "wchar_t") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "this")))) (; ";")) (expression_statement "uVar5 = param_2 + *(int *)(pwVar2 + -6);" (assignment_expression "uVar5 = param_2 + *(int *)(pwVar2 + -6)" (identifier "uVar5") (= "=") (binary_expression "param_2 + *(int *)(pwVar2 + -6)" (identifier "param_2") (+ "+") (pointer_expression "*(int *)(pwVar2 + -6)" (* "*") (cast_expression "(int *)(pwVar2 + -6)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(pwVar2 + -6)" (( "(") (binary_expression "pwVar2 + -6" (identifier "pwVar2") (+ "+") (number_literal "-6")) () ")")))))) (; ";")) (if_statement "if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }" (if "if") (parenthesized_expression "(0xffffffeU - *(int *)(pwVar2 + -6) < param_2)" (( "(") (binary_expression "0xffffffeU - *(int *)(pwVar2 + -6) < param_2" (binary_expression "0xffffffeU - *(int *)(pwVar2 + -6)" (number_literal "0xffffffeU") (- "-") (pointer_expression "*(int *)(pwVar2 + -6)" (* "*") (cast_expression "(int *)(pwVar2 + -6)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(pwVar2 + -6)" (( "(") (binary_expression "pwVar2 + -6" (identifier "pwVar2") (+ "+") (number_literal "-6")) () ")"))))) (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);\n    (*(code *)PTR___throw_length_error_00432480)();\n    pwVar4 = (wstring *)append(pwVar4,param_1,param_2);\n    return pwVar4;\n  }" ({ "{") (expression_statement "pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);" (assignment_expression "pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240)" (identifier "pwVar4") (= "=") (cast_expression "(wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240)" (( "(") (type_descriptor "wstring *" (type_identifier "wstring") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(PTR_s_alize_xindex_004323b4 + -0x6240)" (( "(") (binary_expression "PTR_s_alize_xindex_004323b4 + -0x6240" (identifier "PTR_s_alize_xindex_004323b4") (+ "+") (number_literal "-0x6240")) () ")")))) (; ";")) (expression_statement "(*(code *)PTR___throw_length_error_00432480)();" (call_expression "(*(code *)PTR___throw_length_error_00432480)()" (parenthesized_expression "(*(code *)PTR___throw_length_error_00432480)" (( "(") (pointer_expression "*(code *)PTR___throw_length_error_00432480" (* "*") (cast_expression "(code *)PTR___throw_length_error_00432480" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___throw_length_error_00432480"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "pwVar4 = (wstring *)append(pwVar4,param_1,param_2);" (assignment_expression "pwVar4 = (wstring *)append(pwVar4,param_1,param_2)" (identifier "pwVar4") (= "=") (cast_expression "(wstring *)append(pwVar4,param_1,param_2)" (( "(") (type_descriptor "wstring *" (type_identifier "wstring") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "append(pwVar4,param_1,param_2)" (identifier "append") (argument_list "(pwVar4,param_1,param_2)" (( "(") (identifier "pwVar4") (, ",") (identifier "param_1") (, ",") (identifier "param_2") () ")"))))) (; ";")) (return_statement "return pwVar4;" (return "return") (identifier "pwVar4") (; ";")) (} "}"))) (if_statement "if (*(uint *)(pwVar2 + -4) < uVar5) {\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }\n  else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }" (if "if") (parenthesized_expression "(*(uint *)(pwVar2 + -4) < uVar5)" (( "(") (binary_expression "*(uint *)(pwVar2 + -4) < uVar5" (pointer_expression "*(uint *)(pwVar2 + -4)" (* "*") (cast_expression "(uint *)(pwVar2 + -4)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(pwVar2 + -4)" (( "(") (binary_expression "pwVar2 + -4" (identifier "pwVar2") (+ "+") (number_literal "-4")) () ")")))) (< "<") (identifier "uVar5")) () ")")) (compound_statement "{\nLAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }\n    reserve(this,uVar5);\n    iVar1 = *(int *)this;\n  }" ({ "{") (labeled_statement "LAB_00358e24:\n    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }" (statement_identifier "LAB_00358e24") (: ":") (if_statement "if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }" (if "if") (parenthesized_expression "((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2))" (( "(") (binary_expression "(pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)" (parenthesized_expression "(pwVar2 <= param_1)" (( "(") (binary_expression "pwVar2 <= param_1" (identifier "pwVar2") (<= "<=") (identifier "param_1")) () ")")) (&& "&&") (parenthesized_expression "(param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)" (( "(") (binary_expression "param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2" (identifier "param_1") (<= "<=") (binary_expression "pwVar2 + *(int *)(pwVar2 + -6) * 2" (identifier "pwVar2") (+ "+") (binary_expression "*(int *)(pwVar2 + -6) * 2" (pointer_expression "*(int *)(pwVar2 + -6)" (* "*") (cast_expression "(int *)(pwVar2 + -6)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(pwVar2 + -6)" (( "(") (binary_expression "pwVar2 + -6" (identifier "pwVar2") (+ "+") (number_literal "-6")) () ")")))) (* "*") (number_literal "2")))) () ")"))) () ")")) (compound_statement "{\n      reserve(this,uVar5);\n      iVar1 = *(int *)this;\n      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));\n      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);\n      goto joined_r0x00358e74;\n    }" ({ "{") (expression_statement "reserve(this,uVar5);" (call_expression "reserve(this,uVar5)" (identifier "reserve") (argument_list "(this,uVar5)" (( "(") (identifier "this") (, ",") (identifier "uVar5") () ")"))) (; ";")) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" (identifier "iVar1") (= "=") (pointer_expression "*(int *)this" (* "*") (cast_expression "(int *)this" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this")))) (; ";")) (expression_statement "param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));" (assignment_expression "param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2))" (identifier "param_1") (= "=") (cast_expression "(wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2))" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)param_1 + (iVar1 - (int)pwVar2))" (( "(") (binary_expression "(int)param_1 + (iVar1 - (int)pwVar2)" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (parenthesized_expression "(iVar1 - (int)pwVar2)" (( "(") (binary_expression "iVar1 - (int)pwVar2" (identifier "iVar1") (- "-") (cast_expression "(int)pwVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pwVar2"))) () ")"))) () ")")))) (; ";")) (expression_statement "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);" (assignment_expression "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" (identifier "puVar3") (= "=") (cast_expression "(undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + *(int *)(iVar1 + -0xc) * 4)" (( "(") (binary_expression "iVar1 + *(int *)(iVar1 + -0xc) * 4" (identifier "iVar1") (+ "+") (binary_expression "*(int *)(iVar1 + -0xc) * 4" (pointer_expression "*(int *)(iVar1 + -0xc)" (* "*") (cast_expression "(int *)(iVar1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -0xc)" (( "(") (binary_expression "iVar1 + -0xc" (identifier "iVar1") (+ "+") (number_literal "-0xc")) () ")")))) (* "*") (number_literal "4"))) () ")")))) (; ";")) (goto_statement "goto joined_r0x00358e74;" (goto "goto") (statement_identifier "joined_r0x00358e74") (; ";")) (} "}")))) (expression_statement "reserve(this,uVar5);" (call_expression "reserve(this,uVar5)" (identifier "reserve") (argument_list "(this,uVar5)" (( "(") (identifier "this") (, ",") (identifier "uVar5") () ")"))) (; ";")) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" (identifier "iVar1") (= "=") (pointer_expression "*(int *)this" (* "*") (cast_expression "(int *)this" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this")))) (; ";")) (} "}")) (else_clause "else {\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }" (else "else") (compound_statement "{\n    SYNC(0);\n    if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }\n    iVar1 = *(int *)this;\n  }" ({ "{") (expression_statement "SYNC(0);" (call_expression "SYNC(0)" (identifier "SYNC") (argument_list "(0)" (( "(") (number_literal "0") () ")"))) (; ";")) (if_statement "if (0 < *(int *)(pwVar2 + -2)) {\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }" (if "if") (parenthesized_expression "(0 < *(int *)(pwVar2 + -2))" (( "(") (binary_expression "0 < *(int *)(pwVar2 + -2)" (number_literal "0") (< "<") (pointer_expression "*(int *)(pwVar2 + -2)" (* "*") (cast_expression "(int *)(pwVar2 + -2)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(pwVar2 + -2)" (( "(") (binary_expression "pwVar2 + -2" (identifier "pwVar2") (+ "+") (number_literal "-2")) () ")"))))) () ")")) (compound_statement "{\n      pwVar2 = *(wchar_t **)this;\n      goto LAB_00358e24;\n    }" ({ "{") (expression_statement "pwVar2 = *(wchar_t **)this;" (assignment_expression "pwVar2 = *(wchar_t **)this" (identifier "pwVar2") (= "=") (pointer_expression "*(wchar_t **)this" (* "*") (cast_expression "(wchar_t **)this" (( "(") (type_descriptor "wchar_t **" (type_identifier "wchar_t") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "this")))) (; ";")) (goto_statement "goto LAB_00358e24;" (goto "goto") (statement_identifier "LAB_00358e24") (; ";")) (} "}"))) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" (identifier "iVar1") (= "=") (pointer_expression "*(int *)this" (* "*") (cast_expression "(int *)this" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this")))) (; ";")) (} "}")))) (expression_statement "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);" (assignment_expression "puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" (identifier "puVar3") (= "=") (cast_expression "(undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + *(int *)(iVar1 + -0xc) * 4)" (( "(") (binary_expression "iVar1 + *(int *)(iVar1 + -0xc) * 4" (identifier "iVar1") (+ "+") (binary_expression "*(int *)(iVar1 + -0xc) * 4" (pointer_expression "*(int *)(iVar1 + -0xc)" (* "*") (cast_expression "(int *)(iVar1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -0xc)" (( "(") (binary_expression "iVar1 + -0xc" (identifier "iVar1") (+ "+") (number_literal "-0xc")) () ")")))) (* "*") (number_literal "4"))) () ")")))) (; ";")) (labeled_statement "joined_r0x00358e74:\n  if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" (statement_identifier "joined_r0x00358e74") (: ":") (if_statement "if (param_2 == 1) {\n    *puVar3 = *(undefined4 *)param_1;\n  }\n  else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" (if "if") (parenthesized_expression "(param_2 == 1)" (( "(") (binary_expression "param_2 == 1" (identifier "param_2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n    *puVar3 = *(undefined4 *)param_1;\n  }" ({ "{") (expression_statement "*puVar3 = *(undefined4 *)param_1;" (assignment_expression "*puVar3 = *(undefined4 *)param_1" (pointer_expression "*puVar3" (* "*") (identifier "puVar3")) (= "=") (pointer_expression "*(undefined4 *)param_1" (* "*") (cast_expression "(undefined4 *)param_1" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else {\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" (else "else") (compound_statement "{\n    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);\n    iVar1 = *(int *)this;\n  }" ({ "{") (expression_statement "(*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);" (call_expression "(*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1)" (parenthesized_expression "(*(code *)PTR_wmemcpy_0043682c)" (( "(") (pointer_expression "*(code *)PTR_wmemcpy_0043682c" (* "*") (cast_expression "(code *)PTR_wmemcpy_0043682c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_wmemcpy_0043682c"))) () ")")) (argument_list "(puVar3,param_1)" (( "(") (identifier "puVar3") (, ",") (identifier "param_1") () ")"))) (; ";")) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" (identifier "iVar1") (= "=") (pointer_expression "*(int *)this" (* "*") (cast_expression "(int *)this" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this")))) (; ";")) (} "}"))))) (if_statement "if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }" (if "if") (parenthesized_expression "((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc)" (( "(") (binary_expression "(undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc" (cast_expression "(undefined *)(iVar1 + -0xc)" (( "(") (type_descriptor "undefined *" (type_identifier "undefined") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -0xc)" (( "(") (binary_expression "iVar1 + -0xc" (identifier "iVar1") (+ "+") (number_literal "-0xc")) () ")"))) (!= "!=") (identifier "PTR__S_empty_rep_storage_004322cc")) () ")")) (compound_statement "{\n    *(undefined4 *)(iVar1 + -4) = 0;\n    *(uint *)(iVar1 + -0xc) = uVar5;\n    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;\n  }" ({ "{") (expression_statement "*(undefined4 *)(iVar1 + -4) = 0;" (assignment_expression "*(undefined4 *)(iVar1 + -4) = 0" (pointer_expression "*(undefined4 *)(iVar1 + -4)" (* "*") (cast_expression "(undefined4 *)(iVar1 + -4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -4)" (( "(") (binary_expression "iVar1 + -4" (identifier "iVar1") (+ "+") (number_literal "-4")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(uint *)(iVar1 + -0xc) = uVar5;" (assignment_expression "*(uint *)(iVar1 + -0xc) = uVar5" (pointer_expression "*(uint *)(iVar1 + -0xc)" (* "*") (cast_expression "(uint *)(iVar1 + -0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -0xc)" (( "(") (binary_expression "iVar1 + -0xc" (identifier "iVar1") (+ "+") (number_literal "-0xc")) () ")")))) (= "=") (identifier "uVar5")) (; ";")) (expression_statement "*(undefined4 *)(iVar1 + uVar5 * 4) = 0;" (assignment_expression "*(undefined4 *)(iVar1 + uVar5 * 4) = 0" (pointer_expression "*(undefined4 *)(iVar1 + uVar5 * 4)" (* "*") (cast_expression "(undefined4 *)(iVar1 + uVar5 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + uVar5 * 4)" (( "(") (binary_expression "iVar1 + uVar5 * 4" (identifier "iVar1") (+ "+") (binary_expression "uVar5 * 4" (identifier "uVar5") (* "*") (number_literal "4"))) () ")")))) (= "=") (number_literal "0")) (; ";")) (} "}"))) (return_statement "return this;" (return "return") (identifier "this") (; ";")) (} "}"))

/* std::wstring::append(wchar_t const*, unsigned int) */

type_3 * __thiscall std::type_3::var_4(type_3 *this,type_1 *var_6,type_4 var_1)

{
  int var_8;
  type_1 *var_2;
  type_2 *puVar3;
  type_3 *pwVar4;
  type_4 var_5;
  
  if (var_1 == 0) {
    return this;
  }
  var_2 = *(type_1 **)this;
  var_5 = var_1 + *(int *)(var_2 + -6);
  if (0xffffffeU - *(int *)(var_2 + -6) < var_1) {
    pwVar4 = (type_3 *)(var_3 + -0x6240);
    (*(type_5 *)PTR___throw_length_error_00432480)();
    pwVar4 = (type_3 *)var_4(pwVar4,var_6,var_1);
    return pwVar4;
  }
  if (*(type_4 *)(var_2 + -4) < var_5) {
LAB_00358e24:
    if ((var_2 <= var_6) && (var_6 <= var_2 + *(int *)(var_2 + -6) * 2)) {
      var_7(this,var_5);
      var_8 = *(int *)this;
      var_6 = (type_1 *)((int)var_6 + (var_8 - (int)var_2));
      puVar3 = (type_2 *)(var_8 + *(int *)(var_8 + -0xc) * 4);
      goto joined_r0x00358e74;
    }
    var_7(this,var_5);
    var_8 = *(int *)this;
  }
  else {
    var_9(0);
    if (0 < *(int *)(var_2 + -2)) {
      var_2 = *(type_1 **)this;
      goto LAB_00358e24;
    }
    var_8 = *(int *)this;
  }
  puVar3 = (type_2 *)(var_8 + *(int *)(var_8 + -0xc) * 4);
joined_r0x00358e74:
  if (var_1 == 1) {
    *puVar3 = *(type_2 *)var_6;
  }
  else {
    (*(type_5 *)PTR_wmemcpy_0043682c)(puVar3,var_6);
    var_8 = *(int *)this;
  }
  if ((type_6 *)(var_8 + -0xc) != var_10) {
    *(type_2 *)(var_8 + -4) = 0;
    *(type_4 *)(var_8 + -0xc) = var_5;
    *(type_2 *)(var_8 + var_5 * 4) = 0;
  }
  return this;
}


(translation_unit (ERROR (binary_expression left: (binary_expression left: (identifier) right: (identifier)) (ERROR (identifier) (identifier) (identifier) (identifier)) right: (identifier)) type: (type_identifier) (pointer_declarator declarator: (identifier)) (identifier) (identifier)) (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (number_literal) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))))) (return_statement (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier))) consequence: (compound_statement (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))))))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (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: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))))))) (goto_statement label: (statement_identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier)))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (identifier))))) (goto_statement label: (statement_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))))))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) right: (identifier))) consequence: (compound_statement (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: (identifier) right: (number_literal))))) right: (number_literal))) (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: (identifier) right: (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: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))))) right: (number_literal))))) (return_statement (identifier))))

/* std::wstring::MASKED(wchar_t const*, unsigned int) */

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

{
  int iVar1;
  wchar_t *pwVar2;
  undefined4 *puVar3;
  wstring *pwVar4;
  uint uVar5;
  
  if (param_2 == 0) {
    return this;
  }
  pwVar2 = *(wchar_t **)this;
  uVar5 = param_2 + *(int *)(pwVar2 + -6);
  if (0xffffffeU - *(int *)(pwVar2 + -6) < param_2) {
    pwVar4 = (wstring *)(PTR_s_alize_xindex_004323b4 + -0x6240);
    (*(code *)PTR___throw_length_error_00432480)();
    pwVar4 = (wstring *)MASKED(pwVar4,param_1,param_2);
    return pwVar4;
  }
  if (*(uint *)(pwVar2 + -4) < uVar5) {
LAB_00358e24:
    if ((pwVar2 <= param_1) && (param_1 <= pwVar2 + *(int *)(pwVar2 + -6) * 2)) {
      reserve(this,uVar5);
      iVar1 = *(int *)this;
      param_1 = (wchar_t *)((int)param_1 + (iVar1 - (int)pwVar2));
      puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);
      goto joined_r0x00358e74;
    }
    reserve(this,uVar5);
    iVar1 = *(int *)this;
  }
  else {
    SYNC(0);
    if (0 < *(int *)(pwVar2 + -2)) {
      pwVar2 = *(wchar_t **)this;
      goto LAB_00358e24;
    }
    iVar1 = *(int *)this;
  }
  puVar3 = (undefined4 *)(iVar1 + *(int *)(iVar1 + -0xc) * 4);
joined_r0x00358e74:
  if (param_2 == 1) {
    *puVar3 = *(undefined4 *)param_1;
  }
  else {
    (*(code *)PTR_wmemcpy_0043682c)(puVar3,param_1);
    iVar1 = *(int *)this;
  }
  if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_004322cc) {
    *(undefined4 *)(iVar1 + -4) = 0;
    *(uint *)(iVar1 + -0xc) = uVar5;
    *(undefined4 *)(iVar1 + uVar5 * 4) = 0;
  }
  return this;
}

