
/* WARNING: Function: __x86.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */
/* std::wstring::_M_replace_aux(unsigned int, unsigned int, unsigned int, wchar_t) */

wstring * __thiscall
std::wstring::_M_replace_aux(wstring *this,uint param_1,uint param_2,uint param_3,wchar_t param_4)

{
  int iVar1;
  size_t __n;
  wstring *pwVar2;
  uint uVar3;
  uint uVar4;
  
  iVar1 = *(int *)(this + 4);
  if (param_3 <= (param_2 + 0x1fffffff) - iVar1) {
    pwVar2 = *(wstring **)this;
    uVar4 = (param_3 - param_2) + iVar1;
    if (pwVar2 == this + 8) {
      uVar3 = 3;
    }
    else {
      uVar3 = *(uint *)(this + 8);
    }
    if (uVar3 < uVar4) {
      _M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);
      pwVar2 = *(wstring **)this;
    }
    else {
      __n = iVar1 - (param_1 + param_2);
      if ((__n != 0) && (param_2 != param_3)) {
        if (__n == 1) {
          *(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =
               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4);
        }
        else {
          wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),
                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);
          pwVar2 = *(wstring **)this;
        }
      }
    }
    if (param_3 != 0) {
      if (param_3 == 1) {
        *(wchar_t *)(pwVar2 + param_1 * 4) = param_4;
      }
      else {
        wmemset((wchar_t *)(pwVar2 + param_1 * 4),param_4,param_3);
        pwVar2 = *(wstring **)this;
      }
    }
    *(uint *)(this + 4) = uVar4;
    *(undefined4 *)(pwVar2 + uVar4 * 4) = 0;
    return this;
  }
                    /* WARNING: Subroutine does not return */
  __throw_length_error("basic_string::_M_replace_aux");
}



/* WARNING: Function: __i686.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */

int * FUN_00201eb0(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)

{
  wchar_t *__s;
  int iVar1;
  size_t __n;
  int *piVar2;
  uint uVar3;
  uint uVar4;
  
  iVar1 = param_1[1];
  if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {
    piVar2 = (int *)*param_1;
    uVar4 = (param_4 - param_3) + iVar1;
    if (piVar2 == param_1 + 2) {
      uVar3 = 3;
    }
    else {
      uVar3 = param_1[2];
    }
    if (uVar3 < uVar4) {
      FUN_00201310(param_1,param_2,param_3,0,param_4);
      piVar2 = (int *)*param_1;
    }
    else {
      __n = iVar1 - (param_2 + param_3);
      if ((__n != 0) && (param_3 != param_4)) {
        if (__n == 1) {
          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];
        }
        else {
          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);
          piVar2 = (int *)*param_1;
        }
      }
    }
    if (param_4 != 0) {
      __s = (wchar_t *)((int)piVar2 + param_2 * 4);
      if (param_4 == 1) {
        *__s = param_5;
      }
      else {
        wmemset(__s,param_5,param_4);
        piVar2 = (int *)*param_1;
      }
    }
    param_1[1] = uVar4;
    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00242a10("basic_string::_M_replace_aux");
}


CALL 0x0006206b
ADD EAX,0x1a814b
PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
SUB ESP,0x1c
MOV ESI,dword ptr [ESP + 0x30]
MOV EDX,dword ptr [ESP + 0x38]
MOV dword ptr [ESP + 0xc],EAX
MOV EBP,dword ptr [ESP + 0x3c]
MOV EAX,dword ptr [ESI + 0x4]
LEA ECX,[EDX + 0x1fffffff]
SUB ECX,EAX
CMP EBP,ECX
JA 0x00201fcd
MOV EDI,EBP
MOV ECX,dword ptr [ESI]
LEA EBX,[ESI + 0x8]
SUB EDI,EDX
ADD EDI,EAX
CMP ECX,EBX
JZ 0x00201fa0
MOV EBX,dword ptr [ESI + 0x8]
CMP EBX,EDI
JC 0x00201f78
MOV EBX,dword ptr [ESP + 0x34]
ADD EBX,EDX
SUB EAX,EBX
JZ 0x00201f36
CMP EDX,EBP
JZ 0x00201f36
MOV EBX,dword ptr [ESP + 0x34]
LEA EBX,[ECX + EBX*0x4]
LEA EDX,[EBX + EDX*0x4]
LEA EBX,[EBX + EBP*0x4]
CMP EAX,0x1
JZ 0x00201fc0
SUB ESP,0x4
PUSH EAX
PUSH EDX
PUSH EBX
MOV EBX,dword ptr [ESP + 0x1c]
CALL 0x0002a270
MOV ECX,dword ptr [ESI]
ADD ESP,0x10
TEST EBP,EBP
JZ 0x00201f5d
MOV EAX,dword ptr [ESP + 0x34]
LEA EAX,[ECX + EAX*0x4]
CMP EBP,0x1
JZ 0x00201fb0
SUB ESP,0x4
PUSH EBP
PUSH dword ptr [ESP + 0x48]
PUSH EAX
MOV EBX,dword ptr [ESP + 0x1c]
CALL 0x0002a650
MOV ECX,dword ptr [ESI]
ADD ESP,0x10
MOV dword ptr [ESI + 0x4],EDI
MOV EAX,ESI
MOV dword ptr [ECX + EDI*0x4],0x0
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH EBP
PUSH 0x0
PUSH EDX
PUSH dword ptr [ESP + 0x4c]
PUSH ESI
MOV EBX,dword ptr [ESP + 0x2c]
CALL 0x00201310
MOV ECX,dword ptr [ESI]
ADD ESP,0x20
TEST EBP,EBP
JZ 0x00201f5d
JMP 0x00201f3a
MOV EBX,0x3
JMP 0x00201efa
MOV EDX,dword ptr [ESP + 0x40]
MOV dword ptr [EAX],EDX
JMP 0x00201f5d
MOV EAX,dword ptr [EDX]
MOV dword ptr [EBX],EAX
TEST EBP,EBP
JZ 0x00201f5d
JMP 0x00201f3a
SUB ESP,0xc
MOV EBX,dword ptr [ESP + 0x18]
LEA EAX,[EBX + 0xfff12120]
PUSH EAX
CALL 0x00242a10
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n\nint * FUN_00201eb0(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)\n\n{\n  wchar_t *__s;\n  int iVar1;\n  size_t __n;\n  int *piVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00242a10("basic_string::_M_replace_aux");\n}\n\n" comment (function_definition "int * FUN_00201eb0(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)\n\n{\n  wchar_t *__s;\n  int iVar1;\n  size_t __n;\n  int *piVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00242a10("basic_string::_M_replace_aux");\n}" primitive_type (pointer_declarator "* FUN_00201eb0(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)" * (function_declarator "FUN_00201eb0(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)" identifier (parameter_list "(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) , (parameter_declaration "wchar_t param_5" type_identifier identifier) )))) (compound_statement "{\n  wchar_t *__s;\n  int iVar1;\n  size_t __n;\n  int *piVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00242a10("basic_string::_M_replace_aux");\n}" { (declaration "wchar_t *__s;" type_identifier (pointer_declarator "*__s" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "iVar1 = param_1[1];" (assignment_expression "iVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (if_statement "if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }" if (parenthesized_expression "(param_4 <= (param_3 + 0x1fffffff) - iVar1)" ( (binary_expression "param_4 <= (param_3 + 0x1fffffff) - iVar1" identifier <= (binary_expression "(param_3 + 0x1fffffff) - iVar1" (parenthesized_expression "(param_3 + 0x1fffffff)" ( (binary_expression "param_3 + 0x1fffffff" identifier + number_literal) )) - identifier)) )) (compound_statement "{\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }" { (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "uVar4 = (param_4 - param_3) + iVar1;" (assignment_expression "uVar4 = (param_4 - param_3) + iVar1" identifier = (binary_expression "(param_4 - param_3) + iVar1" (parenthesized_expression "(param_4 - param_3)" ( (binary_expression "param_4 - param_3" identifier - identifier) )) + identifier)) ;) (if_statement "if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }" if (parenthesized_expression "(piVar2 == param_1 + 2)" ( (binary_expression "piVar2 == param_1 + 2" identifier == (binary_expression "param_1 + 2" identifier + number_literal)) )) (compound_statement "{\n      uVar3 = 3;\n    }" { (expression_statement "uVar3 = 3;" (assignment_expression "uVar3 = 3" identifier = number_literal) ;) }) (else_clause "else {\n      uVar3 = param_1[2];\n    }" else (compound_statement "{\n      uVar3 = param_1[2];\n    }" { (expression_statement "uVar3 = param_1[2];" (assignment_expression "uVar3 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" if (parenthesized_expression "(uVar3 < uVar4)" ( (binary_expression "uVar3 < uVar4" identifier < identifier) )) (compound_statement "{\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }" { (expression_statement "FUN_00201310(param_1,param_2,param_3,0,param_4);" (call_expression "FUN_00201310(param_1,param_2,param_3,0,param_4)" identifier (argument_list "(param_1,param_2,param_3,0,param_4)" ( identifier , identifier , identifier , number_literal , identifier ))) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" else (compound_statement "{\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" { (expression_statement "__n = iVar1 - (param_2 + param_3);" (assignment_expression "__n = iVar1 - (param_2 + param_3)" identifier = (binary_expression "iVar1 - (param_2 + param_3)" identifier - (parenthesized_expression "(param_2 + param_3)" ( (binary_expression "param_2 + param_3" identifier + identifier) )))) ;) (if_statement "if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }" if (parenthesized_expression "((__n != 0) && (param_3 != param_4))" ( (binary_expression "(__n != 0) && (param_3 != param_4)" (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) && (parenthesized_expression "(param_3 != param_4)" ( (binary_expression "param_3 != param_4" identifier != identifier) ))) )) (compound_statement "{\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }" { (if_statement "if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }" { (expression_statement "piVar2[param_2 + param_4] = piVar2[param_2 + param_3];" (assignment_expression "piVar2[param_2 + param_4] = piVar2[param_2 + param_3]" (subscript_expression "piVar2[param_2 + param_4]" identifier [ (binary_expression "param_2 + param_4" identifier + identifier) ]) = (subscript_expression "piVar2[param_2 + param_3]" identifier [ (binary_expression "param_2 + param_3" identifier + identifier) ])) ;) }) (else_clause "else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }" else (compound_statement "{\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }" { (expression_statement "wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);" (call_expression "wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n)" identifier (argument_list "(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n)" ( (binary_expression "piVar2 + param_2 + param_4" (binary_expression "piVar2 + param_2" identifier + identifier) + identifier) , (binary_expression "piVar2 + param_2 + param_3" (binary_expression "piVar2 + param_2" identifier + identifier) + identifier) , identifier ))) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })) }))) (if_statement "if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }" { (expression_statement "__s = (wchar_t *)((int)piVar2 + param_2 * 4);" (assignment_expression "__s = (wchar_t *)((int)piVar2 + param_2 * 4)" identifier = (cast_expression "(wchar_t *)((int)piVar2 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + param_2 * 4)" ( (binary_expression "(int)piVar2 + param_2 * 4" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + (binary_expression "param_2 * 4" identifier * number_literal)) )))) ;) (if_statement "if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *__s = param_5;\n      }" { (expression_statement "*__s = param_5;" (assignment_expression "*__s = param_5" (pointer_expression "*__s" * identifier) = identifier) ;) }) (else_clause "else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" else (compound_statement "{\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" { (expression_statement "wmemset(__s,param_5,param_4);" (call_expression "wmemset(__s,param_5,param_4)" identifier (argument_list "(__s,param_5,param_4)" ( identifier , identifier , identifier ))) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })) (expression_statement "param_1[1] = uVar4;" (assignment_expression "param_1[1] = uVar4" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;" (assignment_expression "*(undefined4 *)((int)piVar2 + uVar4 * 4) = 0" (pointer_expression "*(undefined4 *)((int)piVar2 + uVar4 * 4)" * (cast_expression "(undefined4 *)((int)piVar2 + uVar4 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + uVar4 * 4)" ( (binary_expression "(int)piVar2 + uVar4 * 4" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + (binary_expression "uVar4 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })) comment (expression_statement "FUN_00242a10("basic_string::_M_replace_aux");" (call_expression "FUN_00242a10("basic_string::_M_replace_aux")" identifier (argument_list "("basic_string::_M_replace_aux")" ( (string_literal ""basic_string::_M_replace_aux"" " string_content ") ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n/* std::wstring::_M_replace_aux(unsigned int, unsigned int, unsigned int, wchar_t) */\n\nwstring * __thiscall\nstd::wstring::_M_replace_aux(wstring *this,uint param_1,uint param_2,uint param_3,wchar_t param_4)\n\n{\n  int iVar1;\n  size_t __n;\n  wstring *pwVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = *(int *)(this + 4);\n  if (param_3 <= (param_2 + 0x1fffffff) - iVar1) {\n    pwVar2 = *(wstring **)this;\n    uVar4 = (param_3 - param_2) + iVar1;\n    if (pwVar2 == this + 8) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = *(uint *)(this + 8);\n    }\n    if (uVar3 < uVar4) {\n      _M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);\n      pwVar2 = *(wstring **)this;\n    }\n    else {\n      __n = iVar1 - (param_1 + param_2);\n      if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          *(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =\n               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4);\n        }\n        else {\n          wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);\n          pwVar2 = *(wstring **)this;\n        }\n      }\n    }\n    if (param_3 != 0) {\n      if (param_3 == 1) {\n        *(wchar_t *)(pwVar2 + param_1 * 4) = param_4;\n      }\n      else {\n        wmemset((wchar_t *)(pwVar2 + param_1 * 4),param_4,param_3);\n        pwVar2 = *(wstring **)this;\n      }\n    }\n    *(uint *)(this + 4) = uVar4;\n    *(undefined4 *)(pwVar2 + uVar4 * 4) = 0;\n    return this;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_length_error("basic_string::_M_replace_aux");\n}\n\n" comment comment (ERROR "wstring * __thiscall\nstd::wstring::_M_replace_aux(wstring *this," (binary_expression "wstring * __thiscall\nstd::wstring::_M_replace_aux(wstring *this" (binary_expression "wstring * __thiscall" identifier * identifier) (ERROR "std::wstring::_M_replace_aux(wstring" identifier : : identifier : : identifier ( identifier) * identifier) ,) (declaration "uint param_1,uint param_2,uint param_3,wchar_t param_4)\n\n{\n  int iVar1;" type_identifier identifier , (ERROR "uint" identifier) identifier , (ERROR "uint" identifier) identifier , (ERROR "wchar_t param_4)\n\n{\n  int" identifier identifier ) { primitive_type) identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "wstring *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(this + 4);" (assignment_expression "iVar1 = *(int *)(this + 4)" identifier = (pointer_expression "*(int *)(this + 4)" * (cast_expression "(int *)(this + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) ))))) ;) (if_statement "if (param_3 <= (param_2 + 0x1fffffff) - iVar1) {\n    pwVar2 = *(wstring **)this;\n    uVar4 = (param_3 - param_2) + iVar1;\n    if (pwVar2 == this + 8) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = *(uint *)(this + 8);\n    }\n    if (uVar3 < uVar4) {\n      _M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);\n      pwVar2 = *(wstring **)this;\n    }\n    else {\n      __n = iVar1 - (param_1 + param_2);\n      if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          *(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =\n               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4);\n        }\n        else {\n          wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);\n          pwVar2 = *(wstring **)this;\n        }\n      }\n    }\n    if (param_3 != 0) {\n      if (param_3 == 1) {\n        *(wchar_t *)(pwVar2 + param_1 * 4) = param_4;\n      }\n      else {\n        wmemset((wchar_t *)(pwVar2 + param_1 * 4),param_4,param_3);\n        pwVar2 = *(wstring **)this;\n      }\n    }\n    *(uint *)(this + 4) = uVar4;\n    *(undefined4 *)(pwVar2 + uVar4 * 4) = 0;\n    return this;\n  }" if (parenthesized_expression "(param_3 <= (param_2 + 0x1fffffff) - iVar1)" ( (binary_expression "param_3 <= (param_2 + 0x1fffffff) - iVar1" identifier <= (binary_expression "(param_2 + 0x1fffffff) - iVar1" (parenthesized_expression "(param_2 + 0x1fffffff)" ( (binary_expression "param_2 + 0x1fffffff" identifier + number_literal) )) - identifier)) )) (compound_statement "{\n    pwVar2 = *(wstring **)this;\n    uVar4 = (param_3 - param_2) + iVar1;\n    if (pwVar2 == this + 8) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = *(uint *)(this + 8);\n    }\n    if (uVar3 < uVar4) {\n      _M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);\n      pwVar2 = *(wstring **)this;\n    }\n    else {\n      __n = iVar1 - (param_1 + param_2);\n      if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          *(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =\n               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4);\n        }\n        else {\n          wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);\n          pwVar2 = *(wstring **)this;\n        }\n      }\n    }\n    if (param_3 != 0) {\n      if (param_3 == 1) {\n        *(wchar_t *)(pwVar2 + param_1 * 4) = param_4;\n      }\n      else {\n        wmemset((wchar_t *)(pwVar2 + param_1 * 4),param_4,param_3);\n        pwVar2 = *(wstring **)this;\n      }\n    }\n    *(uint *)(this + 4) = uVar4;\n    *(undefined4 *)(pwVar2 + uVar4 * 4) = 0;\n    return this;\n  }" { (expression_statement "pwVar2 = *(wstring **)this;" (assignment_expression "pwVar2 = *(wstring **)this" identifier = (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "uVar4 = (param_3 - param_2) + iVar1;" (assignment_expression "uVar4 = (param_3 - param_2) + iVar1" identifier = (binary_expression "(param_3 - param_2) + iVar1" (parenthesized_expression "(param_3 - param_2)" ( (binary_expression "param_3 - param_2" identifier - identifier) )) + identifier)) ;) (if_statement "if (pwVar2 == this + 8) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = *(uint *)(this + 8);\n    }" if (parenthesized_expression "(pwVar2 == this + 8)" ( (binary_expression "pwVar2 == this + 8" identifier == (binary_expression "this + 8" identifier + number_literal)) )) (compound_statement "{\n      uVar3 = 3;\n    }" { (expression_statement "uVar3 = 3;" (assignment_expression "uVar3 = 3" identifier = number_literal) ;) }) (else_clause "else {\n      uVar3 = *(uint *)(this + 8);\n    }" else (compound_statement "{\n      uVar3 = *(uint *)(this + 8);\n    }" { (expression_statement "uVar3 = *(uint *)(this + 8);" (assignment_expression "uVar3 = *(uint *)(this + 8)" identifier = (pointer_expression "*(uint *)(this + 8)" * (cast_expression "(uint *)(this + 8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))) ;) }))) (if_statement "if (uVar3 < uVar4) {\n      _M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);\n      pwVar2 = *(wstring **)this;\n    }\n    else {\n      __n = iVar1 - (param_1 + param_2);\n      if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          *(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =\n               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4);\n        }\n        else {\n          wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);\n          pwVar2 = *(wstring **)this;\n        }\n      }\n    }" if (parenthesized_expression "(uVar3 < uVar4)" ( (binary_expression "uVar3 < uVar4" identifier < identifier) )) (compound_statement "{\n      _M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);\n      pwVar2 = *(wstring **)this;\n    }" { (expression_statement "_M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);" (call_expression "_M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3)" identifier (argument_list "(this,param_1,param_2,(wchar_t *)0x0,param_3)" ( identifier , identifier , identifier , (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) , identifier ))) ;) (expression_statement "pwVar2 = *(wstring **)this;" (assignment_expression "pwVar2 = *(wstring **)this" identifier = (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }) (else_clause "else {\n      __n = iVar1 - (param_1 + param_2);\n      if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          *(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =\n               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4);\n        }\n        else {\n          wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);\n          pwVar2 = *(wstring **)this;\n        }\n      }\n    }" else (compound_statement "{\n      __n = iVar1 - (param_1 + param_2);\n      if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          *(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =\n               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4);\n        }\n        else {\n          wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);\n          pwVar2 = *(wstring **)this;\n        }\n      }\n    }" { (expression_statement "__n = iVar1 - (param_1 + param_2);" (assignment_expression "__n = iVar1 - (param_1 + param_2)" identifier = (binary_expression "iVar1 - (param_1 + param_2)" identifier - (parenthesized_expression "(param_1 + param_2)" ( (binary_expression "param_1 + param_2" identifier + identifier) )))) ;) (if_statement "if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          *(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =\n               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4);\n        }\n        else {\n          wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);\n          pwVar2 = *(wstring **)this;\n        }\n      }" if (parenthesized_expression "((__n != 0) && (param_2 != param_3))" ( (binary_expression "(__n != 0) && (param_2 != param_3)" (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) && (parenthesized_expression "(param_2 != param_3)" ( (binary_expression "param_2 != param_3" identifier != identifier) ))) )) (compound_statement "{\n        if (__n == 1) {\n          *(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =\n               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4);\n        }\n        else {\n          wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);\n          pwVar2 = *(wstring **)this;\n        }\n      }" { (if_statement "if (__n == 1) {\n          *(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =\n               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4);\n        }\n        else {\n          wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);\n          pwVar2 = *(wstring **)this;\n        }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n          *(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =\n               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4);\n        }" { (expression_statement "*(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =\n               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4);" (assignment_expression "*(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4) =\n               *(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4)" (pointer_expression "*(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4)" * (cast_expression "(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + param_3 * 4 + param_1 * 4)" ( (binary_expression "pwVar2 + param_3 * 4 + param_1 * 4" (binary_expression "pwVar2 + param_3 * 4" identifier + (binary_expression "param_3 * 4" identifier * number_literal)) + (binary_expression "param_1 * 4" identifier * number_literal)) )))) = (pointer_expression "*(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4)" * (cast_expression "(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + param_2 * 4 + param_1 * 4)" ( (binary_expression "pwVar2 + param_2 * 4 + param_1 * 4" (binary_expression "pwVar2 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) + (binary_expression "param_1 * 4" identifier * number_literal)) ))))) ;) }) (else_clause "else {\n          wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);\n          pwVar2 = *(wstring **)this;\n        }" else (compound_statement "{\n          wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);\n          pwVar2 = *(wstring **)this;\n        }" { (expression_statement "wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n);" (call_expression "wmemmove((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n)" identifier (argument_list "((wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4),\n                   (wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4),__n)" ( (cast_expression "(wchar_t *)(pwVar2 + param_3 * 4 + param_1 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + param_3 * 4 + param_1 * 4)" ( (binary_expression "pwVar2 + param_3 * 4 + param_1 * 4" (binary_expression "pwVar2 + param_3 * 4" identifier + (binary_expression "param_3 * 4" identifier * number_literal)) + (binary_expression "param_1 * 4" identifier * number_literal)) ))) , (cast_expression "(wchar_t *)(pwVar2 + param_2 * 4 + param_1 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + param_2 * 4 + param_1 * 4)" ( (binary_expression "pwVar2 + param_2 * 4 + param_1 * 4" (binary_expression "pwVar2 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) + (binary_expression "param_1 * 4" identifier * number_literal)) ))) , identifier ))) ;) (expression_statement "pwVar2 = *(wstring **)this;" (assignment_expression "pwVar2 = *(wstring **)this" identifier = (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }))) })) }))) (if_statement "if (param_3 != 0) {\n      if (param_3 == 1) {\n        *(wchar_t *)(pwVar2 + param_1 * 4) = param_4;\n      }\n      else {\n        wmemset((wchar_t *)(pwVar2 + param_1 * 4),param_4,param_3);\n        pwVar2 = *(wstring **)this;\n      }\n    }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n      if (param_3 == 1) {\n        *(wchar_t *)(pwVar2 + param_1 * 4) = param_4;\n      }\n      else {\n        wmemset((wchar_t *)(pwVar2 + param_1 * 4),param_4,param_3);\n        pwVar2 = *(wstring **)this;\n      }\n    }" { (if_statement "if (param_3 == 1) {\n        *(wchar_t *)(pwVar2 + param_1 * 4) = param_4;\n      }\n      else {\n        wmemset((wchar_t *)(pwVar2 + param_1 * 4),param_4,param_3);\n        pwVar2 = *(wstring **)this;\n      }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n        *(wchar_t *)(pwVar2 + param_1 * 4) = param_4;\n      }" { (expression_statement "*(wchar_t *)(pwVar2 + param_1 * 4) = param_4;" (assignment_expression "*(wchar_t *)(pwVar2 + param_1 * 4) = param_4" (pointer_expression "*(wchar_t *)(pwVar2 + param_1 * 4)" * (cast_expression "(wchar_t *)(pwVar2 + param_1 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + param_1 * 4)" ( (binary_expression "pwVar2 + param_1 * 4" identifier + (binary_expression "param_1 * 4" identifier * number_literal)) )))) = identifier) ;) }) (else_clause "else {\n        wmemset((wchar_t *)(pwVar2 + param_1 * 4),param_4,param_3);\n        pwVar2 = *(wstring **)this;\n      }" else (compound_statement "{\n        wmemset((wchar_t *)(pwVar2 + param_1 * 4),param_4,param_3);\n        pwVar2 = *(wstring **)this;\n      }" { (expression_statement "wmemset((wchar_t *)(pwVar2 + param_1 * 4),param_4,param_3);" (call_expression "wmemset((wchar_t *)(pwVar2 + param_1 * 4),param_4,param_3)" identifier (argument_list "((wchar_t *)(pwVar2 + param_1 * 4),param_4,param_3)" ( (cast_expression "(wchar_t *)(pwVar2 + param_1 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + param_1 * 4)" ( (binary_expression "pwVar2 + param_1 * 4" identifier + (binary_expression "param_1 * 4" identifier * number_literal)) ))) , identifier , identifier ))) ;) (expression_statement "pwVar2 = *(wstring **)this;" (assignment_expression "pwVar2 = *(wstring **)this" identifier = (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }))) })) (expression_statement "*(uint *)(this + 4) = uVar4;" (assignment_expression "*(uint *)(this + 4) = uVar4" (pointer_expression "*(uint *)(this + 4)" * (cast_expression "(uint *)(this + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(pwVar2 + uVar4 * 4) = 0;" (assignment_expression "*(undefined4 *)(pwVar2 + uVar4 * 4) = 0" (pointer_expression "*(undefined4 *)(pwVar2 + uVar4 * 4)" * (cast_expression "(undefined4 *)(pwVar2 + uVar4 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + uVar4 * 4)" ( (binary_expression "pwVar2 + uVar4 * 4" identifier + (binary_expression "uVar4 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return this;" return identifier ;) })) comment (expression_statement "__throw_length_error("basic_string::_M_replace_aux");" (call_expression "__throw_length_error("basic_string::_M_replace_aux")" identifier (argument_list "("basic_string::_M_replace_aux")" ( (string_literal ""basic_string::_M_replace_aux"" " string_content ") ))) ;) (ERROR "}" }))
(translation_unit "int * FUN_00201eb0(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)\n\n{\n  wchar_t *__s;\n  int iVar1;\n  size_t __n;\n  int *piVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    \n  FUN_00242a10("basic_string::_M_replace_aux");\n}\n\n" (function_definition "int * FUN_00201eb0(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)\n\n{\n  wchar_t *__s;\n  int iVar1;\n  size_t __n;\n  int *piVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    \n  FUN_00242a10("basic_string::_M_replace_aux");\n}" primitive_type (pointer_declarator "* FUN_00201eb0(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)" * (function_declarator "FUN_00201eb0(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)" identifier (parameter_list "(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) , (parameter_declaration "wchar_t param_5" type_identifier identifier) )))) (compound_statement "{\n  wchar_t *__s;\n  int iVar1;\n  size_t __n;\n  int *piVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    \n  FUN_00242a10("basic_string::_M_replace_aux");\n}" { (declaration "wchar_t *__s;" type_identifier (pointer_declarator "*__s" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "iVar1 = param_1[1];" (assignment_expression "iVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (if_statement "if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }" if (parenthesized_expression "(param_4 <= (param_3 + 0x1fffffff) - iVar1)" ( (binary_expression "param_4 <= (param_3 + 0x1fffffff) - iVar1" identifier <= (binary_expression "(param_3 + 0x1fffffff) - iVar1" (parenthesized_expression "(param_3 + 0x1fffffff)" ( (binary_expression "param_3 + 0x1fffffff" identifier + number_literal) )) - identifier)) )) (compound_statement "{\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }" { (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "uVar4 = (param_4 - param_3) + iVar1;" (assignment_expression "uVar4 = (param_4 - param_3) + iVar1" identifier = (binary_expression "(param_4 - param_3) + iVar1" (parenthesized_expression "(param_4 - param_3)" ( (binary_expression "param_4 - param_3" identifier - identifier) )) + identifier)) ;) (if_statement "if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }" if (parenthesized_expression "(piVar2 == param_1 + 2)" ( (binary_expression "piVar2 == param_1 + 2" identifier == (binary_expression "param_1 + 2" identifier + number_literal)) )) (compound_statement "{\n      uVar3 = 3;\n    }" { (expression_statement "uVar3 = 3;" (assignment_expression "uVar3 = 3" identifier = number_literal) ;) }) (else_clause "else {\n      uVar3 = param_1[2];\n    }" else (compound_statement "{\n      uVar3 = param_1[2];\n    }" { (expression_statement "uVar3 = param_1[2];" (assignment_expression "uVar3 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" if (parenthesized_expression "(uVar3 < uVar4)" ( (binary_expression "uVar3 < uVar4" identifier < identifier) )) (compound_statement "{\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }" { (expression_statement "FUN_00201310(param_1,param_2,param_3,0,param_4);" (call_expression "FUN_00201310(param_1,param_2,param_3,0,param_4)" identifier (argument_list "(param_1,param_2,param_3,0,param_4)" ( identifier , identifier , identifier , number_literal , identifier ))) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" else (compound_statement "{\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" { (expression_statement "__n = iVar1 - (param_2 + param_3);" (assignment_expression "__n = iVar1 - (param_2 + param_3)" identifier = (binary_expression "iVar1 - (param_2 + param_3)" identifier - (parenthesized_expression "(param_2 + param_3)" ( (binary_expression "param_2 + param_3" identifier + identifier) )))) ;) (if_statement "if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }" if (parenthesized_expression "((__n != 0) && (param_3 != param_4))" ( (binary_expression "(__n != 0) && (param_3 != param_4)" (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) && (parenthesized_expression "(param_3 != param_4)" ( (binary_expression "param_3 != param_4" identifier != identifier) ))) )) (compound_statement "{\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }" { (if_statement "if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }" { (expression_statement "piVar2[param_2 + param_4] = piVar2[param_2 + param_3];" (assignment_expression "piVar2[param_2 + param_4] = piVar2[param_2 + param_3]" (subscript_expression "piVar2[param_2 + param_4]" identifier [ (binary_expression "param_2 + param_4" identifier + identifier) ]) = (subscript_expression "piVar2[param_2 + param_3]" identifier [ (binary_expression "param_2 + param_3" identifier + identifier) ])) ;) }) (else_clause "else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }" else (compound_statement "{\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }" { (expression_statement "wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);" (call_expression "wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n)" identifier (argument_list "(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n)" ( (binary_expression "piVar2 + param_2 + param_4" (binary_expression "piVar2 + param_2" identifier + identifier) + identifier) , (binary_expression "piVar2 + param_2 + param_3" (binary_expression "piVar2 + param_2" identifier + identifier) + identifier) , identifier ))) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })) }))) (if_statement "if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }" { (expression_statement "__s = (wchar_t *)((int)piVar2 + param_2 * 4);" (assignment_expression "__s = (wchar_t *)((int)piVar2 + param_2 * 4)" identifier = (cast_expression "(wchar_t *)((int)piVar2 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + param_2 * 4)" ( (binary_expression "(int)piVar2 + param_2 * 4" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + (binary_expression "param_2 * 4" identifier * number_literal)) )))) ;) (if_statement "if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *__s = param_5;\n      }" { (expression_statement "*__s = param_5;" (assignment_expression "*__s = param_5" (pointer_expression "*__s" * identifier) = identifier) ;) }) (else_clause "else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" else (compound_statement "{\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" { (expression_statement "wmemset(__s,param_5,param_4);" (call_expression "wmemset(__s,param_5,param_4)" identifier (argument_list "(__s,param_5,param_4)" ( identifier , identifier , identifier ))) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })) (expression_statement "param_1[1] = uVar4;" (assignment_expression "param_1[1] = uVar4" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;" (assignment_expression "*(undefined4 *)((int)piVar2 + uVar4 * 4) = 0" (pointer_expression "*(undefined4 *)((int)piVar2 + uVar4 * 4)" * (cast_expression "(undefined4 *)((int)piVar2 + uVar4 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + uVar4 * 4)" ( (binary_expression "(int)piVar2 + uVar4 * 4" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + (binary_expression "uVar4 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })) (expression_statement "FUN_00242a10("basic_string::_M_replace_aux");" (call_expression "FUN_00242a10("basic_string::_M_replace_aux")" identifier (argument_list "("basic_string::_M_replace_aux")" ( (string_literal ""basic_string::_M_replace_aux"" " string_content ") ))) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (binary_expression (parenthesized_expression ( (binary_expression IDENT + LIT) )) - IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT - IDENT) )) + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (binary_expression IDENT + LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , LIT , IDENT ))) ;) (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 = (binary_expression IDENT - (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) && (parenthesized_expression ( (binary_expression IDENT != IDENT) ))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ (binary_expression IDENT + IDENT) ]) = (subscript_expression IDENT [ (binary_expression IDENT + IDENT) ])) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression (binary_expression IDENT + IDENT) + IDENT) , (binary_expression (binary_expression IDENT + IDENT) + IDENT) , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * 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 *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (binary_expression IDENT * LIT)) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }))) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (binary_expression IDENT * LIT)) )))) = LIT) ;) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) })))
(function_definition "int * FUN_00201eb0(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)\n\n{\n  wchar_t *__s;\n  int iVar1;\n  size_t __n;\n  int *piVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    \n  FUN_00242a10("basic_string::_M_replace_aux");\n}" (primitive_type "int") (pointer_declarator "* FUN_00201eb0(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)" (* "*") (function_declarator "FUN_00201eb0(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)" (identifier "FUN_00201eb0") (parameter_list "(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)" (( "(") (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 "uint param_3" (type_identifier "uint") (identifier "param_3")) (, ",") (parameter_declaration "uint param_4" (type_identifier "uint") (identifier "param_4")) (, ",") (parameter_declaration "wchar_t param_5" (type_identifier "wchar_t") (identifier "param_5")) () ")")))) (compound_statement "{\n  wchar_t *__s;\n  int iVar1;\n  size_t __n;\n  int *piVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    \n  FUN_00242a10("basic_string::_M_replace_aux");\n}" ({ "{") (declaration "wchar_t *__s;" (type_identifier "wchar_t") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (expression_statement "iVar1 = param_1[1];" (assignment_expression "iVar1 = param_1[1]" (identifier "iVar1") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (if_statement "if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }" (if "if") (parenthesized_expression "(param_4 <= (param_3 + 0x1fffffff) - iVar1)" (( "(") (binary_expression "param_4 <= (param_3 + 0x1fffffff) - iVar1" (identifier "param_4") (<= "<=") (binary_expression "(param_3 + 0x1fffffff) - iVar1" (parenthesized_expression "(param_3 + 0x1fffffff)" (( "(") (binary_expression "param_3 + 0x1fffffff" (identifier "param_3") (+ "+") (number_literal "0x1fffffff")) () ")")) (- "-") (identifier "iVar1"))) () ")")) (compound_statement "{\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;\n    return param_1;\n  }" ({ "{") (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" (identifier "piVar2") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "uVar4 = (param_4 - param_3) + iVar1;" (assignment_expression "uVar4 = (param_4 - param_3) + iVar1" (identifier "uVar4") (= "=") (binary_expression "(param_4 - param_3) + iVar1" (parenthesized_expression "(param_4 - param_3)" (( "(") (binary_expression "param_4 - param_3" (identifier "param_4") (- "-") (identifier "param_3")) () ")")) (+ "+") (identifier "iVar1"))) (; ";")) (if_statement "if (piVar2 == param_1 + 2) {\n      uVar3 = 3;\n    }\n    else {\n      uVar3 = param_1[2];\n    }" (if "if") (parenthesized_expression "(piVar2 == param_1 + 2)" (( "(") (binary_expression "piVar2 == param_1 + 2" (identifier "piVar2") (== "==") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2"))) () ")")) (compound_statement "{\n      uVar3 = 3;\n    }" ({ "{") (expression_statement "uVar3 = 3;" (assignment_expression "uVar3 = 3" (identifier "uVar3") (= "=") (number_literal "3")) (; ";")) (} "}")) (else_clause "else {\n      uVar3 = param_1[2];\n    }" (else "else") (compound_statement "{\n      uVar3 = param_1[2];\n    }" ({ "{") (expression_statement "uVar3 = param_1[2];" (assignment_expression "uVar3 = param_1[2]" (identifier "uVar3") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (} "}")))) (if_statement "if (uVar3 < uVar4) {\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" (if "if") (parenthesized_expression "(uVar3 < uVar4)" (( "(") (binary_expression "uVar3 < uVar4" (identifier "uVar3") (< "<") (identifier "uVar4")) () ")")) (compound_statement "{\n      FUN_00201310(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }" ({ "{") (expression_statement "FUN_00201310(param_1,param_2,param_3,0,param_4);" (call_expression "FUN_00201310(param_1,param_2,param_3,0,param_4)" (identifier "FUN_00201310") (argument_list "(param_1,param_2,param_3,0,param_4)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (number_literal "0") (, ",") (identifier "param_4") () ")"))) (; ";")) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" (identifier "piVar2") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" (else "else") (compound_statement "{\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" ({ "{") (expression_statement "__n = iVar1 - (param_2 + param_3);" (assignment_expression "__n = iVar1 - (param_2 + param_3)" (identifier "__n") (= "=") (binary_expression "iVar1 - (param_2 + param_3)" (identifier "iVar1") (- "-") (parenthesized_expression "(param_2 + param_3)" (( "(") (binary_expression "param_2 + param_3" (identifier "param_2") (+ "+") (identifier "param_3")) () ")")))) (; ";")) (if_statement "if ((__n != 0) && (param_3 != param_4)) {\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }" (if "if") (parenthesized_expression "((__n != 0) && (param_3 != param_4))" (( "(") (binary_expression "(__n != 0) && (param_3 != param_4)" (parenthesized_expression "(__n != 0)" (( "(") (binary_expression "__n != 0" (identifier "__n") (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(param_3 != param_4)" (( "(") (binary_expression "param_3 != param_4" (identifier "param_3") (!= "!=") (identifier "param_4")) () ")"))) () ")")) (compound_statement "{\n        if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }" ({ "{") (if_statement "if (__n == 1) {\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }\n        else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }" (if "if") (parenthesized_expression "(__n == 1)" (( "(") (binary_expression "__n == 1" (identifier "__n") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];\n        }" ({ "{") (expression_statement "piVar2[param_2 + param_4] = piVar2[param_2 + param_3];" (assignment_expression "piVar2[param_2 + param_4] = piVar2[param_2 + param_3]" (subscript_expression "piVar2[param_2 + param_4]" (identifier "piVar2") ([ "[") (binary_expression "param_2 + param_4" (identifier "param_2") (+ "+") (identifier "param_4")) (] "]")) (= "=") (subscript_expression "piVar2[param_2 + param_3]" (identifier "piVar2") ([ "[") (binary_expression "param_2 + param_3" (identifier "param_2") (+ "+") (identifier "param_3")) (] "]"))) (; ";")) (} "}")) (else_clause "else {\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }" (else "else") (compound_statement "{\n          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);\n          piVar2 = (int *)*param_1;\n        }" ({ "{") (expression_statement "wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);" (call_expression "wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n)" (identifier "wmemmove") (argument_list "(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n)" (( "(") (binary_expression "piVar2 + param_2 + param_4" (binary_expression "piVar2 + param_2" (identifier "piVar2") (+ "+") (identifier "param_2")) (+ "+") (identifier "param_4")) (, ",") (binary_expression "piVar2 + param_2 + param_3" (binary_expression "piVar2 + param_2" (identifier "piVar2") (+ "+") (identifier "param_2")) (+ "+") (identifier "param_3")) (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" (identifier "piVar2") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")))) (} "}"))) (} "}")))) (if_statement "if (param_4 != 0) {\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }" (if "if") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      __s = (wchar_t *)((int)piVar2 + param_2 * 4);\n      if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }" ({ "{") (expression_statement "__s = (wchar_t *)((int)piVar2 + param_2 * 4);" (assignment_expression "__s = (wchar_t *)((int)piVar2 + param_2 * 4)" (identifier "__s") (= "=") (cast_expression "(wchar_t *)((int)piVar2 + param_2 * 4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)piVar2 + param_2 * 4)" (( "(") (binary_expression "(int)piVar2 + param_2 * 4" (cast_expression "(int)piVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar2")) (+ "+") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4"))) () ")")))) (; ";")) (if_statement "if (param_4 == 1) {\n        *__s = param_5;\n      }\n      else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" (if "if") (parenthesized_expression "(param_4 == 1)" (( "(") (binary_expression "param_4 == 1" (identifier "param_4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *__s = param_5;\n      }" ({ "{") (expression_statement "*__s = param_5;" (assignment_expression "*__s = param_5" (pointer_expression "*__s" (* "*") (identifier "__s")) (= "=") (identifier "param_5")) (; ";")) (} "}")) (else_clause "else {\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" (else "else") (compound_statement "{\n        wmemset(__s,param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" ({ "{") (expression_statement "wmemset(__s,param_5,param_4);" (call_expression "wmemset(__s,param_5,param_4)" (identifier "wmemset") (argument_list "(__s,param_5,param_4)" (( "(") (identifier "__s") (, ",") (identifier "param_5") (, ",") (identifier "param_4") () ")"))) (; ";")) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" (identifier "piVar2") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")))) (} "}"))) (expression_statement "param_1[1] = uVar4;" (assignment_expression "param_1[1] = uVar4" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "uVar4")) (; ";")) (expression_statement "*(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;" (assignment_expression "*(undefined4 *)((int)piVar2 + uVar4 * 4) = 0" (pointer_expression "*(undefined4 *)((int)piVar2 + uVar4 * 4)" (* "*") (cast_expression "(undefined4 *)((int)piVar2 + uVar4 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)piVar2 + uVar4 * 4)" (( "(") (binary_expression "(int)piVar2 + uVar4 * 4" (cast_expression "(int)piVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar2")) (+ "+") (binary_expression "uVar4 * 4" (identifier "uVar4") (* "*") (number_literal "4"))) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (expression_statement "FUN_00242a10("basic_string::_M_replace_aux");" (call_expression "FUN_00242a10("basic_string::_M_replace_aux")" (identifier "FUN_00242a10") (argument_list "("basic_string::_M_replace_aux")" (( "(") (string_literal ""basic_string::_M_replace_aux"" (" """) (string_content "basic_string::_M_replace_aux") (" """)) () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */
/* std::wstring::_M_replace_aux(unsigned int, unsigned int, unsigned int, wchar_t) */

type_2 * __thiscall
std::type_2::_M_replace_aux(type_2 *var_1,type_1 var_9,type_1 var_3,type_1 var_2,type_3 param_4)

{
  int var_4;
  size_t var_10;
  type_2 *var_5;
  type_1 var_6;
  type_1 var_7;
  
  var_4 = *(int *)(var_1 + 4);
  if (var_2 <= (var_3 + 0x1fffffff) - var_4) {
    var_5 = *(type_2 **)var_1;
    var_7 = (var_2 - var_3) + var_4;
    if (var_5 == var_1 + 8) {
      var_6 = 3;
    }
    else {
      var_6 = *(type_1 *)(var_1 + 8);
    }
    if (var_6 < var_7) {
      var_8(var_1,var_9,var_3,(type_3 *)0x0,var_2);
      var_5 = *(type_2 **)var_1;
    }
    else {
      var_10 = var_4 - (var_9 + var_3);
      if ((var_10 != 0) && (var_3 != var_2)) {
        if (var_10 == 1) {
          *(type_3 *)(var_5 + var_2 * 4 + var_9 * 4) =
               *(type_3 *)(var_5 + var_3 * 4 + var_9 * 4);
        }
        else {
          var_11((type_3 *)(var_5 + var_2 * 4 + var_9 * 4),
                   (type_3 *)(var_5 + var_3 * 4 + var_9 * 4),var_10);
          var_5 = *(type_2 **)var_1;
        }
      }
    }
    if (var_2 != 0) {
      if (var_2 == 1) {
        *(type_3 *)(var_5 + var_9 * 4) = param_4;
      }
      else {
        var_12((type_3 *)(var_5 + var_9 * 4),param_4,var_2);
        var_5 = *(type_2 **)var_1;
      }
    }
    *(type_1 *)(var_1 + 4) = var_7;
    *(type_4 *)(var_5 + var_7 * 4) = 0;
    return var_1;
  }
                    /* WARNING: Subroutine does not return */
  var_13("basic_string::_M_replace_aux");
}


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

/* WARNING: Function: __i686.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */

int * MASKED(int *param_1,int param_2,uint param_3,uint param_4,wchar_t param_5)

{
  wchar_t *__s;
  int iVar1;
  size_t __n;
  int *piVar2;
  uint uVar3;
  uint uVar4;
  
  iVar1 = param_1[1];
  if (param_4 <= (param_3 + 0x1fffffff) - iVar1) {
    piVar2 = (int *)*param_1;
    uVar4 = (param_4 - param_3) + iVar1;
    if (piVar2 == param_1 + 2) {
      uVar3 = 3;
    }
    else {
      uVar3 = param_1[2];
    }
    if (uVar3 < uVar4) {
      FUN_00201310(param_1,param_2,param_3,0,param_4);
      piVar2 = (int *)*param_1;
    }
    else {
      __n = iVar1 - (param_2 + param_3);
      if ((__n != 0) && (param_3 != param_4)) {
        if (__n == 1) {
          piVar2[param_2 + param_4] = piVar2[param_2 + param_3];
        }
        else {
          wmemmove(piVar2 + param_2 + param_4,piVar2 + param_2 + param_3,__n);
          piVar2 = (int *)*param_1;
        }
      }
    }
    if (param_4 != 0) {
      __s = (wchar_t *)((int)piVar2 + param_2 * 4);
      if (param_4 == 1) {
        *__s = param_5;
      }
      else {
        wmemset(__s,param_5,param_4);
        piVar2 = (int *)*param_1;
      }
    }
    param_1[1] = uVar4;
    *(undefined4 *)((int)piVar2 + uVar4 * 4) = 0;
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00242a10("basic_string::_M_replace_aux");
}

