
/* std::string::_M_construct(unsigned long, char) */

void __thiscall std::string::_M_construct(string *this,ulong param_1,char param_2)

{
  char *__s;
  size_t local_20 [2];
  
  local_20[0] = param_1;
  if (param_1 < 0x10) {
    __s = *(char **)this;
  }
  else {
    __s = (char *)_M_create(this,local_20,0);
    *(char **)this = __s;
    *(size_t *)(this + 0x10) = local_20[0];
  }
  if (local_20[0] != 0) {
    if (local_20[0] == 1) {
      *__s = param_2;
      *(undefined8 *)(this + 8) = 1;
      *(undefined1 *)(*(long *)this + 1) = 0;
      return;
    }
    memset(__s,(int)param_2,local_20[0]);
    __s = *(char **)this;
  }
  *(size_t *)(this + 8) = local_20[0];
  __s[local_20[0]] = '\0';
  return;
}



void FUN_002a9350(long *param_1,ulong param_2,char param_3)

{
  char *__s;
  size_t local_20 [2];
  
  local_20[0] = param_2;
  if (param_2 < 0x10) {
    __s = (char *)*param_1;
  }
  else {
    __s = (char *)FUN_002a92b0(param_1,local_20,0);
    *param_1 = (long)__s;
    param_1[2] = local_20[0];
  }
  if (local_20[0] != 0) {
    if (local_20[0] == 1) {
      *__s = param_3;
      param_1[1] = 1;
      *(undefined1 *)(*param_1 + 1) = 0;
      return;
    }
    memset(__s,(int)param_3,local_20[0]);
    __s = (char *)*param_1;
  }
  param_1[1] = local_20[0];
  __s[local_20[0]] = '\0';
  return;
}


PUSH RBP
MOV EBP,EDX
PUSH RBX
MOV RBX,RDI
SUB RSP,0x18
MOV qword ptr [RSP + 0x8],RSI
CMP RSI,0xf
JA 0x002a93a0
MOV RAX,qword ptr [RDI]
MOV RDX,RSI
TEST RDX,RDX
JZ 0x002a938b
CMP RDX,0x1
JZ 0x002a93c0
MOVSX ESI,BPL
MOV RDI,RAX
CALL 0x00144100
MOV RDX,qword ptr [RSP + 0x8]
MOV RAX,qword ptr [RBX]
MOV qword ptr [RBX + 0x8],RDX
MOV byte ptr [RAX + RDX*0x1],0x0
ADD RSP,0x18
POP RBX
POP RBP
RET
XOR EDX,EDX
LEA RSI,[RSP + 0x8]
CALL 0x002a92b0
MOV RDX,qword ptr [RSP + 0x8]
MOV qword ptr [RBX],RAX
MOV qword ptr [RBX + 0x10],RDX
JMP 0x002a936c
MOV byte ptr [RAX],BPL
MOV RDX,qword ptr [RSP + 0x8]
MOV RAX,qword ptr [RBX]
MOV qword ptr [RBX + 0x8],RDX
MOV byte ptr [RAX + RDX*0x1],0x0
ADD RSP,0x18
POP RBX
POP RBP
RET
(translation_unit "void FUN_002a9350(long *param_1,ulong param_2,char param_3)\n\n{\n  char *__s;\n  size_t local_20 [2];\n  \n  local_20[0] = param_2;\n  if (param_2 < 0x10) {\n    __s = (char *)*param_1;\n  }\n  else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }\n  if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }\n  param_1[1] = local_20[0];\n  __s[local_20[0]] = '\0';\n  return;\n}\n\n" (function_definition "void FUN_002a9350(long *param_1,ulong param_2,char param_3)\n\n{\n  char *__s;\n  size_t local_20 [2];\n  \n  local_20[0] = param_2;\n  if (param_2 < 0x10) {\n    __s = (char *)*param_1;\n  }\n  else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }\n  if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }\n  param_1[1] = local_20[0];\n  __s[local_20[0]] = '\0';\n  return;\n}" primitive_type (function_declarator "FUN_002a9350(long *param_1,ulong param_2,char param_3)" identifier (parameter_list "(long *param_1,ulong param_2,char param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "ulong param_2" type_identifier identifier) , (parameter_declaration "char param_3" primitive_type identifier) ))) (compound_statement "{\n  char *__s;\n  size_t local_20 [2];\n  \n  local_20[0] = param_2;\n  if (param_2 < 0x10) {\n    __s = (char *)*param_1;\n  }\n  else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }\n  if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }\n  param_1[1] = local_20[0];\n  __s[local_20[0]] = '\0';\n  return;\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t local_20 [2];" primitive_type (array_declarator "local_20 [2]" identifier [ number_literal ]) ;) (expression_statement "local_20[0] = param_2;" (assignment_expression "local_20[0] = param_2" (subscript_expression "local_20[0]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (param_2 < 0x10) {\n    __s = (char *)*param_1;\n  }\n  else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }" if (parenthesized_expression "(param_2 < 0x10)" ( (binary_expression "param_2 < 0x10" identifier < number_literal) )) (compound_statement "{\n    __s = (char *)*param_1;\n  }" { (expression_statement "__s = (char *)*param_1;" (assignment_expression "__s = (char *)*param_1" identifier = (cast_expression "(char *)*param_1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }" else (compound_statement "{\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }" { (expression_statement "__s = (char *)FUN_002a92b0(param_1,local_20,0);" (assignment_expression "__s = (char *)FUN_002a92b0(param_1,local_20,0)" identifier = (cast_expression "(char *)FUN_002a92b0(param_1,local_20,0)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_002a92b0(param_1,local_20,0)" identifier (argument_list "(param_1,local_20,0)" ( identifier , identifier , number_literal ))))) ;) (expression_statement "*param_1 = (long)__s;" (assignment_expression "*param_1 = (long)__s" (pointer_expression "*param_1" * identifier) = (cast_expression "(long)__s" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (expression_statement "param_1[2] = local_20[0];" (assignment_expression "param_1[2] = local_20[0]" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (subscript_expression "local_20[0]" identifier [ number_literal ])) ;) }))) (if_statement "if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }" if (parenthesized_expression "(local_20[0] != 0)" ( (binary_expression "local_20[0] != 0" (subscript_expression "local_20[0]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }" { (if_statement "if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }" if (parenthesized_expression "(local_20[0] == 1)" ( (binary_expression "local_20[0] == 1" (subscript_expression "local_20[0]" identifier [ number_literal ]) == number_literal) )) (compound_statement "{\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 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 "*(undefined1 *)(*param_1 + 1) = 0;" (assignment_expression "*(undefined1 *)(*param_1 + 1) = 0" (pointer_expression "*(undefined1 *)(*param_1 + 1)" * (cast_expression "(undefined1 *)(*param_1 + 1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + 1)" ( (binary_expression "*param_1 + 1" (pointer_expression "*param_1" * identifier) + number_literal) )))) = number_literal) ;) (return_statement "return;" return ;) })) (expression_statement "memset(__s,(int)param_3,local_20[0]);" (call_expression "memset(__s,(int)param_3,local_20[0])" identifier (argument_list "(__s,(int)param_3,local_20[0])" ( identifier , (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) , (subscript_expression "local_20[0]" identifier [ number_literal ]) ))) ;) (expression_statement "__s = (char *)*param_1;" (assignment_expression "__s = (char *)*param_1" identifier = (cast_expression "(char *)*param_1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) })) (expression_statement "param_1[1] = local_20[0];" (assignment_expression "param_1[1] = local_20[0]" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (subscript_expression "local_20[0]" identifier [ number_literal ])) ;) (expression_statement "__s[local_20[0]] = '\0';" (assignment_expression "__s[local_20[0]] = '\0'" (subscript_expression "__s[local_20[0]]" identifier [ (subscript_expression "local_20[0]" identifier [ number_literal ]) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (return_statement "return;" return ;) })))
(translation_unit "/* std::string::_M_construct(unsigned long, char) */\n\nvoid __thiscall std::string::_M_construct(string *this,ulong param_1,char param_2)\n\n{\n  char *__s;\n  size_t local_20 [2];\n  \n  local_20[0] = param_1;\n  if (param_1 < 0x10) {\n    __s = *(char **)this;\n  }\n  else {\n    __s = (char *)_M_create(this,local_20,0);\n    *(char **)this = __s;\n    *(size_t *)(this + 0x10) = local_20[0];\n  }\n  if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_2;\n      *(undefined8 *)(this + 8) = 1;\n      *(undefined1 *)(*(long *)this + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_2,local_20[0]);\n    __s = *(char **)this;\n  }\n  *(size_t *)(this + 8) = local_20[0];\n  __s[local_20[0]] = '\0';\n  return;\n}\n\n" comment (function_definition "void __thiscall std::string::_M_construct(string *this,ulong param_1,char param_2)\n\n{\n  char *__s;\n  size_t local_20 [2];\n  \n  local_20[0] = param_1;\n  if (param_1 < 0x10) {\n    __s = *(char **)this;\n  }\n  else {\n    __s = (char *)_M_create(this,local_20,0);\n    *(char **)this = __s;\n    *(size_t *)(this + 0x10) = local_20[0];\n  }\n  if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_2;\n      *(undefined8 *)(this + 8) = 1;\n      *(undefined1 *)(*(long *)this + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_2,local_20[0]);\n    __s = *(char **)this;\n  }\n  *(size_t *)(this + 8) = local_20[0];\n  __s[local_20[0]] = '\0';\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::string::" identifier : : identifier : :) (function_declarator "_M_construct(string *this,ulong param_1,char param_2)" identifier (parameter_list "(string *this,ulong param_1,char param_2)" ( (parameter_declaration "string *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "ulong param_1" type_identifier identifier) , (parameter_declaration "char param_2" primitive_type identifier) ))) (compound_statement "{\n  char *__s;\n  size_t local_20 [2];\n  \n  local_20[0] = param_1;\n  if (param_1 < 0x10) {\n    __s = *(char **)this;\n  }\n  else {\n    __s = (char *)_M_create(this,local_20,0);\n    *(char **)this = __s;\n    *(size_t *)(this + 0x10) = local_20[0];\n  }\n  if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_2;\n      *(undefined8 *)(this + 8) = 1;\n      *(undefined1 *)(*(long *)this + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_2,local_20[0]);\n    __s = *(char **)this;\n  }\n  *(size_t *)(this + 8) = local_20[0];\n  __s[local_20[0]] = '\0';\n  return;\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t local_20 [2];" primitive_type (array_declarator "local_20 [2]" identifier [ number_literal ]) ;) (expression_statement "local_20[0] = param_1;" (assignment_expression "local_20[0] = param_1" (subscript_expression "local_20[0]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (param_1 < 0x10) {\n    __s = *(char **)this;\n  }\n  else {\n    __s = (char *)_M_create(this,local_20,0);\n    *(char **)this = __s;\n    *(size_t *)(this + 0x10) = local_20[0];\n  }" if (parenthesized_expression "(param_1 < 0x10)" ( (binary_expression "param_1 < 0x10" identifier < number_literal) )) (compound_statement "{\n    __s = *(char **)this;\n  }" { (expression_statement "__s = *(char **)this;" (assignment_expression "__s = *(char **)this" identifier = (pointer_expression "*(char **)this" * (cast_expression "(char **)this" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }) (else_clause "else {\n    __s = (char *)_M_create(this,local_20,0);\n    *(char **)this = __s;\n    *(size_t *)(this + 0x10) = local_20[0];\n  }" else (compound_statement "{\n    __s = (char *)_M_create(this,local_20,0);\n    *(char **)this = __s;\n    *(size_t *)(this + 0x10) = local_20[0];\n  }" { (expression_statement "__s = (char *)_M_create(this,local_20,0);" (assignment_expression "__s = (char *)_M_create(this,local_20,0)" identifier = (cast_expression "(char *)_M_create(this,local_20,0)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "_M_create(this,local_20,0)" identifier (argument_list "(this,local_20,0)" ( identifier , identifier , number_literal ))))) ;) (expression_statement "*(char **)this = __s;" (assignment_expression "*(char **)this = __s" (pointer_expression "*(char **)this" * (cast_expression "(char **)this" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) (expression_statement "*(size_t *)(this + 0x10) = local_20[0];" (assignment_expression "*(size_t *)(this + 0x10) = local_20[0]" (pointer_expression "*(size_t *)(this + 0x10)" * (cast_expression "(size_t *)(this + 0x10)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x10)" ( (binary_expression "this + 0x10" identifier + number_literal) )))) = (subscript_expression "local_20[0]" identifier [ number_literal ])) ;) }))) (if_statement "if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_2;\n      *(undefined8 *)(this + 8) = 1;\n      *(undefined1 *)(*(long *)this + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_2,local_20[0]);\n    __s = *(char **)this;\n  }" if (parenthesized_expression "(local_20[0] != 0)" ( (binary_expression "local_20[0] != 0" (subscript_expression "local_20[0]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n    if (local_20[0] == 1) {\n      *__s = param_2;\n      *(undefined8 *)(this + 8) = 1;\n      *(undefined1 *)(*(long *)this + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_2,local_20[0]);\n    __s = *(char **)this;\n  }" { (if_statement "if (local_20[0] == 1) {\n      *__s = param_2;\n      *(undefined8 *)(this + 8) = 1;\n      *(undefined1 *)(*(long *)this + 1) = 0;\n      return;\n    }" if (parenthesized_expression "(local_20[0] == 1)" ( (binary_expression "local_20[0] == 1" (subscript_expression "local_20[0]" identifier [ number_literal ]) == number_literal) )) (compound_statement "{\n      *__s = param_2;\n      *(undefined8 *)(this + 8) = 1;\n      *(undefined1 *)(*(long *)this + 1) = 0;\n      return;\n    }" { (expression_statement "*__s = param_2;" (assignment_expression "*__s = param_2" (pointer_expression "*__s" * identifier) = identifier) ;) (expression_statement "*(undefined8 *)(this + 8) = 1;" (assignment_expression "*(undefined8 *)(this + 8) = 1" (pointer_expression "*(undefined8 *)(this + 8)" * (cast_expression "(undefined8 *)(this + 8)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined1 *)(*(long *)this + 1) = 0;" (assignment_expression "*(undefined1 *)(*(long *)this + 1) = 0" (pointer_expression "*(undefined1 *)(*(long *)this + 1)" * (cast_expression "(undefined1 *)(*(long *)this + 1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(long *)this + 1)" ( (binary_expression "*(long *)this + 1" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) )))) = number_literal) ;) (return_statement "return;" return ;) })) (expression_statement "memset(__s,(int)param_2,local_20[0]);" (call_expression "memset(__s,(int)param_2,local_20[0])" identifier (argument_list "(__s,(int)param_2,local_20[0])" ( identifier , (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier) , (subscript_expression "local_20[0]" identifier [ number_literal ]) ))) ;) (expression_statement "__s = *(char **)this;" (assignment_expression "__s = *(char **)this" identifier = (pointer_expression "*(char **)this" * (cast_expression "(char **)this" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) })) (expression_statement "*(size_t *)(this + 8) = local_20[0];" (assignment_expression "*(size_t *)(this + 8) = local_20[0]" (pointer_expression "*(size_t *)(this + 8)" * (cast_expression "(size_t *)(this + 8)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (subscript_expression "local_20[0]" identifier [ number_literal ])) ;) (expression_statement "__s[local_20[0]] = '\0';" (assignment_expression "__s[local_20[0]] = '\0'" (subscript_expression "__s[local_20[0]]" identifier [ (subscript_expression "local_20[0]" identifier [ number_literal ]) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_002a9350(long *param_1,ulong param_2,char param_3)\n\n{\n  char *__s;\n  size_t local_20 [2];\n  \n  local_20[0] = param_2;\n  if (param_2 < 0x10) {\n    __s = (char *)*param_1;\n  }\n  else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }\n  if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }\n  param_1[1] = local_20[0];\n  __s[local_20[0]] = '\0';\n  return;\n}\n\n" (function_definition "void FUN_002a9350(long *param_1,ulong param_2,char param_3)\n\n{\n  char *__s;\n  size_t local_20 [2];\n  \n  local_20[0] = param_2;\n  if (param_2 < 0x10) {\n    __s = (char *)*param_1;\n  }\n  else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }\n  if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }\n  param_1[1] = local_20[0];\n  __s[local_20[0]] = '\0';\n  return;\n}" primitive_type (function_declarator "FUN_002a9350(long *param_1,ulong param_2,char param_3)" identifier (parameter_list "(long *param_1,ulong param_2,char param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "ulong param_2" type_identifier identifier) , (parameter_declaration "char param_3" primitive_type identifier) ))) (compound_statement "{\n  char *__s;\n  size_t local_20 [2];\n  \n  local_20[0] = param_2;\n  if (param_2 < 0x10) {\n    __s = (char *)*param_1;\n  }\n  else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }\n  if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }\n  param_1[1] = local_20[0];\n  __s[local_20[0]] = '\0';\n  return;\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t local_20 [2];" primitive_type (array_declarator "local_20 [2]" identifier [ number_literal ]) ;) (expression_statement "local_20[0] = param_2;" (assignment_expression "local_20[0] = param_2" (subscript_expression "local_20[0]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (param_2 < 0x10) {\n    __s = (char *)*param_1;\n  }\n  else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }" if (parenthesized_expression "(param_2 < 0x10)" ( (binary_expression "param_2 < 0x10" identifier < number_literal) )) (compound_statement "{\n    __s = (char *)*param_1;\n  }" { (expression_statement "__s = (char *)*param_1;" (assignment_expression "__s = (char *)*param_1" identifier = (cast_expression "(char *)*param_1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }" else (compound_statement "{\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }" { (expression_statement "__s = (char *)FUN_002a92b0(param_1,local_20,0);" (assignment_expression "__s = (char *)FUN_002a92b0(param_1,local_20,0)" identifier = (cast_expression "(char *)FUN_002a92b0(param_1,local_20,0)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_002a92b0(param_1,local_20,0)" identifier (argument_list "(param_1,local_20,0)" ( identifier , identifier , number_literal ))))) ;) (expression_statement "*param_1 = (long)__s;" (assignment_expression "*param_1 = (long)__s" (pointer_expression "*param_1" * identifier) = (cast_expression "(long)__s" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (expression_statement "param_1[2] = local_20[0];" (assignment_expression "param_1[2] = local_20[0]" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (subscript_expression "local_20[0]" identifier [ number_literal ])) ;) }))) (if_statement "if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }" if (parenthesized_expression "(local_20[0] != 0)" ( (binary_expression "local_20[0] != 0" (subscript_expression "local_20[0]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }" { (if_statement "if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }" if (parenthesized_expression "(local_20[0] == 1)" ( (binary_expression "local_20[0] == 1" (subscript_expression "local_20[0]" identifier [ number_literal ]) == number_literal) )) (compound_statement "{\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 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 "*(undefined1 *)(*param_1 + 1) = 0;" (assignment_expression "*(undefined1 *)(*param_1 + 1) = 0" (pointer_expression "*(undefined1 *)(*param_1 + 1)" * (cast_expression "(undefined1 *)(*param_1 + 1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + 1)" ( (binary_expression "*param_1 + 1" (pointer_expression "*param_1" * identifier) + number_literal) )))) = number_literal) ;) (return_statement "return;" return ;) })) (expression_statement "memset(__s,(int)param_3,local_20[0]);" (call_expression "memset(__s,(int)param_3,local_20[0])" identifier (argument_list "(__s,(int)param_3,local_20[0])" ( identifier , (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) , (subscript_expression "local_20[0]" identifier [ number_literal ]) ))) ;) (expression_statement "__s = (char *)*param_1;" (assignment_expression "__s = (char *)*param_1" identifier = (cast_expression "(char *)*param_1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) })) (expression_statement "param_1[1] = local_20[0];" (assignment_expression "param_1[1] = local_20[0]" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (subscript_expression "local_20[0]" identifier [ number_literal ])) ;) (expression_statement "__s[local_20[0]] = '\0';" (assignment_expression "__s[local_20[0]] = '\0'" (subscript_expression "__s[local_20[0]]" identifier [ (subscript_expression "local_20[0]" identifier [ number_literal ]) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = 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 , IDENT , LIT ))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) )))) = LIT) ;) (return_statement return ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE) ) IDENT) , (subscript_expression IDENT [ LIT ]) ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ (subscript_expression IDENT [ LIT ]) ]) = (char_literal ' escape_sequence ')) ;) (return_statement return ;) })))
(function_definition "void FUN_002a9350(long *param_1,ulong param_2,char param_3)\n\n{\n  char *__s;\n  size_t local_20 [2];\n  \n  local_20[0] = param_2;\n  if (param_2 < 0x10) {\n    __s = (char *)*param_1;\n  }\n  else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }\n  if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }\n  param_1[1] = local_20[0];\n  __s[local_20[0]] = '\0';\n  return;\n}" (primitive_type "void") (function_declarator "FUN_002a9350(long *param_1,ulong param_2,char param_3)" (identifier "FUN_002a9350") (parameter_list "(long *param_1,ulong param_2,char param_3)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "ulong param_2" (type_identifier "ulong") (identifier "param_2")) (, ",") (parameter_declaration "char param_3" (primitive_type "char") (identifier "param_3")) () ")"))) (compound_statement "{\n  char *__s;\n  size_t local_20 [2];\n  \n  local_20[0] = param_2;\n  if (param_2 < 0x10) {\n    __s = (char *)*param_1;\n  }\n  else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }\n  if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }\n  param_1[1] = local_20[0];\n  __s[local_20[0]] = '\0';\n  return;\n}" ({ "{") (declaration "char *__s;" (primitive_type "char") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (declaration "size_t local_20 [2];" (primitive_type "size_t") (array_declarator "local_20 [2]" (identifier "local_20") ([ "[") (number_literal "2") (] "]")) (; ";")) (expression_statement "local_20[0] = param_2;" (assignment_expression "local_20[0] = param_2" (subscript_expression "local_20[0]" (identifier "local_20") ([ "[") (number_literal "0") (] "]")) (= "=") (identifier "param_2")) (; ";")) (if_statement "if (param_2 < 0x10) {\n    __s = (char *)*param_1;\n  }\n  else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }" (if "if") (parenthesized_expression "(param_2 < 0x10)" (( "(") (binary_expression "param_2 < 0x10" (identifier "param_2") (< "<") (number_literal "0x10")) () ")")) (compound_statement "{\n    __s = (char *)*param_1;\n  }" ({ "{") (expression_statement "__s = (char *)*param_1;" (assignment_expression "__s = (char *)*param_1" (identifier "__s") (= "=") (cast_expression "(char *)*param_1" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else {\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }" (else "else") (compound_statement "{\n    __s = (char *)FUN_002a92b0(param_1,local_20,0);\n    *param_1 = (long)__s;\n    param_1[2] = local_20[0];\n  }" ({ "{") (expression_statement "__s = (char *)FUN_002a92b0(param_1,local_20,0);" (assignment_expression "__s = (char *)FUN_002a92b0(param_1,local_20,0)" (identifier "__s") (= "=") (cast_expression "(char *)FUN_002a92b0(param_1,local_20,0)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_002a92b0(param_1,local_20,0)" (identifier "FUN_002a92b0") (argument_list "(param_1,local_20,0)" (( "(") (identifier "param_1") (, ",") (identifier "local_20") (, ",") (number_literal "0") () ")"))))) (; ";")) (expression_statement "*param_1 = (long)__s;" (assignment_expression "*param_1 = (long)__s" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(long)__s" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "__s"))) (; ";")) (expression_statement "param_1[2] = local_20[0];" (assignment_expression "param_1[2] = local_20[0]" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (subscript_expression "local_20[0]" (identifier "local_20") ([ "[") (number_literal "0") (] "]"))) (; ";")) (} "}")))) (if_statement "if (local_20[0] != 0) {\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }" (if "if") (parenthesized_expression "(local_20[0] != 0)" (( "(") (binary_expression "local_20[0] != 0" (subscript_expression "local_20[0]" (identifier "local_20") ([ "[") (number_literal "0") (] "]")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }\n    memset(__s,(int)param_3,local_20[0]);\n    __s = (char *)*param_1;\n  }" ({ "{") (if_statement "if (local_20[0] == 1) {\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 0;\n      return;\n    }" (if "if") (parenthesized_expression "(local_20[0] == 1)" (( "(") (binary_expression "local_20[0] == 1" (subscript_expression "local_20[0]" (identifier "local_20") ([ "[") (number_literal "0") (] "]")) (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      *__s = param_3;\n      param_1[1] = 1;\n      *(undefined1 *)(*param_1 + 1) = 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 "*(undefined1 *)(*param_1 + 1) = 0;" (assignment_expression "*(undefined1 *)(*param_1 + 1) = 0" (pointer_expression "*(undefined1 *)(*param_1 + 1)" (* "*") (cast_expression "(undefined1 *)(*param_1 + 1)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + 1)" (( "(") (binary_expression "*param_1 + 1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "1")) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "memset(__s,(int)param_3,local_20[0]);" (call_expression "memset(__s,(int)param_3,local_20[0])" (identifier "memset") (argument_list "(__s,(int)param_3,local_20[0])" (( "(") (identifier "__s") (, ",") (cast_expression "(int)param_3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_3")) (, ",") (subscript_expression "local_20[0]" (identifier "local_20") ([ "[") (number_literal "0") (] "]")) () ")"))) (; ";")) (expression_statement "__s = (char *)*param_1;" (assignment_expression "__s = (char *)*param_1" (identifier "__s") (= "=") (cast_expression "(char *)*param_1" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}"))) (expression_statement "param_1[1] = local_20[0];" (assignment_expression "param_1[1] = local_20[0]" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (subscript_expression "local_20[0]" (identifier "local_20") ([ "[") (number_literal "0") (] "]"))) (; ";")) (expression_statement "__s[local_20[0]] = '\0';" (assignment_expression "__s[local_20[0]] = '\0'" (subscript_expression "__s[local_20[0]]" (identifier "__s") ([ "[") (subscript_expression "local_20[0]" (identifier "local_20") ([ "[") (number_literal "0") (] "]")) (] "]")) (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* std::string::_M_construct(unsigned long, char) */

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

{
  char *__s;
  size_t local_20 [2];
  
  local_20[0] = var_1;
  if (var_1 < 0x10) {
    __s = *(char **)var_3;
  }
  else {
    __s = (char *)var_2(var_3,local_20,0);
    *(char **)var_3 = __s;
    *(size_t *)(var_3 + 0x10) = local_20[0];
  }
  if (local_20[0] != 0) {
    if (local_20[0] == 1) {
      *__s = param_2;
      *(type_3 *)(var_3 + 8) = 1;
      *(type_4 *)(*(long *)var_3 + 1) = 0;
      return;
    }
    var_4(__s,(int)param_2,local_20[0]);
    __s = *(char **)var_3;
  }
  *(size_t *)(var_3 + 8) = local_20[0];
  __s[local_20[0]] = '\0';
  return;
}


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

void MASKED(long *param_1,ulong param_2,char param_3)

{
  char *__s;
  size_t local_20 [2];
  
  local_20[0] = param_2;
  if (param_2 < 0x10) {
    __s = (char *)*param_1;
  }
  else {
    __s = (char *)FUN_002a92b0(param_1,local_20,0);
    *param_1 = (long)__s;
    param_1[2] = local_20[0];
  }
  if (local_20[0] != 0) {
    if (local_20[0] == 1) {
      *__s = param_3;
      param_1[1] = 1;
      *(undefined1 *)(*param_1 + 1) = 0;
      return;
    }
    memset(__s,(int)param_3,local_20[0]);
    __s = (char *)*param_1;
  }
  param_1[1] = local_20[0];
  __s[local_20[0]] = '\0';
  return;
}

