
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::wstring::replace(__normal_iterator<wchar_t const*, std::wstring >, __normal_iterator<wchar_t
   const*, std::wstring >, std::wstring const&) */

void __thiscall std::wstring::replace(wstring *this,int param_2,int param_3,undefined4 *param_4)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  
  uVar1 = *(uint *)(this + 4);
  uVar3 = param_2 - *(int *)this >> 2;
  uVar2 = param_3 - param_2 >> 2;
  if (uVar1 - uVar3 < uVar2) {
    uVar2 = uVar1 - uVar3;
  }
  if (uVar3 <= uVar1) {
    _M_replace(this,uVar3,uVar2,(wchar_t *)*param_4,param_4[1]);
    return;
  }
                    /* WARNING: Subroutine does not return */
  __throw_out_of_range_fmt
            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",uVar3,
             uVar1);
}



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

void FUN_001ec780(int *param_1,int param_2,int param_3,undefined4 *param_4)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  
  uVar1 = param_1[1];
  uVar3 = param_2 - *param_1 >> 2;
  uVar2 = param_3 - param_2 >> 2;
  if (uVar1 - uVar3 < uVar2) {
    uVar2 = uVar1 - uVar3;
  }
  if (uVar3 <= uVar1) {
    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",
               uVar3,uVar1);
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00035840
ADD EBX,0x1a2877
SUB ESP,0xc
MOV EAX,dword ptr [ESP + 0x24]
MOV EDX,dword ptr [ESP + 0x2c]
MOV ECX,dword ptr [ESP + 0x20]
MOV ESI,dword ptr [ESP + 0x28]
MOV EBP,dword ptr [EDX + 0x4]
MOV EDI,dword ptr [EDX]
MOV EDX,EAX
SUB EDX,dword ptr [ECX]
MOV ECX,dword ptr [ECX + 0x4]
SUB ESI,EAX
SAR EDX,0x2
MOV EAX,ESI
MOV ESI,ECX
SAR EAX,0x2
SUB ESI,EDX
CMP EAX,ESI
CMOVA EAX,ESI
CMP EDX,ECX
JA 0x001ec7dd
SUB ESP,0xc
PUSH EBP
PUSH EDI
PUSH EAX
PUSH EDX
PUSH dword ptr [ESP + 0x3c]
CALL 0x001ec020
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
LEA EAX,[EBX + 0xfff14d52]
PUSH ECX
PUSH EDX
PUSH EAX
LEA EAX,[EBX + 0xffefbec4]
PUSH EAX
CALL 0x0022c840
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_001ec780(int *param_1,int param_2,int param_3,undefined4 *param_4)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar1 = param_1[1];\n  uVar3 = param_2 - *param_1 >> 2;\n  uVar2 = param_3 - param_2 >> 2;\n  if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }\n  if (uVar3 <= uVar1) {\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1);\n}\n\n" comment (function_definition "void FUN_001ec780(int *param_1,int param_2,int param_3,undefined4 *param_4)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar1 = param_1[1];\n  uVar3 = param_2 - *param_1 >> 2;\n  uVar2 = param_3 - param_2 >> 2;\n  if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }\n  if (uVar3 <= uVar1) {\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1);\n}" primitive_type (function_declarator "FUN_001ec780(int *param_1,int param_2,int param_3,undefined4 *param_4)" identifier (parameter_list "(int *param_1,int param_2,int param_3,undefined4 *param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "undefined4 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar1 = param_1[1];\n  uVar3 = param_2 - *param_1 >> 2;\n  uVar2 = param_3 - param_2 >> 2;\n  if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }\n  if (uVar3 <= uVar1) {\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1);\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "uVar1 = param_1[1];" (assignment_expression "uVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "uVar3 = param_2 - *param_1 >> 2;" (assignment_expression "uVar3 = param_2 - *param_1 >> 2" identifier = (binary_expression "param_2 - *param_1 >> 2" (binary_expression "param_2 - *param_1" identifier - (pointer_expression "*param_1" * identifier)) >> number_literal)) ;) (expression_statement "uVar2 = param_3 - param_2 >> 2;" (assignment_expression "uVar2 = param_3 - param_2 >> 2" identifier = (binary_expression "param_3 - param_2 >> 2" (binary_expression "param_3 - param_2" identifier - identifier) >> number_literal)) ;) (if_statement "if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }" if (parenthesized_expression "(uVar1 - uVar3 < uVar2)" ( (binary_expression "uVar1 - uVar3 < uVar2" (binary_expression "uVar1 - uVar3" identifier - identifier) < identifier) )) (compound_statement "{\n    uVar2 = uVar1 - uVar3;\n  }" { (expression_statement "uVar2 = uVar1 - uVar3;" (assignment_expression "uVar2 = uVar1 - uVar3" identifier = (binary_expression "uVar1 - uVar3" identifier - identifier)) ;) })) (if_statement "if (uVar3 <= uVar1) {\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }" if (parenthesized_expression "(uVar3 <= uVar1)" ( (binary_expression "uVar3 <= uVar1" identifier <= identifier) )) (compound_statement "{\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }" { (expression_statement "FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);" (call_expression "FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1])" identifier (argument_list "(param_1,uVar3,uVar2,*param_4,param_4[1])" ( identifier , identifier , identifier , (pointer_expression "*param_4" * identifier) , (subscript_expression "param_4[1]" identifier [ number_literal ]) ))) ;) (return_statement "return;" return ;) })) comment (expression_statement "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1);" (call_expression "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::replace"" " string_content ") , identifier , identifier ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::wstring::replace(__normal_iterator<wchar_t const*, std::wstring >, __normal_iterator<wchar_t\n   const*, std::wstring >, std::wstring const&) */\n\nvoid __thiscall std::wstring::replace(wstring *this,int param_2,int param_3,undefined4 *param_4)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(this + 4);\n  uVar3 = param_2 - *(int *)this >> 2;\n  uVar2 = param_3 - param_2 >> 2;\n  if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }\n  if (uVar3 <= uVar1) {\n    _M_replace(this,uVar3,uVar2,(wchar_t *)*param_4,param_4[1]);\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",uVar3,\n             uVar1);\n}\n\n" comment comment (function_definition "void __thiscall std::wstring::replace(wstring *this,int param_2,int param_3,undefined4 *param_4)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(this + 4);\n  uVar3 = param_2 - *(int *)this >> 2;\n  uVar2 = param_3 - param_2 >> 2;\n  if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }\n  if (uVar3 <= uVar1) {\n    _M_replace(this,uVar3,uVar2,(wchar_t *)*param_4,param_4[1]);\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",uVar3,\n             uVar1);\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "replace(wstring *this,int param_2,int param_3,undefined4 *param_4)" identifier (parameter_list "(wstring *this,int param_2,int param_3,undefined4 *param_4)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "undefined4 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(this + 4);\n  uVar3 = param_2 - *(int *)this >> 2;\n  uVar2 = param_3 - param_2 >> 2;\n  if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }\n  if (uVar3 <= uVar1) {\n    _M_replace(this,uVar3,uVar2,(wchar_t *)*param_4,param_4[1]);\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",uVar3,\n             uVar1);\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "uVar1 = *(uint *)(this + 4);" (assignment_expression "uVar1 = *(uint *)(this + 4)" identifier = (pointer_expression "*(uint *)(this + 4)" * (cast_expression "(uint *)(this + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) ))))) ;) (expression_statement "uVar3 = param_2 - *(int *)this >> 2;" (assignment_expression "uVar3 = param_2 - *(int *)this >> 2" identifier = (binary_expression "param_2 - *(int *)this >> 2" (binary_expression "param_2 - *(int *)this" identifier - (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) >> number_literal)) ;) (expression_statement "uVar2 = param_3 - param_2 >> 2;" (assignment_expression "uVar2 = param_3 - param_2 >> 2" identifier = (binary_expression "param_3 - param_2 >> 2" (binary_expression "param_3 - param_2" identifier - identifier) >> number_literal)) ;) (if_statement "if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }" if (parenthesized_expression "(uVar1 - uVar3 < uVar2)" ( (binary_expression "uVar1 - uVar3 < uVar2" (binary_expression "uVar1 - uVar3" identifier - identifier) < identifier) )) (compound_statement "{\n    uVar2 = uVar1 - uVar3;\n  }" { (expression_statement "uVar2 = uVar1 - uVar3;" (assignment_expression "uVar2 = uVar1 - uVar3" identifier = (binary_expression "uVar1 - uVar3" identifier - identifier)) ;) })) (if_statement "if (uVar3 <= uVar1) {\n    _M_replace(this,uVar3,uVar2,(wchar_t *)*param_4,param_4[1]);\n    return;\n  }" if (parenthesized_expression "(uVar3 <= uVar1)" ( (binary_expression "uVar3 <= uVar1" identifier <= identifier) )) (compound_statement "{\n    _M_replace(this,uVar3,uVar2,(wchar_t *)*param_4,param_4[1]);\n    return;\n  }" { (expression_statement "_M_replace(this,uVar3,uVar2,(wchar_t *)*param_4,param_4[1]);" (call_expression "_M_replace(this,uVar3,uVar2,(wchar_t *)*param_4,param_4[1])" identifier (argument_list "(this,uVar3,uVar2,(wchar_t *)*param_4,param_4[1])" ( identifier , identifier , identifier , (cast_expression "(wchar_t *)*param_4" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_4" * identifier)) , (subscript_expression "param_4[1]" identifier [ number_literal ]) ))) ;) (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",uVar3,\n             uVar1);" (call_expression "__throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",uVar3,\n             uVar1)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",uVar3,\n             uVar1)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::replace"" " string_content ") , identifier , identifier ))) ;) })))
(translation_unit "void FUN_001ec780(int *param_1,int param_2,int param_3,undefined4 *param_4)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar1 = param_1[1];\n  uVar3 = param_2 - *param_1 >> 2;\n  uVar2 = param_3 - param_2 >> 2;\n  if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }\n  if (uVar3 <= uVar1) {\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }\n                    \n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1);\n}\n\n" (function_definition "void FUN_001ec780(int *param_1,int param_2,int param_3,undefined4 *param_4)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar1 = param_1[1];\n  uVar3 = param_2 - *param_1 >> 2;\n  uVar2 = param_3 - param_2 >> 2;\n  if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }\n  if (uVar3 <= uVar1) {\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }\n                    \n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1);\n}" primitive_type (function_declarator "FUN_001ec780(int *param_1,int param_2,int param_3,undefined4 *param_4)" identifier (parameter_list "(int *param_1,int param_2,int param_3,undefined4 *param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "undefined4 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar1 = param_1[1];\n  uVar3 = param_2 - *param_1 >> 2;\n  uVar2 = param_3 - param_2 >> 2;\n  if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }\n  if (uVar3 <= uVar1) {\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }\n                    \n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1);\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "uVar1 = param_1[1];" (assignment_expression "uVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "uVar3 = param_2 - *param_1 >> 2;" (assignment_expression "uVar3 = param_2 - *param_1 >> 2" identifier = (binary_expression "param_2 - *param_1 >> 2" (binary_expression "param_2 - *param_1" identifier - (pointer_expression "*param_1" * identifier)) >> number_literal)) ;) (expression_statement "uVar2 = param_3 - param_2 >> 2;" (assignment_expression "uVar2 = param_3 - param_2 >> 2" identifier = (binary_expression "param_3 - param_2 >> 2" (binary_expression "param_3 - param_2" identifier - identifier) >> number_literal)) ;) (if_statement "if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }" if (parenthesized_expression "(uVar1 - uVar3 < uVar2)" ( (binary_expression "uVar1 - uVar3 < uVar2" (binary_expression "uVar1 - uVar3" identifier - identifier) < identifier) )) (compound_statement "{\n    uVar2 = uVar1 - uVar3;\n  }" { (expression_statement "uVar2 = uVar1 - uVar3;" (assignment_expression "uVar2 = uVar1 - uVar3" identifier = (binary_expression "uVar1 - uVar3" identifier - identifier)) ;) })) (if_statement "if (uVar3 <= uVar1) {\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }" if (parenthesized_expression "(uVar3 <= uVar1)" ( (binary_expression "uVar3 <= uVar1" identifier <= identifier) )) (compound_statement "{\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }" { (expression_statement "FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);" (call_expression "FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1])" identifier (argument_list "(param_1,uVar3,uVar2,*param_4,param_4[1])" ( identifier , identifier , identifier , (pointer_expression "*param_4" * identifier) , (subscript_expression "param_4[1]" identifier [ number_literal ]) ))) ;) (return_statement "return;" return ;) })) (expression_statement "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1);" (call_expression "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::replace"" " string_content ") , identifier , identifier ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT - (pointer_expression * IDENT)) >> LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT - IDENT) >> LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT - IDENT) < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , (pointer_expression * IDENT) , (subscript_expression IDENT [ LIT ]) ))) ;) (return_statement return ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , IDENT , IDENT ))) ;) })))
(function_definition "void FUN_001ec780(int *param_1,int param_2,int param_3,undefined4 *param_4)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar1 = param_1[1];\n  uVar3 = param_2 - *param_1 >> 2;\n  uVar2 = param_3 - param_2 >> 2;\n  if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }\n  if (uVar3 <= uVar1) {\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }\n                    \n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1);\n}" (primitive_type "void") (function_declarator "FUN_001ec780(int *param_1,int param_2,int param_3,undefined4 *param_4)" (identifier "FUN_001ec780") (parameter_list "(int *param_1,int param_2,int param_3,undefined4 *param_4)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 *param_4" (type_identifier "undefined4") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")"))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar1 = param_1[1];\n  uVar3 = param_2 - *param_1 >> 2;\n  uVar2 = param_3 - param_2 >> 2;\n  if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }\n  if (uVar3 <= uVar1) {\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }\n                    \n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1);\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (expression_statement "uVar1 = param_1[1];" (assignment_expression "uVar1 = param_1[1]" (identifier "uVar1") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "uVar3 = param_2 - *param_1 >> 2;" (assignment_expression "uVar3 = param_2 - *param_1 >> 2" (identifier "uVar3") (= "=") (binary_expression "param_2 - *param_1 >> 2" (binary_expression "param_2 - *param_1" (identifier "param_2") (- "-") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (>> ">>") (number_literal "2"))) (; ";")) (expression_statement "uVar2 = param_3 - param_2 >> 2;" (assignment_expression "uVar2 = param_3 - param_2 >> 2" (identifier "uVar2") (= "=") (binary_expression "param_3 - param_2 >> 2" (binary_expression "param_3 - param_2" (identifier "param_3") (- "-") (identifier "param_2")) (>> ">>") (number_literal "2"))) (; ";")) (if_statement "if (uVar1 - uVar3 < uVar2) {\n    uVar2 = uVar1 - uVar3;\n  }" (if "if") (parenthesized_expression "(uVar1 - uVar3 < uVar2)" (( "(") (binary_expression "uVar1 - uVar3 < uVar2" (binary_expression "uVar1 - uVar3" (identifier "uVar1") (- "-") (identifier "uVar3")) (< "<") (identifier "uVar2")) () ")")) (compound_statement "{\n    uVar2 = uVar1 - uVar3;\n  }" ({ "{") (expression_statement "uVar2 = uVar1 - uVar3;" (assignment_expression "uVar2 = uVar1 - uVar3" (identifier "uVar2") (= "=") (binary_expression "uVar1 - uVar3" (identifier "uVar1") (- "-") (identifier "uVar3"))) (; ";")) (} "}"))) (if_statement "if (uVar3 <= uVar1) {\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }" (if "if") (parenthesized_expression "(uVar3 <= uVar1)" (( "(") (binary_expression "uVar3 <= uVar1" (identifier "uVar3") (<= "<=") (identifier "uVar1")) () ")")) (compound_statement "{\n    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);\n    return;\n  }" ({ "{") (expression_statement "FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);" (call_expression "FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1])" (identifier "FUN_001ec020") (argument_list "(param_1,uVar3,uVar2,*param_4,param_4[1])" (( "(") (identifier "param_1") (, ",") (identifier "uVar3") (, ",") (identifier "uVar2") (, ",") (pointer_expression "*param_4" (* "*") (identifier "param_4")) (, ",") (subscript_expression "param_4[1]" (identifier "param_4") ([ "[") (number_literal "1") (] "]")) () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1);" (call_expression "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1)" (identifier "FUN_0022c840") (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",\n               uVar3,uVar1)" (( "(") (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 "uVar3") (, ",") (identifier "uVar1") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::wstring::replace(__normal_iterator<wchar_t const*, std::wstring >, __normal_iterator<wchar_t
   const*, std::wstring >, std::wstring const&) */

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

{
  type_3 var_4;
  type_3 var_6;
  type_3 var_5;
  
  var_4 = *(type_3 *)(var_1 + 4);
  var_5 = var_2 - *(int *)var_1 >> 2;
  var_6 = var_3 - var_2 >> 2;
  if (var_4 - var_5 < var_6) {
    var_6 = var_4 - var_5;
  }
  if (var_5 <= var_4) {
    var_7(var_1,var_5,var_6,(type_4 *)*param_4,param_4[1]);
    return;
  }
                    /* WARNING: Subroutine does not return */
  var_8
            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",var_5,
             var_4);
}


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

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

void MASKED(int *param_1,int param_2,int param_3,undefined4 *param_4)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  
  uVar1 = param_1[1];
  uVar3 = param_2 - *param_1 >> 2;
  uVar2 = param_3 - param_2 >> 2;
  if (uVar1 - uVar3 < uVar2) {
    uVar2 = uVar1 - uVar3;
  }
  if (uVar3 <= uVar1) {
    FUN_001ec020(param_1,uVar3,uVar2,*param_4,param_4[1]);
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::replace",
               uVar3,uVar1);
}

