
/* std::string::replace(unsigned long, unsigned long, char const*) */

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

{
  size_t sVar1;
  ulong uVar2;
  
  sVar1 = strlen(param_3);
  uVar2 = *(ulong *)(this + 8) - param_1;
  if (uVar2 <= param_2) {
    param_2 = uVar2;
  }
  if (param_1 <= *(ulong *)(this + 8)) {
    _M_replace(this,param_1,param_2,param_3,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_0027eb00(long param_1,ulong param_2,ulong param_3,char *param_4)

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


PUSH R13
MOV R13,RCX
PUSH R12
MOV R12,RDI
MOV RDI,RCX
PUSH RBP
MOV RBP,RDX
PUSH RBX
MOV RBX,RSI
SUB RSP,0x8
CALL 0x0013e490
MOV RCX,qword ptr [R12 + 0x8]
MOV RDX,RBP
MOV RDI,RCX
SUB RDI,RBX
CMP RDI,RBP
CMOVBE RDX,RDI
CMP RBX,RCX
JA 0x0027eb53
ADD RSP,0x8
MOV RCX,R13
MOV RSI,RBX
MOV RDI,R12
POP RBX
MOV R8,RAX
POP RBP
POP R12
POP R13
JMP 0x0027e650
MOV RDX,RBX
LEA RSI,[0x329286]
LEA RDI,[0x311130]
XOR EAX,EAX
CALL 0x002b56d0
(translation_unit "void FUN_0027eb00(long param_1,ulong param_2,ulong param_3,char *param_4)\n\n{\n  size_t sVar1;\n  ulong uVar2;\n  \n  sVar1 = strlen(param_4);\n  uVar2 = *(ulong *)(param_1 + 8) - param_2;\n  if (uVar2 <= param_3) {\n    param_3 = uVar2;\n  }\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_0027e650(param_1,param_2,param_3,param_4,sVar1);\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}\n\n" (function_definition "void FUN_0027eb00(long param_1,ulong param_2,ulong param_3,char *param_4)\n\n{\n  size_t sVar1;\n  ulong uVar2;\n  \n  sVar1 = strlen(param_4);\n  uVar2 = *(ulong *)(param_1 + 8) - param_2;\n  if (uVar2 <= param_3) {\n    param_3 = uVar2;\n  }\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_0027e650(param_1,param_2,param_3,param_4,sVar1);\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}" primitive_type (function_declarator "FUN_0027eb00(long param_1,ulong param_2,ulong param_3,char *param_4)" identifier (parameter_list "(long param_1,ulong param_2,ulong param_3,char *param_4)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "ulong param_2" type_identifier identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) , (parameter_declaration "char *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  size_t sVar1;\n  ulong uVar2;\n  \n  sVar1 = strlen(param_4);\n  uVar2 = *(ulong *)(param_1 + 8) - param_2;\n  if (uVar2 <= param_3) {\n    param_3 = uVar2;\n  }\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_0027e650(param_1,param_2,param_3,param_4,sVar1);\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (expression_statement "sVar1 = strlen(param_4);" (assignment_expression "sVar1 = strlen(param_4)" identifier = (call_expression "strlen(param_4)" identifier (argument_list "(param_4)" ( identifier )))) ;) (expression_statement "uVar2 = *(ulong *)(param_1 + 8) - param_2;" (assignment_expression "uVar2 = *(ulong *)(param_1 + 8) - param_2" identifier = (binary_expression "*(ulong *)(param_1 + 8) - param_2" (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) )))) - identifier)) ;) (if_statement "if (uVar2 <= param_3) {\n    param_3 = uVar2;\n  }" if (parenthesized_expression "(uVar2 <= param_3)" ( (binary_expression "uVar2 <= param_3" identifier <= identifier) )) (compound_statement "{\n    param_3 = uVar2;\n  }" { (expression_statement "param_3 = uVar2;" (assignment_expression "param_3 = uVar2" identifier = identifier) ;) })) (if_statement "if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_0027e650(param_1,param_2,param_3,param_4,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_0027e650(param_1,param_2,param_3,param_4,sVar1);\n    return;\n  }" { (expression_statement "FUN_0027e650(param_1,param_2,param_3,param_4,sVar1);" (call_expression "FUN_0027e650(param_1,param_2,param_3,param_4,sVar1)" identifier (argument_list "(param_1,param_2,param_3,param_4,sVar1)" ( identifier , identifier , identifier , identifier , identifier ))) ;) (return_statement "return;" return ;) })) comment (expression_statement "FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);" (call_expression "FUN_002b56d0("%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::string::replace(unsigned long, unsigned long, char const*) */\n\nvoid __thiscall std::string::replace(string *this,ulong param_1,ulong param_2,char *param_3)\n\n{\n  size_t sVar1;\n  ulong uVar2;\n  \n  sVar1 = strlen(param_3);\n  uVar2 = *(ulong *)(this + 8) - param_1;\n  if (uVar2 <= param_2) {\n    param_2 = uVar2;\n  }\n  if (param_1 <= *(ulong *)(this + 8)) {\n    _M_replace(this,param_1,param_2,param_3,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::string::replace(string *this,ulong param_1,ulong param_2,char *param_3)\n\n{\n  size_t sVar1;\n  ulong uVar2;\n  \n  sVar1 = strlen(param_3);\n  uVar2 = *(ulong *)(this + 8) - param_1;\n  if (uVar2 <= param_2) {\n    param_2 = uVar2;\n  }\n  if (param_1 <= *(ulong *)(this + 8)) {\n    _M_replace(this,param_1,param_2,param_3,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::string::" identifier : : identifier : :) (function_declarator "replace(string *this,ulong param_1,ulong param_2,char *param_3)" identifier (parameter_list "(string *this,ulong param_1,ulong param_2,char *param_3)" ( (parameter_declaration "string *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "ulong param_1" type_identifier identifier) , (parameter_declaration "ulong param_2" type_identifier identifier) , (parameter_declaration "char *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  size_t sVar1;\n  ulong uVar2;\n  \n  sVar1 = strlen(param_3);\n  uVar2 = *(ulong *)(this + 8) - param_1;\n  if (uVar2 <= param_2) {\n    param_2 = uVar2;\n  }\n  if (param_1 <= *(ulong *)(this + 8)) {\n    _M_replace(this,param_1,param_2,param_3,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 ;) (declaration "ulong uVar2;" type_identifier identifier ;) (expression_statement "sVar1 = strlen(param_3);" (assignment_expression "sVar1 = strlen(param_3)" identifier = (call_expression "strlen(param_3)" identifier (argument_list "(param_3)" ( identifier )))) ;) (expression_statement "uVar2 = *(ulong *)(this + 8) - param_1;" (assignment_expression "uVar2 = *(ulong *)(this + 8) - param_1" identifier = (binary_expression "*(ulong *)(this + 8) - param_1" (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) )))) - identifier)) ;) (if_statement "if (uVar2 <= param_2) {\n    param_2 = uVar2;\n  }" if (parenthesized_expression "(uVar2 <= param_2)" ( (binary_expression "uVar2 <= param_2" identifier <= identifier) )) (compound_statement "{\n    param_2 = uVar2;\n  }" { (expression_statement "param_2 = uVar2;" (assignment_expression "param_2 = uVar2" identifier = identifier) ;) })) (if_statement "if (param_1 <= *(ulong *)(this + 8)) {\n    _M_replace(this,param_1,param_2,param_3,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,param_2,param_3,sVar1);\n    return;\n  }" { (expression_statement "_M_replace(this,param_1,param_2,param_3,sVar1);" (call_expression "_M_replace(this,param_1,param_2,param_3,sVar1)" identifier (argument_list "(this,param_1,param_2,param_3,sVar1)" ( identifier , identifier , identifier , 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_0027eb00(long param_1,ulong param_2,ulong param_3,char *param_4)\n\n{\n  size_t sVar1;\n  ulong uVar2;\n  \n  sVar1 = strlen(param_4);\n  uVar2 = *(ulong *)(param_1 + 8) - param_2;\n  if (uVar2 <= param_3) {\n    param_3 = uVar2;\n  }\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_0027e650(param_1,param_2,param_3,param_4,sVar1);\n    return;\n  }\n                    \n  FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}\n\n" (function_definition "void FUN_0027eb00(long param_1,ulong param_2,ulong param_3,char *param_4)\n\n{\n  size_t sVar1;\n  ulong uVar2;\n  \n  sVar1 = strlen(param_4);\n  uVar2 = *(ulong *)(param_1 + 8) - param_2;\n  if (uVar2 <= param_3) {\n    param_3 = uVar2;\n  }\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_0027e650(param_1,param_2,param_3,param_4,sVar1);\n    return;\n  }\n                    \n  FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}" primitive_type (function_declarator "FUN_0027eb00(long param_1,ulong param_2,ulong param_3,char *param_4)" identifier (parameter_list "(long param_1,ulong param_2,ulong param_3,char *param_4)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "ulong param_2" type_identifier identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) , (parameter_declaration "char *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  size_t sVar1;\n  ulong uVar2;\n  \n  sVar1 = strlen(param_4);\n  uVar2 = *(ulong *)(param_1 + 8) - param_2;\n  if (uVar2 <= param_3) {\n    param_3 = uVar2;\n  }\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_0027e650(param_1,param_2,param_3,param_4,sVar1);\n    return;\n  }\n                    \n  FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (expression_statement "sVar1 = strlen(param_4);" (assignment_expression "sVar1 = strlen(param_4)" identifier = (call_expression "strlen(param_4)" identifier (argument_list "(param_4)" ( identifier )))) ;) (expression_statement "uVar2 = *(ulong *)(param_1 + 8) - param_2;" (assignment_expression "uVar2 = *(ulong *)(param_1 + 8) - param_2" identifier = (binary_expression "*(ulong *)(param_1 + 8) - param_2" (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) )))) - identifier)) ;) (if_statement "if (uVar2 <= param_3) {\n    param_3 = uVar2;\n  }" if (parenthesized_expression "(uVar2 <= param_3)" ( (binary_expression "uVar2 <= param_3" identifier <= identifier) )) (compound_statement "{\n    param_3 = uVar2;\n  }" { (expression_statement "param_3 = uVar2;" (assignment_expression "param_3 = uVar2" identifier = identifier) ;) })) (if_statement "if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_0027e650(param_1,param_2,param_3,param_4,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_0027e650(param_1,param_2,param_3,param_4,sVar1);\n    return;\n  }" { (expression_statement "FUN_0027e650(param_1,param_2,param_3,param_4,sVar1);" (call_expression "FUN_0027e650(param_1,param_2,param_3,param_4,sVar1)" identifier (argument_list "(param_1,param_2,param_3,param_4,sVar1)" ( identifier , identifier , identifier , identifier , identifier ))) ;) (return_statement "return;" return ;) })) (expression_statement "FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);" (call_expression "FUN_002b56d0("%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 IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = 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 , IDENT , 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_0027eb00(long param_1,ulong param_2,ulong param_3,char *param_4)\n\n{\n  size_t sVar1;\n  ulong uVar2;\n  \n  sVar1 = strlen(param_4);\n  uVar2 = *(ulong *)(param_1 + 8) - param_2;\n  if (uVar2 <= param_3) {\n    param_3 = uVar2;\n  }\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_0027e650(param_1,param_2,param_3,param_4,sVar1);\n    return;\n  }\n                    \n  FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);\n}" (primitive_type "void") (function_declarator "FUN_0027eb00(long param_1,ulong param_2,ulong param_3,char *param_4)" (identifier "FUN_0027eb00") (parameter_list "(long param_1,ulong param_2,ulong param_3,char *param_4)" (( "(") (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 "ulong param_3" (type_identifier "ulong") (identifier "param_3")) (, ",") (parameter_declaration "char *param_4" (primitive_type "char") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")"))) (compound_statement "{\n  size_t sVar1;\n  ulong uVar2;\n  \n  sVar1 = strlen(param_4);\n  uVar2 = *(ulong *)(param_1 + 8) - param_2;\n  if (uVar2 <= param_3) {\n    param_3 = uVar2;\n  }\n  if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_0027e650(param_1,param_2,param_3,param_4,sVar1);\n    return;\n  }\n                    \n  FUN_002b56d0("%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") (; ";")) (declaration "ulong uVar2;" (type_identifier "ulong") (identifier "uVar2") (; ";")) (expression_statement "sVar1 = strlen(param_4);" (assignment_expression "sVar1 = strlen(param_4)" (identifier "sVar1") (= "=") (call_expression "strlen(param_4)" (identifier "strlen") (argument_list "(param_4)" (( "(") (identifier "param_4") () ")")))) (; ";")) (expression_statement "uVar2 = *(ulong *)(param_1 + 8) - param_2;" (assignment_expression "uVar2 = *(ulong *)(param_1 + 8) - param_2" (identifier "uVar2") (= "=") (binary_expression "*(ulong *)(param_1 + 8) - 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")) () ")")))) (- "-") (identifier "param_2"))) (; ";")) (if_statement "if (uVar2 <= param_3) {\n    param_3 = uVar2;\n  }" (if "if") (parenthesized_expression "(uVar2 <= param_3)" (( "(") (binary_expression "uVar2 <= param_3" (identifier "uVar2") (<= "<=") (identifier "param_3")) () ")")) (compound_statement "{\n    param_3 = uVar2;\n  }" ({ "{") (expression_statement "param_3 = uVar2;" (assignment_expression "param_3 = uVar2" (identifier "param_3") (= "=") (identifier "uVar2")) (; ";")) (} "}"))) (if_statement "if (param_2 <= *(ulong *)(param_1 + 8)) {\n    FUN_0027e650(param_1,param_2,param_3,param_4,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_0027e650(param_1,param_2,param_3,param_4,sVar1);\n    return;\n  }" ({ "{") (expression_statement "FUN_0027e650(param_1,param_2,param_3,param_4,sVar1);" (call_expression "FUN_0027e650(param_1,param_2,param_3,param_4,sVar1)" (identifier "FUN_0027e650") (argument_list "(param_1,param_2,param_3,param_4,sVar1)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (identifier "param_4") (, ",") (identifier "sVar1") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2);" (call_expression "FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               param_2)" (identifier "FUN_002b56d0") (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::string::replace(unsigned long, unsigned long, char const*) */

void __thiscall std::type_1::function_1(type_1 *var_2,type_2 var_3,type_2 var_5,char *param_3)

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


(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: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (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) (identifier) (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,ulong param_3,char *param_4)

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

