
/* std::wstring::insert(unsigned long, wchar_t const*) */

void __thiscall std::wstring::insert(wstring *this,ulong param_1,wchar_t *param_2)

{
  size_t sVar1;
  
  sVar1 = wcslen(param_2);
  if (param_1 <= *(ulong *)(this + 8)) {
    _M_replace(this,param_1,0,param_2,sVar1);
    return;
  }
                    /* WARNING: Subroutine does not return */
  __throw_out_of_range_fmt
            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",
             param_1);
}



void FUN_002dfc10(long param_1,ulong param_2,wchar_t *param_3)

{
  size_t sVar1;
  
  sVar1 = wcslen(param_3);
  if (param_2 <= *(ulong *)(param_1 + 8)) {
    FUN_002df730(param_1,param_2,0,param_3,sVar1);
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",
               param_2);
}


PUSH R12
MOV R12,RDX
PUSH RBP
MOV RBP,RDI
MOV RDI,RDX
PUSH RBX
MOV RBX,RSI
CALL 0x00147150
MOV RCX,qword ptr [RBP + 0x8]
CMP RBX,RCX
JA 0x002dfc45
MOV RCX,R12
MOV RSI,RBX
MOV RDI,RBP
POP RBX
MOV R8,RAX
POP RBP
XOR EDX,EDX
POP R12
JMP 0x002df730
MOV RDX,RBX
LEA RSI,[0x391166]
LEA RDI,[0x376b80]
XOR EAX,EAX
CALL 0x00319610
(translation_unit "void FUN_002dfc10(long param_1,ulong param_2,wchar_t *param_3)\n\n{\n  size_t sVar1;\n  \n  sVar1 = wcslen(param_3);\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}\n\n" (function_definition "void FUN_002dfc10(long param_1,ulong param_2,wchar_t *param_3)\n\n{\n  size_t sVar1;\n  \n  sVar1 = wcslen(param_3);\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}" primitive_type (function_declarator "FUN_002dfc10(long param_1,ulong param_2,wchar_t *param_3)" identifier (parameter_list "(long param_1,ulong param_2,wchar_t *param_3)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "ulong param_2" type_identifier identifier) , (parameter_declaration "wchar_t *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  size_t sVar1;\n  \n  sVar1 = wcslen(param_3);\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (expression_statement "sVar1 = wcslen(param_3);" (assignment_expression "sVar1 = wcslen(param_3)" identifier = (call_expression "wcslen(param_3)" identifier (argument_list "(param_3)" ( identifier )))) ;) (if_statement "if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }" if (parenthesized_expression "(param_2 <= *(ulong *)(param_1 + 8))" ( (binary_expression "param_2 <= *(ulong *)(param_1 + 8)" identifier <= (pointer_expression "*(ulong *)(param_1 + 8)" * (cast_expression "(ulong *)(param_1 + 8)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) )) (compound_statement "{\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }" { (expression_statement "FUN_002df730(param_1,param_2,0,param_3,sVar1);" (call_expression "FUN_002df730(param_1,param_2,0,param_3,sVar1)" identifier (argument_list "(param_1,param_2,0,param_3,sVar1)" ( identifier , identifier , number_literal , identifier , identifier ))) ;) (return_statement "return;" return ;) })) comment (expression_statement "FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);" (call_expression "FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::replace"" " string_content ") , identifier ))) ;) })))
(translation_unit "/* std::wstring::insert(unsigned long, wchar_t const*) */\n\nvoid __thiscall std::wstring::insert(wstring *this,ulong param_1,wchar_t *param_2)\n\n{\n  size_t sVar1;\n  \n  sVar1 = wcslen(param_2);\n  if (param_1 <= *(ulong *)(this + 8)) {\n    _M_replace(this,param_1,0,param_2,sVar1);\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n             param_1);\n}\n\n" comment (function_definition "void __thiscall std::wstring::insert(wstring *this,ulong param_1,wchar_t *param_2)\n\n{\n  size_t sVar1;\n  \n  sVar1 = wcslen(param_2);\n  if (param_1 <= *(ulong *)(this + 8)) {\n    _M_replace(this,param_1,0,param_2,sVar1);\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n             param_1);\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "insert(wstring *this,ulong param_1,wchar_t *param_2)" identifier (parameter_list "(wstring *this,ulong param_1,wchar_t *param_2)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "ulong param_1" type_identifier identifier) , (parameter_declaration "wchar_t *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  size_t sVar1;\n  \n  sVar1 = wcslen(param_2);\n  if (param_1 <= *(ulong *)(this + 8)) {\n    _M_replace(this,param_1,0,param_2,sVar1);\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n             param_1);\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (expression_statement "sVar1 = wcslen(param_2);" (assignment_expression "sVar1 = wcslen(param_2)" identifier = (call_expression "wcslen(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (if_statement "if (param_1 <= *(ulong *)(this + 8)) {\n    _M_replace(this,param_1,0,param_2,sVar1);\n    return;\n  }" if (parenthesized_expression "(param_1 <= *(ulong *)(this + 8))" ( (binary_expression "param_1 <= *(ulong *)(this + 8)" identifier <= (pointer_expression "*(ulong *)(this + 8)" * (cast_expression "(ulong *)(this + 8)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))) )) (compound_statement "{\n    _M_replace(this,param_1,0,param_2,sVar1);\n    return;\n  }" { (expression_statement "_M_replace(this,param_1,0,param_2,sVar1);" (call_expression "_M_replace(this,param_1,0,param_2,sVar1)" identifier (argument_list "(this,param_1,0,param_2,sVar1)" ( identifier , identifier , number_literal , identifier , identifier ))) ;) (return_statement "return;" return ;) })) comment (expression_statement "__throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n             param_1);" (call_expression "__throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n             param_1)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n             param_1)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::replace"" " string_content ") , identifier ))) ;) })))
(translation_unit "void FUN_002dfc10(long param_1,ulong param_2,wchar_t *param_3)\n\n{\n  size_t sVar1;\n  \n  sVar1 = wcslen(param_3);\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }\n                    \n  FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}\n\n" (function_definition "void FUN_002dfc10(long param_1,ulong param_2,wchar_t *param_3)\n\n{\n  size_t sVar1;\n  \n  sVar1 = wcslen(param_3);\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }\n                    \n  FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}" primitive_type (function_declarator "FUN_002dfc10(long param_1,ulong param_2,wchar_t *param_3)" identifier (parameter_list "(long param_1,ulong param_2,wchar_t *param_3)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "ulong param_2" type_identifier identifier) , (parameter_declaration "wchar_t *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  size_t sVar1;\n  \n  sVar1 = wcslen(param_3);\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }\n                    \n  FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (expression_statement "sVar1 = wcslen(param_3);" (assignment_expression "sVar1 = wcslen(param_3)" identifier = (call_expression "wcslen(param_3)" identifier (argument_list "(param_3)" ( identifier )))) ;) (if_statement "if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }" if (parenthesized_expression "(param_2 <= *(ulong *)(param_1 + 8))" ( (binary_expression "param_2 <= *(ulong *)(param_1 + 8)" identifier <= (pointer_expression "*(ulong *)(param_1 + 8)" * (cast_expression "(ulong *)(param_1 + 8)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) )) (compound_statement "{\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }" { (expression_statement "FUN_002df730(param_1,param_2,0,param_3,sVar1);" (call_expression "FUN_002df730(param_1,param_2,0,param_3,sVar1)" identifier (argument_list "(param_1,param_2,0,param_3,sVar1)" ( identifier , identifier , number_literal , identifier , identifier ))) ;) (return_statement "return;" return ;) })) (expression_statement "FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);" (call_expression "FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::replace"" " string_content ") , identifier ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT , IDENT , IDENT ))) ;) (return_statement return ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , IDENT ))) ;) })))
(function_definition "void FUN_002dfc10(long param_1,ulong param_2,wchar_t *param_3)\n\n{\n  size_t sVar1;\n  \n  sVar1 = wcslen(param_3);\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }\n                    \n  FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}" (primitive_type "void") (function_declarator "FUN_002dfc10(long param_1,ulong param_2,wchar_t *param_3)" (identifier "FUN_002dfc10") (parameter_list "(long param_1,ulong param_2,wchar_t *param_3)" (( "(") (parameter_declaration "long param_1" (sized_type_specifier "long" (long "long")) (identifier "param_1")) (, ",") (parameter_declaration "ulong param_2" (type_identifier "ulong") (identifier "param_2")) (, ",") (parameter_declaration "wchar_t *param_3" (type_identifier "wchar_t") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")"))) (compound_statement "{\n  size_t sVar1;\n  \n  sVar1 = wcslen(param_3);\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }\n                    \n  FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}" ({ "{") (declaration "size_t sVar1;" (primitive_type "size_t") (identifier "sVar1") (; ";")) (expression_statement "sVar1 = wcslen(param_3);" (assignment_expression "sVar1 = wcslen(param_3)" (identifier "sVar1") (= "=") (call_expression "wcslen(param_3)" (identifier "wcslen") (argument_list "(param_3)" (( "(") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }" (if "if") (parenthesized_expression "(param_2 <= *(ulong *)(param_1 + 8))" (( "(") (binary_expression "param_2 <= *(ulong *)(param_1 + 8)" (identifier "param_2") (<= "<=") (pointer_expression "*(ulong *)(param_1 + 8)" (* "*") (cast_expression "(ulong *)(param_1 + 8)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")"))))) () ")")) (compound_statement "{\n    FUN_002df730(param_1,param_2,0,param_3,sVar1);\n    return;\n  }" ({ "{") (expression_statement "FUN_002df730(param_1,param_2,0,param_3,sVar1);" (call_expression "FUN_002df730(param_1,param_2,0,param_3,sVar1)" (identifier "FUN_002df730") (argument_list "(param_1,param_2,0,param_3,sVar1)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (number_literal "0") (, ",") (identifier "param_3") (, ",") (identifier "sVar1") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);" (call_expression "FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2)" (identifier "FUN_00319610") (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2)" (( "(") (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" (" """) (string_content "%s: __pos (which is %zu) > this->size() (which is %zu)") (" """)) (, ",") (string_literal ""basic_string::replace"" (" """) (string_content "basic_string::replace") (" """)) (, ",") (identifier "param_2") () ")"))) (; ";")) (} "}")))

/* std::wstring::insert(unsigned long, wchar_t const*) */

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

{
  size_t sVar1;
  
  sVar1 = var_1(param_2);
  if (var_2 <= *(type_2 *)(var_3 + 8)) {
    var_4(var_3,var_2,0,param_2,sVar1);
    return;
  }
                    /* WARNING: Subroutine does not return */
  var_5
            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",
             var_2);
}


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

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

{
  size_t sVar1;
  
  sVar1 = wcslen(param_3);
  if (param_2 <= *(ulong *)(param_1 + 8)) {
    FUN_002df730(param_1,param_2,0,param_3,sVar1);
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00319610("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",
               param_2);
}

