
/* 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)

{
  uint uVar1;
  int iVar2;
  string *psVar3;
  uint uVar4;
  
  iVar2 = *(int *)(this + 4);
  if ((param_2 + 0x7fffffff) - iVar2 < param_3) {
    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);
    return psVar3;
  }
  psVar3 = *(string **)this;
  uVar4 = (param_3 - param_2) + iVar2;
  if (psVar3 == this + 8) {
    uVar1 = 0xf;
  }
  else {
    uVar1 = *(uint *)(this + 8);
  }
  if (uVar1 < uVar4) {
    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);
    psVar3 = *(string **)this;
  }
  else {
    iVar2 = iVar2 - (param_2 + param_1);
    if ((iVar2 != 0) && (param_2 != param_3)) {
      if (iVar2 == 1) {
        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];
        psVar3 = *(string **)this;
      }
      else {
        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)
        ;
        psVar3 = *(string **)this;
      }
    }
  }
  if (param_3 != 0) {
    if (param_3 == 1) {
      psVar3[param_1] = (string)param_4;
      *(uint *)(this + 4) = uVar4;
      *(undefined1 *)(*(int *)this + uVar4) = 0;
      return this;
    }
    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);
    psVar3 = *(string **)this;
  }
  *(uint *)(this + 4) = uVar4;
  psVar3[uVar4] = (string)0x0;
  return this;
}



/* 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)

{
  uint uVar1;
  int iVar2;
  string *psVar3;
  uint uVar4;
  
  iVar2 = *(int *)(this + 4);
  if ((param_2 + 0x7fffffff) - iVar2 < param_3) {
    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);
    return psVar3;
  }
  psVar3 = *(string **)this;
  uVar4 = (param_3 - param_2) + iVar2;
  if (psVar3 == this + 8) {
    uVar1 = 0xf;
  }
  else {
    uVar1 = *(uint *)(this + 8);
  }
  if (uVar1 < uVar4) {
    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);
    psVar3 = *(string **)this;
  }
  else {
    iVar2 = iVar2 - (param_2 + param_1);
    if ((iVar2 != 0) && (param_2 != param_3)) {
      if (iVar2 == 1) {
        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];
        psVar3 = *(string **)this;
      }
      else {
        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)
        ;
        psVar3 = *(string **)this;
      }
    }
  }
  if (param_3 != 0) {
    if (param_3 == 1) {
      psVar3[param_1] = (string)param_4;
      *(uint *)(this + 4) = uVar4;
      *(undefined1 *)(*(int *)this + uVar4) = 0;
      return this;
    }
    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);
    psVar3 = *(string **)this;
  }
  *(uint *)(this + 4) = uVar4;
  psVar3[uVar4] = (string)0x0;
  return this;
}


lui gp,0x19
addiu gp,gp,-0x27c0
addu gp,gp,t9
addiu sp,sp,-0x38
lui v0,0x7fff
sw s2,0x28(sp)
ori v0,v0,0xffff
sw gp,0x18(sp)
addu v0,a2,v0
sw ra,0x34(sp)
sw s4,0x30(sp)
sw s3,0x2c(sp)
sw s1,0x24(sp)
sw s0,0x20(sp)
lw v1,0x4(a0)
subu v0,v0,v1
sltu v0,v0,a3
bne v0,zero,0x0033bb84
_lb s2,0x4b(sp)
or s0,a0,zero
lw a0,0x0(a0)
subu s1,a3,a2
addiu v0,s0,0x8
or s3,a3,zero
or s4,a1,zero
beq a0,v0,0x0033bb44
_addu s1,s1,v1
lw v0,0x8(s0)
sltu v0,v0,s1
bne v0,zero,0x0033bb08
_addu v0,a2,s4
subu v1,v1,v0
beq v1,zero,0x0033bab4
_nop
beq a2,s3,0x0033bab4
_addu a1,a0,s4
li v0,0x1
addu a0,a1,s3
beq v1,v0,0x0033bb34
_addu a1,a1,a2
lw t9,-0x3748(gp)
jalr t9
_or a2,v1,zero
lw gp,0x18(sp)
lw a0,0x0(s0)
beq s3,zero,0x0033bad8
_li v0,0x1
beq s3,v0,0x0033bb4c
_addu a0,a0,s4
lw t9,-0x35d8(gp)
or a2,s3,zero
jalr t9
_or a1,s2,zero
lw a0,0x0(s0)
addu a0,a0,s1
sw s1,0x4(s0)
or v0,s0,zero
sb zero,0x0(a0)
lw ra,0x34(sp)
lw s4,0x30(sp)
lw s3,0x2c(sp)
lw s2,0x28(sp)
lw s1,0x24(sp)
lw s0,0x20(sp)
jr ra
_addiu sp,sp,0x38
lw t9,-0x71b0(gp)
or a3,zero,zero
or a0,s0,zero
sw s3,0x10(sp)
bal 0x0033abf0
_or a1,s4,zero
lw gp,0x18(sp)
beq s3,zero,0x0033bad8
_lw a0,0x0(s0)
b 0x0033babc
_li v0,0x1
lb v0,0x0(a1)
sb v0,0x0(a0)
b 0x0033bab4
_lw a0,0x0(s0)
b 0x0033ba70
_li v0,0xf
sb s2,0x0(a0)
or v0,s0,zero
lw a0,0x0(s0)
sw s1,0x4(s0)
addu a0,a0,s1
sb zero,0x0(a0)
lw ra,0x34(sp)
lw s4,0x30(sp)
lw s3,0x2c(sp)
lw s2,0x28(sp)
lw s1,0x24(sp)
lw s0,0x20(sp)
jr ra
_addiu sp,sp,0x38
lw a0,-0x7f64(gp)
lw t9,-0x73cc(gp)
jalr t9
_addiu a0,a0,-0x3b24
(translation_unit "/* 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  uint uVar1;\n  int iVar2;\n  string *psVar3;\n  uint uVar4;\n  \n  iVar2 = *(int *)(this + 4);\n  if ((param_2 + 0x7fffffff) - iVar2 < param_3) {\n    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);\n    return psVar3;\n  }\n  psVar3 = *(string **)this;\n  uVar4 = (param_3 - param_2) + iVar2;\n  if (psVar3 == this + 8) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = *(uint *)(this + 8);\n  }\n  if (uVar1 < uVar4) {\n    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n    psVar3 = *(string **)this;\n  }\n  else {\n    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }\n  if (param_3 != 0) {\n    if (param_3 == 1) {\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }\n    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);\n    psVar3 = *(string **)this;\n  }\n  *(uint *)(this + 4) = uVar4;\n  psVar3[uVar4] = (string)0x0;\n  return this;\n}\n\n" 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  uint uVar1;" type_identifier identifier , (ERROR "uint" identifier) identifier , (ERROR "uint" identifier) identifier , (ERROR "char param_4)\n\n{\n  uint" identifier identifier ) { identifier) identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "string *psVar3;" type_identifier (pointer_declarator "*psVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "iVar2 = *(int *)(this + 4);" (assignment_expression "iVar2 = *(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_2 + 0x7fffffff) - iVar2 < param_3) {\n    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);\n    return psVar3;\n  }" if (parenthesized_expression "((param_2 + 0x7fffffff) - iVar2 < param_3)" ( (binary_expression "(param_2 + 0x7fffffff) - iVar2 < param_3" (binary_expression "(param_2 + 0x7fffffff) - iVar2" (parenthesized_expression "(param_2 + 0x7fffffff)" ( (binary_expression "param_2 + 0x7fffffff" identifier + number_literal) )) - identifier) < identifier) )) (compound_statement "{\n    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);\n    return psVar3;\n  }" { (expression_statement "psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);" (assignment_expression "psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24)" identifier = (cast_expression "(string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24)" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24)" (parenthesized_expression "(*(code *)PTR___throw_length_error_004c1e74)" ( (pointer_expression "*(code *)PTR___throw_length_error_004c1e74" * (cast_expression "(code *)PTR___throw_length_error_004c1e74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_UINT_004c12dc + -0x3b24)" ( (binary_expression "PTR_UINT_004c12dc + -0x3b24" identifier + number_literal) ))))) ;) (return_statement "return psVar3;" return identifier ;) })) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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) + iVar2;" (assignment_expression "uVar4 = (param_3 - param_2) + iVar2" identifier = (binary_expression "(param_3 - param_2) + iVar2" (parenthesized_expression "(param_3 - param_2)" ( (binary_expression "param_3 - param_2" identifier - identifier) )) + identifier)) ;) (if_statement "if (psVar3 == this + 8) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = *(uint *)(this + 8);\n  }" if (parenthesized_expression "(psVar3 == this + 8)" ( (binary_expression "psVar3 == this + 8" identifier == (binary_expression "this + 8" identifier + number_literal)) )) (compound_statement "{\n    uVar1 = 0xf;\n  }" { (expression_statement "uVar1 = 0xf;" (assignment_expression "uVar1 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n    uVar1 = *(uint *)(this + 8);\n  }" else (compound_statement "{\n    uVar1 = *(uint *)(this + 8);\n  }" { (expression_statement "uVar1 = *(uint *)(this + 8);" (assignment_expression "uVar1 = *(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 (uVar1 < uVar4) {\n    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n    psVar3 = *(string **)this;\n  }\n  else {\n    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }" if (parenthesized_expression "(uVar1 < uVar4)" ( (binary_expression "uVar1 < uVar4" identifier < identifier) )) (compound_statement "{\n    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n    psVar3 = *(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 "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }" else (compound_statement "{\n    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }" { (expression_statement "iVar2 = iVar2 - (param_2 + param_1);" (assignment_expression "iVar2 = iVar2 - (param_2 + param_1)" identifier = (binary_expression "iVar2 - (param_2 + param_1)" identifier - (parenthesized_expression "(param_2 + param_1)" ( (binary_expression "param_2 + param_1" identifier + identifier) )))) ;) (if_statement "if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }" if (parenthesized_expression "((iVar2 != 0) && (param_2 != param_3))" ( (binary_expression "(iVar2 != 0) && (param_2 != param_3)" (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) && (parenthesized_expression "(param_2 != param_3)" ( (binary_expression "param_2 != param_3" identifier != identifier) ))) )) (compound_statement "{\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }" { (if_statement "if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }" if (parenthesized_expression "(iVar2 == 1)" ( (binary_expression "iVar2 == 1" identifier == number_literal) )) (compound_statement "{\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }" { (expression_statement "psVar3[param_3 + param_1] = psVar3[param_2 + param_1];" (assignment_expression "psVar3[param_3 + param_1] = psVar3[param_2 + param_1]" (subscript_expression "psVar3[param_3 + param_1]" identifier [ (binary_expression "param_3 + param_1" identifier + identifier) ]) = (subscript_expression "psVar3[param_2 + param_1]" identifier [ (binary_expression "param_2 + param_1" identifier + identifier) ])) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }" else (compound_statement "{\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }" { (expression_statement "(*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;" (call_expression "(*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)" (parenthesized_expression "(*(code *)PTR_memmove_004c5af8)" ( (pointer_expression "*(code *)PTR_memmove_004c5af8" * (cast_expression "(code *)PTR_memmove_004c5af8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)" ( (binary_expression "psVar3 + param_3 + param_1" (binary_expression "psVar3 + param_3" identifier + identifier) + identifier) , (binary_expression "psVar3 + param_2 + param_1" (binary_expression "psVar3 + param_2" identifier + identifier) + identifier) , identifier ))) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }\n    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);\n    psVar3 = *(string **)this;\n  }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_3 == 1) {\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }\n    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);\n    psVar3 = *(string **)this;\n  }" { (if_statement "if (param_3 == 1) {\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }" { (expression_statement "psVar3[param_1] = (string)param_4;" (assignment_expression "psVar3[param_1] = (string)param_4" (subscript_expression "psVar3[param_1]" identifier [ identifier ]) = (cast_expression "(string)param_4" ( (type_descriptor "string" type_identifier) ) 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 "*(undefined1 *)(*(int *)this + uVar4) = 0;" (assignment_expression "*(undefined1 *)(*(int *)this + uVar4) = 0" (pointer_expression "*(undefined1 *)(*(int *)this + uVar4)" * (cast_expression "(undefined1 *)(*(int *)this + uVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + uVar4)" ( (binary_expression "*(int *)this + uVar4" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + identifier) )))) = number_literal) ;) (return_statement "return this;" return identifier ;) })) (expression_statement "(*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);" (call_expression "(*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3)" (parenthesized_expression "(*(code *)PTR_memset_004c5c68)" ( (pointer_expression "*(code *)PTR_memset_004c5c68" * (cast_expression "(code *)PTR_memset_004c5c68" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(psVar3 + param_1,(int)param_4,param_3)" ( (binary_expression "psVar3 + param_1" identifier + identifier) , (cast_expression "(int)param_4" ( (type_descriptor "int" primitive_type) ) identifier) , identifier ))) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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 "psVar3[uVar4] = (string)0x0;" (assignment_expression "psVar3[uVar4] = (string)0x0" (subscript_expression "psVar3[uVar4]" identifier [ identifier ]) = (cast_expression "(string)0x0" ( (type_descriptor "string" type_identifier) ) number_literal)) ;) (return_statement "return this;" return identifier ;) (ERROR "}" }))
(translation_unit "/* 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  uint uVar1;\n  int iVar2;\n  string *psVar3;\n  uint uVar4;\n  \n  iVar2 = *(int *)(this + 4);\n  if ((param_2 + 0x7fffffff) - iVar2 < param_3) {\n    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);\n    return psVar3;\n  }\n  psVar3 = *(string **)this;\n  uVar4 = (param_3 - param_2) + iVar2;\n  if (psVar3 == this + 8) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = *(uint *)(this + 8);\n  }\n  if (uVar1 < uVar4) {\n    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n    psVar3 = *(string **)this;\n  }\n  else {\n    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }\n  if (param_3 != 0) {\n    if (param_3 == 1) {\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }\n    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);\n    psVar3 = *(string **)this;\n  }\n  *(uint *)(this + 4) = uVar4;\n  psVar3[uVar4] = (string)0x0;\n  return this;\n}\n\n" 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  uint uVar1;" type_identifier identifier , (ERROR "uint" identifier) identifier , (ERROR "uint" identifier) identifier , (ERROR "char param_4)\n\n{\n  uint" identifier identifier ) { identifier) identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "string *psVar3;" type_identifier (pointer_declarator "*psVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "iVar2 = *(int *)(this + 4);" (assignment_expression "iVar2 = *(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_2 + 0x7fffffff) - iVar2 < param_3) {\n    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);\n    return psVar3;\n  }" if (parenthesized_expression "((param_2 + 0x7fffffff) - iVar2 < param_3)" ( (binary_expression "(param_2 + 0x7fffffff) - iVar2 < param_3" (binary_expression "(param_2 + 0x7fffffff) - iVar2" (parenthesized_expression "(param_2 + 0x7fffffff)" ( (binary_expression "param_2 + 0x7fffffff" identifier + number_literal) )) - identifier) < identifier) )) (compound_statement "{\n    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);\n    return psVar3;\n  }" { (expression_statement "psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);" (assignment_expression "psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24)" identifier = (cast_expression "(string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24)" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24)" (parenthesized_expression "(*(code *)PTR___throw_length_error_004c1e74)" ( (pointer_expression "*(code *)PTR___throw_length_error_004c1e74" * (cast_expression "(code *)PTR___throw_length_error_004c1e74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_UINT_004c12dc + -0x3b24)" ( (binary_expression "PTR_UINT_004c12dc + -0x3b24" identifier + number_literal) ))))) ;) (return_statement "return psVar3;" return identifier ;) })) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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) + iVar2;" (assignment_expression "uVar4 = (param_3 - param_2) + iVar2" identifier = (binary_expression "(param_3 - param_2) + iVar2" (parenthesized_expression "(param_3 - param_2)" ( (binary_expression "param_3 - param_2" identifier - identifier) )) + identifier)) ;) (if_statement "if (psVar3 == this + 8) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = *(uint *)(this + 8);\n  }" if (parenthesized_expression "(psVar3 == this + 8)" ( (binary_expression "psVar3 == this + 8" identifier == (binary_expression "this + 8" identifier + number_literal)) )) (compound_statement "{\n    uVar1 = 0xf;\n  }" { (expression_statement "uVar1 = 0xf;" (assignment_expression "uVar1 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n    uVar1 = *(uint *)(this + 8);\n  }" else (compound_statement "{\n    uVar1 = *(uint *)(this + 8);\n  }" { (expression_statement "uVar1 = *(uint *)(this + 8);" (assignment_expression "uVar1 = *(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 (uVar1 < uVar4) {\n    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n    psVar3 = *(string **)this;\n  }\n  else {\n    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }" if (parenthesized_expression "(uVar1 < uVar4)" ( (binary_expression "uVar1 < uVar4" identifier < identifier) )) (compound_statement "{\n    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n    psVar3 = *(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 "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }" else (compound_statement "{\n    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }" { (expression_statement "iVar2 = iVar2 - (param_2 + param_1);" (assignment_expression "iVar2 = iVar2 - (param_2 + param_1)" identifier = (binary_expression "iVar2 - (param_2 + param_1)" identifier - (parenthesized_expression "(param_2 + param_1)" ( (binary_expression "param_2 + param_1" identifier + identifier) )))) ;) (if_statement "if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }" if (parenthesized_expression "((iVar2 != 0) && (param_2 != param_3))" ( (binary_expression "(iVar2 != 0) && (param_2 != param_3)" (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) && (parenthesized_expression "(param_2 != param_3)" ( (binary_expression "param_2 != param_3" identifier != identifier) ))) )) (compound_statement "{\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }" { (if_statement "if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }" if (parenthesized_expression "(iVar2 == 1)" ( (binary_expression "iVar2 == 1" identifier == number_literal) )) (compound_statement "{\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }" { (expression_statement "psVar3[param_3 + param_1] = psVar3[param_2 + param_1];" (assignment_expression "psVar3[param_3 + param_1] = psVar3[param_2 + param_1]" (subscript_expression "psVar3[param_3 + param_1]" identifier [ (binary_expression "param_3 + param_1" identifier + identifier) ]) = (subscript_expression "psVar3[param_2 + param_1]" identifier [ (binary_expression "param_2 + param_1" identifier + identifier) ])) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }" else (compound_statement "{\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }" { (expression_statement "(*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;" (call_expression "(*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)" (parenthesized_expression "(*(code *)PTR_memmove_004c5af8)" ( (pointer_expression "*(code *)PTR_memmove_004c5af8" * (cast_expression "(code *)PTR_memmove_004c5af8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)" ( (binary_expression "psVar3 + param_3 + param_1" (binary_expression "psVar3 + param_3" identifier + identifier) + identifier) , (binary_expression "psVar3 + param_2 + param_1" (binary_expression "psVar3 + param_2" identifier + identifier) + identifier) , identifier ))) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }\n    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);\n    psVar3 = *(string **)this;\n  }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_3 == 1) {\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }\n    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);\n    psVar3 = *(string **)this;\n  }" { (if_statement "if (param_3 == 1) {\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }" { (expression_statement "psVar3[param_1] = (string)param_4;" (assignment_expression "psVar3[param_1] = (string)param_4" (subscript_expression "psVar3[param_1]" identifier [ identifier ]) = (cast_expression "(string)param_4" ( (type_descriptor "string" type_identifier) ) 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 "*(undefined1 *)(*(int *)this + uVar4) = 0;" (assignment_expression "*(undefined1 *)(*(int *)this + uVar4) = 0" (pointer_expression "*(undefined1 *)(*(int *)this + uVar4)" * (cast_expression "(undefined1 *)(*(int *)this + uVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + uVar4)" ( (binary_expression "*(int *)this + uVar4" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + identifier) )))) = number_literal) ;) (return_statement "return this;" return identifier ;) })) (expression_statement "(*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);" (call_expression "(*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3)" (parenthesized_expression "(*(code *)PTR_memset_004c5c68)" ( (pointer_expression "*(code *)PTR_memset_004c5c68" * (cast_expression "(code *)PTR_memset_004c5c68" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(psVar3 + param_1,(int)param_4,param_3)" ( (binary_expression "psVar3 + param_1" identifier + identifier) , (cast_expression "(int)param_4" ( (type_descriptor "int" primitive_type) ) identifier) , identifier ))) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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 "psVar3[uVar4] = (string)0x0;" (assignment_expression "psVar3[uVar4] = (string)0x0" (subscript_expression "psVar3[uVar4]" identifier [ identifier ]) = (cast_expression "(string)0x0" ( (type_descriptor "string" type_identifier) ) number_literal)) ;) (return_statement "return this;" return identifier ;) (ERROR "}" }))
(translation_unit "string * __thiscall\nstd::string::_M_replace_aux(string *this,uint param_1,uint param_2,uint param_3,char param_4)\n\n{\n  uint uVar1;\n  int iVar2;\n  string *psVar3;\n  uint uVar4;\n  \n  iVar2 = *(int *)(this + 4);\n  if ((param_2 + 0x7fffffff) - iVar2 < param_3) {\n    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);\n    return psVar3;\n  }\n  psVar3 = *(string **)this;\n  uVar4 = (param_3 - param_2) + iVar2;\n  if (psVar3 == this + 8) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = *(uint *)(this + 8);\n  }\n  if (uVar1 < uVar4) {\n    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n    psVar3 = *(string **)this;\n  }\n  else {\n    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }\n  if (param_3 != 0) {\n    if (param_3 == 1) {\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }\n    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);\n    psVar3 = *(string **)this;\n  }\n  *(uint *)(this + 4) = uVar4;\n  psVar3[uVar4] = (string)0x0;\n  return this;\n}\n\n" (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  uint uVar1;" type_identifier identifier , (ERROR "uint" identifier) identifier , (ERROR "uint" identifier) identifier , (ERROR "char param_4)\n\n{\n  uint" identifier identifier ) { identifier) identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "string *psVar3;" type_identifier (pointer_declarator "*psVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "iVar2 = *(int *)(this + 4);" (assignment_expression "iVar2 = *(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_2 + 0x7fffffff) - iVar2 < param_3) {\n    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);\n    return psVar3;\n  }" if (parenthesized_expression "((param_2 + 0x7fffffff) - iVar2 < param_3)" ( (binary_expression "(param_2 + 0x7fffffff) - iVar2 < param_3" (binary_expression "(param_2 + 0x7fffffff) - iVar2" (parenthesized_expression "(param_2 + 0x7fffffff)" ( (binary_expression "param_2 + 0x7fffffff" identifier + number_literal) )) - identifier) < identifier) )) (compound_statement "{\n    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);\n    return psVar3;\n  }" { (expression_statement "psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);" (assignment_expression "psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24)" identifier = (cast_expression "(string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24)" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24)" (parenthesized_expression "(*(code *)PTR___throw_length_error_004c1e74)" ( (pointer_expression "*(code *)PTR___throw_length_error_004c1e74" * (cast_expression "(code *)PTR___throw_length_error_004c1e74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_UINT_004c12dc + -0x3b24)" ( (binary_expression "PTR_UINT_004c12dc + -0x3b24" identifier + number_literal) ))))) ;) (return_statement "return psVar3;" return identifier ;) })) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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) + iVar2;" (assignment_expression "uVar4 = (param_3 - param_2) + iVar2" identifier = (binary_expression "(param_3 - param_2) + iVar2" (parenthesized_expression "(param_3 - param_2)" ( (binary_expression "param_3 - param_2" identifier - identifier) )) + identifier)) ;) (if_statement "if (psVar3 == this + 8) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = *(uint *)(this + 8);\n  }" if (parenthesized_expression "(psVar3 == this + 8)" ( (binary_expression "psVar3 == this + 8" identifier == (binary_expression "this + 8" identifier + number_literal)) )) (compound_statement "{\n    uVar1 = 0xf;\n  }" { (expression_statement "uVar1 = 0xf;" (assignment_expression "uVar1 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n    uVar1 = *(uint *)(this + 8);\n  }" else (compound_statement "{\n    uVar1 = *(uint *)(this + 8);\n  }" { (expression_statement "uVar1 = *(uint *)(this + 8);" (assignment_expression "uVar1 = *(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 (uVar1 < uVar4) {\n    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n    psVar3 = *(string **)this;\n  }\n  else {\n    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }" if (parenthesized_expression "(uVar1 < uVar4)" ( (binary_expression "uVar1 < uVar4" identifier < identifier) )) (compound_statement "{\n    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n    psVar3 = *(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 "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }" else (compound_statement "{\n    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }" { (expression_statement "iVar2 = iVar2 - (param_2 + param_1);" (assignment_expression "iVar2 = iVar2 - (param_2 + param_1)" identifier = (binary_expression "iVar2 - (param_2 + param_1)" identifier - (parenthesized_expression "(param_2 + param_1)" ( (binary_expression "param_2 + param_1" identifier + identifier) )))) ;) (if_statement "if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }" if (parenthesized_expression "((iVar2 != 0) && (param_2 != param_3))" ( (binary_expression "(iVar2 != 0) && (param_2 != param_3)" (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) && (parenthesized_expression "(param_2 != param_3)" ( (binary_expression "param_2 != param_3" identifier != identifier) ))) )) (compound_statement "{\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }" { (if_statement "if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }" if (parenthesized_expression "(iVar2 == 1)" ( (binary_expression "iVar2 == 1" identifier == number_literal) )) (compound_statement "{\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }" { (expression_statement "psVar3[param_3 + param_1] = psVar3[param_2 + param_1];" (assignment_expression "psVar3[param_3 + param_1] = psVar3[param_2 + param_1]" (subscript_expression "psVar3[param_3 + param_1]" identifier [ (binary_expression "param_3 + param_1" identifier + identifier) ]) = (subscript_expression "psVar3[param_2 + param_1]" identifier [ (binary_expression "param_2 + param_1" identifier + identifier) ])) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }" else (compound_statement "{\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }" { (expression_statement "(*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;" (call_expression "(*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)" (parenthesized_expression "(*(code *)PTR_memmove_004c5af8)" ( (pointer_expression "*(code *)PTR_memmove_004c5af8" * (cast_expression "(code *)PTR_memmove_004c5af8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)" ( (binary_expression "psVar3 + param_3 + param_1" (binary_expression "psVar3 + param_3" identifier + identifier) + identifier) , (binary_expression "psVar3 + param_2 + param_1" (binary_expression "psVar3 + param_2" identifier + identifier) + identifier) , identifier ))) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }\n    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);\n    psVar3 = *(string **)this;\n  }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_3 == 1) {\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }\n    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);\n    psVar3 = *(string **)this;\n  }" { (if_statement "if (param_3 == 1) {\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }" { (expression_statement "psVar3[param_1] = (string)param_4;" (assignment_expression "psVar3[param_1] = (string)param_4" (subscript_expression "psVar3[param_1]" identifier [ identifier ]) = (cast_expression "(string)param_4" ( (type_descriptor "string" type_identifier) ) 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 "*(undefined1 *)(*(int *)this + uVar4) = 0;" (assignment_expression "*(undefined1 *)(*(int *)this + uVar4) = 0" (pointer_expression "*(undefined1 *)(*(int *)this + uVar4)" * (cast_expression "(undefined1 *)(*(int *)this + uVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + uVar4)" ( (binary_expression "*(int *)this + uVar4" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + identifier) )))) = number_literal) ;) (return_statement "return this;" return identifier ;) })) (expression_statement "(*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);" (call_expression "(*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3)" (parenthesized_expression "(*(code *)PTR_memset_004c5c68)" ( (pointer_expression "*(code *)PTR_memset_004c5c68" * (cast_expression "(code *)PTR_memset_004c5c68" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(psVar3 + param_1,(int)param_4,param_3)" ( (binary_expression "psVar3 + param_1" identifier + identifier) , (cast_expression "(int)param_4" ( (type_descriptor "int" primitive_type) ) identifier) , identifier ))) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(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 "psVar3[uVar4] = (string)0x0;" (assignment_expression "psVar3[uVar4] = (string)0x0" (subscript_expression "psVar3[uVar4]" identifier [ identifier ]) = (cast_expression "(string)0x0" ( (type_descriptor "string" type_identifier) ) number_literal)) ;) (return_statement "return this;" return identifier ;) (ERROR "}" }))
(translation_unit (ERROR (binary_expression (binary_expression IDENT * IDENT) (ERROR IDENT : : IDENT : : IDENT ( IDENT) * IDENT) ,) (declaration TYPE IDENT , (ERROR IDENT) IDENT , (ERROR IDENT) IDENT , (ERROR IDENT IDENT ) { IDENT) IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression (parenthesized_expression ( (binary_expression IDENT + LIT) )) - IDENT) < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + LIT) ))))) ;) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) 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 = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) IDENT))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) && (parenthesized_expression ( (binary_expression IDENT != IDENT) ))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ (binary_expression IDENT + IDENT) ]) = (subscript_expression IDENT [ (binary_expression IDENT + IDENT) ])) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) IDENT))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression (binary_expression IDENT + IDENT) + IDENT) , (binary_expression (binary_expression IDENT + IDENT) + IDENT) , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) 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 (subscript_expression IDENT [ IDENT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) + IDENT) )))) = LIT) ;) (return_statement return IDENT ;) })) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + IDENT) , (cast_expression ( (type_descriptor TYPE) ) IDENT) , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) IDENT))) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (cast_expression ( (type_descriptor TYPE) ) LIT)) ;) (return_statement return IDENT ;) (ERROR }))
(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 "string") (* "*") (identifier "__thiscall")) (ERROR "std::string::_M_replace_aux(string" (identifier "std") (: ":") (: ":") (identifier "string") (: ":") (: ":") (identifier "_M_replace_aux") (( "(") (identifier "string")) (* "*") (identifier "this")) (, ",")) (declaration "uint param_1,uint param_2,uint param_3,char param_4)\n\n{\n  uint uVar1;" (type_identifier "uint") (identifier "param_1") (, ",") (ERROR "uint" (identifier "uint")) (identifier "param_2") (, ",") (ERROR "uint" (identifier "uint")) (identifier "param_3") (, ",") (ERROR "char param_4)\n\n{\n  uint" (identifier "char") (identifier "param_4") () ")") ({ "{") (identifier "uint")) (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "string *psVar3;" (type_identifier "string") (pointer_declarator "*psVar3" (* "*") (identifier "psVar3")) (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (expression_statement "iVar2 = *(int *)(this + 4);" (assignment_expression "iVar2 = *(int *)(this + 4)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)(this + 4)" (* "*") (cast_expression "(int *)(this + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(this + 4)" (( "(") (binary_expression "this + 4" (identifier "this") (+ "+") (number_literal "4")) () ")"))))) (; ";")) (if_statement "if ((param_2 + 0x7fffffff) - iVar2 < param_3) {\n    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);\n    return psVar3;\n  }" (if "if") (parenthesized_expression "((param_2 + 0x7fffffff) - iVar2 < param_3)" (( "(") (binary_expression "(param_2 + 0x7fffffff) - iVar2 < param_3" (binary_expression "(param_2 + 0x7fffffff) - iVar2" (parenthesized_expression "(param_2 + 0x7fffffff)" (( "(") (binary_expression "param_2 + 0x7fffffff" (identifier "param_2") (+ "+") (number_literal "0x7fffffff")) () ")")) (- "-") (identifier "iVar2")) (< "<") (identifier "param_3")) () ")")) (compound_statement "{\n    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);\n    return psVar3;\n  }" ({ "{") (expression_statement "psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);" (assignment_expression "psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24)" (identifier "psVar3") (= "=") (cast_expression "(string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24)" (( "(") (type_descriptor "string *" (type_identifier "string") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24)" (parenthesized_expression "(*(code *)PTR___throw_length_error_004c1e74)" (( "(") (pointer_expression "*(code *)PTR___throw_length_error_004c1e74" (* "*") (cast_expression "(code *)PTR___throw_length_error_004c1e74" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___throw_length_error_004c1e74"))) () ")")) (argument_list "(PTR_UINT_004c12dc + -0x3b24)" (( "(") (binary_expression "PTR_UINT_004c12dc + -0x3b24" (identifier "PTR_UINT_004c12dc") (+ "+") (number_literal "-0x3b24")) () ")"))))) (; ";")) (return_statement "return psVar3;" (return "return") (identifier "psVar3") (; ";")) (} "}"))) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(string **)this" (identifier "psVar3") (= "=") (pointer_expression "*(string **)this" (* "*") (cast_expression "(string **)this" (( "(") (type_descriptor "string **" (type_identifier "string") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "this")))) (; ";")) (expression_statement "uVar4 = (param_3 - param_2) + iVar2;" (assignment_expression "uVar4 = (param_3 - param_2) + iVar2" (identifier "uVar4") (= "=") (binary_expression "(param_3 - param_2) + iVar2" (parenthesized_expression "(param_3 - param_2)" (( "(") (binary_expression "param_3 - param_2" (identifier "param_3") (- "-") (identifier "param_2")) () ")")) (+ "+") (identifier "iVar2"))) (; ";")) (if_statement "if (psVar3 == this + 8) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = *(uint *)(this + 8);\n  }" (if "if") (parenthesized_expression "(psVar3 == this + 8)" (( "(") (binary_expression "psVar3 == this + 8" (identifier "psVar3") (== "==") (binary_expression "this + 8" (identifier "this") (+ "+") (number_literal "8"))) () ")")) (compound_statement "{\n    uVar1 = 0xf;\n  }" ({ "{") (expression_statement "uVar1 = 0xf;" (assignment_expression "uVar1 = 0xf" (identifier "uVar1") (= "=") (number_literal "0xf")) (; ";")) (} "}")) (else_clause "else {\n    uVar1 = *(uint *)(this + 8);\n  }" (else "else") (compound_statement "{\n    uVar1 = *(uint *)(this + 8);\n  }" ({ "{") (expression_statement "uVar1 = *(uint *)(this + 8);" (assignment_expression "uVar1 = *(uint *)(this + 8)" (identifier "uVar1") (= "=") (pointer_expression "*(uint *)(this + 8)" (* "*") (cast_expression "(uint *)(this + 8)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(this + 8)" (( "(") (binary_expression "this + 8" (identifier "this") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (} "}")))) (if_statement "if (uVar1 < uVar4) {\n    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n    psVar3 = *(string **)this;\n  }\n  else {\n    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }" (if "if") (parenthesized_expression "(uVar1 < uVar4)" (( "(") (binary_expression "uVar1 < uVar4" (identifier "uVar1") (< "<") (identifier "uVar4")) () ")")) (compound_statement "{\n    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);\n    psVar3 = *(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 "_M_mutate") (argument_list "(this,param_1,param_2,(char *)0x0,param_3)" (( "(") (identifier "this") (, ",") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (, ",") (identifier "param_3") () ")"))) (; ";")) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(string **)this" (identifier "psVar3") (= "=") (pointer_expression "*(string **)this" (* "*") (cast_expression "(string **)this" (( "(") (type_descriptor "string **" (type_identifier "string") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "this")))) (; ";")) (} "}")) (else_clause "else {\n    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }" (else "else") (compound_statement "{\n    iVar2 = iVar2 - (param_2 + param_1);\n    if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }\n  }" ({ "{") (expression_statement "iVar2 = iVar2 - (param_2 + param_1);" (assignment_expression "iVar2 = iVar2 - (param_2 + param_1)" (identifier "iVar2") (= "=") (binary_expression "iVar2 - (param_2 + param_1)" (identifier "iVar2") (- "-") (parenthesized_expression "(param_2 + param_1)" (( "(") (binary_expression "param_2 + param_1" (identifier "param_2") (+ "+") (identifier "param_1")) () ")")))) (; ";")) (if_statement "if ((iVar2 != 0) && (param_2 != param_3)) {\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }" (if "if") (parenthesized_expression "((iVar2 != 0) && (param_2 != param_3))" (( "(") (binary_expression "(iVar2 != 0) && (param_2 != param_3)" (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(param_2 != param_3)" (( "(") (binary_expression "param_2 != param_3" (identifier "param_2") (!= "!=") (identifier "param_3")) () ")"))) () ")")) (compound_statement "{\n      if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }\n    }" ({ "{") (if_statement "if (iVar2 == 1) {\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }\n      else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }" (if "if") (parenthesized_expression "(iVar2 == 1)" (( "(") (binary_expression "iVar2 == 1" (identifier "iVar2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];\n        psVar3 = *(string **)this;\n      }" ({ "{") (expression_statement "psVar3[param_3 + param_1] = psVar3[param_2 + param_1];" (assignment_expression "psVar3[param_3 + param_1] = psVar3[param_2 + param_1]" (subscript_expression "psVar3[param_3 + param_1]" (identifier "psVar3") ([ "[") (binary_expression "param_3 + param_1" (identifier "param_3") (+ "+") (identifier "param_1")) (] "]")) (= "=") (subscript_expression "psVar3[param_2 + param_1]" (identifier "psVar3") ([ "[") (binary_expression "param_2 + param_1" (identifier "param_2") (+ "+") (identifier "param_1")) (] "]"))) (; ";")) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(string **)this" (identifier "psVar3") (= "=") (pointer_expression "*(string **)this" (* "*") (cast_expression "(string **)this" (( "(") (type_descriptor "string **" (type_identifier "string") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "this")))) (; ";")) (} "}")) (else_clause "else {\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }" (else "else") (compound_statement "{\n        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;\n        psVar3 = *(string **)this;\n      }" ({ "{") (expression_statement "(*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)\n        ;" (call_expression "(*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)" (parenthesized_expression "(*(code *)PTR_memmove_004c5af8)" (( "(") (pointer_expression "*(code *)PTR_memmove_004c5af8" (* "*") (cast_expression "(code *)PTR_memmove_004c5af8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_memmove_004c5af8"))) () ")")) (argument_list "(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)" (( "(") (binary_expression "psVar3 + param_3 + param_1" (binary_expression "psVar3 + param_3" (identifier "psVar3") (+ "+") (identifier "param_3")) (+ "+") (identifier "param_1")) (, ",") (binary_expression "psVar3 + param_2 + param_1" (binary_expression "psVar3 + param_2" (identifier "psVar3") (+ "+") (identifier "param_2")) (+ "+") (identifier "param_1")) (, ",") (identifier "iVar2") () ")"))) (; ";")) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(string **)this" (identifier "psVar3") (= "=") (pointer_expression "*(string **)this" (* "*") (cast_expression "(string **)this" (( "(") (type_descriptor "string **" (type_identifier "string") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "this")))) (; ";")) (} "}")))) (} "}"))) (} "}")))) (if_statement "if (param_3 != 0) {\n    if (param_3 == 1) {\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }\n    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);\n    psVar3 = *(string **)this;\n  }" (if "if") (parenthesized_expression "(param_3 != 0)" (( "(") (binary_expression "param_3 != 0" (identifier "param_3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    if (param_3 == 1) {\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }\n    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);\n    psVar3 = *(string **)this;\n  }" ({ "{") (if_statement "if (param_3 == 1) {\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }" (if "if") (parenthesized_expression "(param_3 == 1)" (( "(") (binary_expression "param_3 == 1" (identifier "param_3") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      psVar3[param_1] = (string)param_4;\n      *(uint *)(this + 4) = uVar4;\n      *(undefined1 *)(*(int *)this + uVar4) = 0;\n      return this;\n    }" ({ "{") (expression_statement "psVar3[param_1] = (string)param_4;" (assignment_expression "psVar3[param_1] = (string)param_4" (subscript_expression "psVar3[param_1]" (identifier "psVar3") ([ "[") (identifier "param_1") (] "]")) (= "=") (cast_expression "(string)param_4" (( "(") (type_descriptor "string" (type_identifier "string")) () ")") (identifier "param_4"))) (; ";")) (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 "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(this + 4)" (( "(") (binary_expression "this + 4" (identifier "this") (+ "+") (number_literal "4")) () ")")))) (= "=") (identifier "uVar4")) (; ";")) (expression_statement "*(undefined1 *)(*(int *)this + uVar4) = 0;" (assignment_expression "*(undefined1 *)(*(int *)this + uVar4) = 0" (pointer_expression "*(undefined1 *)(*(int *)this + uVar4)" (* "*") (cast_expression "(undefined1 *)(*(int *)this + uVar4)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)this + uVar4)" (( "(") (binary_expression "*(int *)this + uVar4" (pointer_expression "*(int *)this" (* "*") (cast_expression "(int *)this" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this"))) (+ "+") (identifier "uVar4")) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return this;" (return "return") (identifier "this") (; ";")) (} "}"))) (expression_statement "(*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);" (call_expression "(*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3)" (parenthesized_expression "(*(code *)PTR_memset_004c5c68)" (( "(") (pointer_expression "*(code *)PTR_memset_004c5c68" (* "*") (cast_expression "(code *)PTR_memset_004c5c68" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_memset_004c5c68"))) () ")")) (argument_list "(psVar3 + param_1,(int)param_4,param_3)" (( "(") (binary_expression "psVar3 + param_1" (identifier "psVar3") (+ "+") (identifier "param_1")) (, ",") (cast_expression "(int)param_4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_4")) (, ",") (identifier "param_3") () ")"))) (; ";")) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(string **)this" (identifier "psVar3") (= "=") (pointer_expression "*(string **)this" (* "*") (cast_expression "(string **)this" (( "(") (type_descriptor "string **" (type_identifier "string") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (identifier "this")))) (; ";")) (} "}"))) (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 "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(this + 4)" (( "(") (binary_expression "this + 4" (identifier "this") (+ "+") (number_literal "4")) () ")")))) (= "=") (identifier "uVar4")) (; ";")) (expression_statement "psVar3[uVar4] = (string)0x0;" (assignment_expression "psVar3[uVar4] = (string)0x0" (subscript_expression "psVar3[uVar4]" (identifier "psVar3") ([ "[") (identifier "uVar4") (] "]")) (= "=") (cast_expression "(string)0x0" (( "(") (type_descriptor "string" (type_identifier "string")) () ")") (number_literal "0x0"))) (; ";")) (return_statement "return this;" (return "return") (identifier "this") (; ";")) (ERROR "}" (} "}"))

/* 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_10,type_1 var_2,type_1 var_4,char param_4)

{
  type_1 var_7;
  int var_3;
  type_2 *var_6;
  type_1 var_8;
  
  var_3 = *(int *)(var_1 + 4);
  if ((var_2 + 0x7fffffff) - var_3 < var_4) {
    var_6 = (type_2 *)(*(type_3 *)PTR___throw_length_error_004c1e74)(var_5 + -0x3b24);
    return var_6;
  }
  var_6 = *(type_2 **)var_1;
  var_8 = (var_4 - var_2) + var_3;
  if (var_6 == var_1 + 8) {
    var_7 = 0xf;
  }
  else {
    var_7 = *(type_1 *)(var_1 + 8);
  }
  if (var_7 < var_8) {
    var_9(var_1,var_10,var_2,(char *)0x0,var_4);
    var_6 = *(type_2 **)var_1;
  }
  else {
    var_3 = var_3 - (var_2 + var_10);
    if ((var_3 != 0) && (var_2 != var_4)) {
      if (var_3 == 1) {
        var_6[var_4 + var_10] = var_6[var_2 + var_10];
        var_6 = *(type_2 **)var_1;
      }
      else {
        (*(type_3 *)PTR_memmove_004c5af8)(var_6 + var_4 + var_10,var_6 + var_2 + var_10,var_3)
        ;
        var_6 = *(type_2 **)var_1;
      }
    }
  }
  if (var_4 != 0) {
    if (var_4 == 1) {
      var_6[var_10] = (type_2)param_4;
      *(type_1 *)(var_1 + 4) = var_8;
      *(type_4 *)(*(int *)var_1 + var_8) = 0;
      return var_1;
    }
    (*(type_3 *)PTR_memset_004c5c68)(var_6 + var_10,(int)param_4,var_4);
    var_6 = *(type_2 **)var_1;
  }
  *(type_1 *)(var_1 + 4) = var_8;
  var_6[var_8] = (type_2)0x0;
  return var_1;
}


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

/* std::string::MASKED(unsigned int, unsigned int, unsigned int, char) */

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

{
  uint uVar1;
  int iVar2;
  string *psVar3;
  uint uVar4;
  
  iVar2 = *(int *)(this + 4);
  if ((param_2 + 0x7fffffff) - iVar2 < param_3) {
    psVar3 = (string *)(*(code *)PTR___throw_length_error_004c1e74)(PTR_UINT_004c12dc + -0x3b24);
    return psVar3;
  }
  psVar3 = *(string **)this;
  uVar4 = (param_3 - param_2) + iVar2;
  if (psVar3 == this + 8) {
    uVar1 = 0xf;
  }
  else {
    uVar1 = *(uint *)(this + 8);
  }
  if (uVar1 < uVar4) {
    _M_mutate(this,param_1,param_2,(char *)0x0,param_3);
    psVar3 = *(string **)this;
  }
  else {
    iVar2 = iVar2 - (param_2 + param_1);
    if ((iVar2 != 0) && (param_2 != param_3)) {
      if (iVar2 == 1) {
        psVar3[param_3 + param_1] = psVar3[param_2 + param_1];
        psVar3 = *(string **)this;
      }
      else {
        (*(code *)PTR_memmove_004c5af8)(psVar3 + param_3 + param_1,psVar3 + param_2 + param_1,iVar2)
        ;
        psVar3 = *(string **)this;
      }
    }
  }
  if (param_3 != 0) {
    if (param_3 == 1) {
      psVar3[param_1] = (string)param_4;
      *(uint *)(this + 4) = uVar4;
      *(undefined1 *)(*(int *)this + uVar4) = 0;
      return this;
    }
    (*(code *)PTR_memset_004c5c68)(psVar3 + param_1,(int)param_4,param_3);
    psVar3 = *(string **)this;
  }
  *(uint *)(this + 4) = uVar4;
  psVar3[uVar4] = (string)0x0;
  return this;
}

