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

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

{
  wchar_t *__s;
  
  if (param_1 < 4) {
    __s = *(wchar_t **)this;
  }
  else {
    __s = (wchar_t *)_M_create(this,&param_1,0);
    *(wchar_t **)this = __s;
    *(uint *)(this + 8) = param_1;
  }
  if (param_1 != 0) {
    if (param_1 == 1) {
      *__s = param_2;
      *(undefined4 *)(this + 4) = 1;
      __s[1] = L'\0';
      return;
    }
    wmemset(__s,param_2,param_1);
    __s = *(wchar_t **)this;
  }
  *(uint *)(this + 4) = param_1;
  __s[param_1] = L'\0';
  return;
}



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

void FUN_00184570(undefined4 *param_1,size_t param_2,wchar_t param_3)

{
  wchar_t *__s;
  
  if (param_2 < 4) {
    __s = (wchar_t *)*param_1;
  }
  else {
    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);
    *param_1 = __s;
    param_1[2] = param_2;
  }
  if (param_2 != 0) {
    if (param_2 == 1) {
      *__s = param_3;
      param_1[1] = 1;
      __s[1] = L'\0';
      return;
    }
    wmemset(__s,param_3,param_2);
    __s = (wchar_t *)*param_1;
  }
  param_1[1] = param_2;
  __s[param_2] = L'\0';
  return;
}


PUSH ESI
PUSH EBX
CALL 0x00032730
ADD EBX,0x17da89
SUB ESP,0x4
MOV EDX,dword ptr [ESP + 0x14]
MOV ESI,dword ptr [ESP + 0x10]
CMP EDX,0x3
JA 0x001845c0
MOV EAX,dword ptr [ESI]
TEST EDX,EDX
JZ 0x001845af
CMP EDX,0x1
JZ 0x001845e0
SUB ESP,0x4
PUSH EDX
PUSH dword ptr [ESP + 0x20]
PUSH EAX
CALL 0x00026650
MOV EAX,dword ptr [ESI]
MOV EDX,dword ptr [ESP + 0x24]
ADD ESP,0x10
MOV dword ptr [ESI + 0x4],EDX
MOV dword ptr [EAX + EDX*0x4],0x0
ADD ESP,0x4
POP EBX
POP ESI
RET
SUB ESP,0x4
PUSH 0x0
LEA EAX,[ESP + 0x1c]
PUSH EAX
PUSH ESI
CALL 0x001844a0
MOV EDX,dword ptr [ESP + 0x24]
ADD ESP,0x10
MOV dword ptr [ESI],EAX
MOV dword ptr [ESI + 0x8],EDX
JMP 0x0018458f
MOV ECX,dword ptr [ESP + 0x18]
MOV dword ptr [EAX],ECX
MOV dword ptr [ESI + 0x4],EDX
MOV dword ptr [EAX + EDX*0x4],0x0
ADD ESP,0x4
POP EBX
POP ESI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_00184570(undefined4 *param_1,size_t param_2,wchar_t param_3)\n\n{\n  wchar_t *__s;\n  \n  if (param_2 < 4) {\n    __s = (wchar_t *)*param_1;\n  }\n  else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }\n  param_1[1] = param_2;\n  __s[param_2] = L'\0';\n  return;\n}\n\n" comment (function_definition "void FUN_00184570(undefined4 *param_1,size_t param_2,wchar_t param_3)\n\n{\n  wchar_t *__s;\n  \n  if (param_2 < 4) {\n    __s = (wchar_t *)*param_1;\n  }\n  else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }\n  param_1[1] = param_2;\n  __s[param_2] = L'\0';\n  return;\n}" primitive_type (function_declarator "FUN_00184570(undefined4 *param_1,size_t param_2,wchar_t param_3)" identifier (parameter_list "(undefined4 *param_1,size_t param_2,wchar_t param_3)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "wchar_t param_3" type_identifier identifier) ))) (compound_statement "{\n  wchar_t *__s;\n  \n  if (param_2 < 4) {\n    __s = (wchar_t *)*param_1;\n  }\n  else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }\n  param_1[1] = param_2;\n  __s[param_2] = L'\0';\n  return;\n}" { (declaration "wchar_t *__s;" type_identifier (pointer_declarator "*__s" * identifier) ;) (if_statement "if (param_2 < 4) {\n    __s = (wchar_t *)*param_1;\n  }\n  else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }" if (parenthesized_expression "(param_2 < 4)" ( (binary_expression "param_2 < 4" identifier < number_literal) )) (compound_statement "{\n    __s = (wchar_t *)*param_1;\n  }" { (expression_statement "__s = (wchar_t *)*param_1;" (assignment_expression "__s = (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))) ;) }) (else_clause "else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }" else (compound_statement "{\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }" { (expression_statement "__s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);" (assignment_expression "__s = (wchar_t *)FUN_001844a0(param_1,&param_2,0)" identifier = (cast_expression "(wchar_t *)FUN_001844a0(param_1,&param_2,0)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_001844a0(param_1,&param_2,0)" identifier (argument_list "(param_1,&param_2,0)" ( identifier , (pointer_expression "&param_2" & identifier) , number_literal ))))) ;) (expression_statement "*param_1 = __s;" (assignment_expression "*param_1 = __s" (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) ;) }))) (if_statement "if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }" { (if_statement "if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }" { (expression_statement "*__s = param_3;" (assignment_expression "*__s = param_3" (pointer_expression "*__s" * identifier) = identifier) ;) (expression_statement "param_1[1] = 1;" (assignment_expression "param_1[1] = 1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "__s[1] = L'\0';" (assignment_expression "__s[1] = L'\0'" (subscript_expression "__s[1]" identifier [ number_literal ]) = (char_literal "L'\0'" L' escape_sequence ')) ;) (return_statement "return;" return ;) })) (expression_statement "wmemset(__s,param_3,param_2);" (call_expression "wmemset(__s,param_3,param_2)" identifier (argument_list "(__s,param_3,param_2)" ( identifier , identifier , identifier ))) ;) (expression_statement "__s = (wchar_t *)*param_1;" (assignment_expression "__s = (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 "param_1[1] = param_2;" (assignment_expression "param_1[1] = param_2" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "__s[param_2] = L'\0';" (assignment_expression "__s[param_2] = L'\0'" (subscript_expression "__s[param_2]" identifier [ identifier ]) = (char_literal "L'\0'" L' escape_sequence ')) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::wstring::_M_construct(unsigned int, wchar_t) */\n\nvoid __thiscall std::wstring::_M_construct(wstring *this,uint param_1,wchar_t param_2)\n\n{\n  wchar_t *__s;\n  \n  if (param_1 < 4) {\n    __s = *(wchar_t **)this;\n  }\n  else {\n    __s = (wchar_t *)_M_create(this,&param_1,0);\n    *(wchar_t **)this = __s;\n    *(uint *)(this + 8) = param_1;\n  }\n  if (param_1 != 0) {\n    if (param_1 == 1) {\n      *__s = param_2;\n      *(undefined4 *)(this + 4) = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_2,param_1);\n    __s = *(wchar_t **)this;\n  }\n  *(uint *)(this + 4) = param_1;\n  __s[param_1] = L'\0';\n  return;\n}\n\n" comment comment (function_definition "void __thiscall std::wstring::_M_construct(wstring *this,uint param_1,wchar_t param_2)\n\n{\n  wchar_t *__s;\n  \n  if (param_1 < 4) {\n    __s = *(wchar_t **)this;\n  }\n  else {\n    __s = (wchar_t *)_M_create(this,&param_1,0);\n    *(wchar_t **)this = __s;\n    *(uint *)(this + 8) = param_1;\n  }\n  if (param_1 != 0) {\n    if (param_1 == 1) {\n      *__s = param_2;\n      *(undefined4 *)(this + 4) = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_2,param_1);\n    __s = *(wchar_t **)this;\n  }\n  *(uint *)(this + 4) = param_1;\n  __s[param_1] = L'\0';\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "_M_construct(wstring *this,uint param_1,wchar_t param_2)" identifier (parameter_list "(wstring *this,uint param_1,wchar_t param_2)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "uint param_1" type_identifier identifier) , (parameter_declaration "wchar_t param_2" type_identifier identifier) ))) (compound_statement "{\n  wchar_t *__s;\n  \n  if (param_1 < 4) {\n    __s = *(wchar_t **)this;\n  }\n  else {\n    __s = (wchar_t *)_M_create(this,&param_1,0);\n    *(wchar_t **)this = __s;\n    *(uint *)(this + 8) = param_1;\n  }\n  if (param_1 != 0) {\n    if (param_1 == 1) {\n      *__s = param_2;\n      *(undefined4 *)(this + 4) = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_2,param_1);\n    __s = *(wchar_t **)this;\n  }\n  *(uint *)(this + 4) = param_1;\n  __s[param_1] = L'\0';\n  return;\n}" { (declaration "wchar_t *__s;" type_identifier (pointer_declarator "*__s" * identifier) ;) (if_statement "if (param_1 < 4) {\n    __s = *(wchar_t **)this;\n  }\n  else {\n    __s = (wchar_t *)_M_create(this,&param_1,0);\n    *(wchar_t **)this = __s;\n    *(uint *)(this + 8) = param_1;\n  }" if (parenthesized_expression "(param_1 < 4)" ( (binary_expression "param_1 < 4" identifier < number_literal) )) (compound_statement "{\n    __s = *(wchar_t **)this;\n  }" { (expression_statement "__s = *(wchar_t **)this;" (assignment_expression "__s = *(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))) ;) }) (else_clause "else {\n    __s = (wchar_t *)_M_create(this,&param_1,0);\n    *(wchar_t **)this = __s;\n    *(uint *)(this + 8) = param_1;\n  }" else (compound_statement "{\n    __s = (wchar_t *)_M_create(this,&param_1,0);\n    *(wchar_t **)this = __s;\n    *(uint *)(this + 8) = param_1;\n  }" { (expression_statement "__s = (wchar_t *)_M_create(this,&param_1,0);" (assignment_expression "__s = (wchar_t *)_M_create(this,&param_1,0)" identifier = (cast_expression "(wchar_t *)_M_create(this,&param_1,0)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "_M_create(this,&param_1,0)" identifier (argument_list "(this,&param_1,0)" ( identifier , (pointer_expression "&param_1" & identifier) , number_literal ))))) ;) (expression_statement "*(wchar_t **)this = __s;" (assignment_expression "*(wchar_t **)this = __s" (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) ;) }))) (if_statement "if (param_1 != 0) {\n    if (param_1 == 1) {\n      *__s = param_2;\n      *(undefined4 *)(this + 4) = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_2,param_1);\n    __s = *(wchar_t **)this;\n  }" if (parenthesized_expression "(param_1 != 0)" ( (binary_expression "param_1 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_1 == 1) {\n      *__s = param_2;\n      *(undefined4 *)(this + 4) = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_2,param_1);\n    __s = *(wchar_t **)this;\n  }" { (if_statement "if (param_1 == 1) {\n      *__s = param_2;\n      *(undefined4 *)(this + 4) = 1;\n      __s[1] = L'\0';\n      return;\n    }" if (parenthesized_expression "(param_1 == 1)" ( (binary_expression "param_1 == 1" identifier == number_literal) )) (compound_statement "{\n      *__s = param_2;\n      *(undefined4 *)(this + 4) = 1;\n      __s[1] = L'\0';\n      return;\n    }" { (expression_statement "*__s = param_2;" (assignment_expression "*__s = param_2" (pointer_expression "*__s" * identifier) = identifier) ;) (expression_statement "*(undefined4 *)(this + 4) = 1;" (assignment_expression "*(undefined4 *)(this + 4) = 1" (pointer_expression "*(undefined4 *)(this + 4)" * (cast_expression "(undefined4 *)(this + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "__s[1] = L'\0';" (assignment_expression "__s[1] = L'\0'" (subscript_expression "__s[1]" identifier [ number_literal ]) = (char_literal "L'\0'" L' escape_sequence ')) ;) (return_statement "return;" return ;) })) (expression_statement "wmemset(__s,param_2,param_1);" (call_expression "wmemset(__s,param_2,param_1)" identifier (argument_list "(__s,param_2,param_1)" ( identifier , identifier , identifier ))) ;) (expression_statement "__s = *(wchar_t **)this;" (assignment_expression "__s = *(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 "*(uint *)(this + 4) = param_1;" (assignment_expression "*(uint *)(this + 4) = param_1" (pointer_expression "*(uint *)(this + 4)" * (cast_expression "(uint *)(this + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) = identifier) ;) (expression_statement "__s[param_1] = L'\0';" (assignment_expression "__s[param_1] = L'\0'" (subscript_expression "__s[param_1]" identifier [ identifier ]) = (char_literal "L'\0'" L' escape_sequence ')) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_00184570(undefined4 *param_1,size_t param_2,wchar_t param_3)\n\n{\n  wchar_t *__s;\n  \n  if (param_2 < 4) {\n    __s = (wchar_t *)*param_1;\n  }\n  else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }\n  param_1[1] = param_2;\n  __s[param_2] = L'\0';\n  return;\n}\n\n" (function_definition "void FUN_00184570(undefined4 *param_1,size_t param_2,wchar_t param_3)\n\n{\n  wchar_t *__s;\n  \n  if (param_2 < 4) {\n    __s = (wchar_t *)*param_1;\n  }\n  else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }\n  param_1[1] = param_2;\n  __s[param_2] = L'\0';\n  return;\n}" primitive_type (function_declarator "FUN_00184570(undefined4 *param_1,size_t param_2,wchar_t param_3)" identifier (parameter_list "(undefined4 *param_1,size_t param_2,wchar_t param_3)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "wchar_t param_3" type_identifier identifier) ))) (compound_statement "{\n  wchar_t *__s;\n  \n  if (param_2 < 4) {\n    __s = (wchar_t *)*param_1;\n  }\n  else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }\n  param_1[1] = param_2;\n  __s[param_2] = L'\0';\n  return;\n}" { (declaration "wchar_t *__s;" type_identifier (pointer_declarator "*__s" * identifier) ;) (if_statement "if (param_2 < 4) {\n    __s = (wchar_t *)*param_1;\n  }\n  else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }" if (parenthesized_expression "(param_2 < 4)" ( (binary_expression "param_2 < 4" identifier < number_literal) )) (compound_statement "{\n    __s = (wchar_t *)*param_1;\n  }" { (expression_statement "__s = (wchar_t *)*param_1;" (assignment_expression "__s = (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))) ;) }) (else_clause "else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }" else (compound_statement "{\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }" { (expression_statement "__s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);" (assignment_expression "__s = (wchar_t *)FUN_001844a0(param_1,&param_2,0)" identifier = (cast_expression "(wchar_t *)FUN_001844a0(param_1,&param_2,0)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_001844a0(param_1,&param_2,0)" identifier (argument_list "(param_1,&param_2,0)" ( identifier , (pointer_expression "&param_2" & identifier) , number_literal ))))) ;) (expression_statement "*param_1 = __s;" (assignment_expression "*param_1 = __s" (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) ;) }))) (if_statement "if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }" { (if_statement "if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }" { (expression_statement "*__s = param_3;" (assignment_expression "*__s = param_3" (pointer_expression "*__s" * identifier) = identifier) ;) (expression_statement "param_1[1] = 1;" (assignment_expression "param_1[1] = 1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "__s[1] = L'\0';" (assignment_expression "__s[1] = L'\0'" (subscript_expression "__s[1]" identifier [ number_literal ]) = (char_literal "L'\0'" L' escape_sequence ')) ;) (return_statement "return;" return ;) })) (expression_statement "wmemset(__s,param_3,param_2);" (call_expression "wmemset(__s,param_3,param_2)" identifier (argument_list "(__s,param_3,param_2)" ( identifier , identifier , identifier ))) ;) (expression_statement "__s = (wchar_t *)*param_1;" (assignment_expression "__s = (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 "param_1[1] = param_2;" (assignment_expression "param_1[1] = param_2" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "__s[param_2] = L'\0';" (assignment_expression "__s[param_2] = L'\0'" (subscript_expression "__s[param_2]" identifier [ identifier ]) = (char_literal "L'\0'" L' escape_sequence ')) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) , LIT ))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (char_literal L' escape_sequence ')) ;) (return_statement return ;) })) (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 (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (char_literal L' escape_sequence ')) ;) (return_statement return ;) })))
(function_definition "void FUN_00184570(undefined4 *param_1,size_t param_2,wchar_t param_3)\n\n{\n  wchar_t *__s;\n  \n  if (param_2 < 4) {\n    __s = (wchar_t *)*param_1;\n  }\n  else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }\n  param_1[1] = param_2;\n  __s[param_2] = L'\0';\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00184570(undefined4 *param_1,size_t param_2,wchar_t param_3)" (identifier "FUN_00184570") (parameter_list "(undefined4 *param_1,size_t param_2,wchar_t param_3)" (( "(") (parameter_declaration "undefined4 *param_1" (type_identifier "undefined4") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "size_t param_2" (primitive_type "size_t") (identifier "param_2")) (, ",") (parameter_declaration "wchar_t param_3" (type_identifier "wchar_t") (identifier "param_3")) () ")"))) (compound_statement "{\n  wchar_t *__s;\n  \n  if (param_2 < 4) {\n    __s = (wchar_t *)*param_1;\n  }\n  else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }\n  param_1[1] = param_2;\n  __s[param_2] = L'\0';\n  return;\n}" ({ "{") (declaration "wchar_t *__s;" (type_identifier "wchar_t") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (if_statement "if (param_2 < 4) {\n    __s = (wchar_t *)*param_1;\n  }\n  else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }" (if "if") (parenthesized_expression "(param_2 < 4)" (( "(") (binary_expression "param_2 < 4" (identifier "param_2") (< "<") (number_literal "4")) () ")")) (compound_statement "{\n    __s = (wchar_t *)*param_1;\n  }" ({ "{") (expression_statement "__s = (wchar_t *)*param_1;" (assignment_expression "__s = (wchar_t *)*param_1" (identifier "__s") (= "=") (cast_expression "(wchar_t *)*param_1" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else {\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }" (else "else") (compound_statement "{\n    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);\n    *param_1 = __s;\n    param_1[2] = param_2;\n  }" ({ "{") (expression_statement "__s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);" (assignment_expression "__s = (wchar_t *)FUN_001844a0(param_1,&param_2,0)" (identifier "__s") (= "=") (cast_expression "(wchar_t *)FUN_001844a0(param_1,&param_2,0)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_001844a0(param_1,&param_2,0)" (identifier "FUN_001844a0") (argument_list "(param_1,&param_2,0)" (( "(") (identifier "param_1") (, ",") (pointer_expression "&param_2" (& "&") (identifier "param_2")) (, ",") (number_literal "0") () ")"))))) (; ";")) (expression_statement "*param_1 = __s;" (assignment_expression "*param_1 = __s" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "__s")) (; ";")) (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")) (; ";")) (} "}")))) (if_statement "if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }" (if "if") (parenthesized_expression "(param_2 != 0)" (( "(") (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }\n    wmemset(__s,param_3,param_2);\n    __s = (wchar_t *)*param_1;\n  }" ({ "{") (if_statement "if (param_2 == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }" (if "if") (parenthesized_expression "(param_2 == 1)" (( "(") (binary_expression "param_2 == 1" (identifier "param_2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      *__s = param_3;\n      param_1[1] = 1;\n      __s[1] = L'\0';\n      return;\n    }" ({ "{") (expression_statement "*__s = param_3;" (assignment_expression "*__s = param_3" (pointer_expression "*__s" (* "*") (identifier "__s")) (= "=") (identifier "param_3")) (; ";")) (expression_statement "param_1[1] = 1;" (assignment_expression "param_1[1] = 1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "1")) (; ";")) (expression_statement "__s[1] = L'\0';" (assignment_expression "__s[1] = L'\0'" (subscript_expression "__s[1]" (identifier "__s") ([ "[") (number_literal "1") (] "]")) (= "=") (char_literal "L'\0'" (L' "L'") (escape_sequence "\0") (' "'"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "wmemset(__s,param_3,param_2);" (call_expression "wmemset(__s,param_3,param_2)" (identifier "wmemset") (argument_list "(__s,param_3,param_2)" (( "(") (identifier "__s") (, ",") (identifier "param_3") (, ",") (identifier "param_2") () ")"))) (; ";")) (expression_statement "__s = (wchar_t *)*param_1;" (assignment_expression "__s = (wchar_t *)*param_1" (identifier "__s") (= "=") (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 "param_1[1] = param_2;" (assignment_expression "param_1[1] = param_2" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "param_2")) (; ";")) (expression_statement "__s[param_2] = L'\0';" (assignment_expression "__s[param_2] = L'\0'" (subscript_expression "__s[param_2]" (identifier "__s") ([ "[") (identifier "param_2") (] "]")) (= "=") (char_literal "L'\0'" (L' "L'") (escape_sequence "\0") (' "'"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

void __thiscall std::type_1::function_1(type_1 *var_3,type_2 var_1,type_3 param_2)

{
  type_3 *__s;
  
  if (var_1 < 4) {
    __s = *(type_3 **)var_3;
  }
  else {
    __s = (type_3 *)var_2(var_3,&var_1,0);
    *(type_3 **)var_3 = __s;
    *(type_2 *)(var_3 + 8) = var_1;
  }
  if (var_1 != 0) {
    if (var_1 == 1) {
      *__s = param_2;
      *(type_4 *)(var_3 + 4) = 1;
      __s[1] = L'\0';
      return;
    }
    var_4(__s,param_2,var_1);
    __s = *(type_3 **)var_3;
  }
  *(type_2 *)(var_3 + 4) = var_1;
  __s[var_1] = L'\0';
  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: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier)))))) alternative: (else_clause (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)) (number_literal)))))) (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)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (char_literal (escape_sequence)))) (return_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 (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (char_literal (escape_sequence)))) (return_statement))))

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

void MASKED(undefined4 *param_1,size_t param_2,wchar_t param_3)

{
  wchar_t *__s;
  
  if (param_2 < 4) {
    __s = (wchar_t *)*param_1;
  }
  else {
    __s = (wchar_t *)FUN_001844a0(param_1,&param_2,0);
    *param_1 = __s;
    param_1[2] = param_2;
  }
  if (param_2 != 0) {
    if (param_2 == 1) {
      *__s = param_3;
      param_1[1] = 1;
      __s[1] = L'\0';
      return;
    }
    wmemset(__s,param_3,param_2);
    __s = (wchar_t *)*param_1;
  }
  param_1[1] = param_2;
  __s[param_2] = L'\0';
  return;
}

