
/* std::string::insert(unsigned long, char const*, unsigned long) */

string * __thiscall std::string::insert(string *this,ulong param_1,char *param_2,ulong param_3)

{
  undefined1 *__src;
  undefined1 *__src_00;
  char *pcVar1;
  ulong uVar2;
  long lVar3;
  string *psVar4;
  undefined1 *__dest;
  size_t __n;
  size_t __n_00;
  
  pcVar1 = *(char **)this;
  uVar2 = *(ulong *)(pcVar1 + -0x18);
  if (uVar2 < param_1) {
                    /* WARNING: Subroutine does not return */
    __throw_out_of_range_fmt
              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",
               param_1);
  }
  if (param_3 <= 0x3ffffffffffffff9 - uVar2) {
    if (((pcVar1 <= param_2) && (param_2 <= pcVar1 + uVar2)) && (*(int *)(pcVar1 + -8) < 1)) {
      lVar3 = *(long *)this;
      _M_mutate(this,param_1,0,param_3);
      __src = (undefined1 *)(*(long *)this + ((long)param_2 - lVar3));
      __dest = (undefined1 *)(*(long *)this + param_1);
      __src_00 = __src + param_3;
      if (__dest < __src_00) {
        if (__src < __dest) {
          __n_00 = param_1 - ((long)param_2 - lVar3);
          if (__n_00 == 1) {
            *__dest = *__src;
          }
          else if (__n_00 != 0) {
            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);
          }
          __n = param_3 - __n_00;
          if (__n == 1) {
            __dest[__n_00] = __dest[param_3];
          }
          else if (__n != 0) {
            memcpy(__dest + __n_00,__dest + param_3,__n);
          }
        }
        else if (param_3 == 1) {
          *__dest = *__src_00;
        }
        else if (param_3 != 0) {
          memcpy(__dest,__src_00,param_3);
        }
      }
      else if (param_3 == 1) {
        *__dest = *__src;
      }
      else if (param_3 != 0) {
        memcpy(__dest,__src,param_3);
      }
      return this;
    }
    psVar4 = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);
    return psVar4;
  }
                    /* WARNING: Subroutine does not return */
  __throw_length_error("basic_string::insert");
}



ulong * FUN_0030e4a0(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)

{
  undefined1 *__src;
  undefined1 *__src_00;
  ulong uVar1;
  ulong uVar2;
  ulong *puVar3;
  undefined1 *__dest;
  size_t __n;
  size_t __n_00;
  
  uVar1 = *param_1;
  uVar2 = *(ulong *)(uVar1 - 0x18);
  if (uVar2 < param_2) {
                    /* WARNING: Subroutine does not return */
    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",
                 param_2);
  }
  if (param_4 <= 0x3ffffffffffffff9 - uVar2) {
    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {
      uVar1 = *param_1;
      FUN_0030dbd0(param_1,param_2,0,param_4);
      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));
      __dest = (undefined1 *)(*param_1 + param_2);
      __src_00 = __src + param_4;
      if (__dest < __src_00) {
        if (__src < __dest) {
          __n_00 = param_2 - (param_3 - uVar1);
          if (__n_00 == 1) {
            *__dest = *__src;
          }
          else if (__n_00 != 0) {
            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);
          }
          __n = param_4 - __n_00;
          if (__n == 1) {
            __dest[__n_00] = __dest[param_4];
          }
          else if (__n != 0) {
            memcpy(__dest + __n_00,__dest + param_4,__n);
          }
        }
        else if (param_4 == 1) {
          *__dest = *__src_00;
        }
        else if (param_4 != 0) {
          memcpy(__dest,__src_00,param_4);
        }
      }
      else if (param_4 == 1) {
        *__dest = *__src;
      }
      else if (param_4 != 0) {
        memcpy(__dest,__src,param_4);
      }
      return param_1;
    }
    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);
    return puVar3;
  }
                    /* WARNING: Subroutine does not return */
  FUN_003195a0("basic_string::insert");
}


PUSH R12
MOV R12,RSI
MOV R8,RCX
PUSH RBP
PUSH RBX
SUB RSP,0x10
MOV RSI,qword ptr [RDI]
MOV RCX,qword ptr [RSI + -0x18]
CMP R12,RCX
JA 0x0030e5f4
MOV RAX,0x3ffffffffffffff9
SUB RAX,RCX
CMP R8,RAX
JA 0x0030e5e8
MOV RBP,RDI
CMP RSI,RDX
JA 0x0030e4eb
ADD RCX,RSI
CMP RDX,RCX
JA 0x0030e4eb
MOV EAX,dword ptr [RSI + -0x8]
TEST EAX,EAX
JLE 0x0030e508
ADD RSP,0x10
MOV RCX,RDX
MOV RSI,R12
MOV RDI,RBP
POP RBX
XOR EDX,EDX
POP RBP
POP R12
JMP 0x0030e270
MOV RCX,R8
MOV RBX,RDX
MOV RSI,R12
XOR EDX,EDX
SUB RBX,qword ptr [RDI]
MOV qword ptr [RSP + 0x8],R8
CALL 0x0030dbd0
MOV RCX,qword ptr [RBP]
MOV R8,qword ptr [RSP + 0x8]
LEA RSI,[RCX + RBX*0x1]
ADD RCX,R12
LEA RAX,[RSI + R8*0x1]
CMP RAX,RCX
JA 0x0030e560
CMP R8,0x1
JZ 0x0030e5c6
TEST R8,R8
JZ 0x0030e553
MOV RDX,R8
MOV RDI,RCX
CALL 0x00147aa0
ADD RSP,0x10
MOV RAX,RBP
POP RBX
POP RBP
POP R12
RET
CMP RSI,RCX
JC 0x0030e580
CMP R8,0x1
JZ 0x0030e5d4
TEST R8,R8
JZ 0x0030e553
MOV RDX,R8
MOV RSI,RAX
MOV RDI,RCX
CALL 0x00147aa0
JMP 0x0030e553
SUB R12,RBX
CMP R12,0x1
JZ 0x0030e5cd
TEST R12,R12
JZ 0x0030e5a6
MOV RDI,RCX
MOV RDX,R12
MOV qword ptr [RSP + 0x8],R8
CALL 0x00147aa0
MOV R8,qword ptr [RSP + 0x8]
MOV RCX,RAX
MOV RDX,R8
LEA RSI,[RCX + R8*0x1]
LEA RDI,[RCX + R12*0x1]
SUB RDX,R12
CMP RDX,0x1
JZ 0x0030e5de
TEST RDX,RDX
JZ 0x0030e553
CALL 0x00147aa0
JMP 0x0030e553
MOVZX EAX,byte ptr [RSI]
MOV byte ptr [RCX],AL
JMP 0x0030e553
MOVZX EAX,byte ptr [RSI]
MOV byte ptr [RCX],AL
JMP 0x0030e5a6
MOVZX EAX,byte ptr [RAX]
MOV byte ptr [RCX],AL
JMP 0x0030e553
MOVZX EAX,byte ptr [RSI]
MOV byte ptr [RDI],AL
JMP 0x0030e553
LEA RDI,[0x391151]
CALL 0x003195a0
MOV RDX,R12
LEA RSI,[0x391151]
LEA RDI,[0x376b80]
XOR EAX,EAX
CALL 0x00319620
(translation_unit "ulong * FUN_0030e4a0(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)\n\n{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  ulong uVar1;\n  ulong uVar2;\n  ulong *puVar3;\n  undefined1 *__dest;\n  size_t __n;\n  size_t __n_00;\n  \n  uVar1 = *param_1;\n  uVar2 = *(ulong *)(uVar1 - 0x18);\n  if (uVar2 < param_2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_003195a0("basic_string::insert");\n}\n\n" (function_definition "ulong * FUN_0030e4a0(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)\n\n{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  ulong uVar1;\n  ulong uVar2;\n  ulong *puVar3;\n  undefined1 *__dest;\n  size_t __n;\n  size_t __n_00;\n  \n  uVar1 = *param_1;\n  uVar2 = *(ulong *)(uVar1 - 0x18);\n  if (uVar2 < param_2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_003195a0("basic_string::insert");\n}" type_identifier (pointer_declarator "* FUN_0030e4a0(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" * (function_declarator "FUN_0030e4a0(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" identifier (parameter_list "(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" ( (parameter_declaration "ulong *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "ulong param_2" type_identifier identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) , (parameter_declaration "ulong param_4" type_identifier identifier) )))) (compound_statement "{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  ulong uVar1;\n  ulong uVar2;\n  ulong *puVar3;\n  undefined1 *__dest;\n  size_t __n;\n  size_t __n_00;\n  \n  uVar1 = *param_1;\n  uVar2 = *(ulong *)(uVar1 - 0x18);\n  if (uVar2 < param_2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_003195a0("basic_string::insert");\n}" { (declaration "undefined1 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "undefined1 *__src_00;" type_identifier (pointer_declarator "*__src_00" * identifier) ;) (declaration "ulong uVar1;" type_identifier identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "ulong *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "size_t __n_00;" primitive_type identifier ;) (expression_statement "uVar1 = *param_1;" (assignment_expression "uVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar2 = *(ulong *)(uVar1 - 0x18);" (assignment_expression "uVar2 = *(ulong *)(uVar1 - 0x18)" identifier = (pointer_expression "*(ulong *)(uVar1 - 0x18)" * (cast_expression "(ulong *)(uVar1 - 0x18)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 - 0x18)" ( (binary_expression "uVar1 - 0x18" identifier - number_literal) ))))) ;) (if_statement "if (uVar2 < param_2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }" if (parenthesized_expression "(uVar2 < param_2)" ( (binary_expression "uVar2 < param_2" identifier < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }" { comment (expression_statement "FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);" (call_expression "FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::insert"" " string_content ") , identifier ))) ;) })) (if_statement "if (param_4 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }" if (parenthesized_expression "(param_4 <= 0x3ffffffffffffff9 - uVar2)" ( (binary_expression "param_4 <= 0x3ffffffffffffff9 - uVar2" identifier <= (binary_expression "0x3ffffffffffffff9 - uVar2" number_literal - identifier)) )) (compound_statement "{\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }" { (if_statement "if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }" if (parenthesized_expression "(((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1))" ( (binary_expression "((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)" (parenthesized_expression "((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1))" ( (binary_expression "(uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)" (parenthesized_expression "(uVar1 <= param_3)" ( (binary_expression "uVar1 <= param_3" identifier <= identifier) )) && (parenthesized_expression "(param_3 <= uVar2 + uVar1)" ( (binary_expression "param_3 <= uVar2 + uVar1" identifier <= (binary_expression "uVar2 + uVar1" identifier + identifier)) ))) )) && (parenthesized_expression "(*(int *)(uVar1 - 8) < 1)" ( (binary_expression "*(int *)(uVar1 - 8) < 1" (pointer_expression "*(int *)(uVar1 - 8)" * (cast_expression "(int *)(uVar1 - 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 - 8)" ( (binary_expression "uVar1 - 8" identifier - number_literal) )))) < number_literal) ))) )) (compound_statement "{\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }" { (expression_statement "uVar1 = *param_1;" (assignment_expression "uVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "FUN_0030dbd0(param_1,param_2,0,param_4);" (call_expression "FUN_0030dbd0(param_1,param_2,0,param_4)" identifier (argument_list "(param_1,param_2,0,param_4)" ( identifier , identifier , number_literal , identifier ))) ;) (expression_statement "__src = (undefined1 *)(*param_1 + (param_3 - uVar1));" (assignment_expression "__src = (undefined1 *)(*param_1 + (param_3 - uVar1))" identifier = (cast_expression "(undefined1 *)(*param_1 + (param_3 - uVar1))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + (param_3 - uVar1))" ( (binary_expression "*param_1 + (param_3 - uVar1)" (pointer_expression "*param_1" * identifier) + (parenthesized_expression "(param_3 - uVar1)" ( (binary_expression "param_3 - uVar1" identifier - identifier) ))) )))) ;) (expression_statement "__dest = (undefined1 *)(*param_1 + param_2);" (assignment_expression "__dest = (undefined1 *)(*param_1 + param_2)" identifier = (cast_expression "(undefined1 *)(*param_1 + param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + param_2)" ( (binary_expression "*param_1 + param_2" (pointer_expression "*param_1" * identifier) + identifier) )))) ;) (expression_statement "__src_00 = __src + param_4;" (assignment_expression "__src_00 = __src + param_4" identifier = (binary_expression "__src + param_4" identifier + identifier)) ;) (if_statement "if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" if (parenthesized_expression "(__dest < __src_00)" ( (binary_expression "__dest < __src_00" identifier < identifier) )) (compound_statement "{\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }" { (if_statement "if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" if (parenthesized_expression "(__src < __dest)" ( (binary_expression "__src < __dest" identifier < identifier) )) (compound_statement "{\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }" { (expression_statement "__n_00 = param_2 - (param_3 - uVar1);" (assignment_expression "__n_00 = param_2 - (param_3 - uVar1)" identifier = (binary_expression "param_2 - (param_3 - uVar1)" identifier - (parenthesized_expression "(param_3 - uVar1)" ( (binary_expression "param_3 - uVar1" identifier - identifier) )))) ;) (if_statement "if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" if (parenthesized_expression "(__n_00 == 1)" ( (binary_expression "__n_00 == 1" identifier == number_literal) )) (compound_statement "{\n            *__dest = *__src;\n          }" { (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src" * identifier)) ;) }) (else_clause "else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" else (if_statement "if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" if (parenthesized_expression "(__n_00 != 0)" ( (binary_expression "__n_00 != 0" identifier != number_literal) )) (compound_statement "{\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" { (expression_statement "__dest = (undefined1 *)memcpy(__dest,__src,__n_00);" (assignment_expression "__dest = (undefined1 *)memcpy(__dest,__src,__n_00)" identifier = (cast_expression "(undefined1 *)memcpy(__dest,__src,__n_00)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "memcpy(__dest,__src,__n_00)" identifier (argument_list "(__dest,__src,__n_00)" ( identifier , identifier , identifier ))))) ;) })))) (expression_statement "__n = param_4 - __n_00;" (assignment_expression "__n = param_4 - __n_00" identifier = (binary_expression "param_4 - __n_00" identifier - identifier)) ;) (if_statement "if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n            __dest[__n_00] = __dest[param_4];\n          }" { (expression_statement "__dest[__n_00] = __dest[param_4];" (assignment_expression "__dest[__n_00] = __dest[param_4]" (subscript_expression "__dest[__n_00]" identifier [ identifier ]) = (subscript_expression "__dest[param_4]" identifier [ identifier ])) ;) }) (else_clause "else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" else (if_statement "if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" { (expression_statement "memcpy(__dest + __n_00,__dest + param_4,__n);" (call_expression "memcpy(__dest + __n_00,__dest + param_4,__n)" identifier (argument_list "(__dest + __n_00,__dest + param_4,__n)" ( (binary_expression "__dest + __n_00" identifier + identifier) , (binary_expression "__dest + param_4" identifier + identifier) , identifier ))) ;) })))) }) (else_clause "else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" else (if_statement "if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n          *__dest = *__src_00;\n        }" { (expression_statement "*__dest = *__src_00;" (assignment_expression "*__dest = *__src_00" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src_00" * identifier)) ;) }) (else_clause "else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" else (if_statement "if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n          memcpy(__dest,__src_00,param_4);\n        }" { (expression_statement "memcpy(__dest,__src_00,param_4);" (call_expression "memcpy(__dest,__src_00,param_4)" identifier (argument_list "(__dest,__src_00,param_4)" ( identifier , identifier , identifier ))) ;) })))))) }) (else_clause "else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" else (if_statement "if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *__dest = *__src;\n      }" { (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src" * identifier)) ;) }) (else_clause "else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" else (if_statement "if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n        memcpy(__dest,__src,param_4);\n      }" { (expression_statement "memcpy(__dest,__src,param_4);" (call_expression "memcpy(__dest,__src,param_4)" identifier (argument_list "(__dest,__src,param_4)" ( identifier , identifier , identifier ))) ;) })))))) (return_statement "return param_1;" return identifier ;) })) (expression_statement "puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);" (assignment_expression "puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3)" identifier = (cast_expression "(ulong *)FUN_0030e270(param_1,param_2,0,param_3)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0030e270(param_1,param_2,0,param_3)" identifier (argument_list "(param_1,param_2,0,param_3)" ( identifier , identifier , number_literal , identifier ))))) ;) (return_statement "return puVar3;" return identifier ;) })) comment (expression_statement "FUN_003195a0("basic_string::insert");" (call_expression "FUN_003195a0("basic_string::insert")" identifier (argument_list "("basic_string::insert")" ( (string_literal ""basic_string::insert"" " string_content ") ))) ;) })))
(translation_unit "/* std::string::insert(unsigned long, char const*, unsigned long) */\n\nstring * __thiscall std::string::insert(string *this,ulong param_1,char *param_2,ulong param_3)\n\n{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  char *pcVar1;\n  ulong uVar2;\n  long lVar3;\n  string *psVar4;\n  undefined1 *__dest;\n  size_t __n;\n  size_t __n_00;\n  \n  pcVar1 = *(char **)this;\n  uVar2 = *(ulong *)(pcVar1 + -0x18);\n  if (uVar2 < param_1) {\n                    /* WARNING: Subroutine does not return */\n    __throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n               param_1);\n  }\n  if (param_3 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((pcVar1 <= param_2) && (param_2 <= pcVar1 + uVar2)) && (*(int *)(pcVar1 + -8) < 1)) {\n      lVar3 = *(long *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src = (undefined1 *)(*(long *)this + ((long)param_2 - lVar3));\n      __dest = (undefined1 *)(*(long *)this + param_1);\n      __src_00 = __src + param_3;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_1 - ((long)param_2 - lVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src,param_3);\n      }\n      return this;\n    }\n    psVar4 = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    return psVar4;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_length_error("basic_string::insert");\n}\n\n" comment (ERROR "string * __thiscall std::string::insert(string *this,ulong param_1,char *param_2,ulong param_3)" (binary_expression "string * __thiscall std::string::insert(string *this" (binary_expression "string * __thiscall" identifier * identifier) (ERROR "std::string::insert(string" identifier : : identifier : : identifier ( identifier) * identifier) , type_identifier identifier , (ERROR "char" identifier) (pointer_declarator "*param_2" * identifier) , identifier identifier )) (compound_statement "{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  char *pcVar1;\n  ulong uVar2;\n  long lVar3;\n  string *psVar4;\n  undefined1 *__dest;\n  size_t __n;\n  size_t __n_00;\n  \n  pcVar1 = *(char **)this;\n  uVar2 = *(ulong *)(pcVar1 + -0x18);\n  if (uVar2 < param_1) {\n                    /* WARNING: Subroutine does not return */\n    __throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n               param_1);\n  }\n  if (param_3 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((pcVar1 <= param_2) && (param_2 <= pcVar1 + uVar2)) && (*(int *)(pcVar1 + -8) < 1)) {\n      lVar3 = *(long *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src = (undefined1 *)(*(long *)this + ((long)param_2 - lVar3));\n      __dest = (undefined1 *)(*(long *)this + param_1);\n      __src_00 = __src + param_3;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_1 - ((long)param_2 - lVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src,param_3);\n      }\n      return this;\n    }\n    psVar4 = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    return psVar4;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_length_error("basic_string::insert");\n}" { (declaration "undefined1 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "undefined1 *__src_00;" type_identifier (pointer_declarator "*__src_00" * identifier) ;) (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "string *psVar4;" type_identifier (pointer_declarator "*psVar4" * identifier) ;) (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "size_t __n_00;" primitive_type identifier ;) (expression_statement "pcVar1 = *(char **)this;" (assignment_expression "pcVar1 = *(char **)this" identifier = (pointer_expression "*(char **)this" * (cast_expression "(char **)this" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "uVar2 = *(ulong *)(pcVar1 + -0x18);" (assignment_expression "uVar2 = *(ulong *)(pcVar1 + -0x18)" identifier = (pointer_expression "*(ulong *)(pcVar1 + -0x18)" * (cast_expression "(ulong *)(pcVar1 + -0x18)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar1 + -0x18)" ( (binary_expression "pcVar1 + -0x18" identifier + number_literal) ))))) ;) (if_statement "if (uVar2 < param_1) {\n                    /* WARNING: Subroutine does not return */\n    __throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n               param_1);\n  }" if (parenthesized_expression "(uVar2 < param_1)" ( (binary_expression "uVar2 < param_1" identifier < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n               param_1);\n  }" { comment (expression_statement "__throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n               param_1);" (call_expression "__throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n               param_1)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n               param_1)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::insert"" " string_content ") , identifier ))) ;) })) (if_statement "if (param_3 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((pcVar1 <= param_2) && (param_2 <= pcVar1 + uVar2)) && (*(int *)(pcVar1 + -8) < 1)) {\n      lVar3 = *(long *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src = (undefined1 *)(*(long *)this + ((long)param_2 - lVar3));\n      __dest = (undefined1 *)(*(long *)this + param_1);\n      __src_00 = __src + param_3;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_1 - ((long)param_2 - lVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src,param_3);\n      }\n      return this;\n    }\n    psVar4 = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    return psVar4;\n  }" if (parenthesized_expression "(param_3 <= 0x3ffffffffffffff9 - uVar2)" ( (binary_expression "param_3 <= 0x3ffffffffffffff9 - uVar2" identifier <= (binary_expression "0x3ffffffffffffff9 - uVar2" number_literal - identifier)) )) (compound_statement "{\n    if (((pcVar1 <= param_2) && (param_2 <= pcVar1 + uVar2)) && (*(int *)(pcVar1 + -8) < 1)) {\n      lVar3 = *(long *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src = (undefined1 *)(*(long *)this + ((long)param_2 - lVar3));\n      __dest = (undefined1 *)(*(long *)this + param_1);\n      __src_00 = __src + param_3;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_1 - ((long)param_2 - lVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src,param_3);\n      }\n      return this;\n    }\n    psVar4 = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    return psVar4;\n  }" { (if_statement "if (((pcVar1 <= param_2) && (param_2 <= pcVar1 + uVar2)) && (*(int *)(pcVar1 + -8) < 1)) {\n      lVar3 = *(long *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src = (undefined1 *)(*(long *)this + ((long)param_2 - lVar3));\n      __dest = (undefined1 *)(*(long *)this + param_1);\n      __src_00 = __src + param_3;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_1 - ((long)param_2 - lVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src,param_3);\n      }\n      return this;\n    }" if (parenthesized_expression "(((pcVar1 <= param_2) && (param_2 <= pcVar1 + uVar2)) && (*(int *)(pcVar1 + -8) < 1))" ( (binary_expression "((pcVar1 <= param_2) && (param_2 <= pcVar1 + uVar2)) && (*(int *)(pcVar1 + -8) < 1)" (parenthesized_expression "((pcVar1 <= param_2) && (param_2 <= pcVar1 + uVar2))" ( (binary_expression "(pcVar1 <= param_2) && (param_2 <= pcVar1 + uVar2)" (parenthesized_expression "(pcVar1 <= param_2)" ( (binary_expression "pcVar1 <= param_2" identifier <= identifier) )) && (parenthesized_expression "(param_2 <= pcVar1 + uVar2)" ( (binary_expression "param_2 <= pcVar1 + uVar2" identifier <= (binary_expression "pcVar1 + uVar2" identifier + identifier)) ))) )) && (parenthesized_expression "(*(int *)(pcVar1 + -8) < 1)" ( (binary_expression "*(int *)(pcVar1 + -8) < 1" (pointer_expression "*(int *)(pcVar1 + -8)" * (cast_expression "(int *)(pcVar1 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar1 + -8)" ( (binary_expression "pcVar1 + -8" identifier + number_literal) )))) < number_literal) ))) )) (compound_statement "{\n      lVar3 = *(long *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src = (undefined1 *)(*(long *)this + ((long)param_2 - lVar3));\n      __dest = (undefined1 *)(*(long *)this + param_1);\n      __src_00 = __src + param_3;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_1 - ((long)param_2 - lVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src,param_3);\n      }\n      return this;\n    }" { (expression_statement "lVar3 = *(long *)this;" (assignment_expression "lVar3 = *(long *)this" identifier = (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "_M_mutate(this,param_1,0,param_3);" (call_expression "_M_mutate(this,param_1,0,param_3)" identifier (argument_list "(this,param_1,0,param_3)" ( identifier , identifier , number_literal , identifier ))) ;) (expression_statement "__src = (undefined1 *)(*(long *)this + ((long)param_2 - lVar3));" (assignment_expression "__src = (undefined1 *)(*(long *)this + ((long)param_2 - lVar3))" identifier = (cast_expression "(undefined1 *)(*(long *)this + ((long)param_2 - lVar3))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(long *)this + ((long)param_2 - lVar3))" ( (binary_expression "*(long *)this + ((long)param_2 - lVar3)" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + (parenthesized_expression "((long)param_2 - lVar3)" ( (binary_expression "(long)param_2 - lVar3" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - identifier) ))) )))) ;) (expression_statement "__dest = (undefined1 *)(*(long *)this + param_1);" (assignment_expression "__dest = (undefined1 *)(*(long *)this + param_1)" identifier = (cast_expression "(undefined1 *)(*(long *)this + param_1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(long *)this + param_1)" ( (binary_expression "*(long *)this + param_1" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + identifier) )))) ;) (expression_statement "__src_00 = __src + param_3;" (assignment_expression "__src_00 = __src + param_3" identifier = (binary_expression "__src + param_3" identifier + identifier)) ;) (if_statement "if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_1 - ((long)param_2 - lVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src,param_3);\n      }" if (parenthesized_expression "(__dest < __src_00)" ( (binary_expression "__dest < __src_00" identifier < identifier) )) (compound_statement "{\n        if (__src < __dest) {\n          __n_00 = param_1 - ((long)param_2 - lVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }\n      }" { (if_statement "if (__src < __dest) {\n          __n_00 = param_1 - ((long)param_2 - lVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }" if (parenthesized_expression "(__src < __dest)" ( (binary_expression "__src < __dest" identifier < identifier) )) (compound_statement "{\n          __n_00 = param_1 - ((long)param_2 - lVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }" { (expression_statement "__n_00 = param_1 - ((long)param_2 - lVar3);" (assignment_expression "__n_00 = param_1 - ((long)param_2 - lVar3)" identifier = (binary_expression "param_1 - ((long)param_2 - lVar3)" identifier - (parenthesized_expression "((long)param_2 - lVar3)" ( (binary_expression "(long)param_2 - lVar3" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - identifier) )))) ;) (if_statement "if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" if (parenthesized_expression "(__n_00 == 1)" ( (binary_expression "__n_00 == 1" identifier == number_literal) )) (compound_statement "{\n            *__dest = *__src;\n          }" { (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src" * identifier)) ;) }) (else_clause "else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" else (if_statement "if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" if (parenthesized_expression "(__n_00 != 0)" ( (binary_expression "__n_00 != 0" identifier != number_literal) )) (compound_statement "{\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" { (expression_statement "__dest = (undefined1 *)memcpy(__dest,__src,__n_00);" (assignment_expression "__dest = (undefined1 *)memcpy(__dest,__src,__n_00)" identifier = (cast_expression "(undefined1 *)memcpy(__dest,__src,__n_00)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "memcpy(__dest,__src,__n_00)" identifier (argument_list "(__dest,__src,__n_00)" ( identifier , identifier , identifier ))))) ;) })))) (expression_statement "__n = param_3 - __n_00;" (assignment_expression "__n = param_3 - __n_00" identifier = (binary_expression "param_3 - __n_00" identifier - identifier)) ;) (if_statement "if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n            __dest[__n_00] = __dest[param_3];\n          }" { (expression_statement "__dest[__n_00] = __dest[param_3];" (assignment_expression "__dest[__n_00] = __dest[param_3]" (subscript_expression "__dest[__n_00]" identifier [ identifier ]) = (subscript_expression "__dest[param_3]" identifier [ identifier ])) ;) }) (else_clause "else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }" else (if_statement "if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }" { (expression_statement "memcpy(__dest + __n_00,__dest + param_3,__n);" (call_expression "memcpy(__dest + __n_00,__dest + param_3,__n)" identifier (argument_list "(__dest + __n_00,__dest + param_3,__n)" ( (binary_expression "__dest + __n_00" identifier + identifier) , (binary_expression "__dest + param_3" identifier + identifier) , identifier ))) ;) })))) }) (else_clause "else if (param_3 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }" else (if_statement "if (param_3 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n          *__dest = *__src_00;\n        }" { (expression_statement "*__dest = *__src_00;" (assignment_expression "*__dest = *__src_00" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src_00" * identifier)) ;) }) (else_clause "else if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }" else (if_statement "if (param_3 != 0) {\n          memcpy(__dest,__src_00,param_3);\n        }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n          memcpy(__dest,__src_00,param_3);\n        }" { (expression_statement "memcpy(__dest,__src_00,param_3);" (call_expression "memcpy(__dest,__src_00,param_3)" identifier (argument_list "(__dest,__src_00,param_3)" ( identifier , identifier , identifier ))) ;) })))))) }) (else_clause "else if (param_3 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src,param_3);\n      }" else (if_statement "if (param_3 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src,param_3);\n      }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n        *__dest = *__src;\n      }" { (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src" * identifier)) ;) }) (else_clause "else if (param_3 != 0) {\n        memcpy(__dest,__src,param_3);\n      }" else (if_statement "if (param_3 != 0) {\n        memcpy(__dest,__src,param_3);\n      }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n        memcpy(__dest,__src,param_3);\n      }" { (expression_statement "memcpy(__dest,__src,param_3);" (call_expression "memcpy(__dest,__src,param_3)" identifier (argument_list "(__dest,__src,param_3)" ( identifier , identifier , identifier ))) ;) })))))) (return_statement "return this;" return identifier ;) })) (expression_statement "psVar4 = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);" (assignment_expression "psVar4 = (string *)_M_replace_safe(this,param_1,0,param_2,param_3)" identifier = (cast_expression "(string *)_M_replace_safe(this,param_1,0,param_2,param_3)" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "_M_replace_safe(this,param_1,0,param_2,param_3)" identifier (argument_list "(this,param_1,0,param_2,param_3)" ( identifier , identifier , number_literal , identifier , identifier ))))) ;) (return_statement "return psVar4;" return identifier ;) })) comment (expression_statement "__throw_length_error("basic_string::insert");" (call_expression "__throw_length_error("basic_string::insert")" identifier (argument_list "("basic_string::insert")" ( (string_literal ""basic_string::insert"" " string_content ") ))) ;) }))
(translation_unit "ulong * FUN_0030e4a0(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)\n\n{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  ulong uVar1;\n  ulong uVar2;\n  ulong *puVar3;\n  undefined1 *__dest;\n  size_t __n;\n  size_t __n_00;\n  \n  uVar1 = *param_1;\n  uVar2 = *(ulong *)(uVar1 - 0x18);\n  if (uVar2 < param_2) {\n                    \n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }\n                    \n  FUN_003195a0("basic_string::insert");\n}\n\n" (function_definition "ulong * FUN_0030e4a0(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)\n\n{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  ulong uVar1;\n  ulong uVar2;\n  ulong *puVar3;\n  undefined1 *__dest;\n  size_t __n;\n  size_t __n_00;\n  \n  uVar1 = *param_1;\n  uVar2 = *(ulong *)(uVar1 - 0x18);\n  if (uVar2 < param_2) {\n                    \n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }\n                    \n  FUN_003195a0("basic_string::insert");\n}" type_identifier (pointer_declarator "* FUN_0030e4a0(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" * (function_declarator "FUN_0030e4a0(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" identifier (parameter_list "(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" ( (parameter_declaration "ulong *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "ulong param_2" type_identifier identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) , (parameter_declaration "ulong param_4" type_identifier identifier) )))) (compound_statement "{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  ulong uVar1;\n  ulong uVar2;\n  ulong *puVar3;\n  undefined1 *__dest;\n  size_t __n;\n  size_t __n_00;\n  \n  uVar1 = *param_1;\n  uVar2 = *(ulong *)(uVar1 - 0x18);\n  if (uVar2 < param_2) {\n                    \n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }\n                    \n  FUN_003195a0("basic_string::insert");\n}" { (declaration "undefined1 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "undefined1 *__src_00;" type_identifier (pointer_declarator "*__src_00" * identifier) ;) (declaration "ulong uVar1;" type_identifier identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "ulong *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "size_t __n_00;" primitive_type identifier ;) (expression_statement "uVar1 = *param_1;" (assignment_expression "uVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar2 = *(ulong *)(uVar1 - 0x18);" (assignment_expression "uVar2 = *(ulong *)(uVar1 - 0x18)" identifier = (pointer_expression "*(ulong *)(uVar1 - 0x18)" * (cast_expression "(ulong *)(uVar1 - 0x18)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 - 0x18)" ( (binary_expression "uVar1 - 0x18" identifier - number_literal) ))))) ;) (if_statement "if (uVar2 < param_2) {\n                    \n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }" if (parenthesized_expression "(uVar2 < param_2)" ( (binary_expression "uVar2 < param_2" identifier < identifier) )) (compound_statement "{\n                    \n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }" { (expression_statement "FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);" (call_expression "FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::insert"" " string_content ") , identifier ))) ;) })) (if_statement "if (param_4 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }" if (parenthesized_expression "(param_4 <= 0x3ffffffffffffff9 - uVar2)" ( (binary_expression "param_4 <= 0x3ffffffffffffff9 - uVar2" identifier <= (binary_expression "0x3ffffffffffffff9 - uVar2" number_literal - identifier)) )) (compound_statement "{\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }" { (if_statement "if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }" if (parenthesized_expression "(((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1))" ( (binary_expression "((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)" (parenthesized_expression "((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1))" ( (binary_expression "(uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)" (parenthesized_expression "(uVar1 <= param_3)" ( (binary_expression "uVar1 <= param_3" identifier <= identifier) )) && (parenthesized_expression "(param_3 <= uVar2 + uVar1)" ( (binary_expression "param_3 <= uVar2 + uVar1" identifier <= (binary_expression "uVar2 + uVar1" identifier + identifier)) ))) )) && (parenthesized_expression "(*(int *)(uVar1 - 8) < 1)" ( (binary_expression "*(int *)(uVar1 - 8) < 1" (pointer_expression "*(int *)(uVar1 - 8)" * (cast_expression "(int *)(uVar1 - 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 - 8)" ( (binary_expression "uVar1 - 8" identifier - number_literal) )))) < number_literal) ))) )) (compound_statement "{\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }" { (expression_statement "uVar1 = *param_1;" (assignment_expression "uVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "FUN_0030dbd0(param_1,param_2,0,param_4);" (call_expression "FUN_0030dbd0(param_1,param_2,0,param_4)" identifier (argument_list "(param_1,param_2,0,param_4)" ( identifier , identifier , number_literal , identifier ))) ;) (expression_statement "__src = (undefined1 *)(*param_1 + (param_3 - uVar1));" (assignment_expression "__src = (undefined1 *)(*param_1 + (param_3 - uVar1))" identifier = (cast_expression "(undefined1 *)(*param_1 + (param_3 - uVar1))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + (param_3 - uVar1))" ( (binary_expression "*param_1 + (param_3 - uVar1)" (pointer_expression "*param_1" * identifier) + (parenthesized_expression "(param_3 - uVar1)" ( (binary_expression "param_3 - uVar1" identifier - identifier) ))) )))) ;) (expression_statement "__dest = (undefined1 *)(*param_1 + param_2);" (assignment_expression "__dest = (undefined1 *)(*param_1 + param_2)" identifier = (cast_expression "(undefined1 *)(*param_1 + param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + param_2)" ( (binary_expression "*param_1 + param_2" (pointer_expression "*param_1" * identifier) + identifier) )))) ;) (expression_statement "__src_00 = __src + param_4;" (assignment_expression "__src_00 = __src + param_4" identifier = (binary_expression "__src + param_4" identifier + identifier)) ;) (if_statement "if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" if (parenthesized_expression "(__dest < __src_00)" ( (binary_expression "__dest < __src_00" identifier < identifier) )) (compound_statement "{\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }" { (if_statement "if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" if (parenthesized_expression "(__src < __dest)" ( (binary_expression "__src < __dest" identifier < identifier) )) (compound_statement "{\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }" { (expression_statement "__n_00 = param_2 - (param_3 - uVar1);" (assignment_expression "__n_00 = param_2 - (param_3 - uVar1)" identifier = (binary_expression "param_2 - (param_3 - uVar1)" identifier - (parenthesized_expression "(param_3 - uVar1)" ( (binary_expression "param_3 - uVar1" identifier - identifier) )))) ;) (if_statement "if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" if (parenthesized_expression "(__n_00 == 1)" ( (binary_expression "__n_00 == 1" identifier == number_literal) )) (compound_statement "{\n            *__dest = *__src;\n          }" { (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src" * identifier)) ;) }) (else_clause "else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" else (if_statement "if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" if (parenthesized_expression "(__n_00 != 0)" ( (binary_expression "__n_00 != 0" identifier != number_literal) )) (compound_statement "{\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" { (expression_statement "__dest = (undefined1 *)memcpy(__dest,__src,__n_00);" (assignment_expression "__dest = (undefined1 *)memcpy(__dest,__src,__n_00)" identifier = (cast_expression "(undefined1 *)memcpy(__dest,__src,__n_00)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "memcpy(__dest,__src,__n_00)" identifier (argument_list "(__dest,__src,__n_00)" ( identifier , identifier , identifier ))))) ;) })))) (expression_statement "__n = param_4 - __n_00;" (assignment_expression "__n = param_4 - __n_00" identifier = (binary_expression "param_4 - __n_00" identifier - identifier)) ;) (if_statement "if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n            __dest[__n_00] = __dest[param_4];\n          }" { (expression_statement "__dest[__n_00] = __dest[param_4];" (assignment_expression "__dest[__n_00] = __dest[param_4]" (subscript_expression "__dest[__n_00]" identifier [ identifier ]) = (subscript_expression "__dest[param_4]" identifier [ identifier ])) ;) }) (else_clause "else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" else (if_statement "if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" { (expression_statement "memcpy(__dest + __n_00,__dest + param_4,__n);" (call_expression "memcpy(__dest + __n_00,__dest + param_4,__n)" identifier (argument_list "(__dest + __n_00,__dest + param_4,__n)" ( (binary_expression "__dest + __n_00" identifier + identifier) , (binary_expression "__dest + param_4" identifier + identifier) , identifier ))) ;) })))) }) (else_clause "else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" else (if_statement "if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n          *__dest = *__src_00;\n        }" { (expression_statement "*__dest = *__src_00;" (assignment_expression "*__dest = *__src_00" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src_00" * identifier)) ;) }) (else_clause "else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" else (if_statement "if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n          memcpy(__dest,__src_00,param_4);\n        }" { (expression_statement "memcpy(__dest,__src_00,param_4);" (call_expression "memcpy(__dest,__src_00,param_4)" identifier (argument_list "(__dest,__src_00,param_4)" ( identifier , identifier , identifier ))) ;) })))))) }) (else_clause "else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" else (if_statement "if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *__dest = *__src;\n      }" { (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src" * identifier)) ;) }) (else_clause "else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" else (if_statement "if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n        memcpy(__dest,__src,param_4);\n      }" { (expression_statement "memcpy(__dest,__src,param_4);" (call_expression "memcpy(__dest,__src,param_4)" identifier (argument_list "(__dest,__src,param_4)" ( identifier , identifier , identifier ))) ;) })))))) (return_statement "return param_1;" return identifier ;) })) (expression_statement "puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);" (assignment_expression "puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3)" identifier = (cast_expression "(ulong *)FUN_0030e270(param_1,param_2,0,param_3)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0030e270(param_1,param_2,0,param_3)" identifier (argument_list "(param_1,param_2,0,param_3)" ( identifier , identifier , number_literal , identifier ))))) ;) (return_statement "return puVar3;" return identifier ;) })) (expression_statement "FUN_003195a0("basic_string::insert");" (call_expression "FUN_003195a0("basic_string::insert")" identifier (argument_list "("basic_string::insert")" ( (string_literal ""basic_string::insert"" " 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) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * 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 IDENT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , IDENT ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (binary_expression LIT - IDENT)) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) && (parenthesized_expression ( (binary_expression IDENT <= (binary_expression IDENT + IDENT)) ))) )) && (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT - LIT) )))) < LIT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + (parenthesized_expression ( (binary_expression IDENT - IDENT) ))) )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (parenthesized_expression ( (binary_expression IDENT - IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))))) ;) })))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (subscript_expression IDENT [ IDENT ])) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + IDENT) , (binary_expression IDENT + IDENT) , IDENT ))) ;) })))) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })))))) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })))))) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , IDENT , LIT , IDENT ))))) ;) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) })))
(function_definition "ulong * FUN_0030e4a0(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)\n\n{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  ulong uVar1;\n  ulong uVar2;\n  ulong *puVar3;\n  undefined1 *__dest;\n  size_t __n;\n  size_t __n_00;\n  \n  uVar1 = *param_1;\n  uVar2 = *(ulong *)(uVar1 - 0x18);\n  if (uVar2 < param_2) {\n                    \n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }\n                    \n  FUN_003195a0("basic_string::insert");\n}" (type_identifier "ulong") (pointer_declarator "* FUN_0030e4a0(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" (* "*") (function_declarator "FUN_0030e4a0(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" (identifier "FUN_0030e4a0") (parameter_list "(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" (( "(") (parameter_declaration "ulong *param_1" (type_identifier "ulong") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "ulong param_2" (type_identifier "ulong") (identifier "param_2")) (, ",") (parameter_declaration "ulong param_3" (type_identifier "ulong") (identifier "param_3")) (, ",") (parameter_declaration "ulong param_4" (type_identifier "ulong") (identifier "param_4")) () ")")))) (compound_statement "{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  ulong uVar1;\n  ulong uVar2;\n  ulong *puVar3;\n  undefined1 *__dest;\n  size_t __n;\n  size_t __n_00;\n  \n  uVar1 = *param_1;\n  uVar2 = *(ulong *)(uVar1 - 0x18);\n  if (uVar2 < param_2) {\n                    \n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }\n                    \n  FUN_003195a0("basic_string::insert");\n}" ({ "{") (declaration "undefined1 *__src;" (type_identifier "undefined1") (pointer_declarator "*__src" (* "*") (identifier "__src")) (; ";")) (declaration "undefined1 *__src_00;" (type_identifier "undefined1") (pointer_declarator "*__src_00" (* "*") (identifier "__src_00")) (; ";")) (declaration "ulong uVar1;" (type_identifier "ulong") (identifier "uVar1") (; ";")) (declaration "ulong uVar2;" (type_identifier "ulong") (identifier "uVar2") (; ";")) (declaration "ulong *puVar3;" (type_identifier "ulong") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "undefined1 *__dest;" (type_identifier "undefined1") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "size_t __n_00;" (primitive_type "size_t") (identifier "__n_00") (; ";")) (expression_statement "uVar1 = *param_1;" (assignment_expression "uVar1 = *param_1" (identifier "uVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "uVar2 = *(ulong *)(uVar1 - 0x18);" (assignment_expression "uVar2 = *(ulong *)(uVar1 - 0x18)" (identifier "uVar2") (= "=") (pointer_expression "*(ulong *)(uVar1 - 0x18)" (* "*") (cast_expression "(ulong *)(uVar1 - 0x18)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(uVar1 - 0x18)" (( "(") (binary_expression "uVar1 - 0x18" (identifier "uVar1") (- "-") (number_literal "0x18")) () ")"))))) (; ";")) (if_statement "if (uVar2 < param_2) {\n                    \n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }" (if "if") (parenthesized_expression "(uVar2 < param_2)" (( "(") (binary_expression "uVar2 < param_2" (identifier "uVar2") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n                    \n    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }" ({ "{") (expression_statement "FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);" (call_expression "FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2)" (identifier "FUN_00319620") (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2)" (( "(") (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" (" """) (string_content "%s: __pos (which is %zu) > this->size() (which is %zu)") (" """)) (, ",") (string_literal ""basic_string::insert"" (" """) (string_content "basic_string::insert") (" """)) (, ",") (identifier "param_2") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_4 <= 0x3ffffffffffffff9 - uVar2) {\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }" (if "if") (parenthesized_expression "(param_4 <= 0x3ffffffffffffff9 - uVar2)" (( "(") (binary_expression "param_4 <= 0x3ffffffffffffff9 - uVar2" (identifier "param_4") (<= "<=") (binary_expression "0x3ffffffffffffff9 - uVar2" (number_literal "0x3ffffffffffffff9") (- "-") (identifier "uVar2"))) () ")")) (compound_statement "{\n    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }\n    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);\n    return puVar3;\n  }" ({ "{") (if_statement "if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }" (if "if") (parenthesized_expression "(((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1))" (( "(") (binary_expression "((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)" (parenthesized_expression "((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1))" (( "(") (binary_expression "(uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)" (parenthesized_expression "(uVar1 <= param_3)" (( "(") (binary_expression "uVar1 <= param_3" (identifier "uVar1") (<= "<=") (identifier "param_3")) () ")")) (&& "&&") (parenthesized_expression "(param_3 <= uVar2 + uVar1)" (( "(") (binary_expression "param_3 <= uVar2 + uVar1" (identifier "param_3") (<= "<=") (binary_expression "uVar2 + uVar1" (identifier "uVar2") (+ "+") (identifier "uVar1"))) () ")"))) () ")")) (&& "&&") (parenthesized_expression "(*(int *)(uVar1 - 8) < 1)" (( "(") (binary_expression "*(int *)(uVar1 - 8) < 1" (pointer_expression "*(int *)(uVar1 - 8)" (* "*") (cast_expression "(int *)(uVar1 - 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(uVar1 - 8)" (( "(") (binary_expression "uVar1 - 8" (identifier "uVar1") (- "-") (number_literal "8")) () ")")))) (< "<") (number_literal "1")) () ")"))) () ")")) (compound_statement "{\n      uVar1 = *param_1;\n      FUN_0030dbd0(param_1,param_2,0,param_4);\n      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src_00 = __src + param_4;\n      if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }\n      return param_1;\n    }" ({ "{") (expression_statement "uVar1 = *param_1;" (assignment_expression "uVar1 = *param_1" (identifier "uVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "FUN_0030dbd0(param_1,param_2,0,param_4);" (call_expression "FUN_0030dbd0(param_1,param_2,0,param_4)" (identifier "FUN_0030dbd0") (argument_list "(param_1,param_2,0,param_4)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (number_literal "0") (, ",") (identifier "param_4") () ")"))) (; ";")) (expression_statement "__src = (undefined1 *)(*param_1 + (param_3 - uVar1));" (assignment_expression "__src = (undefined1 *)(*param_1 + (param_3 - uVar1))" (identifier "__src") (= "=") (cast_expression "(undefined1 *)(*param_1 + (param_3 - uVar1))" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + (param_3 - uVar1))" (( "(") (binary_expression "*param_1 + (param_3 - uVar1)" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (parenthesized_expression "(param_3 - uVar1)" (( "(") (binary_expression "param_3 - uVar1" (identifier "param_3") (- "-") (identifier "uVar1")) () ")"))) () ")")))) (; ";")) (expression_statement "__dest = (undefined1 *)(*param_1 + param_2);" (assignment_expression "__dest = (undefined1 *)(*param_1 + param_2)" (identifier "__dest") (= "=") (cast_expression "(undefined1 *)(*param_1 + param_2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + param_2)" (( "(") (binary_expression "*param_1 + param_2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (identifier "param_2")) () ")")))) (; ";")) (expression_statement "__src_00 = __src + param_4;" (assignment_expression "__src_00 = __src + param_4" (identifier "__src_00") (= "=") (binary_expression "__src + param_4" (identifier "__src") (+ "+") (identifier "param_4"))) (; ";")) (if_statement "if (__dest < __src_00) {\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" (if "if") (parenthesized_expression "(__dest < __src_00)" (( "(") (binary_expression "__dest < __src_00" (identifier "__dest") (< "<") (identifier "__src_00")) () ")")) (compound_statement "{\n        if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }\n      }" ({ "{") (if_statement "if (__src < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" (if "if") (parenthesized_expression "(__src < __dest)" (( "(") (binary_expression "__src < __dest" (identifier "__src") (< "<") (identifier "__dest")) () ")")) (compound_statement "{\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }" ({ "{") (expression_statement "__n_00 = param_2 - (param_3 - uVar1);" (assignment_expression "__n_00 = param_2 - (param_3 - uVar1)" (identifier "__n_00") (= "=") (binary_expression "param_2 - (param_3 - uVar1)" (identifier "param_2") (- "-") (parenthesized_expression "(param_3 - uVar1)" (( "(") (binary_expression "param_3 - uVar1" (identifier "param_3") (- "-") (identifier "uVar1")) () ")")))) (; ";")) (if_statement "if (__n_00 == 1) {\n            *__dest = *__src;\n          }\n          else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" (if "if") (parenthesized_expression "(__n_00 == 1)" (( "(") (binary_expression "__n_00 == 1" (identifier "__n_00") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n            *__dest = *__src;\n          }" ({ "{") (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" (* "*") (identifier "__dest")) (= "=") (pointer_expression "*__src" (* "*") (identifier "__src"))) (; ";")) (} "}")) (else_clause "else if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" (else "else") (if_statement "if (__n_00 != 0) {\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" (if "if") (parenthesized_expression "(__n_00 != 0)" (( "(") (binary_expression "__n_00 != 0" (identifier "__n_00") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);\n          }" ({ "{") (expression_statement "__dest = (undefined1 *)memcpy(__dest,__src,__n_00);" (assignment_expression "__dest = (undefined1 *)memcpy(__dest,__src,__n_00)" (identifier "__dest") (= "=") (cast_expression "(undefined1 *)memcpy(__dest,__src,__n_00)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "memcpy(__dest,__src,__n_00)" (identifier "memcpy") (argument_list "(__dest,__src,__n_00)" (( "(") (identifier "__dest") (, ",") (identifier "__src") (, ",") (identifier "__n_00") () ")"))))) (; ";")) (} "}"))))) (expression_statement "__n = param_4 - __n_00;" (assignment_expression "__n = param_4 - __n_00" (identifier "__n") (= "=") (binary_expression "param_4 - __n_00" (identifier "param_4") (- "-") (identifier "__n_00"))) (; ";")) (if_statement "if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" (if "if") (parenthesized_expression "(__n == 1)" (( "(") (binary_expression "__n == 1" (identifier "__n") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n            __dest[__n_00] = __dest[param_4];\n          }" ({ "{") (expression_statement "__dest[__n_00] = __dest[param_4];" (assignment_expression "__dest[__n_00] = __dest[param_4]" (subscript_expression "__dest[__n_00]" (identifier "__dest") ([ "[") (identifier "__n_00") (] "]")) (= "=") (subscript_expression "__dest[param_4]" (identifier "__dest") ([ "[") (identifier "param_4") (] "]"))) (; ";")) (} "}")) (else_clause "else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" (else "else") (if_statement "if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" (if "if") (parenthesized_expression "(__n != 0)" (( "(") (binary_expression "__n != 0" (identifier "__n") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" ({ "{") (expression_statement "memcpy(__dest + __n_00,__dest + param_4,__n);" (call_expression "memcpy(__dest + __n_00,__dest + param_4,__n)" (identifier "memcpy") (argument_list "(__dest + __n_00,__dest + param_4,__n)" (( "(") (binary_expression "__dest + __n_00" (identifier "__dest") (+ "+") (identifier "__n_00")) (, ",") (binary_expression "__dest + param_4" (identifier "__dest") (+ "+") (identifier "param_4")) (, ",") (identifier "__n") () ")"))) (; ";")) (} "}"))))) (} "}")) (else_clause "else if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" (else "else") (if_statement "if (param_4 == 1) {\n          *__dest = *__src_00;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" (if "if") (parenthesized_expression "(param_4 == 1)" (( "(") (binary_expression "param_4 == 1" (identifier "param_4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n          *__dest = *__src_00;\n        }" ({ "{") (expression_statement "*__dest = *__src_00;" (assignment_expression "*__dest = *__src_00" (pointer_expression "*__dest" (* "*") (identifier "__dest")) (= "=") (pointer_expression "*__src_00" (* "*") (identifier "__src_00"))) (; ";")) (} "}")) (else_clause "else if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" (else "else") (if_statement "if (param_4 != 0) {\n          memcpy(__dest,__src_00,param_4);\n        }" (if "if") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n          memcpy(__dest,__src_00,param_4);\n        }" ({ "{") (expression_statement "memcpy(__dest,__src_00,param_4);" (call_expression "memcpy(__dest,__src_00,param_4)" (identifier "memcpy") (argument_list "(__dest,__src_00,param_4)" (( "(") (identifier "__dest") (, ",") (identifier "__src_00") (, ",") (identifier "param_4") () ")"))) (; ";")) (} "}"))))))) (} "}")) (else_clause "else if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" (else "else") (if_statement "if (param_4 == 1) {\n        *__dest = *__src;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" (if "if") (parenthesized_expression "(param_4 == 1)" (( "(") (binary_expression "param_4 == 1" (identifier "param_4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *__dest = *__src;\n      }" ({ "{") (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" (* "*") (identifier "__dest")) (= "=") (pointer_expression "*__src" (* "*") (identifier "__src"))) (; ";")) (} "}")) (else_clause "else if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" (else "else") (if_statement "if (param_4 != 0) {\n        memcpy(__dest,__src,param_4);\n      }" (if "if") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        memcpy(__dest,__src,param_4);\n      }" ({ "{") (expression_statement "memcpy(__dest,__src,param_4);" (call_expression "memcpy(__dest,__src,param_4)" (identifier "memcpy") (argument_list "(__dest,__src,param_4)" (( "(") (identifier "__dest") (, ",") (identifier "__src") (, ",") (identifier "param_4") () ")"))) (; ";")) (} "}"))))))) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (expression_statement "puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);" (assignment_expression "puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3)" (identifier "puVar3") (= "=") (cast_expression "(ulong *)FUN_0030e270(param_1,param_2,0,param_3)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0030e270(param_1,param_2,0,param_3)" (identifier "FUN_0030e270") (argument_list "(param_1,param_2,0,param_3)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (number_literal "0") (, ",") (identifier "param_3") () ")"))))) (; ";")) (return_statement "return puVar3;" (return "return") (identifier "puVar3") (; ";")) (} "}"))) (expression_statement "FUN_003195a0("basic_string::insert");" (call_expression "FUN_003195a0("basic_string::insert")" (identifier "FUN_003195a0") (argument_list "("basic_string::insert")" (( "(") (string_literal ""basic_string::insert"" (" """) (string_content "basic_string::insert") (" """)) () ")"))) (; ";")) (} "}")))

/* std::string::insert(unsigned long, char const*, unsigned long) */

type_3 * __thiscall std::type_3::insert(type_3 *this,type_2 var_3,char *var_6,type_2 var_5)

{
  type_1 *var_9;
  type_1 *var_11;
  char *var_1;
  type_2 var_2;
  long var_8;
  type_3 *psVar4;
  type_1 *var_10;
  size_t var_14;
  size_t var_12;
  
  var_1 = *(char **)this;
  var_2 = *(type_2 *)(var_1 + -0x18);
  if (var_2 < var_3) {
                    /* WARNING: Subroutine does not return */
    var_4
              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",
               var_3);
  }
  if (var_5 <= 0x3ffffffffffffff9 - var_2) {
    if (((var_1 <= var_6) && (var_6 <= var_1 + var_2)) && (*(int *)(var_1 + -8) < 1)) {
      var_8 = *(long *)this;
      var_7(this,var_3,0,var_5);
      var_9 = (type_1 *)(*(long *)this + ((long)var_6 - var_8));
      var_10 = (type_1 *)(*(long *)this + var_3);
      var_11 = var_9 + var_5;
      if (var_10 < var_11) {
        if (var_9 < var_10) {
          var_12 = var_3 - ((long)var_6 - var_8);
          if (var_12 == 1) {
            *var_10 = *var_9;
          }
          else if (var_12 != 0) {
            var_10 = (type_1 *)var_13(var_10,var_9,var_12);
          }
          var_14 = var_5 - var_12;
          if (var_14 == 1) {
            var_10[var_12] = var_10[var_5];
          }
          else if (var_14 != 0) {
            var_13(var_10 + var_12,var_10 + var_5,var_14);
          }
        }
        else if (var_5 == 1) {
          *var_10 = *var_11;
        }
        else if (var_5 != 0) {
          var_13(var_10,var_11,var_5);
        }
      }
      else if (var_5 == 1) {
        *var_10 = *var_9;
      }
      else if (var_5 != 0) {
        var_13(var_10,var_9,var_5);
      }
      return this;
    }
    psVar4 = (type_3 *)var_15(this,var_3,0,var_6,var_5);
    return psVar4;
  }
                    /* WARNING: Subroutine does not return */
  var_16("basic_string::insert");
}


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

ulong * MASKED(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)

{
  undefined1 *__src;
  undefined1 *__src_00;
  ulong uVar1;
  ulong uVar2;
  ulong *puVar3;
  undefined1 *__dest;
  size_t __n;
  size_t __n_00;
  
  uVar1 = *param_1;
  uVar2 = *(ulong *)(uVar1 - 0x18);
  if (uVar2 < param_2) {
                    /* WARNING: Subroutine does not return */
    FUN_00319620("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",
                 param_2);
  }
  if (param_4 <= 0x3ffffffffffffff9 - uVar2) {
    if (((uVar1 <= param_3) && (param_3 <= uVar2 + uVar1)) && (*(int *)(uVar1 - 8) < 1)) {
      uVar1 = *param_1;
      FUN_0030dbd0(param_1,param_2,0,param_4);
      __src = (undefined1 *)(*param_1 + (param_3 - uVar1));
      __dest = (undefined1 *)(*param_1 + param_2);
      __src_00 = __src + param_4;
      if (__dest < __src_00) {
        if (__src < __dest) {
          __n_00 = param_2 - (param_3 - uVar1);
          if (__n_00 == 1) {
            *__dest = *__src;
          }
          else if (__n_00 != 0) {
            __dest = (undefined1 *)memcpy(__dest,__src,__n_00);
          }
          __n = param_4 - __n_00;
          if (__n == 1) {
            __dest[__n_00] = __dest[param_4];
          }
          else if (__n != 0) {
            memcpy(__dest + __n_00,__dest + param_4,__n);
          }
        }
        else if (param_4 == 1) {
          *__dest = *__src_00;
        }
        else if (param_4 != 0) {
          memcpy(__dest,__src_00,param_4);
        }
      }
      else if (param_4 == 1) {
        *__dest = *__src;
      }
      else if (param_4 != 0) {
        memcpy(__dest,__src,param_4);
      }
      return param_1;
    }
    puVar3 = (ulong *)FUN_0030e270(param_1,param_2,0,param_3);
    return puVar3;
  }
                    /* WARNING: Subroutine does not return */
  FUN_003195a0("basic_string::insert");
}

