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

string * __thiscall
std::string::_M_replace_aux(string *this,uint param_1,uint param_2,uint param_3,char param_4)

{
  int iVar1;
  string *psVar2;
  size_t __n;
  uint uVar3;
  uint uVar4;
  
  iVar1 = *(int *)(this + 4);
  if (param_3 <= (param_2 + 0x7fffffff) - iVar1) {
    psVar2 = *(string **)this;
    uVar4 = (param_3 - param_2) + iVar1;
    if (psVar2 == this + 8) {
      uVar3 = 0xf;
    }
    else {
      uVar3 = *(uint *)(this + 8);
    }
    if (uVar3 < uVar4) {
      _M_mutate(this,param_1,param_2,(char *)0x0,param_3);
      psVar2 = *(string **)this;
    }
    else {
      __n = iVar1 - (param_1 + param_2);
      if ((__n != 0) && (param_2 != param_3)) {
        if (__n == 1) {
          psVar2[param_3 + param_1] = psVar2[param_2 + param_1];
          psVar2 = *(string **)this;
        }
        else {
          memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);
          psVar2 = *(string **)this;
        }
      }
    }
    if (param_3 != 0) {
      if (param_3 == 1) {
        psVar2[param_1] = (string)param_4;
        psVar2 = *(string **)this;
      }
      else {
        memset(psVar2 + param_1,(int)param_4,param_3);
        psVar2 = *(string **)this;
      }
    }
    *(uint *)(this + 4) = uVar4;
    psVar2[uVar4] = (string)0x0;
    return this;
  }
                    /* WARNING: Subroutine does not return */
  __throw_length_error("basic_string::_M_replace_aux");
}



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

int * FUN_00189020(int *param_1,int param_2,uint param_3,uint param_4,char param_5)

{
  int iVar1;
  undefined1 *__dest;
  int *piVar2;
  undefined1 *__src;
  size_t __n;
  uint uVar3;
  uint uVar4;
  
  iVar1 = param_1[1];
  if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {
    piVar2 = (int *)*param_1;
    uVar4 = (param_4 - param_3) + iVar1;
    if (piVar2 == param_1 + 2) {
      uVar3 = 0xf;
    }
    else {
      uVar3 = param_1[2];
    }
    if (uVar3 < uVar4) {
      FUN_00188490(param_1,param_2,param_3,0,param_4);
      piVar2 = (int *)*param_1;
    }
    else {
      __n = iVar1 - (param_2 + param_3);
      if ((__n != 0) && (param_3 != param_4)) {
        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);
        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);
        if (__n == 1) {
          *__dest = *__src;
          piVar2 = (int *)*param_1;
        }
        else {
          memmove(__dest,__src,__n);
          piVar2 = (int *)*param_1;
        }
      }
    }
    if (param_4 != 0) {
      if (param_4 == 1) {
        *(char *)((int)piVar2 + param_2) = param_5;
        piVar2 = (int *)*param_1;
      }
      else {
        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);
        piVar2 = (int *)*param_1;
      }
    }
    param_1[1] = uVar4;
    *(undefined1 *)((int)piVar2 + uVar4) = 0;
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_001c6190("basic_string::_M_replace_aux");
}


CALL 0x0004fb76
ADD EAX,0x178fdb
PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
SUB ESP,0x1c
MOV ESI,dword ptr [ESP + 0x30]
MOV ECX,dword ptr [ESP + 0x38]
MOV dword ptr [ESP + 0x8],EAX
MOV EAX,dword ptr [ESP + 0x40]
MOV EBP,dword ptr [ESP + 0x3c]
MOV EDX,dword ptr [ESI + 0x4]
MOV dword ptr [ESP + 0xc],EAX
LEA EAX,[ECX + 0x7fffffff]
SUB EAX,EDX
CMP EBP,EAX
JA 0x0018912d
MOV EDI,EBP
MOV EAX,dword ptr [ESI]
LEA EBX,[ESI + 0x8]
SUB EDI,ECX
ADD EDI,EDX
CMP EAX,EBX
JZ 0x00189100
MOV EBX,dword ptr [ESI + 0x8]
CMP EBX,EDI
JC 0x001890e0
MOV EBX,dword ptr [ESP + 0x34]
ADD EBX,ECX
SUB EDX,EBX
JZ 0x001890a9
CMP ECX,EBP
JZ 0x001890a9
ADD EAX,dword ptr [ESP + 0x34]
ADD ECX,EAX
ADD EAX,EBP
CMP EDX,0x1
JZ 0x00189120
SUB ESP,0x4
PUSH EDX
PUSH ECX
PUSH EAX
MOV EBX,dword ptr [ESP + 0x18]
CALL 0x000268a0
MOV EAX,dword ptr [ESI]
ADD ESP,0x10
TEST EBP,EBP
JZ 0x001890cf
ADD EAX,dword ptr [ESP + 0x34]
CMP EBP,0x1
JZ 0x00189110
SUB ESP,0x4
PUSH EBP
MOVSX EDX,byte ptr [ESP + 0x14]
PUSH EDX
PUSH EAX
MOV EBX,dword ptr [ESP + 0x18]
CALL 0x000262f0
MOV EAX,dword ptr [ESI]
ADD ESP,0x10
MOV dword ptr [ESI + 0x4],EDI
MOV byte ptr [EAX + EDI*0x1],0x0
ADD ESP,0x1c
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH EBP
PUSH 0x0
PUSH ECX
PUSH dword ptr [ESP + 0x4c]
PUSH ESI
MOV EBX,dword ptr [ESP + 0x28]
CALL 0x00188490
MOV EAX,dword ptr [ESI]
ADD ESP,0x20
TEST EBP,EBP
JZ 0x001890cf
JMP 0x001890ad
MOV EBX,0xf
JMP 0x00189072
MOVZX ECX,byte ptr [ESP + 0xc]
MOV byte ptr [EAX],CL
MOV EAX,dword ptr [ESI]
JMP 0x001890cf
MOVZX EDX,byte ptr [ECX]
MOV byte ptr [EAX],DL
MOV EAX,dword ptr [ESI]
TEST EBP,EBP
JZ 0x001890cf
JMP 0x001890ad
SUB ESP,0xc
MOV EBX,dword ptr [ESP + 0x14]
LEA EAX,[EBX + 0xfff38880]
PUSH EAX
CALL 0x001c6190
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n\nint * FUN_00189020(int *param_1,int param_2,uint param_3,uint param_4,char param_5)\n\n{\n  int iVar1;\n  undefined1 *__dest;\n  int *piVar2;\n  undefined1 *__src;\n  size_t __n;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_001c6190("basic_string::_M_replace_aux");\n}\n\n" comment (function_definition "int * FUN_00189020(int *param_1,int param_2,uint param_3,uint param_4,char param_5)\n\n{\n  int iVar1;\n  undefined1 *__dest;\n  int *piVar2;\n  undefined1 *__src;\n  size_t __n;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_001c6190("basic_string::_M_replace_aux");\n}" primitive_type (pointer_declarator "* FUN_00189020(int *param_1,int param_2,uint param_3,uint param_4,char param_5)" * (function_declarator "FUN_00189020(int *param_1,int param_2,uint param_3,uint param_4,char param_5)" identifier (parameter_list "(int *param_1,int param_2,uint param_3,uint param_4,char param_5)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) , (parameter_declaration "char param_5" primitive_type identifier) )))) (compound_statement "{\n  int iVar1;\n  undefined1 *__dest;\n  int *piVar2;\n  undefined1 *__src;\n  size_t __n;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_001c6190("basic_string::_M_replace_aux");\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "undefined1 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "iVar1 = param_1[1];" (assignment_expression "iVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (if_statement "if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }" if (parenthesized_expression "(param_4 <= (param_3 + 0x7fffffff) - iVar1)" ( (binary_expression "param_4 <= (param_3 + 0x7fffffff) - iVar1" identifier <= (binary_expression "(param_3 + 0x7fffffff) - iVar1" (parenthesized_expression "(param_3 + 0x7fffffff)" ( (binary_expression "param_3 + 0x7fffffff" identifier + number_literal) )) - identifier)) )) (compound_statement "{\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }" { (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "uVar4 = (param_4 - param_3) + iVar1;" (assignment_expression "uVar4 = (param_4 - param_3) + iVar1" identifier = (binary_expression "(param_4 - param_3) + iVar1" (parenthesized_expression "(param_4 - param_3)" ( (binary_expression "param_4 - param_3" identifier - identifier) )) + identifier)) ;) (if_statement "if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }" if (parenthesized_expression "(piVar2 == param_1 + 2)" ( (binary_expression "piVar2 == param_1 + 2" identifier == (binary_expression "param_1 + 2" identifier + number_literal)) )) (compound_statement "{\n      uVar3 = 0xf;\n    }" { (expression_statement "uVar3 = 0xf;" (assignment_expression "uVar3 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n      uVar3 = param_1[2];\n    }" else (compound_statement "{\n      uVar3 = param_1[2];\n    }" { (expression_statement "uVar3 = param_1[2];" (assignment_expression "uVar3 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" if (parenthesized_expression "(uVar3 < uVar4)" ( (binary_expression "uVar3 < uVar4" identifier < identifier) )) (compound_statement "{\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }" { (expression_statement "FUN_00188490(param_1,param_2,param_3,0,param_4);" (call_expression "FUN_00188490(param_1,param_2,param_3,0,param_4)" identifier (argument_list "(param_1,param_2,param_3,0,param_4)" ( identifier , identifier , identifier , number_literal , identifier ))) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" else (compound_statement "{\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" { (expression_statement "__n = iVar1 - (param_2 + param_3);" (assignment_expression "__n = iVar1 - (param_2 + param_3)" identifier = (binary_expression "iVar1 - (param_2 + param_3)" identifier - (parenthesized_expression "(param_2 + param_3)" ( (binary_expression "param_2 + param_3" identifier + identifier) )))) ;) (if_statement "if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }" if (parenthesized_expression "((__n != 0) && (param_3 != param_4))" ( (binary_expression "(__n != 0) && (param_3 != param_4)" (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) && (parenthesized_expression "(param_3 != param_4)" ( (binary_expression "param_3 != param_4" identifier != identifier) ))) )) (compound_statement "{\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }" { (expression_statement "__src = (undefined1 *)((int)piVar2 + param_3 + param_2);" (assignment_expression "__src = (undefined1 *)((int)piVar2 + param_3 + param_2)" identifier = (cast_expression "(undefined1 *)((int)piVar2 + param_3 + param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + param_3 + param_2)" ( (binary_expression "(int)piVar2 + param_3 + param_2" (binary_expression "(int)piVar2 + param_3" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) + identifier) )))) ;) (expression_statement "__dest = (undefined1 *)((int)piVar2 + param_4 + param_2);" (assignment_expression "__dest = (undefined1 *)((int)piVar2 + param_4 + param_2)" identifier = (cast_expression "(undefined1 *)((int)piVar2 + param_4 + param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + param_4 + param_2)" ( (binary_expression "(int)piVar2 + param_4 + param_2" (binary_expression "(int)piVar2 + param_4" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) + identifier) )))) ;) (if_statement "if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }" { (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src" * identifier)) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }" else (compound_statement "{\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }" { (expression_statement "memmove(__dest,__src,__n);" (call_expression "memmove(__dest,__src,__n)" identifier (argument_list "(__dest,__src,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })) }))) (if_statement "if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }" { (if_statement "if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }" { (expression_statement "*(char *)((int)piVar2 + param_2) = param_5;" (assignment_expression "*(char *)((int)piVar2 + param_2) = param_5" (pointer_expression "*(char *)((int)piVar2 + param_2)" * (cast_expression "(char *)((int)piVar2 + param_2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + param_2)" ( (binary_expression "(int)piVar2 + param_2" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) )))) = identifier) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" else (compound_statement "{\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" { (expression_statement "memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);" (call_expression "memset((char *)((int)piVar2 + param_2),(int)param_5,param_4)" identifier (argument_list "((char *)((int)piVar2 + param_2),(int)param_5,param_4)" ( (cast_expression "(char *)((int)piVar2 + param_2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + param_2)" ( (binary_expression "(int)piVar2 + param_2" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) , (cast_expression "(int)param_5" ( (type_descriptor "int" primitive_type) ) identifier) , identifier ))) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })) (expression_statement "param_1[1] = uVar4;" (assignment_expression "param_1[1] = uVar4" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined1 *)((int)piVar2 + uVar4) = 0;" (assignment_expression "*(undefined1 *)((int)piVar2 + uVar4) = 0" (pointer_expression "*(undefined1 *)((int)piVar2 + uVar4)" * (cast_expression "(undefined1 *)((int)piVar2 + uVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + uVar4)" ( (binary_expression "(int)piVar2 + uVar4" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) )))) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })) comment (expression_statement "FUN_001c6190("basic_string::_M_replace_aux");" (call_expression "FUN_001c6190("basic_string::_M_replace_aux")" identifier (argument_list "("basic_string::_M_replace_aux")" ( (string_literal ""basic_string::_M_replace_aux"" " string_content ") ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n/* std::string::_M_replace_aux(unsigned int, unsigned int, unsigned int, char) */\n\nstring * __thiscall\nstd::string::_M_replace_aux(string *this,uint param_1,uint param_2,uint param_3,char param_4)\n\n{\n  int iVar1;\n  string *psVar2;\n  size_t __n;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = *(int *)(this + 4);\n  if (param_3 <= (param_2 + 0x7fffffff) - iVar1) {\n    psVar2 = *(string **)this;\n    uVar4 = (param_3 - param_2) + iVar1;\n    if (psVar2 == this + 8) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = *(uint *)(this + 8);\n    }\n    if (uVar3 < uVar4) {\n      _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n      psVar2 = *(string **)this;\n    }\n    else {\n      __n = iVar1 - (param_1 + param_2);\n      if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          psVar2[param_3 + param_1] = psVar2[param_2 + param_1];\n          psVar2 = *(string **)this;\n        }\n        else {\n          memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);\n          psVar2 = *(string **)this;\n        }\n      }\n    }\n    if (param_3 != 0) {\n      if (param_3 == 1) {\n        psVar2[param_1] = (string)param_4;\n        psVar2 = *(string **)this;\n      }\n      else {\n        memset(psVar2 + param_1,(int)param_4,param_3);\n        psVar2 = *(string **)this;\n      }\n    }\n    *(uint *)(this + 4) = uVar4;\n    psVar2[uVar4] = (string)0x0;\n    return this;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_length_error("basic_string::_M_replace_aux");\n}\n\n" comment comment (ERROR "string * __thiscall\nstd::string::_M_replace_aux(string *this," (binary_expression "string * __thiscall\nstd::string::_M_replace_aux(string *this" (binary_expression "string * __thiscall" identifier * identifier) (ERROR "std::string::_M_replace_aux(string" identifier : : identifier : : identifier ( identifier) * identifier) ,) (declaration "uint param_1,uint param_2,uint param_3,char param_4)\n\n{\n  int iVar1;" type_identifier identifier , (ERROR "uint" identifier) identifier , (ERROR "uint" identifier) identifier , (ERROR "char param_4)\n\n{\n  int" identifier identifier ) { primitive_type) identifier ;) (declaration "string *psVar2;" type_identifier (pointer_declarator "*psVar2" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(this + 4);" (assignment_expression "iVar1 = *(int *)(this + 4)" identifier = (pointer_expression "*(int *)(this + 4)" * (cast_expression "(int *)(this + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) ))))) ;) (if_statement "if (param_3 <= (param_2 + 0x7fffffff) - iVar1) {\n    psVar2 = *(string **)this;\n    uVar4 = (param_3 - param_2) + iVar1;\n    if (psVar2 == this + 8) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = *(uint *)(this + 8);\n    }\n    if (uVar3 < uVar4) {\n      _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n      psVar2 = *(string **)this;\n    }\n    else {\n      __n = iVar1 - (param_1 + param_2);\n      if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          psVar2[param_3 + param_1] = psVar2[param_2 + param_1];\n          psVar2 = *(string **)this;\n        }\n        else {\n          memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);\n          psVar2 = *(string **)this;\n        }\n      }\n    }\n    if (param_3 != 0) {\n      if (param_3 == 1) {\n        psVar2[param_1] = (string)param_4;\n        psVar2 = *(string **)this;\n      }\n      else {\n        memset(psVar2 + param_1,(int)param_4,param_3);\n        psVar2 = *(string **)this;\n      }\n    }\n    *(uint *)(this + 4) = uVar4;\n    psVar2[uVar4] = (string)0x0;\n    return this;\n  }" if (parenthesized_expression "(param_3 <= (param_2 + 0x7fffffff) - iVar1)" ( (binary_expression "param_3 <= (param_2 + 0x7fffffff) - iVar1" identifier <= (binary_expression "(param_2 + 0x7fffffff) - iVar1" (parenthesized_expression "(param_2 + 0x7fffffff)" ( (binary_expression "param_2 + 0x7fffffff" identifier + number_literal) )) - identifier)) )) (compound_statement "{\n    psVar2 = *(string **)this;\n    uVar4 = (param_3 - param_2) + iVar1;\n    if (psVar2 == this + 8) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = *(uint *)(this + 8);\n    }\n    if (uVar3 < uVar4) {\n      _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n      psVar2 = *(string **)this;\n    }\n    else {\n      __n = iVar1 - (param_1 + param_2);\n      if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          psVar2[param_3 + param_1] = psVar2[param_2 + param_1];\n          psVar2 = *(string **)this;\n        }\n        else {\n          memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);\n          psVar2 = *(string **)this;\n        }\n      }\n    }\n    if (param_3 != 0) {\n      if (param_3 == 1) {\n        psVar2[param_1] = (string)param_4;\n        psVar2 = *(string **)this;\n      }\n      else {\n        memset(psVar2 + param_1,(int)param_4,param_3);\n        psVar2 = *(string **)this;\n      }\n    }\n    *(uint *)(this + 4) = uVar4;\n    psVar2[uVar4] = (string)0x0;\n    return this;\n  }" { (expression_statement "psVar2 = *(string **)this;" (assignment_expression "psVar2 = *(string **)this" identifier = (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "uVar4 = (param_3 - param_2) + iVar1;" (assignment_expression "uVar4 = (param_3 - param_2) + iVar1" identifier = (binary_expression "(param_3 - param_2) + iVar1" (parenthesized_expression "(param_3 - param_2)" ( (binary_expression "param_3 - param_2" identifier - identifier) )) + identifier)) ;) (if_statement "if (psVar2 == this + 8) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = *(uint *)(this + 8);\n    }" if (parenthesized_expression "(psVar2 == this + 8)" ( (binary_expression "psVar2 == this + 8" identifier == (binary_expression "this + 8" identifier + number_literal)) )) (compound_statement "{\n      uVar3 = 0xf;\n    }" { (expression_statement "uVar3 = 0xf;" (assignment_expression "uVar3 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n      uVar3 = *(uint *)(this + 8);\n    }" else (compound_statement "{\n      uVar3 = *(uint *)(this + 8);\n    }" { (expression_statement "uVar3 = *(uint *)(this + 8);" (assignment_expression "uVar3 = *(uint *)(this + 8)" identifier = (pointer_expression "*(uint *)(this + 8)" * (cast_expression "(uint *)(this + 8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))) ;) }))) (if_statement "if (uVar3 < uVar4) {\n      _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n      psVar2 = *(string **)this;\n    }\n    else {\n      __n = iVar1 - (param_1 + param_2);\n      if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          psVar2[param_3 + param_1] = psVar2[param_2 + param_1];\n          psVar2 = *(string **)this;\n        }\n        else {\n          memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);\n          psVar2 = *(string **)this;\n        }\n      }\n    }" if (parenthesized_expression "(uVar3 < uVar4)" ( (binary_expression "uVar3 < uVar4" identifier < identifier) )) (compound_statement "{\n      _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n      psVar2 = *(string **)this;\n    }" { (expression_statement "_M_mutate(this,param_1,param_2,(char *)0x0,param_3);" (call_expression "_M_mutate(this,param_1,param_2,(char *)0x0,param_3)" identifier (argument_list "(this,param_1,param_2,(char *)0x0,param_3)" ( identifier , identifier , identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , identifier ))) ;) (expression_statement "psVar2 = *(string **)this;" (assignment_expression "psVar2 = *(string **)this" identifier = (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }) (else_clause "else {\n      __n = iVar1 - (param_1 + param_2);\n      if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          psVar2[param_3 + param_1] = psVar2[param_2 + param_1];\n          psVar2 = *(string **)this;\n        }\n        else {\n          memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);\n          psVar2 = *(string **)this;\n        }\n      }\n    }" else (compound_statement "{\n      __n = iVar1 - (param_1 + param_2);\n      if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          psVar2[param_3 + param_1] = psVar2[param_2 + param_1];\n          psVar2 = *(string **)this;\n        }\n        else {\n          memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);\n          psVar2 = *(string **)this;\n        }\n      }\n    }" { (expression_statement "__n = iVar1 - (param_1 + param_2);" (assignment_expression "__n = iVar1 - (param_1 + param_2)" identifier = (binary_expression "iVar1 - (param_1 + param_2)" identifier - (parenthesized_expression "(param_1 + param_2)" ( (binary_expression "param_1 + param_2" identifier + identifier) )))) ;) (if_statement "if ((__n != 0) && (param_2 != param_3)) {\n        if (__n == 1) {\n          psVar2[param_3 + param_1] = psVar2[param_2 + param_1];\n          psVar2 = *(string **)this;\n        }\n        else {\n          memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);\n          psVar2 = *(string **)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          psVar2[param_3 + param_1] = psVar2[param_2 + param_1];\n          psVar2 = *(string **)this;\n        }\n        else {\n          memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);\n          psVar2 = *(string **)this;\n        }\n      }" { (if_statement "if (__n == 1) {\n          psVar2[param_3 + param_1] = psVar2[param_2 + param_1];\n          psVar2 = *(string **)this;\n        }\n        else {\n          memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);\n          psVar2 = *(string **)this;\n        }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n          psVar2[param_3 + param_1] = psVar2[param_2 + param_1];\n          psVar2 = *(string **)this;\n        }" { (expression_statement "psVar2[param_3 + param_1] = psVar2[param_2 + param_1];" (assignment_expression "psVar2[param_3 + param_1] = psVar2[param_2 + param_1]" (subscript_expression "psVar2[param_3 + param_1]" identifier [ (binary_expression "param_3 + param_1" identifier + identifier) ]) = (subscript_expression "psVar2[param_2 + param_1]" identifier [ (binary_expression "param_2 + param_1" identifier + identifier) ])) ;) (expression_statement "psVar2 = *(string **)this;" (assignment_expression "psVar2 = *(string **)this" identifier = (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }) (else_clause "else {\n          memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);\n          psVar2 = *(string **)this;\n        }" else (compound_statement "{\n          memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);\n          psVar2 = *(string **)this;\n        }" { (expression_statement "memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n);" (call_expression "memmove(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n)" identifier (argument_list "(psVar2 + param_3 + param_1,psVar2 + param_2 + param_1,__n)" ( (binary_expression "psVar2 + param_3 + param_1" (binary_expression "psVar2 + param_3" identifier + identifier) + identifier) , (binary_expression "psVar2 + param_2 + param_1" (binary_expression "psVar2 + param_2" identifier + identifier) + identifier) , identifier ))) ;) (expression_statement "psVar2 = *(string **)this;" (assignment_expression "psVar2 = *(string **)this" identifier = (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }))) })) }))) (if_statement "if (param_3 != 0) {\n      if (param_3 == 1) {\n        psVar2[param_1] = (string)param_4;\n        psVar2 = *(string **)this;\n      }\n      else {\n        memset(psVar2 + param_1,(int)param_4,param_3);\n        psVar2 = *(string **)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        psVar2[param_1] = (string)param_4;\n        psVar2 = *(string **)this;\n      }\n      else {\n        memset(psVar2 + param_1,(int)param_4,param_3);\n        psVar2 = *(string **)this;\n      }\n    }" { (if_statement "if (param_3 == 1) {\n        psVar2[param_1] = (string)param_4;\n        psVar2 = *(string **)this;\n      }\n      else {\n        memset(psVar2 + param_1,(int)param_4,param_3);\n        psVar2 = *(string **)this;\n      }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n        psVar2[param_1] = (string)param_4;\n        psVar2 = *(string **)this;\n      }" { (expression_statement "psVar2[param_1] = (string)param_4;" (assignment_expression "psVar2[param_1] = (string)param_4" (subscript_expression "psVar2[param_1]" identifier [ identifier ]) = (cast_expression "(string)param_4" ( (type_descriptor "string" type_identifier) ) identifier)) ;) (expression_statement "psVar2 = *(string **)this;" (assignment_expression "psVar2 = *(string **)this" identifier = (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }) (else_clause "else {\n        memset(psVar2 + param_1,(int)param_4,param_3);\n        psVar2 = *(string **)this;\n      }" else (compound_statement "{\n        memset(psVar2 + param_1,(int)param_4,param_3);\n        psVar2 = *(string **)this;\n      }" { (expression_statement "memset(psVar2 + param_1,(int)param_4,param_3);" (call_expression "memset(psVar2 + param_1,(int)param_4,param_3)" identifier (argument_list "(psVar2 + param_1,(int)param_4,param_3)" ( (binary_expression "psVar2 + param_1" identifier + identifier) , (cast_expression "(int)param_4" ( (type_descriptor "int" primitive_type) ) identifier) , identifier ))) ;) (expression_statement "psVar2 = *(string **)this;" (assignment_expression "psVar2 = *(string **)this" identifier = (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }))) })) (expression_statement "*(uint *)(this + 4) = uVar4;" (assignment_expression "*(uint *)(this + 4) = uVar4" (pointer_expression "*(uint *)(this + 4)" * (cast_expression "(uint *)(this + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) = identifier) ;) (expression_statement "psVar2[uVar4] = (string)0x0;" (assignment_expression "psVar2[uVar4] = (string)0x0" (subscript_expression "psVar2[uVar4]" identifier [ identifier ]) = (cast_expression "(string)0x0" ( (type_descriptor "string" type_identifier) ) number_literal)) ;) (return_statement "return this;" return identifier ;) })) comment (expression_statement "__throw_length_error("basic_string::_M_replace_aux");" (call_expression "__throw_length_error("basic_string::_M_replace_aux")" identifier (argument_list "("basic_string::_M_replace_aux")" ( (string_literal ""basic_string::_M_replace_aux"" " string_content ") ))) ;) (ERROR "}" }))
(translation_unit "int * FUN_00189020(int *param_1,int param_2,uint param_3,uint param_4,char param_5)\n\n{\n  int iVar1;\n  undefined1 *__dest;\n  int *piVar2;\n  undefined1 *__src;\n  size_t __n;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }\n                    \n  FUN_001c6190("basic_string::_M_replace_aux");\n}\n\n" (function_definition "int * FUN_00189020(int *param_1,int param_2,uint param_3,uint param_4,char param_5)\n\n{\n  int iVar1;\n  undefined1 *__dest;\n  int *piVar2;\n  undefined1 *__src;\n  size_t __n;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }\n                    \n  FUN_001c6190("basic_string::_M_replace_aux");\n}" primitive_type (pointer_declarator "* FUN_00189020(int *param_1,int param_2,uint param_3,uint param_4,char param_5)" * (function_declarator "FUN_00189020(int *param_1,int param_2,uint param_3,uint param_4,char param_5)" identifier (parameter_list "(int *param_1,int param_2,uint param_3,uint param_4,char param_5)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) , (parameter_declaration "char param_5" primitive_type identifier) )))) (compound_statement "{\n  int iVar1;\n  undefined1 *__dest;\n  int *piVar2;\n  undefined1 *__src;\n  size_t __n;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }\n                    \n  FUN_001c6190("basic_string::_M_replace_aux");\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "undefined1 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "iVar1 = param_1[1];" (assignment_expression "iVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (if_statement "if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }" if (parenthesized_expression "(param_4 <= (param_3 + 0x7fffffff) - iVar1)" ( (binary_expression "param_4 <= (param_3 + 0x7fffffff) - iVar1" identifier <= (binary_expression "(param_3 + 0x7fffffff) - iVar1" (parenthesized_expression "(param_3 + 0x7fffffff)" ( (binary_expression "param_3 + 0x7fffffff" identifier + number_literal) )) - identifier)) )) (compound_statement "{\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }" { (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "uVar4 = (param_4 - param_3) + iVar1;" (assignment_expression "uVar4 = (param_4 - param_3) + iVar1" identifier = (binary_expression "(param_4 - param_3) + iVar1" (parenthesized_expression "(param_4 - param_3)" ( (binary_expression "param_4 - param_3" identifier - identifier) )) + identifier)) ;) (if_statement "if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }" if (parenthesized_expression "(piVar2 == param_1 + 2)" ( (binary_expression "piVar2 == param_1 + 2" identifier == (binary_expression "param_1 + 2" identifier + number_literal)) )) (compound_statement "{\n      uVar3 = 0xf;\n    }" { (expression_statement "uVar3 = 0xf;" (assignment_expression "uVar3 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n      uVar3 = param_1[2];\n    }" else (compound_statement "{\n      uVar3 = param_1[2];\n    }" { (expression_statement "uVar3 = param_1[2];" (assignment_expression "uVar3 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" if (parenthesized_expression "(uVar3 < uVar4)" ( (binary_expression "uVar3 < uVar4" identifier < identifier) )) (compound_statement "{\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }" { (expression_statement "FUN_00188490(param_1,param_2,param_3,0,param_4);" (call_expression "FUN_00188490(param_1,param_2,param_3,0,param_4)" identifier (argument_list "(param_1,param_2,param_3,0,param_4)" ( identifier , identifier , identifier , number_literal , identifier ))) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" else (compound_statement "{\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" { (expression_statement "__n = iVar1 - (param_2 + param_3);" (assignment_expression "__n = iVar1 - (param_2 + param_3)" identifier = (binary_expression "iVar1 - (param_2 + param_3)" identifier - (parenthesized_expression "(param_2 + param_3)" ( (binary_expression "param_2 + param_3" identifier + identifier) )))) ;) (if_statement "if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }" if (parenthesized_expression "((__n != 0) && (param_3 != param_4))" ( (binary_expression "(__n != 0) && (param_3 != param_4)" (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) && (parenthesized_expression "(param_3 != param_4)" ( (binary_expression "param_3 != param_4" identifier != identifier) ))) )) (compound_statement "{\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }" { (expression_statement "__src = (undefined1 *)((int)piVar2 + param_3 + param_2);" (assignment_expression "__src = (undefined1 *)((int)piVar2 + param_3 + param_2)" identifier = (cast_expression "(undefined1 *)((int)piVar2 + param_3 + param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + param_3 + param_2)" ( (binary_expression "(int)piVar2 + param_3 + param_2" (binary_expression "(int)piVar2 + param_3" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) + identifier) )))) ;) (expression_statement "__dest = (undefined1 *)((int)piVar2 + param_4 + param_2);" (assignment_expression "__dest = (undefined1 *)((int)piVar2 + param_4 + param_2)" identifier = (cast_expression "(undefined1 *)((int)piVar2 + param_4 + param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + param_4 + param_2)" ( (binary_expression "(int)piVar2 + param_4 + param_2" (binary_expression "(int)piVar2 + param_4" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) + identifier) )))) ;) (if_statement "if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }" { (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src" * identifier)) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }" else (compound_statement "{\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }" { (expression_statement "memmove(__dest,__src,__n);" (call_expression "memmove(__dest,__src,__n)" identifier (argument_list "(__dest,__src,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })) }))) (if_statement "if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }" { (if_statement "if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }" { (expression_statement "*(char *)((int)piVar2 + param_2) = param_5;" (assignment_expression "*(char *)((int)piVar2 + param_2) = param_5" (pointer_expression "*(char *)((int)piVar2 + param_2)" * (cast_expression "(char *)((int)piVar2 + param_2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + param_2)" ( (binary_expression "(int)piVar2 + param_2" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) )))) = identifier) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" else (compound_statement "{\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" { (expression_statement "memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);" (call_expression "memset((char *)((int)piVar2 + param_2),(int)param_5,param_4)" identifier (argument_list "((char *)((int)piVar2 + param_2),(int)param_5,param_4)" ( (cast_expression "(char *)((int)piVar2 + param_2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + param_2)" ( (binary_expression "(int)piVar2 + param_2" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) , (cast_expression "(int)param_5" ( (type_descriptor "int" primitive_type) ) identifier) , identifier ))) ;) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" identifier = (cast_expression "(int *)*param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })) (expression_statement "param_1[1] = uVar4;" (assignment_expression "param_1[1] = uVar4" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined1 *)((int)piVar2 + uVar4) = 0;" (assignment_expression "*(undefined1 *)((int)piVar2 + uVar4) = 0" (pointer_expression "*(undefined1 *)((int)piVar2 + uVar4)" * (cast_expression "(undefined1 *)((int)piVar2 + uVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)piVar2 + uVar4)" ( (binary_expression "(int)piVar2 + uVar4" (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) )))) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })) (expression_statement "FUN_001c6190("basic_string::_M_replace_aux");" (call_expression "FUN_001c6190("basic_string::_M_replace_aux")" identifier (argument_list "("basic_string::_M_replace_aux")" ( (string_literal ""basic_string::_M_replace_aux"" " string_content ") ))) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (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 TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT - IDENT) )) + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (binary_expression IDENT + LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , LIT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) && (parenthesized_expression ( (binary_expression IDENT != IDENT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) + IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) + IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (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 TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }))) })) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) )))) = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) ))) , (cast_expression ( (type_descriptor TYPE) ) IDENT) , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }))) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) )))) = LIT) ;) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) })))
(function_definition "int * FUN_00189020(int *param_1,int param_2,uint param_3,uint param_4,char param_5)\n\n{\n  int iVar1;\n  undefined1 *__dest;\n  int *piVar2;\n  undefined1 *__src;\n  size_t __n;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }\n                    \n  FUN_001c6190("basic_string::_M_replace_aux");\n}" (primitive_type "int") (pointer_declarator "* FUN_00189020(int *param_1,int param_2,uint param_3,uint param_4,char param_5)" (* "*") (function_declarator "FUN_00189020(int *param_1,int param_2,uint param_3,uint param_4,char param_5)" (identifier "FUN_00189020") (parameter_list "(int *param_1,int param_2,uint param_3,uint param_4,char param_5)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) (, ",") (parameter_declaration "uint param_4" (type_identifier "uint") (identifier "param_4")) (, ",") (parameter_declaration "char param_5" (primitive_type "char") (identifier "param_5")) () ")")))) (compound_statement "{\n  int iVar1;\n  undefined1 *__dest;\n  int *piVar2;\n  undefined1 *__src;\n  size_t __n;\n  uint uVar3;\n  uint uVar4;\n  \n  iVar1 = param_1[1];\n  if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }\n                    \n  FUN_001c6190("basic_string::_M_replace_aux");\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined1 *__dest;" (type_identifier "undefined1") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "undefined1 *__src;" (type_identifier "undefined1") (pointer_declarator "*__src" (* "*") (identifier "__src")) (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (expression_statement "iVar1 = param_1[1];" (assignment_expression "iVar1 = param_1[1]" (identifier "iVar1") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (if_statement "if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }" (if "if") (parenthesized_expression "(param_4 <= (param_3 + 0x7fffffff) - iVar1)" (( "(") (binary_expression "param_4 <= (param_3 + 0x7fffffff) - iVar1" (identifier "param_4") (<= "<=") (binary_expression "(param_3 + 0x7fffffff) - iVar1" (parenthesized_expression "(param_3 + 0x7fffffff)" (( "(") (binary_expression "param_3 + 0x7fffffff" (identifier "param_3") (+ "+") (number_literal "0x7fffffff")) () ")")) (- "-") (identifier "iVar1"))) () ")")) (compound_statement "{\n    piVar2 = (int *)*param_1;\n    uVar4 = (param_4 - param_3) + iVar1;\n    if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }\n    if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }\n    if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }\n    param_1[1] = uVar4;\n    *(undefined1 *)((int)piVar2 + uVar4) = 0;\n    return param_1;\n  }" ({ "{") (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" (identifier "piVar2") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "uVar4 = (param_4 - param_3) + iVar1;" (assignment_expression "uVar4 = (param_4 - param_3) + iVar1" (identifier "uVar4") (= "=") (binary_expression "(param_4 - param_3) + iVar1" (parenthesized_expression "(param_4 - param_3)" (( "(") (binary_expression "param_4 - param_3" (identifier "param_4") (- "-") (identifier "param_3")) () ")")) (+ "+") (identifier "iVar1"))) (; ";")) (if_statement "if (piVar2 == param_1 + 2) {\n      uVar3 = 0xf;\n    }\n    else {\n      uVar3 = param_1[2];\n    }" (if "if") (parenthesized_expression "(piVar2 == param_1 + 2)" (( "(") (binary_expression "piVar2 == param_1 + 2" (identifier "piVar2") (== "==") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2"))) () ")")) (compound_statement "{\n      uVar3 = 0xf;\n    }" ({ "{") (expression_statement "uVar3 = 0xf;" (assignment_expression "uVar3 = 0xf" (identifier "uVar3") (= "=") (number_literal "0xf")) (; ";")) (} "}")) (else_clause "else {\n      uVar3 = param_1[2];\n    }" (else "else") (compound_statement "{\n      uVar3 = param_1[2];\n    }" ({ "{") (expression_statement "uVar3 = param_1[2];" (assignment_expression "uVar3 = param_1[2]" (identifier "uVar3") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (} "}")))) (if_statement "if (uVar3 < uVar4) {\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }\n    else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" (if "if") (parenthesized_expression "(uVar3 < uVar4)" (( "(") (binary_expression "uVar3 < uVar4" (identifier "uVar3") (< "<") (identifier "uVar4")) () ")")) (compound_statement "{\n      FUN_00188490(param_1,param_2,param_3,0,param_4);\n      piVar2 = (int *)*param_1;\n    }" ({ "{") (expression_statement "FUN_00188490(param_1,param_2,param_3,0,param_4);" (call_expression "FUN_00188490(param_1,param_2,param_3,0,param_4)" (identifier "FUN_00188490") (argument_list "(param_1,param_2,param_3,0,param_4)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (number_literal "0") (, ",") (identifier "param_4") () ")"))) (; ";")) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" (identifier "piVar2") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else {\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" (else "else") (compound_statement "{\n      __n = iVar1 - (param_2 + param_3);\n      if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }\n    }" ({ "{") (expression_statement "__n = iVar1 - (param_2 + param_3);" (assignment_expression "__n = iVar1 - (param_2 + param_3)" (identifier "__n") (= "=") (binary_expression "iVar1 - (param_2 + param_3)" (identifier "iVar1") (- "-") (parenthesized_expression "(param_2 + param_3)" (( "(") (binary_expression "param_2 + param_3" (identifier "param_2") (+ "+") (identifier "param_3")) () ")")))) (; ";")) (if_statement "if ((__n != 0) && (param_3 != param_4)) {\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }" (if "if") (parenthesized_expression "((__n != 0) && (param_3 != param_4))" (( "(") (binary_expression "(__n != 0) && (param_3 != param_4)" (parenthesized_expression "(__n != 0)" (( "(") (binary_expression "__n != 0" (identifier "__n") (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(param_3 != param_4)" (( "(") (binary_expression "param_3 != param_4" (identifier "param_3") (!= "!=") (identifier "param_4")) () ")"))) () ")")) (compound_statement "{\n        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);\n        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);\n        if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }\n      }" ({ "{") (expression_statement "__src = (undefined1 *)((int)piVar2 + param_3 + param_2);" (assignment_expression "__src = (undefined1 *)((int)piVar2 + param_3 + param_2)" (identifier "__src") (= "=") (cast_expression "(undefined1 *)((int)piVar2 + param_3 + param_2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)piVar2 + param_3 + param_2)" (( "(") (binary_expression "(int)piVar2 + param_3 + param_2" (binary_expression "(int)piVar2 + param_3" (cast_expression "(int)piVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar2")) (+ "+") (identifier "param_3")) (+ "+") (identifier "param_2")) () ")")))) (; ";")) (expression_statement "__dest = (undefined1 *)((int)piVar2 + param_4 + param_2);" (assignment_expression "__dest = (undefined1 *)((int)piVar2 + param_4 + param_2)" (identifier "__dest") (= "=") (cast_expression "(undefined1 *)((int)piVar2 + param_4 + param_2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)piVar2 + param_4 + param_2)" (( "(") (binary_expression "(int)piVar2 + param_4 + param_2" (binary_expression "(int)piVar2 + param_4" (cast_expression "(int)piVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar2")) (+ "+") (identifier "param_4")) (+ "+") (identifier "param_2")) () ")")))) (; ";")) (if_statement "if (__n == 1) {\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }\n        else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }" (if "if") (parenthesized_expression "(__n == 1)" (( "(") (binary_expression "__n == 1" (identifier "__n") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n          *__dest = *__src;\n          piVar2 = (int *)*param_1;\n        }" ({ "{") (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" (* "*") (identifier "__dest")) (= "=") (pointer_expression "*__src" (* "*") (identifier "__src"))) (; ";")) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" (identifier "piVar2") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else {\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }" (else "else") (compound_statement "{\n          memmove(__dest,__src,__n);\n          piVar2 = (int *)*param_1;\n        }" ({ "{") (expression_statement "memmove(__dest,__src,__n);" (call_expression "memmove(__dest,__src,__n)" (identifier "memmove") (argument_list "(__dest,__src,__n)" (( "(") (identifier "__dest") (, ",") (identifier "__src") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" (identifier "piVar2") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")))) (} "}"))) (} "}")))) (if_statement "if (param_4 != 0) {\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }" (if "if") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }\n    }" ({ "{") (if_statement "if (param_4 == 1) {\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }\n      else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" (if "if") (parenthesized_expression "(param_4 == 1)" (( "(") (binary_expression "param_4 == 1" (identifier "param_4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *(char *)((int)piVar2 + param_2) = param_5;\n        piVar2 = (int *)*param_1;\n      }" ({ "{") (expression_statement "*(char *)((int)piVar2 + param_2) = param_5;" (assignment_expression "*(char *)((int)piVar2 + param_2) = param_5" (pointer_expression "*(char *)((int)piVar2 + param_2)" (* "*") (cast_expression "(char *)((int)piVar2 + param_2)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)piVar2 + param_2)" (( "(") (binary_expression "(int)piVar2 + param_2" (cast_expression "(int)piVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar2")) (+ "+") (identifier "param_2")) () ")")))) (= "=") (identifier "param_5")) (; ";")) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" (identifier "piVar2") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else {\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" (else "else") (compound_statement "{\n        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);\n        piVar2 = (int *)*param_1;\n      }" ({ "{") (expression_statement "memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);" (call_expression "memset((char *)((int)piVar2 + param_2),(int)param_5,param_4)" (identifier "memset") (argument_list "((char *)((int)piVar2 + param_2),(int)param_5,param_4)" (( "(") (cast_expression "(char *)((int)piVar2 + param_2)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)piVar2 + param_2)" (( "(") (binary_expression "(int)piVar2 + param_2" (cast_expression "(int)piVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar2")) (+ "+") (identifier "param_2")) () ")"))) (, ",") (cast_expression "(int)param_5" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_5")) (, ",") (identifier "param_4") () ")"))) (; ";")) (expression_statement "piVar2 = (int *)*param_1;" (assignment_expression "piVar2 = (int *)*param_1" (identifier "piVar2") (= "=") (cast_expression "(int *)*param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")))) (} "}"))) (expression_statement "param_1[1] = uVar4;" (assignment_expression "param_1[1] = uVar4" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "uVar4")) (; ";")) (expression_statement "*(undefined1 *)((int)piVar2 + uVar4) = 0;" (assignment_expression "*(undefined1 *)((int)piVar2 + uVar4) = 0" (pointer_expression "*(undefined1 *)((int)piVar2 + uVar4)" (* "*") (cast_expression "(undefined1 *)((int)piVar2 + uVar4)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)piVar2 + uVar4)" (( "(") (binary_expression "(int)piVar2 + uVar4" (cast_expression "(int)piVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar2")) (+ "+") (identifier "uVar4")) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (expression_statement "FUN_001c6190("basic_string::_M_replace_aux");" (call_expression "FUN_001c6190("basic_string::_M_replace_aux")" (identifier "FUN_001c6190") (argument_list "("basic_string::_M_replace_aux")" (( "(") (string_literal ""basic_string::_M_replace_aux"" (" """) (string_content "basic_string::_M_replace_aux") (" """)) () ")"))) (; ";")) (} "}")))

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

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

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


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

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

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

{
  int iVar1;
  undefined1 *__dest;
  int *piVar2;
  undefined1 *__src;
  size_t __n;
  uint uVar3;
  uint uVar4;
  
  iVar1 = param_1[1];
  if (param_4 <= (param_3 + 0x7fffffff) - iVar1) {
    piVar2 = (int *)*param_1;
    uVar4 = (param_4 - param_3) + iVar1;
    if (piVar2 == param_1 + 2) {
      uVar3 = 0xf;
    }
    else {
      uVar3 = param_1[2];
    }
    if (uVar3 < uVar4) {
      FUN_00188490(param_1,param_2,param_3,0,param_4);
      piVar2 = (int *)*param_1;
    }
    else {
      __n = iVar1 - (param_2 + param_3);
      if ((__n != 0) && (param_3 != param_4)) {
        __src = (undefined1 *)((int)piVar2 + param_3 + param_2);
        __dest = (undefined1 *)((int)piVar2 + param_4 + param_2);
        if (__n == 1) {
          *__dest = *__src;
          piVar2 = (int *)*param_1;
        }
        else {
          memmove(__dest,__src,__n);
          piVar2 = (int *)*param_1;
        }
      }
    }
    if (param_4 != 0) {
      if (param_4 == 1) {
        *(char *)((int)piVar2 + param_2) = param_5;
        piVar2 = (int *)*param_1;
      }
      else {
        memset((char *)((int)piVar2 + param_2),(int)param_5,param_4);
        piVar2 = (int *)*param_1;
      }
    }
    param_1[1] = uVar4;
    *(undefined1 *)((int)piVar2 + uVar4) = 0;
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_001c6190("basic_string::_M_replace_aux");
}

