
/* std::wstring::_M_replace_aux(unsigned long, unsigned long, unsigned long, wchar_t) */

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

{
  long lVar1;
  wstring *pwVar2;
  size_t __n;
  ulong uVar3;
  ulong uVar4;
  
  lVar1 = *(long *)(this + 8);
  if (param_3 <= (param_2 + 0x1fffffffffffffff) - lVar1) {
    pwVar2 = *(wstring **)this;
    uVar3 = (param_3 - param_2) + lVar1;
    if (pwVar2 == this + 0x10) {
      uVar4 = 3;
    }
    else {
      uVar4 = *(ulong *)(this + 0x10);
    }
    if (uVar4 < uVar3) {
      _M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);
      pwVar2 = *(wstring **)this;
    }
    else {
      __n = lVar1 - (param_2 + param_1);
      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;
      }
    }
    *(ulong *)(this + 8) = uVar3;
    *(undefined4 *)(pwVar2 + uVar3 * 4) = 0;
    return this;
  }
                    /* WARNING: Subroutine does not return */
  __throw_length_error("basic_string::_M_replace_aux");
}



long * FUN_002df460(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)

{
  wchar_t *pwVar1;
  wchar_t *__s1;
  long lVar2;
  long *plVar3;
  size_t __n;
  ulong uVar4;
  ulong uVar5;
  
  lVar2 = param_1[1];
  if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {
    plVar3 = (long *)*param_1;
    uVar4 = (param_4 - param_3) + lVar2;
    if (plVar3 == param_1 + 2) {
      uVar5 = 3;
    }
    else {
      uVar5 = param_1[2];
    }
    if (uVar5 < uVar4) {
      FUN_002dea50(param_1,param_2,param_3,0,param_4);
      plVar3 = (long *)*param_1;
    }
    else {
      __n = lVar2 - (param_3 + param_2);
      if ((__n != 0) && (param_3 != param_4)) {
        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);
        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);
        if (__n == 1) {
          *__s1 = *pwVar1;
        }
        else {
          wmemmove(__s1,pwVar1,__n);
          plVar3 = (long *)*param_1;
        }
      }
    }
    if (param_4 != 0) {
      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);
      if (param_4 == 1) {
        *pwVar1 = param_5;
      }
      else {
        wmemset(pwVar1,param_5,param_4);
        plVar3 = (long *)*param_1;
      }
    }
    param_1[1] = uVar4;
    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00319590("basic_string::_M_replace_aux");
}


MOV RAX,0x1fffffffffffffff
PUSH R14
PUSH R13
ADD RAX,RDX
PUSH R12
MOV R12,RCX
PUSH RBP
PUSH RBX
MOV RCX,qword ptr [RDI + 0x8]
SUB RAX,RCX
CMP R12,RAX
JA 0x002df55b
MOV RBP,R12
MOV RAX,qword ptr [RDI]
MOV R13,RSI
LEA RSI,[RDI + 0x10]
SUB RBP,RDX
MOV RBX,RDI
MOV R14D,R8D
ADD RBP,RCX
CMP RAX,RSI
JZ 0x002df538
MOV RSI,qword ptr [RDI + 0x10]
CMP RSI,RBP
JC 0x002df518
LEA RSI,[RDX + R13*0x1]
SUB RCX,RSI
JZ 0x002df4de
CMP RDX,R12
JZ 0x002df4de
LEA RDI,[RAX + R13*0x4]
LEA RSI,[RDI + RDX*0x4]
LEA RDI,[RDI + R12*0x4]
CMP RCX,0x1
JZ 0x002df550
MOV RDX,RCX
CALL 0x00147720
MOV RAX,qword ptr [RBX]
TEST R12,R12
JZ 0x002df4fb
LEA RDI,[RAX + R13*0x4]
CMP R12,0x1
JZ 0x002df548
MOV RDX,R12
MOV ESI,R14D
CALL 0x00147af0
MOV RAX,qword ptr [RBX]
MOV qword ptr [RBX + 0x8],RBP
MOV dword ptr [RAX + RBP*0x4],0x0
MOV RAX,RBX
POP RBX
POP RBP
POP R12
POP R13
POP R14
RET
MOV R8,R12
XOR ECX,ECX
MOV RSI,R13
MOV RDI,RBX
CALL 0x002dea50
MOV RAX,qword ptr [RBX]
TEST R12,R12
JZ 0x002df4fb
JMP 0x002df4e3
MOV ESI,0x3
JMP 0x002df4ae
MOV dword ptr [RDI],R14D
JMP 0x002df4fb
MOV EDX,dword ptr [RSI]
MOV dword ptr [RDI],EDX
TEST R12,R12
JZ 0x002df4fb
JMP 0x002df4e3
LEA RDI,[0x391134]
CALL 0x00319590
(translation_unit "long * FUN_002df460(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)\n\n{\n  wchar_t *pwVar1;\n  wchar_t *__s1;\n  long lVar2;\n  long *plVar3;\n  size_t __n;\n  ulong uVar4;\n  ulong uVar5;\n  \n  lVar2 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00319590("basic_string::_M_replace_aux");\n}\n\n" (function_definition "long * FUN_002df460(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)\n\n{\n  wchar_t *pwVar1;\n  wchar_t *__s1;\n  long lVar2;\n  long *plVar3;\n  size_t __n;\n  ulong uVar4;\n  ulong uVar5;\n  \n  lVar2 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00319590("basic_string::_M_replace_aux");\n}" (sized_type_specifier "long" long) (pointer_declarator "* FUN_002df460(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)" * (function_declarator "FUN_002df460(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)" identifier (parameter_list "(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "long param_2" (sized_type_specifier "long" long) identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) , (parameter_declaration "ulong param_4" type_identifier identifier) , (parameter_declaration "wchar_t param_5" type_identifier identifier) )))) (compound_statement "{\n  wchar_t *pwVar1;\n  wchar_t *__s1;\n  long lVar2;\n  long *plVar3;\n  size_t __n;\n  ulong uVar4;\n  ulong uVar5;\n  \n  lVar2 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00319590("basic_string::_M_replace_aux");\n}" { (declaration "wchar_t *pwVar1;" type_identifier (pointer_declarator "*pwVar1" * identifier) ;) (declaration "wchar_t *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "long *plVar3;" (sized_type_specifier "long" long) (pointer_declarator "*plVar3" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "ulong uVar4;" type_identifier identifier ;) (declaration "ulong uVar5;" type_identifier identifier ;) (expression_statement "lVar2 = param_1[1];" (assignment_expression "lVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (if_statement "if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }" if (parenthesized_expression "(param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2)" ( (binary_expression "param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2" identifier <= (binary_expression "(param_3 + 0x1fffffffffffffff) - lVar2" (parenthesized_expression "(param_3 + 0x1fffffffffffffff)" ( (binary_expression "param_3 + 0x1fffffffffffffff" identifier + number_literal) )) - identifier)) )) (compound_statement "{\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }" { (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "uVar4 = (param_4 - param_3) + lVar2;" (assignment_expression "uVar4 = (param_4 - param_3) + lVar2" identifier = (binary_expression "(param_4 - param_3) + lVar2" (parenthesized_expression "(param_4 - param_3)" ( (binary_expression "param_4 - param_3" identifier - identifier) )) + identifier)) ;) (if_statement "if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }" if (parenthesized_expression "(plVar3 == param_1 + 2)" ( (binary_expression "plVar3 == param_1 + 2" identifier == (binary_expression "param_1 + 2" identifier + number_literal)) )) (compound_statement "{\n      uVar5 = 3;\n    }" { (expression_statement "uVar5 = 3;" (assignment_expression "uVar5 = 3" identifier = number_literal) ;) }) (else_clause "else {\n      uVar5 = param_1[2];\n    }" else (compound_statement "{\n      uVar5 = param_1[2];\n    }" { (expression_statement "uVar5 = param_1[2];" (assignment_expression "uVar5 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }" if (parenthesized_expression "(uVar5 < uVar4)" ( (binary_expression "uVar5 < uVar4" identifier < identifier) )) (compound_statement "{\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }" { (expression_statement "FUN_002dea50(param_1,param_2,param_3,0,param_4);" (call_expression "FUN_002dea50(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 "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }" else (compound_statement "{\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }" { (expression_statement "__n = lVar2 - (param_3 + param_2);" (assignment_expression "__n = lVar2 - (param_3 + param_2)" identifier = (binary_expression "lVar2 - (param_3 + param_2)" identifier - (parenthesized_expression "(param_3 + param_2)" ( (binary_expression "param_3 + param_2" identifier + identifier) )))) ;) (if_statement "if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*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        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }" { (expression_statement "pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);" (assignment_expression "pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4)" identifier = (cast_expression "(wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + param_3 * 4 + param_2 * 4)" ( (binary_expression "(long)plVar3 + param_3 * 4 + param_2 * 4" (binary_expression "(long)plVar3 + param_3 * 4" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "param_3 * 4" identifier * number_literal)) + (binary_expression "param_2 * 4" identifier * number_literal)) )))) ;) (expression_statement "__s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);" (assignment_expression "__s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4)" identifier = (cast_expression "(wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + param_4 * 4 + param_2 * 4)" ( (binary_expression "(long)plVar3 + param_4 * 4 + param_2 * 4" (binary_expression "(long)plVar3 + param_4 * 4" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "param_4 * 4" identifier * number_literal)) + (binary_expression "param_2 * 4" identifier * number_literal)) )))) ;) (if_statement "if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n          *__s1 = *pwVar1;\n        }" { (expression_statement "*__s1 = *pwVar1;" (assignment_expression "*__s1 = *pwVar1" (pointer_expression "*__s1" * identifier) = (pointer_expression "*pwVar1" * identifier)) ;) }) (else_clause "else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }" else (compound_statement "{\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }" { (expression_statement "wmemmove(__s1,pwVar1,__n);" (call_expression "wmemmove(__s1,pwVar1,__n)" identifier (argument_list "(__s1,pwVar1,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })) }))) (if_statement "if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }" { (expression_statement "pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);" (assignment_expression "pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4)" identifier = (cast_expression "(wchar_t *)((long)plVar3 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + param_2 * 4)" ( (binary_expression "(long)plVar3 + param_2 * 4" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "param_2 * 4" identifier * number_literal)) )))) ;) (if_statement "if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *pwVar1 = param_5;\n      }" { (expression_statement "*pwVar1 = param_5;" (assignment_expression "*pwVar1 = param_5" (pointer_expression "*pwVar1" * identifier) = identifier) ;) }) (else_clause "else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }" else (compound_statement "{\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }" { (expression_statement "wmemset(pwVar1,param_5,param_4);" (call_expression "wmemset(pwVar1,param_5,param_4)" identifier (argument_list "(pwVar1,param_5,param_4)" ( identifier , identifier , identifier ))) ;) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (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 *)((long)plVar3 + uVar4 * 4) = 0;" (assignment_expression "*(undefined4 *)((long)plVar3 + uVar4 * 4) = 0" (pointer_expression "*(undefined4 *)((long)plVar3 + uVar4 * 4)" * (cast_expression "(undefined4 *)((long)plVar3 + uVar4 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + uVar4 * 4)" ( (binary_expression "(long)plVar3 + uVar4 * 4" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "uVar4 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })) comment (expression_statement "FUN_00319590("basic_string::_M_replace_aux");" (call_expression "FUN_00319590("basic_string::_M_replace_aux")" identifier (argument_list "("basic_string::_M_replace_aux")" ( (string_literal ""basic_string::_M_replace_aux"" " string_content ") ))) ;) })))
(translation_unit "/* std::wstring::_M_replace_aux(unsigned long, unsigned long, unsigned long, wchar_t) */\n\nwstring * __thiscall\nstd::wstring::_M_replace_aux\n          (wstring *this,ulong param_1,ulong param_2,ulong param_3,wchar_t param_4)\n\n{\n  long lVar1;\n  wstring *pwVar2;\n  size_t __n;\n  ulong uVar3;\n  ulong uVar4;\n  \n  lVar1 = *(long *)(this + 8);\n  if (param_3 <= (param_2 + 0x1fffffffffffffff) - lVar1) {\n    pwVar2 = *(wstring **)this;\n    uVar3 = (param_3 - param_2) + lVar1;\n    if (pwVar2 == this + 0x10) {\n      uVar4 = 3;\n    }\n    else {\n      uVar4 = *(ulong *)(this + 0x10);\n    }\n    if (uVar4 < uVar3) {\n      _M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);\n      pwVar2 = *(wstring **)this;\n    }\n    else {\n      __n = lVar1 - (param_2 + param_1);\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    *(ulong *)(this + 8) = uVar3;\n    *(undefined4 *)(pwVar2 + uVar3 * 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 (ERROR "wstring * __thiscall\nstd::wstring::_M_replace_aux\n          (wstring *this,ulong param_1,ulong param_2,ulong param_3,wchar_t param_4)" (binary_expression "wstring * __thiscall\nstd::wstring::_M_replace_aux\n          (wstring *this,ulong param_1,ulong param_2,ulong param_3,wchar_t param_4)" identifier * (call_expression "__thiscall\nstd::wstring::_M_replace_aux\n          (wstring *this,ulong param_1,ulong param_2,ulong param_3,wchar_t param_4)" identifier (ERROR "std::wstring::_M_replace_aux" identifier : : identifier : : identifier) (argument_list "(wstring *this,ulong param_1,ulong param_2,ulong param_3,wchar_t param_4)" ( (binary_expression "wstring *this" identifier * identifier) , (ERROR "ulong" identifier) identifier , (ERROR "ulong" identifier) identifier , (ERROR "ulong" identifier) identifier , identifier (ERROR "param_4" identifier) ))))) (compound_statement "{\n  long lVar1;\n  wstring *pwVar2;\n  size_t __n;\n  ulong uVar3;\n  ulong uVar4;\n  \n  lVar1 = *(long *)(this + 8);\n  if (param_3 <= (param_2 + 0x1fffffffffffffff) - lVar1) {\n    pwVar2 = *(wstring **)this;\n    uVar3 = (param_3 - param_2) + lVar1;\n    if (pwVar2 == this + 0x10) {\n      uVar4 = 3;\n    }\n    else {\n      uVar4 = *(ulong *)(this + 0x10);\n    }\n    if (uVar4 < uVar3) {\n      _M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);\n      pwVar2 = *(wstring **)this;\n    }\n    else {\n      __n = lVar1 - (param_2 + param_1);\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    *(ulong *)(this + 8) = uVar3;\n    *(undefined4 *)(pwVar2 + uVar3 * 4) = 0;\n    return this;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_length_error("basic_string::_M_replace_aux");\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "wstring *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "ulong uVar3;" type_identifier identifier ;) (declaration "ulong uVar4;" type_identifier identifier ;) (expression_statement "lVar1 = *(long *)(this + 8);" (assignment_expression "lVar1 = *(long *)(this + 8)" identifier = (pointer_expression "*(long *)(this + 8)" * (cast_expression "(long *)(this + 8)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))) ;) (if_statement "if (param_3 <= (param_2 + 0x1fffffffffffffff) - lVar1) {\n    pwVar2 = *(wstring **)this;\n    uVar3 = (param_3 - param_2) + lVar1;\n    if (pwVar2 == this + 0x10) {\n      uVar4 = 3;\n    }\n    else {\n      uVar4 = *(ulong *)(this + 0x10);\n    }\n    if (uVar4 < uVar3) {\n      _M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);\n      pwVar2 = *(wstring **)this;\n    }\n    else {\n      __n = lVar1 - (param_2 + param_1);\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    *(ulong *)(this + 8) = uVar3;\n    *(undefined4 *)(pwVar2 + uVar3 * 4) = 0;\n    return this;\n  }" if (parenthesized_expression "(param_3 <= (param_2 + 0x1fffffffffffffff) - lVar1)" ( (binary_expression "param_3 <= (param_2 + 0x1fffffffffffffff) - lVar1" identifier <= (binary_expression "(param_2 + 0x1fffffffffffffff) - lVar1" (parenthesized_expression "(param_2 + 0x1fffffffffffffff)" ( (binary_expression "param_2 + 0x1fffffffffffffff" identifier + number_literal) )) - identifier)) )) (compound_statement "{\n    pwVar2 = *(wstring **)this;\n    uVar3 = (param_3 - param_2) + lVar1;\n    if (pwVar2 == this + 0x10) {\n      uVar4 = 3;\n    }\n    else {\n      uVar4 = *(ulong *)(this + 0x10);\n    }\n    if (uVar4 < uVar3) {\n      _M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);\n      pwVar2 = *(wstring **)this;\n    }\n    else {\n      __n = lVar1 - (param_2 + param_1);\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    *(ulong *)(this + 8) = uVar3;\n    *(undefined4 *)(pwVar2 + uVar3 * 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 "uVar3 = (param_3 - param_2) + lVar1;" (assignment_expression "uVar3 = (param_3 - param_2) + lVar1" identifier = (binary_expression "(param_3 - param_2) + lVar1" (parenthesized_expression "(param_3 - param_2)" ( (binary_expression "param_3 - param_2" identifier - identifier) )) + identifier)) ;) (if_statement "if (pwVar2 == this + 0x10) {\n      uVar4 = 3;\n    }\n    else {\n      uVar4 = *(ulong *)(this + 0x10);\n    }" if (parenthesized_expression "(pwVar2 == this + 0x10)" ( (binary_expression "pwVar2 == this + 0x10" identifier == (binary_expression "this + 0x10" identifier + number_literal)) )) (compound_statement "{\n      uVar4 = 3;\n    }" { (expression_statement "uVar4 = 3;" (assignment_expression "uVar4 = 3" identifier = number_literal) ;) }) (else_clause "else {\n      uVar4 = *(ulong *)(this + 0x10);\n    }" else (compound_statement "{\n      uVar4 = *(ulong *)(this + 0x10);\n    }" { (expression_statement "uVar4 = *(ulong *)(this + 0x10);" (assignment_expression "uVar4 = *(ulong *)(this + 0x10)" identifier = (pointer_expression "*(ulong *)(this + 0x10)" * (cast_expression "(ulong *)(this + 0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x10)" ( (binary_expression "this + 0x10" identifier + number_literal) ))))) ;) }))) (if_statement "if (uVar4 < uVar3) {\n      _M_mutate(this,param_1,param_2,(wchar_t *)0x0,param_3);\n      pwVar2 = *(wstring **)this;\n    }\n    else {\n      __n = lVar1 - (param_2 + param_1);\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 "(uVar4 < uVar3)" ( (binary_expression "uVar4 < uVar3" 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 = lVar1 - (param_2 + param_1);\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 = lVar1 - (param_2 + param_1);\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 = lVar1 - (param_2 + param_1);" (assignment_expression "__n = lVar1 - (param_2 + param_1)" identifier = (binary_expression "lVar1 - (param_2 + param_1)" identifier - (parenthesized_expression "(param_2 + param_1)" ( (binary_expression "param_2 + param_1" 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 "*(ulong *)(this + 8) = uVar3;" (assignment_expression "*(ulong *)(this + 8) = uVar3" (pointer_expression "*(ulong *)(this + 8)" * (cast_expression "(ulong *)(this + 8)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined4 *)(pwVar2 + uVar3 * 4) = 0;" (assignment_expression "*(undefined4 *)(pwVar2 + uVar3 * 4) = 0" (pointer_expression "*(undefined4 *)(pwVar2 + uVar3 * 4)" * (cast_expression "(undefined4 *)(pwVar2 + uVar3 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + uVar3 * 4)" ( (binary_expression "pwVar2 + uVar3 * 4" identifier + (binary_expression "uVar3 * 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 ") ))) ;) }))
(translation_unit "long * FUN_002df460(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)\n\n{\n  wchar_t *pwVar1;\n  wchar_t *__s1;\n  long lVar2;\n  long *plVar3;\n  size_t __n;\n  ulong uVar4;\n  ulong uVar5;\n  \n  lVar2 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    \n  FUN_00319590("basic_string::_M_replace_aux");\n}\n\n" (function_definition "long * FUN_002df460(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)\n\n{\n  wchar_t *pwVar1;\n  wchar_t *__s1;\n  long lVar2;\n  long *plVar3;\n  size_t __n;\n  ulong uVar4;\n  ulong uVar5;\n  \n  lVar2 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    \n  FUN_00319590("basic_string::_M_replace_aux");\n}" (sized_type_specifier "long" long) (pointer_declarator "* FUN_002df460(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)" * (function_declarator "FUN_002df460(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)" identifier (parameter_list "(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "long param_2" (sized_type_specifier "long" long) identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) , (parameter_declaration "ulong param_4" type_identifier identifier) , (parameter_declaration "wchar_t param_5" type_identifier identifier) )))) (compound_statement "{\n  wchar_t *pwVar1;\n  wchar_t *__s1;\n  long lVar2;\n  long *plVar3;\n  size_t __n;\n  ulong uVar4;\n  ulong uVar5;\n  \n  lVar2 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    \n  FUN_00319590("basic_string::_M_replace_aux");\n}" { (declaration "wchar_t *pwVar1;" type_identifier (pointer_declarator "*pwVar1" * identifier) ;) (declaration "wchar_t *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "long *plVar3;" (sized_type_specifier "long" long) (pointer_declarator "*plVar3" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "ulong uVar4;" type_identifier identifier ;) (declaration "ulong uVar5;" type_identifier identifier ;) (expression_statement "lVar2 = param_1[1];" (assignment_expression "lVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (if_statement "if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }" if (parenthesized_expression "(param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2)" ( (binary_expression "param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2" identifier <= (binary_expression "(param_3 + 0x1fffffffffffffff) - lVar2" (parenthesized_expression "(param_3 + 0x1fffffffffffffff)" ( (binary_expression "param_3 + 0x1fffffffffffffff" identifier + number_literal) )) - identifier)) )) (compound_statement "{\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }" { (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "uVar4 = (param_4 - param_3) + lVar2;" (assignment_expression "uVar4 = (param_4 - param_3) + lVar2" identifier = (binary_expression "(param_4 - param_3) + lVar2" (parenthesized_expression "(param_4 - param_3)" ( (binary_expression "param_4 - param_3" identifier - identifier) )) + identifier)) ;) (if_statement "if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }" if (parenthesized_expression "(plVar3 == param_1 + 2)" ( (binary_expression "plVar3 == param_1 + 2" identifier == (binary_expression "param_1 + 2" identifier + number_literal)) )) (compound_statement "{\n      uVar5 = 3;\n    }" { (expression_statement "uVar5 = 3;" (assignment_expression "uVar5 = 3" identifier = number_literal) ;) }) (else_clause "else {\n      uVar5 = param_1[2];\n    }" else (compound_statement "{\n      uVar5 = param_1[2];\n    }" { (expression_statement "uVar5 = param_1[2];" (assignment_expression "uVar5 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }" if (parenthesized_expression "(uVar5 < uVar4)" ( (binary_expression "uVar5 < uVar4" identifier < identifier) )) (compound_statement "{\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }" { (expression_statement "FUN_002dea50(param_1,param_2,param_3,0,param_4);" (call_expression "FUN_002dea50(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 "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }" else (compound_statement "{\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }" { (expression_statement "__n = lVar2 - (param_3 + param_2);" (assignment_expression "__n = lVar2 - (param_3 + param_2)" identifier = (binary_expression "lVar2 - (param_3 + param_2)" identifier - (parenthesized_expression "(param_3 + param_2)" ( (binary_expression "param_3 + param_2" identifier + identifier) )))) ;) (if_statement "if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*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        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }" { (expression_statement "pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);" (assignment_expression "pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4)" identifier = (cast_expression "(wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + param_3 * 4 + param_2 * 4)" ( (binary_expression "(long)plVar3 + param_3 * 4 + param_2 * 4" (binary_expression "(long)plVar3 + param_3 * 4" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "param_3 * 4" identifier * number_literal)) + (binary_expression "param_2 * 4" identifier * number_literal)) )))) ;) (expression_statement "__s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);" (assignment_expression "__s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4)" identifier = (cast_expression "(wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + param_4 * 4 + param_2 * 4)" ( (binary_expression "(long)plVar3 + param_4 * 4 + param_2 * 4" (binary_expression "(long)plVar3 + param_4 * 4" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "param_4 * 4" identifier * number_literal)) + (binary_expression "param_2 * 4" identifier * number_literal)) )))) ;) (if_statement "if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n          *__s1 = *pwVar1;\n        }" { (expression_statement "*__s1 = *pwVar1;" (assignment_expression "*__s1 = *pwVar1" (pointer_expression "*__s1" * identifier) = (pointer_expression "*pwVar1" * identifier)) ;) }) (else_clause "else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }" else (compound_statement "{\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }" { (expression_statement "wmemmove(__s1,pwVar1,__n);" (call_expression "wmemmove(__s1,pwVar1,__n)" identifier (argument_list "(__s1,pwVar1,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })) }))) (if_statement "if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }" { (expression_statement "pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);" (assignment_expression "pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4)" identifier = (cast_expression "(wchar_t *)((long)plVar3 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + param_2 * 4)" ( (binary_expression "(long)plVar3 + param_2 * 4" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "param_2 * 4" identifier * number_literal)) )))) ;) (if_statement "if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *pwVar1 = param_5;\n      }" { (expression_statement "*pwVar1 = param_5;" (assignment_expression "*pwVar1 = param_5" (pointer_expression "*pwVar1" * identifier) = identifier) ;) }) (else_clause "else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }" else (compound_statement "{\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }" { (expression_statement "wmemset(pwVar1,param_5,param_4);" (call_expression "wmemset(pwVar1,param_5,param_4)" identifier (argument_list "(pwVar1,param_5,param_4)" ( identifier , identifier , identifier ))) ;) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (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 *)((long)plVar3 + uVar4 * 4) = 0;" (assignment_expression "*(undefined4 *)((long)plVar3 + uVar4 * 4) = 0" (pointer_expression "*(undefined4 *)((long)plVar3 + uVar4 * 4)" * (cast_expression "(undefined4 *)((long)plVar3 + uVar4 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + uVar4 * 4)" ( (binary_expression "(long)plVar3 + uVar4 * 4" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "uVar4 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })) (expression_statement "FUN_00319590("basic_string::_M_replace_aux");" (call_expression "FUN_00319590("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 (sized_type_specifier long) (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration (sized_type_specifier long) (pointer_declarator * IDENT) ;) (declaration TYPE 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 (sized_type_specifier long) (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 (sized_type_specifier long) (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 { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + (binary_expression IDENT * LIT)) + (binary_expression IDENT * LIT)) )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + (binary_expression IDENT * LIT)) + (binary_expression IDENT * LIT)) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * 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 (sized_type_specifier long) (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 (sized_type_specifier long)) ) 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 (sized_type_specifier long) (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 (sized_type_specifier long)) ) IDENT) + (binary_expression IDENT * LIT)) )))) = LIT) ;) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) })))
(function_definition "long * FUN_002df460(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)\n\n{\n  wchar_t *pwVar1;\n  wchar_t *__s1;\n  long lVar2;\n  long *plVar3;\n  size_t __n;\n  ulong uVar4;\n  ulong uVar5;\n  \n  lVar2 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    \n  FUN_00319590("basic_string::_M_replace_aux");\n}" (sized_type_specifier "long" (long "long")) (pointer_declarator "* FUN_002df460(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)" (* "*") (function_declarator "FUN_002df460(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)" (identifier "FUN_002df460") (parameter_list "(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "long param_2" (sized_type_specifier "long" (long "long")) (identifier "param_2")) (, ",") (parameter_declaration "ulong param_3" (type_identifier "ulong") (identifier "param_3")) (, ",") (parameter_declaration "ulong param_4" (type_identifier "ulong") (identifier "param_4")) (, ",") (parameter_declaration "wchar_t param_5" (type_identifier "wchar_t") (identifier "param_5")) () ")")))) (compound_statement "{\n  wchar_t *pwVar1;\n  wchar_t *__s1;\n  long lVar2;\n  long *plVar3;\n  size_t __n;\n  ulong uVar4;\n  ulong uVar5;\n  \n  lVar2 = param_1[1];\n  if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }\n                    \n  FUN_00319590("basic_string::_M_replace_aux");\n}" ({ "{") (declaration "wchar_t *pwVar1;" (type_identifier "wchar_t") (pointer_declarator "*pwVar1" (* "*") (identifier "pwVar1")) (; ";")) (declaration "wchar_t *__s1;" (type_identifier "wchar_t") (pointer_declarator "*__s1" (* "*") (identifier "__s1")) (; ";")) (declaration "long lVar2;" (sized_type_specifier "long" (long "long")) (identifier "lVar2") (; ";")) (declaration "long *plVar3;" (sized_type_specifier "long" (long "long")) (pointer_declarator "*plVar3" (* "*") (identifier "plVar3")) (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "ulong uVar4;" (type_identifier "ulong") (identifier "uVar4") (; ";")) (declaration "ulong uVar5;" (type_identifier "ulong") (identifier "uVar5") (; ";")) (expression_statement "lVar2 = param_1[1];" (assignment_expression "lVar2 = param_1[1]" (identifier "lVar2") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (if_statement "if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }" (if "if") (parenthesized_expression "(param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2)" (( "(") (binary_expression "param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2" (identifier "param_4") (<= "<=") (binary_expression "(param_3 + 0x1fffffffffffffff) - lVar2" (parenthesized_expression "(param_3 + 0x1fffffffffffffff)" (( "(") (binary_expression "param_3 + 0x1fffffffffffffff" (identifier "param_3") (+ "+") (number_literal "0x1fffffffffffffff")) () ")")) (- "-") (identifier "lVar2"))) () ")")) (compound_statement "{\n    plVar3 = (long *)*param_1;\n    uVar4 = (param_4 - param_3) + lVar2;\n    if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }\n    if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;\n    return param_1;\n  }" ({ "{") (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" (identifier "plVar3") (= "=") (cast_expression "(long *)*param_1" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "uVar4 = (param_4 - param_3) + lVar2;" (assignment_expression "uVar4 = (param_4 - param_3) + lVar2" (identifier "uVar4") (= "=") (binary_expression "(param_4 - param_3) + lVar2" (parenthesized_expression "(param_4 - param_3)" (( "(") (binary_expression "param_4 - param_3" (identifier "param_4") (- "-") (identifier "param_3")) () ")")) (+ "+") (identifier "lVar2"))) (; ";")) (if_statement "if (plVar3 == param_1 + 2) {\n      uVar5 = 3;\n    }\n    else {\n      uVar5 = param_1[2];\n    }" (if "if") (parenthesized_expression "(plVar3 == param_1 + 2)" (( "(") (binary_expression "plVar3 == param_1 + 2" (identifier "plVar3") (== "==") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2"))) () ")")) (compound_statement "{\n      uVar5 = 3;\n    }" ({ "{") (expression_statement "uVar5 = 3;" (assignment_expression "uVar5 = 3" (identifier "uVar5") (= "=") (number_literal "3")) (; ";")) (} "}")) (else_clause "else {\n      uVar5 = param_1[2];\n    }" (else "else") (compound_statement "{\n      uVar5 = param_1[2];\n    }" ({ "{") (expression_statement "uVar5 = param_1[2];" (assignment_expression "uVar5 = param_1[2]" (identifier "uVar5") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (} "}")))) (if_statement "if (uVar5 < uVar4) {\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }" (if "if") (parenthesized_expression "(uVar5 < uVar4)" (( "(") (binary_expression "uVar5 < uVar4" (identifier "uVar5") (< "<") (identifier "uVar4")) () ")")) (compound_statement "{\n      FUN_002dea50(param_1,param_2,param_3,0,param_4);\n      plVar3 = (long *)*param_1;\n    }" ({ "{") (expression_statement "FUN_002dea50(param_1,param_2,param_3,0,param_4);" (call_expression "FUN_002dea50(param_1,param_2,param_3,0,param_4)" (identifier "FUN_002dea50") (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 "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" (identifier "plVar3") (= "=") (cast_expression "(long *)*param_1" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else {\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }" (else "else") (compound_statement "{\n      __n = lVar2 - (param_3 + param_2);\n      if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }\n    }" ({ "{") (expression_statement "__n = lVar2 - (param_3 + param_2);" (assignment_expression "__n = lVar2 - (param_3 + param_2)" (identifier "__n") (= "=") (binary_expression "lVar2 - (param_3 + param_2)" (identifier "lVar2") (- "-") (parenthesized_expression "(param_3 + param_2)" (( "(") (binary_expression "param_3 + param_2" (identifier "param_3") (+ "+") (identifier "param_2")) () ")")))) (; ";")) (if_statement "if ((__n != 0) && (param_3 != param_4)) {\n        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*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        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);\n        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);\n        if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }\n      }" ({ "{") (expression_statement "pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);" (assignment_expression "pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4)" (identifier "pwVar1") (= "=") (cast_expression "(wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)plVar3 + param_3 * 4 + param_2 * 4)" (( "(") (binary_expression "(long)plVar3 + param_3 * 4 + param_2 * 4" (binary_expression "(long)plVar3 + param_3 * 4" (cast_expression "(long)plVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "plVar3")) (+ "+") (binary_expression "param_3 * 4" (identifier "param_3") (* "*") (number_literal "4"))) (+ "+") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4"))) () ")")))) (; ";")) (expression_statement "__s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);" (assignment_expression "__s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4)" (identifier "__s1") (= "=") (cast_expression "(wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)plVar3 + param_4 * 4 + param_2 * 4)" (( "(") (binary_expression "(long)plVar3 + param_4 * 4 + param_2 * 4" (binary_expression "(long)plVar3 + param_4 * 4" (cast_expression "(long)plVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "plVar3")) (+ "+") (binary_expression "param_4 * 4" (identifier "param_4") (* "*") (number_literal "4"))) (+ "+") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4"))) () ")")))) (; ";")) (if_statement "if (__n == 1) {\n          *__s1 = *pwVar1;\n        }\n        else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }" (if "if") (parenthesized_expression "(__n == 1)" (( "(") (binary_expression "__n == 1" (identifier "__n") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n          *__s1 = *pwVar1;\n        }" ({ "{") (expression_statement "*__s1 = *pwVar1;" (assignment_expression "*__s1 = *pwVar1" (pointer_expression "*__s1" (* "*") (identifier "__s1")) (= "=") (pointer_expression "*pwVar1" (* "*") (identifier "pwVar1"))) (; ";")) (} "}")) (else_clause "else {\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }" (else "else") (compound_statement "{\n          wmemmove(__s1,pwVar1,__n);\n          plVar3 = (long *)*param_1;\n        }" ({ "{") (expression_statement "wmemmove(__s1,pwVar1,__n);" (call_expression "wmemmove(__s1,pwVar1,__n)" (identifier "wmemmove") (argument_list "(__s1,pwVar1,__n)" (( "(") (identifier "__s1") (, ",") (identifier "pwVar1") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" (identifier "plVar3") (= "=") (cast_expression "(long *)*param_1" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")))) (} "}"))) (} "}")))) (if_statement "if (param_4 != 0) {\n      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*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      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);\n      if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }\n    }" ({ "{") (expression_statement "pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);" (assignment_expression "pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4)" (identifier "pwVar1") (= "=") (cast_expression "(wchar_t *)((long)plVar3 + param_2 * 4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)plVar3 + param_2 * 4)" (( "(") (binary_expression "(long)plVar3 + param_2 * 4" (cast_expression "(long)plVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "plVar3")) (+ "+") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4"))) () ")")))) (; ";")) (if_statement "if (param_4 == 1) {\n        *pwVar1 = param_5;\n      }\n      else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }" (if "if") (parenthesized_expression "(param_4 == 1)" (( "(") (binary_expression "param_4 == 1" (identifier "param_4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *pwVar1 = param_5;\n      }" ({ "{") (expression_statement "*pwVar1 = param_5;" (assignment_expression "*pwVar1 = param_5" (pointer_expression "*pwVar1" (* "*") (identifier "pwVar1")) (= "=") (identifier "param_5")) (; ";")) (} "}")) (else_clause "else {\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }" (else "else") (compound_statement "{\n        wmemset(pwVar1,param_5,param_4);\n        plVar3 = (long *)*param_1;\n      }" ({ "{") (expression_statement "wmemset(pwVar1,param_5,param_4);" (call_expression "wmemset(pwVar1,param_5,param_4)" (identifier "wmemset") (argument_list "(pwVar1,param_5,param_4)" (( "(") (identifier "pwVar1") (, ",") (identifier "param_5") (, ",") (identifier "param_4") () ")"))) (; ";")) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" (identifier "plVar3") (= "=") (cast_expression "(long *)*param_1" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (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 *)((long)plVar3 + uVar4 * 4) = 0;" (assignment_expression "*(undefined4 *)((long)plVar3 + uVar4 * 4) = 0" (pointer_expression "*(undefined4 *)((long)plVar3 + uVar4 * 4)" (* "*") (cast_expression "(undefined4 *)((long)plVar3 + uVar4 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)plVar3 + uVar4 * 4)" (( "(") (binary_expression "(long)plVar3 + uVar4 * 4" (cast_expression "(long)plVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "plVar3")) (+ "+") (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_00319590("basic_string::_M_replace_aux");" (call_expression "FUN_00319590("basic_string::_M_replace_aux")" (identifier "FUN_00319590") (argument_list "("basic_string::_M_replace_aux")" (( "(") (string_literal ""basic_string::_M_replace_aux"" (" """) (string_content "basic_string::_M_replace_aux") (" """)) () ")"))) (; ";")) (} "}")))

/* std::wstring::_M_replace_aux(unsigned long, unsigned long, unsigned long, wchar_t) */

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

{
  long var_4;
  type_1 *var_5;
  size_t var_10;
  type_2 var_7;
  type_2 var_6;
  
  var_4 = *(long *)(var_1 + 8);
  if (var_2 <= (var_3 + 0x1fffffffffffffff) - var_4) {
    var_5 = *(type_1 **)var_1;
    var_7 = (var_2 - var_3) + var_4;
    if (var_5 == var_1 + 0x10) {
      var_6 = 3;
    }
    else {
      var_6 = *(type_2 *)(var_1 + 0x10);
    }
    if (var_6 < var_7) {
      var_8(var_1,var_9,var_3,(type_3 *)0x0,var_2);
      var_5 = *(type_1 **)var_1;
    }
    else {
      var_10 = var_4 - (var_3 + var_9);
      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_1 **)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_1 **)var_1;
      }
    }
    *(type_2 *)(var_1 + 8) = 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: (sized_type_specifier) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (sized_type_specifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (sized_type_specifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier))))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) 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: (sized_type_specifier) 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: (sized_type_specifier) 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 (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: (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (binary_expression left: (identifier) right: (number_literal))) right: (binary_expression left: (identifier) right: (number_literal))))))) (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: (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (binary_expression left: (identifier) right: (number_literal))) 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: (pointer_expression argument: (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: (sized_type_specifier) 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: (sized_type_specifier)) 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: (sized_type_specifier) 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: (sized_type_specifier)) 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))))))))

long * MASKED(long *param_1,long param_2,ulong param_3,ulong param_4,wchar_t param_5)

{
  wchar_t *pwVar1;
  wchar_t *__s1;
  long lVar2;
  long *plVar3;
  size_t __n;
  ulong uVar4;
  ulong uVar5;
  
  lVar2 = param_1[1];
  if (param_4 <= (param_3 + 0x1fffffffffffffff) - lVar2) {
    plVar3 = (long *)*param_1;
    uVar4 = (param_4 - param_3) + lVar2;
    if (plVar3 == param_1 + 2) {
      uVar5 = 3;
    }
    else {
      uVar5 = param_1[2];
    }
    if (uVar5 < uVar4) {
      FUN_002dea50(param_1,param_2,param_3,0,param_4);
      plVar3 = (long *)*param_1;
    }
    else {
      __n = lVar2 - (param_3 + param_2);
      if ((__n != 0) && (param_3 != param_4)) {
        pwVar1 = (wchar_t *)((long)plVar3 + param_3 * 4 + param_2 * 4);
        __s1 = (wchar_t *)((long)plVar3 + param_4 * 4 + param_2 * 4);
        if (__n == 1) {
          *__s1 = *pwVar1;
        }
        else {
          wmemmove(__s1,pwVar1,__n);
          plVar3 = (long *)*param_1;
        }
      }
    }
    if (param_4 != 0) {
      pwVar1 = (wchar_t *)((long)plVar3 + param_2 * 4);
      if (param_4 == 1) {
        *pwVar1 = param_5;
      }
      else {
        wmemset(pwVar1,param_5,param_4);
        plVar3 = (long *)*param_1;
      }
    }
    param_1[1] = uVar4;
    *(undefined4 *)((long)plVar3 + uVar4 * 4) = 0;
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00319590("basic_string::_M_replace_aux");
}

