
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::wstring::reserve(unsigned int) */

void __thiscall std::wstring::reserve(wstring *this,uint param_1)

{
  wstring *__s1;
  uint uVar1;
  wchar_t *__s1_00;
  wstring *pwVar2;
  size_t sVar3;
  uint uVar4;
  
  uVar1 = *(uint *)(this + 4);
  if (param_1 < uVar1) {
    param_1 = uVar1;
  }
  pwVar2 = *(wstring **)this;
  __s1 = this + 8;
  if (__s1 == pwVar2) {
    uVar4 = 3;
  }
  else {
    uVar4 = *(uint *)(this + 8);
  }
  if (uVar4 != param_1) {
    if ((uVar4 < param_1) || (3 < param_1)) {
      __s1_00 = (wchar_t *)_M_create(this,&param_1,uVar4);
      pwVar2 = *(wstring **)this;
      sVar3 = *(int *)(this + 4) + 1;
      if (sVar3 == 1) {
        *__s1_00 = *(wchar_t *)pwVar2;
      }
      else if (sVar3 != 0) {
        wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);
        pwVar2 = *(wstring **)this;
      }
      if (__s1 != pwVar2) {
        operator_delete(pwVar2);
      }
      *(wchar_t **)this = __s1_00;
      *(uint *)(this + 8) = param_1;
      return;
    }
    if (__s1 != pwVar2) {
      sVar3 = uVar1 + 1;
      if (sVar3 == 1) {
        *(wchar_t *)(this + 8) = *(wchar_t *)pwVar2;
      }
      else if (sVar3 != 0) {
        wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);
        pwVar2 = *(wstring **)this;
      }
      operator_delete(pwVar2);
      *(wstring **)this = __s1;
    }
  }
  return;
}



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

void FUN_00185050(undefined4 *param_1,uint param_2)

{
  wchar_t *__s1;
  uint uVar1;
  wchar_t *__s1_00;
  wchar_t *pwVar2;
  size_t sVar3;
  uint uVar4;
  
  uVar1 = param_1[1];
  if (param_2 < uVar1) {
    param_2 = uVar1;
  }
  pwVar2 = (wchar_t *)*param_1;
  __s1 = param_1 + 2;
  if (__s1 == pwVar2) {
    uVar4 = 3;
  }
  else {
    uVar4 = param_1[2];
  }
  if (uVar4 != param_2) {
    if ((uVar4 < param_2) || (3 < param_2)) {
      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);
      pwVar2 = (wchar_t *)*param_1;
      sVar3 = param_1[1] + 1;
      if (sVar3 == 1) {
        *__s1_00 = *pwVar2;
      }
      else if (sVar3 != 0) {
        wmemcpy(__s1_00,pwVar2,sVar3);
        pwVar2 = (wchar_t *)*param_1;
      }
      if (__s1 != pwVar2) {
        FUN_001807a0(pwVar2);
      }
      *param_1 = __s1_00;
      param_1[2] = param_2;
      return;
    }
    if (__s1 != pwVar2) {
      sVar3 = uVar1 + 1;
      if (sVar3 == 1) {
        param_1[2] = *pwVar2;
      }
      else if (sVar3 != 0) {
        wmemcpy(__s1,pwVar2,sVar3);
        pwVar2 = (wchar_t *)*param_1;
      }
      FUN_001807a0(pwVar2);
      *param_1 = __s1;
    }
  }
  return;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00032730
ADD EBX,0x17cfa7
SUB ESP,0xc
MOV ESI,dword ptr [ESP + 0x20]
MOV EAX,dword ptr [ESP + 0x24]
MOV EDX,dword ptr [ESI + 0x4]
CMP EAX,EDX
JNC 0x00185077
MOV dword ptr [ESP + 0x24],EDX
MOV EAX,EDX
MOV ECX,dword ptr [ESI]
LEA EDI,[ESI + 0x8]
CMP EDI,ECX
JZ 0x00185138
MOV EBP,dword ptr [ESI + 0x8]
CMP EBP,EAX
JZ 0x001850c4
JC 0x001850d0
CMP EAX,0x3
JA 0x001850d0
CMP EDI,ECX
JZ 0x001850c4
ADD EDX,0x1
CMP EDX,0x1
JZ 0x00185150
TEST EDX,EDX
JZ 0x001850b6
SUB ESP,0x4
PUSH EDX
PUSH ECX
PUSH EDI
CALL 0x00026370
MOV ECX,dword ptr [ESI]
ADD ESP,0x10
SUB ESP,0xc
PUSH ECX
CALL 0x001807a0
MOV dword ptr [ESI],EDI
ADD ESP,0x10
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x4
PUSH EBP
LEA EAX,[ESP + 0x2c]
PUSH EAX
PUSH ESI
CALL 0x001844a0
MOV EDX,dword ptr [ESI]
ADD ESP,0x10
MOV EBP,EAX
MOV EAX,dword ptr [ESI + 0x4]
ADD EAX,0x1
CMP EAX,0x1
JZ 0x00185148
TEST EAX,EAX
JNZ 0x00185120
CMP EDI,EDX
JZ 0x00185105
SUB ESP,0xc
PUSH EDX
CALL 0x001807a0
ADD ESP,0x10
MOV EAX,dword ptr [ESP + 0x24]
MOV dword ptr [ESI],EBP
MOV dword ptr [ESI + 0x8],EAX
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x4
PUSH EAX
PUSH EDX
PUSH EBP
CALL 0x00026370
MOV EDX,dword ptr [ESI]
ADD ESP,0x10
JMP 0x001850f5
MOV EBP,0x3
JMP 0x00185087
MOV EAX,dword ptr [EDX]
MOV dword ptr [EBP],EAX
JMP 0x001850f5
MOV EAX,dword ptr [ECX]
MOV dword ptr [ESI + 0x8],EAX
JMP 0x001850b6
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_00185050(undefined4 *param_1,uint param_2)\n\n{\n  wchar_t *__s1;\n  uint uVar1;\n  wchar_t *__s1_00;\n  wchar_t *pwVar2;\n  size_t sVar3;\n  uint uVar4;\n  \n  uVar1 = param_1[1];\n  if (param_2 < uVar1) {\n    param_2 = uVar1;\n  }\n  pwVar2 = (wchar_t *)*param_1;\n  __s1 = param_1 + 2;\n  if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 != param_2) {\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }\n  return;\n}\n\n" comment (function_definition "void FUN_00185050(undefined4 *param_1,uint param_2)\n\n{\n  wchar_t *__s1;\n  uint uVar1;\n  wchar_t *__s1_00;\n  wchar_t *pwVar2;\n  size_t sVar3;\n  uint uVar4;\n  \n  uVar1 = param_1[1];\n  if (param_2 < uVar1) {\n    param_2 = uVar1;\n  }\n  pwVar2 = (wchar_t *)*param_1;\n  __s1 = param_1 + 2;\n  if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 != param_2) {\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }\n  return;\n}" primitive_type (function_declarator "FUN_00185050(undefined4 *param_1,uint param_2)" identifier (parameter_list "(undefined4 *param_1,uint param_2)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  wchar_t *__s1;\n  uint uVar1;\n  wchar_t *__s1_00;\n  wchar_t *pwVar2;\n  size_t sVar3;\n  uint uVar4;\n  \n  uVar1 = param_1[1];\n  if (param_2 < uVar1) {\n    param_2 = uVar1;\n  }\n  pwVar2 = (wchar_t *)*param_1;\n  __s1 = param_1 + 2;\n  if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 != param_2) {\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }\n  return;\n}" { (declaration "wchar_t *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (declaration "uint uVar1;" type_identifier identifier ;) (declaration "wchar_t *__s1_00;" type_identifier (pointer_declarator "*__s1_00" * identifier) ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "uVar1 = param_1[1];" (assignment_expression "uVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (if_statement "if (param_2 < uVar1) {\n    param_2 = uVar1;\n  }" if (parenthesized_expression "(param_2 < uVar1)" ( (binary_expression "param_2 < uVar1" identifier < identifier) )) (compound_statement "{\n    param_2 = uVar1;\n  }" { (expression_statement "param_2 = uVar1;" (assignment_expression "param_2 = uVar1" identifier = identifier) ;) })) (expression_statement "pwVar2 = (wchar_t *)*param_1;" (assignment_expression "pwVar2 = (wchar_t *)*param_1" identifier = (cast_expression "(wchar_t *)*param_1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "__s1 = param_1 + 2;" (assignment_expression "__s1 = param_1 + 2" identifier = (binary_expression "param_1 + 2" identifier + number_literal)) ;) (if_statement "if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }" if (parenthesized_expression "(__s1 == pwVar2)" ( (binary_expression "__s1 == pwVar2" identifier == identifier) )) (compound_statement "{\n    uVar4 = 3;\n  }" { (expression_statement "uVar4 = 3;" (assignment_expression "uVar4 = 3" identifier = number_literal) ;) }) (else_clause "else {\n    uVar4 = param_1[2];\n  }" else (compound_statement "{\n    uVar4 = param_1[2];\n  }" { (expression_statement "uVar4 = param_1[2];" (assignment_expression "uVar4 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar4 != param_2) {\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }" if (parenthesized_expression "(uVar4 != param_2)" ( (binary_expression "uVar4 != param_2" identifier != identifier) )) (compound_statement "{\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }" { (if_statement "if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }" if (parenthesized_expression "((uVar4 < param_2) || (3 < param_2))" ( (binary_expression "(uVar4 < param_2) || (3 < param_2)" (parenthesized_expression "(uVar4 < param_2)" ( (binary_expression "uVar4 < param_2" identifier < identifier) )) || (parenthesized_expression "(3 < param_2)" ( (binary_expression "3 < param_2" number_literal < identifier) ))) )) (compound_statement "{\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }" { (expression_statement "__s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);" (assignment_expression "__s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4)" identifier = (cast_expression "(wchar_t *)FUN_001844a0(param_1,&param_2,uVar4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_001844a0(param_1,&param_2,uVar4)" identifier (argument_list "(param_1,&param_2,uVar4)" ( identifier , (pointer_expression "&param_2" & identifier) , identifier ))))) ;) (expression_statement "pwVar2 = (wchar_t *)*param_1;" (assignment_expression "pwVar2 = (wchar_t *)*param_1" identifier = (cast_expression "(wchar_t *)*param_1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "sVar3 = param_1[1] + 1;" (assignment_expression "sVar3 = param_1[1] + 1" identifier = (binary_expression "param_1[1] + 1" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal)) ;) (if_statement "if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" if (parenthesized_expression "(sVar3 == 1)" ( (binary_expression "sVar3 == 1" identifier == number_literal) )) (compound_statement "{\n        *__s1_00 = *pwVar2;\n      }" { (expression_statement "*__s1_00 = *pwVar2;" (assignment_expression "*__s1_00 = *pwVar2" (pointer_expression "*__s1_00" * identifier) = (pointer_expression "*pwVar2" * identifier)) ;) }) (else_clause "else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" else (if_statement "if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" if (parenthesized_expression "(sVar3 != 0)" ( (binary_expression "sVar3 != 0" identifier != number_literal) )) (compound_statement "{\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" { (expression_statement "wmemcpy(__s1_00,pwVar2,sVar3);" (call_expression "wmemcpy(__s1_00,pwVar2,sVar3)" identifier (argument_list "(__s1_00,pwVar2,sVar3)" ( identifier , identifier , identifier ))) ;) (expression_statement "pwVar2 = (wchar_t *)*param_1;" (assignment_expression "pwVar2 = (wchar_t *)*param_1" identifier = (cast_expression "(wchar_t *)*param_1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) })))) (if_statement "if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }" if (parenthesized_expression "(__s1 != pwVar2)" ( (binary_expression "__s1 != pwVar2" identifier != identifier) )) (compound_statement "{\n        FUN_001807a0(pwVar2);\n      }" { (expression_statement "FUN_001807a0(pwVar2);" (call_expression "FUN_001807a0(pwVar2)" identifier (argument_list "(pwVar2)" ( identifier ))) ;) })) (expression_statement "*param_1 = __s1_00;" (assignment_expression "*param_1 = __s1_00" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1[2] = param_2;" (assignment_expression "param_1[2] = param_2" (subscript_expression "param_1[2]" identifier [ number_literal ]) = identifier) ;) (return_statement "return;" return ;) })) (if_statement "if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }" if (parenthesized_expression "(__s1 != pwVar2)" ( (binary_expression "__s1 != pwVar2" identifier != identifier) )) (compound_statement "{\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }" { (expression_statement "sVar3 = uVar1 + 1;" (assignment_expression "sVar3 = uVar1 + 1" identifier = (binary_expression "uVar1 + 1" identifier + number_literal)) ;) (if_statement "if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" if (parenthesized_expression "(sVar3 == 1)" ( (binary_expression "sVar3 == 1" identifier == number_literal) )) (compound_statement "{\n        param_1[2] = *pwVar2;\n      }" { (expression_statement "param_1[2] = *pwVar2;" (assignment_expression "param_1[2] = *pwVar2" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (pointer_expression "*pwVar2" * identifier)) ;) }) (else_clause "else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" else (if_statement "if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" if (parenthesized_expression "(sVar3 != 0)" ( (binary_expression "sVar3 != 0" identifier != number_literal) )) (compound_statement "{\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" { (expression_statement "wmemcpy(__s1,pwVar2,sVar3);" (call_expression "wmemcpy(__s1,pwVar2,sVar3)" identifier (argument_list "(__s1,pwVar2,sVar3)" ( identifier , identifier , identifier ))) ;) (expression_statement "pwVar2 = (wchar_t *)*param_1;" (assignment_expression "pwVar2 = (wchar_t *)*param_1" identifier = (cast_expression "(wchar_t *)*param_1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) })))) (expression_statement "FUN_001807a0(pwVar2);" (call_expression "FUN_001807a0(pwVar2)" identifier (argument_list "(pwVar2)" ( identifier ))) ;) (expression_statement "*param_1 = __s1;" (assignment_expression "*param_1 = __s1" (pointer_expression "*param_1" * identifier) = identifier) ;) })) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::wstring::reserve(unsigned int) */\n\nvoid __thiscall std::wstring::reserve(wstring *this,uint param_1)\n\n{\n  wstring *__s1;\n  uint uVar1;\n  wchar_t *__s1_00;\n  wstring *pwVar2;\n  size_t sVar3;\n  uint uVar4;\n  \n  uVar1 = *(uint *)(this + 4);\n  if (param_1 < uVar1) {\n    param_1 = uVar1;\n  }\n  pwVar2 = *(wstring **)this;\n  __s1 = this + 8;\n  if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = *(uint *)(this + 8);\n  }\n  if (uVar4 != param_1) {\n    if ((uVar4 < param_1) || (3 < param_1)) {\n      __s1_00 = (wchar_t *)_M_create(this,&param_1,uVar4);\n      pwVar2 = *(wstring **)this;\n      sVar3 = *(int *)(this + 4) + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      if (__s1 != pwVar2) {\n        operator_delete(pwVar2);\n      }\n      *(wchar_t **)this = __s1_00;\n      *(uint *)(this + 8) = param_1;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        *(wchar_t *)(this + 8) = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      operator_delete(pwVar2);\n      *(wstring **)this = __s1;\n    }\n  }\n  return;\n}\n\n" comment comment (function_definition "void __thiscall std::wstring::reserve(wstring *this,uint param_1)\n\n{\n  wstring *__s1;\n  uint uVar1;\n  wchar_t *__s1_00;\n  wstring *pwVar2;\n  size_t sVar3;\n  uint uVar4;\n  \n  uVar1 = *(uint *)(this + 4);\n  if (param_1 < uVar1) {\n    param_1 = uVar1;\n  }\n  pwVar2 = *(wstring **)this;\n  __s1 = this + 8;\n  if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = *(uint *)(this + 8);\n  }\n  if (uVar4 != param_1) {\n    if ((uVar4 < param_1) || (3 < param_1)) {\n      __s1_00 = (wchar_t *)_M_create(this,&param_1,uVar4);\n      pwVar2 = *(wstring **)this;\n      sVar3 = *(int *)(this + 4) + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      if (__s1 != pwVar2) {\n        operator_delete(pwVar2);\n      }\n      *(wchar_t **)this = __s1_00;\n      *(uint *)(this + 8) = param_1;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        *(wchar_t *)(this + 8) = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      operator_delete(pwVar2);\n      *(wstring **)this = __s1;\n    }\n  }\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "reserve(wstring *this,uint param_1)" identifier (parameter_list "(wstring *this,uint param_1)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "uint param_1" type_identifier identifier) ))) (compound_statement "{\n  wstring *__s1;\n  uint uVar1;\n  wchar_t *__s1_00;\n  wstring *pwVar2;\n  size_t sVar3;\n  uint uVar4;\n  \n  uVar1 = *(uint *)(this + 4);\n  if (param_1 < uVar1) {\n    param_1 = uVar1;\n  }\n  pwVar2 = *(wstring **)this;\n  __s1 = this + 8;\n  if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = *(uint *)(this + 8);\n  }\n  if (uVar4 != param_1) {\n    if ((uVar4 < param_1) || (3 < param_1)) {\n      __s1_00 = (wchar_t *)_M_create(this,&param_1,uVar4);\n      pwVar2 = *(wstring **)this;\n      sVar3 = *(int *)(this + 4) + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      if (__s1 != pwVar2) {\n        operator_delete(pwVar2);\n      }\n      *(wchar_t **)this = __s1_00;\n      *(uint *)(this + 8) = param_1;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        *(wchar_t *)(this + 8) = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      operator_delete(pwVar2);\n      *(wstring **)this = __s1;\n    }\n  }\n  return;\n}" { (declaration "wstring *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (declaration "uint uVar1;" type_identifier identifier ;) (declaration "wchar_t *__s1_00;" type_identifier (pointer_declarator "*__s1_00" * identifier) ;) (declaration "wstring *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "uVar1 = *(uint *)(this + 4);" (assignment_expression "uVar1 = *(uint *)(this + 4)" identifier = (pointer_expression "*(uint *)(this + 4)" * (cast_expression "(uint *)(this + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) ))))) ;) (if_statement "if (param_1 < uVar1) {\n    param_1 = uVar1;\n  }" if (parenthesized_expression "(param_1 < uVar1)" ( (binary_expression "param_1 < uVar1" identifier < identifier) )) (compound_statement "{\n    param_1 = uVar1;\n  }" { (expression_statement "param_1 = uVar1;" (assignment_expression "param_1 = uVar1" identifier = identifier) ;) })) (expression_statement "pwVar2 = *(wstring **)this;" (assignment_expression "pwVar2 = *(wstring **)this" identifier = (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "__s1 = this + 8;" (assignment_expression "__s1 = this + 8" identifier = (binary_expression "this + 8" identifier + number_literal)) ;) (if_statement "if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = *(uint *)(this + 8);\n  }" if (parenthesized_expression "(__s1 == pwVar2)" ( (binary_expression "__s1 == pwVar2" identifier == identifier) )) (compound_statement "{\n    uVar4 = 3;\n  }" { (expression_statement "uVar4 = 3;" (assignment_expression "uVar4 = 3" identifier = number_literal) ;) }) (else_clause "else {\n    uVar4 = *(uint *)(this + 8);\n  }" else (compound_statement "{\n    uVar4 = *(uint *)(this + 8);\n  }" { (expression_statement "uVar4 = *(uint *)(this + 8);" (assignment_expression "uVar4 = *(uint *)(this + 8)" identifier = (pointer_expression "*(uint *)(this + 8)" * (cast_expression "(uint *)(this + 8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))) ;) }))) (if_statement "if (uVar4 != param_1) {\n    if ((uVar4 < param_1) || (3 < param_1)) {\n      __s1_00 = (wchar_t *)_M_create(this,&param_1,uVar4);\n      pwVar2 = *(wstring **)this;\n      sVar3 = *(int *)(this + 4) + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      if (__s1 != pwVar2) {\n        operator_delete(pwVar2);\n      }\n      *(wchar_t **)this = __s1_00;\n      *(uint *)(this + 8) = param_1;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        *(wchar_t *)(this + 8) = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      operator_delete(pwVar2);\n      *(wstring **)this = __s1;\n    }\n  }" if (parenthesized_expression "(uVar4 != param_1)" ( (binary_expression "uVar4 != param_1" identifier != identifier) )) (compound_statement "{\n    if ((uVar4 < param_1) || (3 < param_1)) {\n      __s1_00 = (wchar_t *)_M_create(this,&param_1,uVar4);\n      pwVar2 = *(wstring **)this;\n      sVar3 = *(int *)(this + 4) + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      if (__s1 != pwVar2) {\n        operator_delete(pwVar2);\n      }\n      *(wchar_t **)this = __s1_00;\n      *(uint *)(this + 8) = param_1;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        *(wchar_t *)(this + 8) = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      operator_delete(pwVar2);\n      *(wstring **)this = __s1;\n    }\n  }" { (if_statement "if ((uVar4 < param_1) || (3 < param_1)) {\n      __s1_00 = (wchar_t *)_M_create(this,&param_1,uVar4);\n      pwVar2 = *(wstring **)this;\n      sVar3 = *(int *)(this + 4) + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      if (__s1 != pwVar2) {\n        operator_delete(pwVar2);\n      }\n      *(wchar_t **)this = __s1_00;\n      *(uint *)(this + 8) = param_1;\n      return;\n    }" if (parenthesized_expression "((uVar4 < param_1) || (3 < param_1))" ( (binary_expression "(uVar4 < param_1) || (3 < param_1)" (parenthesized_expression "(uVar4 < param_1)" ( (binary_expression "uVar4 < param_1" identifier < identifier) )) || (parenthesized_expression "(3 < param_1)" ( (binary_expression "3 < param_1" number_literal < identifier) ))) )) (compound_statement "{\n      __s1_00 = (wchar_t *)_M_create(this,&param_1,uVar4);\n      pwVar2 = *(wstring **)this;\n      sVar3 = *(int *)(this + 4) + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      if (__s1 != pwVar2) {\n        operator_delete(pwVar2);\n      }\n      *(wchar_t **)this = __s1_00;\n      *(uint *)(this + 8) = param_1;\n      return;\n    }" { (expression_statement "__s1_00 = (wchar_t *)_M_create(this,&param_1,uVar4);" (assignment_expression "__s1_00 = (wchar_t *)_M_create(this,&param_1,uVar4)" identifier = (cast_expression "(wchar_t *)_M_create(this,&param_1,uVar4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "_M_create(this,&param_1,uVar4)" identifier (argument_list "(this,&param_1,uVar4)" ( identifier , (pointer_expression "&param_1" & identifier) , identifier ))))) ;) (expression_statement "pwVar2 = *(wstring **)this;" (assignment_expression "pwVar2 = *(wstring **)this" identifier = (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "sVar3 = *(int *)(this + 4) + 1;" (assignment_expression "sVar3 = *(int *)(this + 4) + 1" identifier = (binary_expression "*(int *)(this + 4) + 1" (pointer_expression "*(int *)(this + 4)" * (cast_expression "(int *)(this + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) + number_literal)) ;) (if_statement "if (sVar3 == 1) {\n        *__s1_00 = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }" if (parenthesized_expression "(sVar3 == 1)" ( (binary_expression "sVar3 == 1" identifier == number_literal) )) (compound_statement "{\n        *__s1_00 = *(wchar_t *)pwVar2;\n      }" { (expression_statement "*__s1_00 = *(wchar_t *)pwVar2;" (assignment_expression "*__s1_00 = *(wchar_t *)pwVar2" (pointer_expression "*__s1_00" * identifier) = (pointer_expression "*(wchar_t *)pwVar2" * (cast_expression "(wchar_t *)pwVar2" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier))) ;) }) (else_clause "else if (sVar3 != 0) {\n        wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }" else (if_statement "if (sVar3 != 0) {\n        wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }" if (parenthesized_expression "(sVar3 != 0)" ( (binary_expression "sVar3 != 0" identifier != number_literal) )) (compound_statement "{\n        wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }" { (expression_statement "wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3);" (call_expression "wmemcpy(__s1_00,(wchar_t *)pwVar2,sVar3)" identifier (argument_list "(__s1_00,(wchar_t *)pwVar2,sVar3)" ( identifier , (cast_expression "(wchar_t *)pwVar2" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , identifier ))) ;) (expression_statement "pwVar2 = *(wstring **)this;" (assignment_expression "pwVar2 = *(wstring **)this" identifier = (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) })))) (if_statement "if (__s1 != pwVar2) {\n        operator_delete(pwVar2);\n      }" if (parenthesized_expression "(__s1 != pwVar2)" ( (binary_expression "__s1 != pwVar2" identifier != identifier) )) (compound_statement "{\n        operator_delete(pwVar2);\n      }" { (expression_statement "operator_delete(pwVar2);" (call_expression "operator_delete(pwVar2)" identifier (argument_list "(pwVar2)" ( identifier ))) ;) })) (expression_statement "*(wchar_t **)this = __s1_00;" (assignment_expression "*(wchar_t **)this = __s1_00" (pointer_expression "*(wchar_t **)this" * (cast_expression "(wchar_t **)this" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) (expression_statement "*(uint *)(this + 8) = param_1;" (assignment_expression "*(uint *)(this + 8) = param_1" (pointer_expression "*(uint *)(this + 8)" * (cast_expression "(uint *)(this + 8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = identifier) ;) (return_statement "return;" return ;) })) (if_statement "if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        *(wchar_t *)(this + 8) = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      operator_delete(pwVar2);\n      *(wstring **)this = __s1;\n    }" if (parenthesized_expression "(__s1 != pwVar2)" ( (binary_expression "__s1 != pwVar2" identifier != identifier) )) (compound_statement "{\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        *(wchar_t *)(this + 8) = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }\n      operator_delete(pwVar2);\n      *(wstring **)this = __s1;\n    }" { (expression_statement "sVar3 = uVar1 + 1;" (assignment_expression "sVar3 = uVar1 + 1" identifier = (binary_expression "uVar1 + 1" identifier + number_literal)) ;) (if_statement "if (sVar3 == 1) {\n        *(wchar_t *)(this + 8) = *(wchar_t *)pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }" if (parenthesized_expression "(sVar3 == 1)" ( (binary_expression "sVar3 == 1" identifier == number_literal) )) (compound_statement "{\n        *(wchar_t *)(this + 8) = *(wchar_t *)pwVar2;\n      }" { (expression_statement "*(wchar_t *)(this + 8) = *(wchar_t *)pwVar2;" (assignment_expression "*(wchar_t *)(this + 8) = *(wchar_t *)pwVar2" (pointer_expression "*(wchar_t *)(this + 8)" * (cast_expression "(wchar_t *)(this + 8)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (pointer_expression "*(wchar_t *)pwVar2" * (cast_expression "(wchar_t *)pwVar2" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier))) ;) }) (else_clause "else if (sVar3 != 0) {\n        wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }" else (if_statement "if (sVar3 != 0) {\n        wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }" if (parenthesized_expression "(sVar3 != 0)" ( (binary_expression "sVar3 != 0" identifier != number_literal) )) (compound_statement "{\n        wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);\n        pwVar2 = *(wstring **)this;\n      }" { (expression_statement "wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3);" (call_expression "wmemcpy((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3)" identifier (argument_list "((wchar_t *)__s1,(wchar_t *)pwVar2,sVar3)" ( (cast_expression "(wchar_t *)__s1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(wchar_t *)pwVar2" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , identifier ))) ;) (expression_statement "pwVar2 = *(wstring **)this;" (assignment_expression "pwVar2 = *(wstring **)this" identifier = (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) })))) (expression_statement "operator_delete(pwVar2);" (call_expression "operator_delete(pwVar2)" identifier (argument_list "(pwVar2)" ( identifier ))) ;) (expression_statement "*(wstring **)this = __s1;" (assignment_expression "*(wstring **)this = __s1" (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) })) })) (return_statement "return;" return ;) })))
(translation_unit "void FUN_00185050(undefined4 *param_1,uint param_2)\n\n{\n  wchar_t *__s1;\n  uint uVar1;\n  wchar_t *__s1_00;\n  wchar_t *pwVar2;\n  size_t sVar3;\n  uint uVar4;\n  \n  uVar1 = param_1[1];\n  if (param_2 < uVar1) {\n    param_2 = uVar1;\n  }\n  pwVar2 = (wchar_t *)*param_1;\n  __s1 = param_1 + 2;\n  if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 != param_2) {\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }\n  return;\n}\n\n" (function_definition "void FUN_00185050(undefined4 *param_1,uint param_2)\n\n{\n  wchar_t *__s1;\n  uint uVar1;\n  wchar_t *__s1_00;\n  wchar_t *pwVar2;\n  size_t sVar3;\n  uint uVar4;\n  \n  uVar1 = param_1[1];\n  if (param_2 < uVar1) {\n    param_2 = uVar1;\n  }\n  pwVar2 = (wchar_t *)*param_1;\n  __s1 = param_1 + 2;\n  if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 != param_2) {\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }\n  return;\n}" primitive_type (function_declarator "FUN_00185050(undefined4 *param_1,uint param_2)" identifier (parameter_list "(undefined4 *param_1,uint param_2)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  wchar_t *__s1;\n  uint uVar1;\n  wchar_t *__s1_00;\n  wchar_t *pwVar2;\n  size_t sVar3;\n  uint uVar4;\n  \n  uVar1 = param_1[1];\n  if (param_2 < uVar1) {\n    param_2 = uVar1;\n  }\n  pwVar2 = (wchar_t *)*param_1;\n  __s1 = param_1 + 2;\n  if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 != param_2) {\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }\n  return;\n}" { (declaration "wchar_t *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (declaration "uint uVar1;" type_identifier identifier ;) (declaration "wchar_t *__s1_00;" type_identifier (pointer_declarator "*__s1_00" * identifier) ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "uVar1 = param_1[1];" (assignment_expression "uVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (if_statement "if (param_2 < uVar1) {\n    param_2 = uVar1;\n  }" if (parenthesized_expression "(param_2 < uVar1)" ( (binary_expression "param_2 < uVar1" identifier < identifier) )) (compound_statement "{\n    param_2 = uVar1;\n  }" { (expression_statement "param_2 = uVar1;" (assignment_expression "param_2 = uVar1" identifier = identifier) ;) })) (expression_statement "pwVar2 = (wchar_t *)*param_1;" (assignment_expression "pwVar2 = (wchar_t *)*param_1" identifier = (cast_expression "(wchar_t *)*param_1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "__s1 = param_1 + 2;" (assignment_expression "__s1 = param_1 + 2" identifier = (binary_expression "param_1 + 2" identifier + number_literal)) ;) (if_statement "if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }" if (parenthesized_expression "(__s1 == pwVar2)" ( (binary_expression "__s1 == pwVar2" identifier == identifier) )) (compound_statement "{\n    uVar4 = 3;\n  }" { (expression_statement "uVar4 = 3;" (assignment_expression "uVar4 = 3" identifier = number_literal) ;) }) (else_clause "else {\n    uVar4 = param_1[2];\n  }" else (compound_statement "{\n    uVar4 = param_1[2];\n  }" { (expression_statement "uVar4 = param_1[2];" (assignment_expression "uVar4 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar4 != param_2) {\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }" if (parenthesized_expression "(uVar4 != param_2)" ( (binary_expression "uVar4 != param_2" identifier != identifier) )) (compound_statement "{\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }" { (if_statement "if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }" if (parenthesized_expression "((uVar4 < param_2) || (3 < param_2))" ( (binary_expression "(uVar4 < param_2) || (3 < param_2)" (parenthesized_expression "(uVar4 < param_2)" ( (binary_expression "uVar4 < param_2" identifier < identifier) )) || (parenthesized_expression "(3 < param_2)" ( (binary_expression "3 < param_2" number_literal < identifier) ))) )) (compound_statement "{\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }" { (expression_statement "__s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);" (assignment_expression "__s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4)" identifier = (cast_expression "(wchar_t *)FUN_001844a0(param_1,&param_2,uVar4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_001844a0(param_1,&param_2,uVar4)" identifier (argument_list "(param_1,&param_2,uVar4)" ( identifier , (pointer_expression "&param_2" & identifier) , identifier ))))) ;) (expression_statement "pwVar2 = (wchar_t *)*param_1;" (assignment_expression "pwVar2 = (wchar_t *)*param_1" identifier = (cast_expression "(wchar_t *)*param_1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "sVar3 = param_1[1] + 1;" (assignment_expression "sVar3 = param_1[1] + 1" identifier = (binary_expression "param_1[1] + 1" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal)) ;) (if_statement "if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" if (parenthesized_expression "(sVar3 == 1)" ( (binary_expression "sVar3 == 1" identifier == number_literal) )) (compound_statement "{\n        *__s1_00 = *pwVar2;\n      }" { (expression_statement "*__s1_00 = *pwVar2;" (assignment_expression "*__s1_00 = *pwVar2" (pointer_expression "*__s1_00" * identifier) = (pointer_expression "*pwVar2" * identifier)) ;) }) (else_clause "else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" else (if_statement "if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" if (parenthesized_expression "(sVar3 != 0)" ( (binary_expression "sVar3 != 0" identifier != number_literal) )) (compound_statement "{\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" { (expression_statement "wmemcpy(__s1_00,pwVar2,sVar3);" (call_expression "wmemcpy(__s1_00,pwVar2,sVar3)" identifier (argument_list "(__s1_00,pwVar2,sVar3)" ( identifier , identifier , identifier ))) ;) (expression_statement "pwVar2 = (wchar_t *)*param_1;" (assignment_expression "pwVar2 = (wchar_t *)*param_1" identifier = (cast_expression "(wchar_t *)*param_1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) })))) (if_statement "if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }" if (parenthesized_expression "(__s1 != pwVar2)" ( (binary_expression "__s1 != pwVar2" identifier != identifier) )) (compound_statement "{\n        FUN_001807a0(pwVar2);\n      }" { (expression_statement "FUN_001807a0(pwVar2);" (call_expression "FUN_001807a0(pwVar2)" identifier (argument_list "(pwVar2)" ( identifier ))) ;) })) (expression_statement "*param_1 = __s1_00;" (assignment_expression "*param_1 = __s1_00" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1[2] = param_2;" (assignment_expression "param_1[2] = param_2" (subscript_expression "param_1[2]" identifier [ number_literal ]) = identifier) ;) (return_statement "return;" return ;) })) (if_statement "if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }" if (parenthesized_expression "(__s1 != pwVar2)" ( (binary_expression "__s1 != pwVar2" identifier != identifier) )) (compound_statement "{\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }" { (expression_statement "sVar3 = uVar1 + 1;" (assignment_expression "sVar3 = uVar1 + 1" identifier = (binary_expression "uVar1 + 1" identifier + number_literal)) ;) (if_statement "if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" if (parenthesized_expression "(sVar3 == 1)" ( (binary_expression "sVar3 == 1" identifier == number_literal) )) (compound_statement "{\n        param_1[2] = *pwVar2;\n      }" { (expression_statement "param_1[2] = *pwVar2;" (assignment_expression "param_1[2] = *pwVar2" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (pointer_expression "*pwVar2" * identifier)) ;) }) (else_clause "else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" else (if_statement "if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" if (parenthesized_expression "(sVar3 != 0)" ( (binary_expression "sVar3 != 0" identifier != number_literal) )) (compound_statement "{\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" { (expression_statement "wmemcpy(__s1,pwVar2,sVar3);" (call_expression "wmemcpy(__s1,pwVar2,sVar3)" identifier (argument_list "(__s1,pwVar2,sVar3)" ( identifier , identifier , identifier ))) ;) (expression_statement "pwVar2 = (wchar_t *)*param_1;" (assignment_expression "pwVar2 = (wchar_t *)*param_1" identifier = (cast_expression "(wchar_t *)*param_1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) })))) (expression_statement "FUN_001807a0(pwVar2);" (call_expression "FUN_001807a0(pwVar2)" identifier (argument_list "(pwVar2)" ( identifier ))) ;) (expression_statement "*param_1 = __s1;" (assignment_expression "*param_1 = __s1" (pointer_expression "*param_1" * identifier) = identifier) ;) })) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != IDENT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < IDENT) )) || (parenthesized_expression ( (binary_expression LIT < IDENT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) , IDENT ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) })))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (return_statement return ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (pointer_expression * IDENT)) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) })))) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) })) })) (return_statement return ;) })))
(function_definition "void FUN_00185050(undefined4 *param_1,uint param_2)\n\n{\n  wchar_t *__s1;\n  uint uVar1;\n  wchar_t *__s1_00;\n  wchar_t *pwVar2;\n  size_t sVar3;\n  uint uVar4;\n  \n  uVar1 = param_1[1];\n  if (param_2 < uVar1) {\n    param_2 = uVar1;\n  }\n  pwVar2 = (wchar_t *)*param_1;\n  __s1 = param_1 + 2;\n  if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 != param_2) {\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00185050(undefined4 *param_1,uint param_2)" (identifier "FUN_00185050") (parameter_list "(undefined4 *param_1,uint param_2)" (( "(") (parameter_declaration "undefined4 *param_1" (type_identifier "undefined4") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) () ")"))) (compound_statement "{\n  wchar_t *__s1;\n  uint uVar1;\n  wchar_t *__s1_00;\n  wchar_t *pwVar2;\n  size_t sVar3;\n  uint uVar4;\n  \n  uVar1 = param_1[1];\n  if (param_2 < uVar1) {\n    param_2 = uVar1;\n  }\n  pwVar2 = (wchar_t *)*param_1;\n  __s1 = param_1 + 2;\n  if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 != param_2) {\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }\n  return;\n}" ({ "{") (declaration "wchar_t *__s1;" (type_identifier "wchar_t") (pointer_declarator "*__s1" (* "*") (identifier "__s1")) (; ";")) (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "wchar_t *__s1_00;" (type_identifier "wchar_t") (pointer_declarator "*__s1_00" (* "*") (identifier "__s1_00")) (; ";")) (declaration "wchar_t *pwVar2;" (type_identifier "wchar_t") (pointer_declarator "*pwVar2" (* "*") (identifier "pwVar2")) (; ";")) (declaration "size_t sVar3;" (primitive_type "size_t") (identifier "sVar3") (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (expression_statement "uVar1 = param_1[1];" (assignment_expression "uVar1 = param_1[1]" (identifier "uVar1") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (if_statement "if (param_2 < uVar1) {\n    param_2 = uVar1;\n  }" (if "if") (parenthesized_expression "(param_2 < uVar1)" (( "(") (binary_expression "param_2 < uVar1" (identifier "param_2") (< "<") (identifier "uVar1")) () ")")) (compound_statement "{\n    param_2 = uVar1;\n  }" ({ "{") (expression_statement "param_2 = uVar1;" (assignment_expression "param_2 = uVar1" (identifier "param_2") (= "=") (identifier "uVar1")) (; ";")) (} "}"))) (expression_statement "pwVar2 = (wchar_t *)*param_1;" (assignment_expression "pwVar2 = (wchar_t *)*param_1" (identifier "pwVar2") (= "=") (cast_expression "(wchar_t *)*param_1" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "__s1 = param_1 + 2;" (assignment_expression "__s1 = param_1 + 2" (identifier "__s1") (= "=") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2"))) (; ";")) (if_statement "if (__s1 == pwVar2) {\n    uVar4 = 3;\n  }\n  else {\n    uVar4 = param_1[2];\n  }" (if "if") (parenthesized_expression "(__s1 == pwVar2)" (( "(") (binary_expression "__s1 == pwVar2" (identifier "__s1") (== "==") (identifier "pwVar2")) () ")")) (compound_statement "{\n    uVar4 = 3;\n  }" ({ "{") (expression_statement "uVar4 = 3;" (assignment_expression "uVar4 = 3" (identifier "uVar4") (= "=") (number_literal "3")) (; ";")) (} "}")) (else_clause "else {\n    uVar4 = param_1[2];\n  }" (else "else") (compound_statement "{\n    uVar4 = param_1[2];\n  }" ({ "{") (expression_statement "uVar4 = param_1[2];" (assignment_expression "uVar4 = param_1[2]" (identifier "uVar4") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (} "}")))) (if_statement "if (uVar4 != param_2) {\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }" (if "if") (parenthesized_expression "(uVar4 != param_2)" (( "(") (binary_expression "uVar4 != param_2" (identifier "uVar4") (!= "!=") (identifier "param_2")) () ")")) (compound_statement "{\n    if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }\n    if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }\n  }" ({ "{") (if_statement "if ((uVar4 < param_2) || (3 < param_2)) {\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }" (if "if") (parenthesized_expression "((uVar4 < param_2) || (3 < param_2))" (( "(") (binary_expression "(uVar4 < param_2) || (3 < param_2)" (parenthesized_expression "(uVar4 < param_2)" (( "(") (binary_expression "uVar4 < param_2" (identifier "uVar4") (< "<") (identifier "param_2")) () ")")) (|| "||") (parenthesized_expression "(3 < param_2)" (( "(") (binary_expression "3 < param_2" (number_literal "3") (< "<") (identifier "param_2")) () ")"))) () ")")) (compound_statement "{\n      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);\n      pwVar2 = (wchar_t *)*param_1;\n      sVar3 = param_1[1] + 1;\n      if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }\n      *param_1 = __s1_00;\n      param_1[2] = param_2;\n      return;\n    }" ({ "{") (expression_statement "__s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);" (assignment_expression "__s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4)" (identifier "__s1_00") (= "=") (cast_expression "(wchar_t *)FUN_001844a0(param_1,&param_2,uVar4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_001844a0(param_1,&param_2,uVar4)" (identifier "FUN_001844a0") (argument_list "(param_1,&param_2,uVar4)" (( "(") (identifier "param_1") (, ",") (pointer_expression "&param_2" (& "&") (identifier "param_2")) (, ",") (identifier "uVar4") () ")"))))) (; ";")) (expression_statement "pwVar2 = (wchar_t *)*param_1;" (assignment_expression "pwVar2 = (wchar_t *)*param_1" (identifier "pwVar2") (= "=") (cast_expression "(wchar_t *)*param_1" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "sVar3 = param_1[1] + 1;" (assignment_expression "sVar3 = param_1[1] + 1" (identifier "sVar3") (= "=") (binary_expression "param_1[1] + 1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (sVar3 == 1) {\n        *__s1_00 = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" (if "if") (parenthesized_expression "(sVar3 == 1)" (( "(") (binary_expression "sVar3 == 1" (identifier "sVar3") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *__s1_00 = *pwVar2;\n      }" ({ "{") (expression_statement "*__s1_00 = *pwVar2;" (assignment_expression "*__s1_00 = *pwVar2" (pointer_expression "*__s1_00" (* "*") (identifier "__s1_00")) (= "=") (pointer_expression "*pwVar2" (* "*") (identifier "pwVar2"))) (; ";")) (} "}")) (else_clause "else if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" (else "else") (if_statement "if (sVar3 != 0) {\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" (if "if") (parenthesized_expression "(sVar3 != 0)" (( "(") (binary_expression "sVar3 != 0" (identifier "sVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        wmemcpy(__s1_00,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" ({ "{") (expression_statement "wmemcpy(__s1_00,pwVar2,sVar3);" (call_expression "wmemcpy(__s1_00,pwVar2,sVar3)" (identifier "wmemcpy") (argument_list "(__s1_00,pwVar2,sVar3)" (( "(") (identifier "__s1_00") (, ",") (identifier "pwVar2") (, ",") (identifier "sVar3") () ")"))) (; ";")) (expression_statement "pwVar2 = (wchar_t *)*param_1;" (assignment_expression "pwVar2 = (wchar_t *)*param_1" (identifier "pwVar2") (= "=") (cast_expression "(wchar_t *)*param_1" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}"))))) (if_statement "if (__s1 != pwVar2) {\n        FUN_001807a0(pwVar2);\n      }" (if "if") (parenthesized_expression "(__s1 != pwVar2)" (( "(") (binary_expression "__s1 != pwVar2" (identifier "__s1") (!= "!=") (identifier "pwVar2")) () ")")) (compound_statement "{\n        FUN_001807a0(pwVar2);\n      }" ({ "{") (expression_statement "FUN_001807a0(pwVar2);" (call_expression "FUN_001807a0(pwVar2)" (identifier "FUN_001807a0") (argument_list "(pwVar2)" (( "(") (identifier "pwVar2") () ")"))) (; ";")) (} "}"))) (expression_statement "*param_1 = __s1_00;" (assignment_expression "*param_1 = __s1_00" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "__s1_00")) (; ";")) (expression_statement "param_1[2] = param_2;" (assignment_expression "param_1[2] = param_2" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "param_2")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (if_statement "if (__s1 != pwVar2) {\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }" (if "if") (parenthesized_expression "(__s1 != pwVar2)" (( "(") (binary_expression "__s1 != pwVar2" (identifier "__s1") (!= "!=") (identifier "pwVar2")) () ")")) (compound_statement "{\n      sVar3 = uVar1 + 1;\n      if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }\n      FUN_001807a0(pwVar2);\n      *param_1 = __s1;\n    }" ({ "{") (expression_statement "sVar3 = uVar1 + 1;" (assignment_expression "sVar3 = uVar1 + 1" (identifier "sVar3") (= "=") (binary_expression "uVar1 + 1" (identifier "uVar1") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (sVar3 == 1) {\n        param_1[2] = *pwVar2;\n      }\n      else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" (if "if") (parenthesized_expression "(sVar3 == 1)" (( "(") (binary_expression "sVar3 == 1" (identifier "sVar3") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        param_1[2] = *pwVar2;\n      }" ({ "{") (expression_statement "param_1[2] = *pwVar2;" (assignment_expression "param_1[2] = *pwVar2" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (pointer_expression "*pwVar2" (* "*") (identifier "pwVar2"))) (; ";")) (} "}")) (else_clause "else if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" (else "else") (if_statement "if (sVar3 != 0) {\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" (if "if") (parenthesized_expression "(sVar3 != 0)" (( "(") (binary_expression "sVar3 != 0" (identifier "sVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        wmemcpy(__s1,pwVar2,sVar3);\n        pwVar2 = (wchar_t *)*param_1;\n      }" ({ "{") (expression_statement "wmemcpy(__s1,pwVar2,sVar3);" (call_expression "wmemcpy(__s1,pwVar2,sVar3)" (identifier "wmemcpy") (argument_list "(__s1,pwVar2,sVar3)" (( "(") (identifier "__s1") (, ",") (identifier "pwVar2") (, ",") (identifier "sVar3") () ")"))) (; ";")) (expression_statement "pwVar2 = (wchar_t *)*param_1;" (assignment_expression "pwVar2 = (wchar_t *)*param_1" (identifier "pwVar2") (= "=") (cast_expression "(wchar_t *)*param_1" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}"))))) (expression_statement "FUN_001807a0(pwVar2);" (call_expression "FUN_001807a0(pwVar2)" (identifier "FUN_001807a0") (argument_list "(pwVar2)" (( "(") (identifier "pwVar2") () ")"))) (; ";")) (expression_statement "*param_1 = __s1;" (assignment_expression "*param_1 = __s1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "__s1")) (; ";")) (} "}"))) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::wstring::reserve(unsigned int) */

void __thiscall std::type_1::function_1(type_1 *var_1,type_2 var_2)

{
  type_1 *var_4;
  type_2 var_3;
  type_3 *__s1_00;
  type_1 *var_5;
  size_t var_8;
  type_2 var_6;
  
  var_3 = *(type_2 *)(var_1 + 4);
  if (var_2 < var_3) {
    var_2 = var_3;
  }
  var_5 = *(type_1 **)var_1;
  var_4 = var_1 + 8;
  if (var_4 == var_5) {
    var_6 = 3;
  }
  else {
    var_6 = *(type_2 *)(var_1 + 8);
  }
  if (var_6 != var_2) {
    if ((var_6 < var_2) || (3 < var_2)) {
      __s1_00 = (type_3 *)var_7(var_1,&var_2,var_6);
      var_5 = *(type_1 **)var_1;
      var_8 = *(int *)(var_1 + 4) + 1;
      if (var_8 == 1) {
        *__s1_00 = *(type_3 *)var_5;
      }
      else if (var_8 != 0) {
        var_9(__s1_00,(type_3 *)var_5,var_8);
        var_5 = *(type_1 **)var_1;
      }
      if (var_4 != var_5) {
        var_10(var_5);
      }
      *(type_3 **)var_1 = __s1_00;
      *(type_2 *)(var_1 + 8) = var_2;
      return;
    }
    if (var_4 != var_5) {
      var_8 = var_3 + 1;
      if (var_8 == 1) {
        *(type_3 *)(var_1 + 8) = *(type_3 *)var_5;
      }
      else if (var_8 != 0) {
        var_9((type_3 *)var_4,(type_3 *)var_5,var_8);
        var_5 = *(type_1 **)var_1;
      }
      var_10(var_5);
      *(type_1 **)var_1 = var_4;
    }
  }
  return;
}


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

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

void MASKED(undefined4 *param_1,uint param_2)

{
  wchar_t *__s1;
  uint uVar1;
  wchar_t *__s1_00;
  wchar_t *pwVar2;
  size_t sVar3;
  uint uVar4;
  
  uVar1 = param_1[1];
  if (param_2 < uVar1) {
    param_2 = uVar1;
  }
  pwVar2 = (wchar_t *)*param_1;
  __s1 = param_1 + 2;
  if (__s1 == pwVar2) {
    uVar4 = 3;
  }
  else {
    uVar4 = param_1[2];
  }
  if (uVar4 != param_2) {
    if ((uVar4 < param_2) || (3 < param_2)) {
      __s1_00 = (wchar_t *)FUN_001844a0(param_1,&param_2,uVar4);
      pwVar2 = (wchar_t *)*param_1;
      sVar3 = param_1[1] + 1;
      if (sVar3 == 1) {
        *__s1_00 = *pwVar2;
      }
      else if (sVar3 != 0) {
        wmemcpy(__s1_00,pwVar2,sVar3);
        pwVar2 = (wchar_t *)*param_1;
      }
      if (__s1 != pwVar2) {
        FUN_001807a0(pwVar2);
      }
      *param_1 = __s1_00;
      param_1[2] = param_2;
      return;
    }
    if (__s1 != pwVar2) {
      sVar3 = uVar1 + 1;
      if (sVar3 == 1) {
        param_1[2] = *pwVar2;
      }
      else if (sVar3 != 0) {
        wmemcpy(__s1,pwVar2,sVar3);
        pwVar2 = (wchar_t *)*param_1;
      }
      FUN_001807a0(pwVar2);
      *param_1 = __s1;
    }
  }
  return;
}

