
/* std::wstring::insert(unsigned long, wchar_t const*, unsigned long) */

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

{
  wchar_t *__s2;
  wchar_t *pwVar1;
  ulong uVar2;
  wstring *pwVar3;
  size_t sVar4;
  long lVar5;
  wchar_t *__s1;
  
  pwVar1 = *(wchar_t **)this;
  uVar2 = *(ulong *)(pwVar1 + -6);
  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 <= 0xffffffffffffffe - uVar2) {
    if (((pwVar1 <= param_2) && (param_2 <= pwVar1 + uVar2)) && (pwVar1[-2] < L'\x01')) {
      lVar5 = *(long *)this;
      _M_mutate(this,param_1,0,param_3);
      __s2 = (wchar_t *)(*(long *)this + ((long)param_2 - lVar5));
      __s1 = (wchar_t *)(*(long *)this + param_1 * 4);
      pwVar1 = __s2 + param_3;
      if (__s1 < pwVar1) {
        if (__s2 < __s1) {
          lVar5 = param_1 * 4 - ((long)param_2 - lVar5);
          sVar4 = lVar5 >> 2;
          if (sVar4 == 1) {
            *__s1 = *__s2;
          }
          else if (sVar4 != 0) {
            wmemcpy(__s1,__s2,sVar4);
          }
          sVar4 = param_3 - sVar4;
          pwVar1 = (wchar_t *)((long)__s1 + lVar5);
          if (sVar4 == 1) {
            *pwVar1 = __s1[param_3];
          }
          else if (sVar4 != 0) {
            wmemcpy(pwVar1,__s1 + param_3,sVar4);
          }
        }
        else if (param_3 == 1) {
          *__s1 = *pwVar1;
        }
        else if (param_3 != 0) {
          wmemcpy(__s1,pwVar1,param_3);
        }
      }
      else if (param_3 == 1) {
        *__s1 = *__s2;
      }
      else if (param_3 != 0) {
        wmemcpy(__s1,__s2,param_3);
      }
      return this;
    }
    pwVar3 = (wstring *)_M_replace_safe(this,param_1,0,param_2,param_3);
    return pwVar3;
  }
                    /* WARNING: Subroutine does not return */
  __throw_length_error("basic_string::insert");
}



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

{
  wchar_t *__s2;
  wchar_t *pwVar1;
  ulong uVar2;
  ulong uVar3;
  ulong *puVar4;
  size_t sVar5;
  long lVar6;
  wchar_t *__s1;
  
  uVar2 = *param_1;
  uVar3 = *(ulong *)(uVar2 - 0x18);
  if (uVar3 < param_2) {
                    /* WARNING: Subroutine does not return */
    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",
                 param_2);
  }
  if (param_4 <= 0xffffffffffffffe - uVar3) {
    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {
      uVar2 = *param_1;
      FUN_002f1e60(param_1,param_2,0,param_4);
      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));
      __s1 = (wchar_t *)(*param_1 + param_2 * 4);
      pwVar1 = __s2 + param_4;
      if (__s1 < pwVar1) {
        if (__s2 < __s1) {
          lVar6 = param_2 * 4 - (param_3 - uVar2);
          sVar5 = lVar6 >> 2;
          if (sVar5 == 1) {
            *__s1 = *__s2;
          }
          else if (sVar5 != 0) {
            wmemcpy(__s1,__s2,sVar5);
          }
          sVar5 = param_4 - sVar5;
          pwVar1 = (wchar_t *)((long)__s1 + lVar6);
          if (sVar5 == 1) {
            *pwVar1 = __s1[param_4];
          }
          else if (sVar5 != 0) {
            wmemcpy(pwVar1,__s1 + param_4,sVar5);
          }
        }
        else if (param_4 == 1) {
          *__s1 = *pwVar1;
        }
        else if (param_4 != 0) {
          wmemcpy(__s1,pwVar1,param_4);
        }
      }
      else if (param_4 == 1) {
        *__s1 = *__s2;
      }
      else if (param_4 != 0) {
        wmemcpy(__s1,__s2,param_4);
      }
      return param_1;
    }
    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);
    return puVar4;
  }
                    /* WARNING: Subroutine does not return */
  FUN_002b5650("basic_string::insert");
}


PUSH R14
MOV R8,RCX
PUSH R13
PUSH R12
PUSH RBP
MOV RBP,RSI
PUSH RBX
SUB RSP,0x10
MOV RSI,qword ptr [RDI]
MOV RCX,qword ptr [RSI + -0x18]
CMP RBP,RCX
JA 0x002f28f2
MOV RAX,0xffffffffffffffe
SUB RAX,RCX
CMP R8,RAX
JA 0x002f28e6
MOV R12,RDI
CMP RSI,RDX
JA 0x002f27c0
LEA RAX,[RSI + RCX*0x4]
CMP RDX,RAX
JA 0x002f27c0
MOV EAX,dword ptr [RSI + -0x8]
TEST EAX,EAX
JLE 0x002f27e0
ADD RSP,0x10
MOV RCX,RDX
MOV RSI,RBP
MOV RDI,R12
POP RBX
XOR EDX,EDX
POP RBP
POP R12
POP R13
POP R14
JMP 0x002f2540
MOV RSI,RBP
MOV RBX,RDX
MOV RCX,R8
XOR EDX,EDX
SUB RBX,qword ptr [RDI]
MOV qword ptr [RSP + 0x8],R8
SHL RBP,0x2
CALL 0x002f1e60
MOV R13,qword ptr [R12]
MOV R8,qword ptr [RSP + 0x8]
LEA RSI,[R13 + RBX*0x1]
LEA R14,[R8*0x4]
ADD R13,RBP
LEA RAX,[RSI + R14*0x1]
CMP RAX,R13
JA 0x002f2850
CMP R8,0x1
JZ 0x002f28bf
TEST R8,R8
JZ 0x002f2838
MOV RDX,R8
MOV RDI,R13
CALL 0x0013e0f0
ADD RSP,0x10
MOV RAX,R12
POP RBX
POP RBP
POP R12
POP R13
POP R14
RET
CMP RSI,R13
JC 0x002f2870
CMP R8,0x1
JZ 0x002f28d2
TEST R8,R8
JZ 0x002f2838
MOV RDX,R8
MOV RSI,RAX
MOV RDI,R13
CALL 0x0013e0f0
JMP 0x002f2838
SUB RBP,RBX
MOV RBX,RBP
SAR RBX,0x2
CMP RBX,0x1
JZ 0x002f28ca
TEST RBX,RBX
JZ 0x002f289a
MOV RDX,RBX
MOV RDI,R13
MOV qword ptr [RSP + 0x8],R8
CALL 0x0013e0f0
MOV R8,qword ptr [RSP + 0x8]
SUB R8,RBX
LEA RSI,[R13 + R14*0x1]
LEA RDI,[R13 + RBP*0x1]
CMP R8,0x1
JZ 0x002f28dd
TEST R8,R8
JZ 0x002f2838
MOV RDX,R8
CALL 0x0013e0f0
JMP 0x002f2838
MOV EAX,dword ptr [RSI]
MOV dword ptr [R13],EAX
JMP 0x002f2838
MOV EAX,dword ptr [RSI]
MOV dword ptr [R13],EAX
JMP 0x002f289a
MOV EAX,dword ptr [RAX]
MOV dword ptr [R13],EAX
JMP 0x002f2838
MOV EAX,dword ptr [RSI]
MOV dword ptr [RDI],EAX
JMP 0x002f2838
LEA RDI,[0x329271]
CALL 0x002b5650
MOV RDX,RBP
LEA RSI,[0x329271]
LEA RDI,[0x311130]
XOR EAX,EAX
CALL 0x002b56d0
(translation_unit "ulong * FUN_002f2770(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)\n\n{\n  wchar_t *__s2;\n  wchar_t *pwVar1;\n  ulong uVar2;\n  ulong uVar3;\n  ulong *puVar4;\n  size_t sVar5;\n  long lVar6;\n  wchar_t *__s1;\n  \n  uVar2 = *param_1;\n  uVar3 = *(ulong *)(uVar2 - 0x18);\n  if (uVar3 < param_2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0xffffffffffffffe - uVar3) {\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_002b5650("basic_string::insert");\n}\n\n" (function_definition "ulong * FUN_002f2770(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)\n\n{\n  wchar_t *__s2;\n  wchar_t *pwVar1;\n  ulong uVar2;\n  ulong uVar3;\n  ulong *puVar4;\n  size_t sVar5;\n  long lVar6;\n  wchar_t *__s1;\n  \n  uVar2 = *param_1;\n  uVar3 = *(ulong *)(uVar2 - 0x18);\n  if (uVar3 < param_2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0xffffffffffffffe - uVar3) {\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_002b5650("basic_string::insert");\n}" type_identifier (pointer_declarator "* FUN_002f2770(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" * (function_declarator "FUN_002f2770(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  wchar_t *__s2;\n  wchar_t *pwVar1;\n  ulong uVar2;\n  ulong uVar3;\n  ulong *puVar4;\n  size_t sVar5;\n  long lVar6;\n  wchar_t *__s1;\n  \n  uVar2 = *param_1;\n  uVar3 = *(ulong *)(uVar2 - 0x18);\n  if (uVar3 < param_2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0xffffffffffffffe - uVar3) {\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_002b5650("basic_string::insert");\n}" { (declaration "wchar_t *__s2;" type_identifier (pointer_declarator "*__s2" * identifier) ;) (declaration "wchar_t *pwVar1;" type_identifier (pointer_declarator "*pwVar1" * identifier) ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "ulong uVar3;" type_identifier identifier ;) (declaration "ulong *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "size_t sVar5;" primitive_type identifier ;) (declaration "long lVar6;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar_t *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (expression_statement "uVar2 = *param_1;" (assignment_expression "uVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar3 = *(ulong *)(uVar2 - 0x18);" (assignment_expression "uVar3 = *(ulong *)(uVar2 - 0x18)" identifier = (pointer_expression "*(ulong *)(uVar2 - 0x18)" * (cast_expression "(ulong *)(uVar2 - 0x18)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar2 - 0x18)" ( (binary_expression "uVar2 - 0x18" identifier - number_literal) ))))) ;) (if_statement "if (uVar3 < param_2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }" if (parenthesized_expression "(uVar3 < param_2)" ( (binary_expression "uVar3 < param_2" identifier < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }" { comment (expression_statement "FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);" (call_expression "FUN_002b56d0("%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 <= 0xffffffffffffffe - uVar3) {\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }" if (parenthesized_expression "(param_4 <= 0xffffffffffffffe - uVar3)" ( (binary_expression "param_4 <= 0xffffffffffffffe - uVar3" identifier <= (binary_expression "0xffffffffffffffe - uVar3" number_literal - identifier)) )) (compound_statement "{\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }" { (if_statement "if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }" if (parenthesized_expression "(((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1))" ( (binary_expression "((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)" (parenthesized_expression "((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4))" ( (binary_expression "(uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)" (parenthesized_expression "(uVar2 <= param_3)" ( (binary_expression "uVar2 <= param_3" identifier <= identifier) )) && (parenthesized_expression "(param_3 <= uVar2 + uVar3 * 4)" ( (binary_expression "param_3 <= uVar2 + uVar3 * 4" identifier <= (binary_expression "uVar2 + uVar3 * 4" identifier + (binary_expression "uVar3 * 4" identifier * number_literal))) ))) )) && (parenthesized_expression "(*(int *)(uVar2 - 8) < 1)" ( (binary_expression "*(int *)(uVar2 - 8) < 1" (pointer_expression "*(int *)(uVar2 - 8)" * (cast_expression "(int *)(uVar2 - 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar2 - 8)" ( (binary_expression "uVar2 - 8" identifier - number_literal) )))) < number_literal) ))) )) (compound_statement "{\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }" { (expression_statement "uVar2 = *param_1;" (assignment_expression "uVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "FUN_002f1e60(param_1,param_2,0,param_4);" (call_expression "FUN_002f1e60(param_1,param_2,0,param_4)" identifier (argument_list "(param_1,param_2,0,param_4)" ( identifier , identifier , number_literal , identifier ))) ;) (expression_statement "__s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));" (assignment_expression "__s2 = (wchar_t *)(*param_1 + (param_3 - uVar2))" identifier = (cast_expression "(wchar_t *)(*param_1 + (param_3 - uVar2))" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + (param_3 - uVar2))" ( (binary_expression "*param_1 + (param_3 - uVar2)" (pointer_expression "*param_1" * identifier) + (parenthesized_expression "(param_3 - uVar2)" ( (binary_expression "param_3 - uVar2" identifier - identifier) ))) )))) ;) (expression_statement "__s1 = (wchar_t *)(*param_1 + param_2 * 4);" (assignment_expression "__s1 = (wchar_t *)(*param_1 + param_2 * 4)" identifier = (cast_expression "(wchar_t *)(*param_1 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + param_2 * 4)" ( (binary_expression "*param_1 + param_2 * 4" (pointer_expression "*param_1" * identifier) + (binary_expression "param_2 * 4" identifier * number_literal)) )))) ;) (expression_statement "pwVar1 = __s2 + param_4;" (assignment_expression "pwVar1 = __s2 + param_4" identifier = (binary_expression "__s2 + param_4" identifier + identifier)) ;) (if_statement "if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" if (parenthesized_expression "(__s1 < pwVar1)" ( (binary_expression "__s1 < pwVar1" identifier < identifier) )) (compound_statement "{\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }" { (if_statement "if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" if (parenthesized_expression "(__s2 < __s1)" ( (binary_expression "__s2 < __s1" identifier < identifier) )) (compound_statement "{\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }" { (expression_statement "lVar6 = param_2 * 4 - (param_3 - uVar2);" (assignment_expression "lVar6 = param_2 * 4 - (param_3 - uVar2)" identifier = (binary_expression "param_2 * 4 - (param_3 - uVar2)" (binary_expression "param_2 * 4" identifier * number_literal) - (parenthesized_expression "(param_3 - uVar2)" ( (binary_expression "param_3 - uVar2" identifier - identifier) )))) ;) (expression_statement "sVar5 = lVar6 >> 2;" (assignment_expression "sVar5 = lVar6 >> 2" identifier = (binary_expression "lVar6 >> 2" identifier >> number_literal)) ;) (if_statement "if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }" if (parenthesized_expression "(sVar5 == 1)" ( (binary_expression "sVar5 == 1" identifier == number_literal) )) (compound_statement "{\n            *__s1 = *__s2;\n          }" { (expression_statement "*__s1 = *__s2;" (assignment_expression "*__s1 = *__s2" (pointer_expression "*__s1" * identifier) = (pointer_expression "*__s2" * identifier)) ;) }) (else_clause "else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }" else (if_statement "if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }" if (parenthesized_expression "(sVar5 != 0)" ( (binary_expression "sVar5 != 0" identifier != number_literal) )) (compound_statement "{\n            wmemcpy(__s1,__s2,sVar5);\n          }" { (expression_statement "wmemcpy(__s1,__s2,sVar5);" (call_expression "wmemcpy(__s1,__s2,sVar5)" identifier (argument_list "(__s1,__s2,sVar5)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "sVar5 = param_4 - sVar5;" (assignment_expression "sVar5 = param_4 - sVar5" identifier = (binary_expression "param_4 - sVar5" identifier - identifier)) ;) (expression_statement "pwVar1 = (wchar_t *)((long)__s1 + lVar6);" (assignment_expression "pwVar1 = (wchar_t *)((long)__s1 + lVar6)" identifier = (cast_expression "(wchar_t *)((long)__s1 + lVar6)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__s1 + lVar6)" ( (binary_expression "(long)__s1 + lVar6" (cast_expression "(long)__s1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) ;) (if_statement "if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }" if (parenthesized_expression "(sVar5 == 1)" ( (binary_expression "sVar5 == 1" identifier == number_literal) )) (compound_statement "{\n            *pwVar1 = __s1[param_4];\n          }" { (expression_statement "*pwVar1 = __s1[param_4];" (assignment_expression "*pwVar1 = __s1[param_4]" (pointer_expression "*pwVar1" * identifier) = (subscript_expression "__s1[param_4]" identifier [ identifier ])) ;) }) (else_clause "else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }" else (if_statement "if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }" if (parenthesized_expression "(sVar5 != 0)" ( (binary_expression "sVar5 != 0" identifier != number_literal) )) (compound_statement "{\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }" { (expression_statement "wmemcpy(pwVar1,__s1 + param_4,sVar5);" (call_expression "wmemcpy(pwVar1,__s1 + param_4,sVar5)" identifier (argument_list "(pwVar1,__s1 + param_4,sVar5)" ( identifier , (binary_expression "__s1 + param_4" identifier + identifier) , identifier ))) ;) })))) }) (else_clause "else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" else (if_statement "if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n          *__s1 = *pwVar1;\n        }" { (expression_statement "*__s1 = *pwVar1;" (assignment_expression "*__s1 = *pwVar1" (pointer_expression "*__s1" * identifier) = (pointer_expression "*pwVar1" * identifier)) ;) }) (else_clause "else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" else (if_statement "if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n          wmemcpy(__s1,pwVar1,param_4);\n        }" { (expression_statement "wmemcpy(__s1,pwVar1,param_4);" (call_expression "wmemcpy(__s1,pwVar1,param_4)" identifier (argument_list "(__s1,pwVar1,param_4)" ( identifier , identifier , identifier ))) ;) })))))) }) (else_clause "else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" else (if_statement "if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *__s1 = *__s2;\n      }" { (expression_statement "*__s1 = *__s2;" (assignment_expression "*__s1 = *__s2" (pointer_expression "*__s1" * identifier) = (pointer_expression "*__s2" * identifier)) ;) }) (else_clause "else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" else (if_statement "if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n        wmemcpy(__s1,__s2,param_4);\n      }" { (expression_statement "wmemcpy(__s1,__s2,param_4);" (call_expression "wmemcpy(__s1,__s2,param_4)" identifier (argument_list "(__s1,__s2,param_4)" ( identifier , identifier , identifier ))) ;) })))))) (return_statement "return param_1;" return identifier ;) })) (expression_statement "puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);" (assignment_expression "puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3)" identifier = (cast_expression "(ulong *)FUN_002f2540(param_1,param_2,0,param_3)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_002f2540(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 puVar4;" return identifier ;) })) comment (expression_statement "FUN_002b5650("basic_string::insert");" (call_expression "FUN_002b5650("basic_string::insert")" identifier (argument_list "("basic_string::insert")" ( (string_literal ""basic_string::insert"" " string_content ") ))) ;) })))
(translation_unit "/* std::wstring::insert(unsigned long, wchar_t const*, unsigned long) */\n\nwstring * __thiscall\nstd::wstring::insert(wstring *this,ulong param_1,wchar_t *param_2,ulong param_3)\n\n{\n  wchar_t *__s2;\n  wchar_t *pwVar1;\n  ulong uVar2;\n  wstring *pwVar3;\n  size_t sVar4;\n  long lVar5;\n  wchar_t *__s1;\n  \n  pwVar1 = *(wchar_t **)this;\n  uVar2 = *(ulong *)(pwVar1 + -6);\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 <= 0xffffffffffffffe - uVar2) {\n    if (((pwVar1 <= param_2) && (param_2 <= pwVar1 + uVar2)) && (pwVar1[-2] < L'\x01')) {\n      lVar5 = *(long *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __s2 = (wchar_t *)(*(long *)this + ((long)param_2 - lVar5));\n      __s1 = (wchar_t *)(*(long *)this + param_1 * 4);\n      pwVar1 = __s2 + param_3;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar5 = param_1 * 4 - ((long)param_2 - lVar5);\n          sVar4 = lVar5 >> 2;\n          if (sVar4 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }\n          sVar4 = param_3 - sVar4;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar5);\n          if (sVar4 == 1) {\n            *pwVar1 = __s1[param_3];\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }\n        }\n        else if (param_3 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_3 != 0) {\n        wmemcpy(__s1,__s2,param_3);\n      }\n      return this;\n    }\n    pwVar3 = (wstring *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    return pwVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_length_error("basic_string::insert");\n}\n\n" comment (ERROR "wstring * __thiscall\nstd::wstring::insert(wstring *this,ulong param_1,wchar_t *param_2,ulong param_3)" (binary_expression "wstring * __thiscall\nstd::wstring::insert(wstring *this" (binary_expression "wstring * __thiscall" identifier * identifier) (ERROR "std::wstring::insert(wstring" identifier : : identifier : : identifier ( identifier) * identifier) , type_identifier identifier , (ERROR "wchar_t" identifier) (pointer_declarator "*param_2" * identifier) , identifier identifier )) (compound_statement "{\n  wchar_t *__s2;\n  wchar_t *pwVar1;\n  ulong uVar2;\n  wstring *pwVar3;\n  size_t sVar4;\n  long lVar5;\n  wchar_t *__s1;\n  \n  pwVar1 = *(wchar_t **)this;\n  uVar2 = *(ulong *)(pwVar1 + -6);\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 <= 0xffffffffffffffe - uVar2) {\n    if (((pwVar1 <= param_2) && (param_2 <= pwVar1 + uVar2)) && (pwVar1[-2] < L'\x01')) {\n      lVar5 = *(long *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __s2 = (wchar_t *)(*(long *)this + ((long)param_2 - lVar5));\n      __s1 = (wchar_t *)(*(long *)this + param_1 * 4);\n      pwVar1 = __s2 + param_3;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar5 = param_1 * 4 - ((long)param_2 - lVar5);\n          sVar4 = lVar5 >> 2;\n          if (sVar4 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }\n          sVar4 = param_3 - sVar4;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar5);\n          if (sVar4 == 1) {\n            *pwVar1 = __s1[param_3];\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }\n        }\n        else if (param_3 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_3 != 0) {\n        wmemcpy(__s1,__s2,param_3);\n      }\n      return this;\n    }\n    pwVar3 = (wstring *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    return pwVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_length_error("basic_string::insert");\n}" { (declaration "wchar_t *__s2;" type_identifier (pointer_declarator "*__s2" * identifier) ;) (declaration "wchar_t *pwVar1;" type_identifier (pointer_declarator "*pwVar1" * identifier) ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "wstring *pwVar3;" type_identifier (pointer_declarator "*pwVar3" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "long lVar5;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar_t *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (expression_statement "pwVar1 = *(wchar_t **)this;" (assignment_expression "pwVar1 = *(wchar_t **)this" identifier = (pointer_expression "*(wchar_t **)this" * (cast_expression "(wchar_t **)this" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "uVar2 = *(ulong *)(pwVar1 + -6);" (assignment_expression "uVar2 = *(ulong *)(pwVar1 + -6)" identifier = (pointer_expression "*(ulong *)(pwVar1 + -6)" * (cast_expression "(ulong *)(pwVar1 + -6)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar1 + -6)" ( (binary_expression "pwVar1 + -6" 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 <= 0xffffffffffffffe - uVar2) {\n    if (((pwVar1 <= param_2) && (param_2 <= pwVar1 + uVar2)) && (pwVar1[-2] < L'\x01')) {\n      lVar5 = *(long *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __s2 = (wchar_t *)(*(long *)this + ((long)param_2 - lVar5));\n      __s1 = (wchar_t *)(*(long *)this + param_1 * 4);\n      pwVar1 = __s2 + param_3;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar5 = param_1 * 4 - ((long)param_2 - lVar5);\n          sVar4 = lVar5 >> 2;\n          if (sVar4 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }\n          sVar4 = param_3 - sVar4;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar5);\n          if (sVar4 == 1) {\n            *pwVar1 = __s1[param_3];\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }\n        }\n        else if (param_3 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_3 != 0) {\n        wmemcpy(__s1,__s2,param_3);\n      }\n      return this;\n    }\n    pwVar3 = (wstring *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    return pwVar3;\n  }" if (parenthesized_expression "(param_3 <= 0xffffffffffffffe - uVar2)" ( (binary_expression "param_3 <= 0xffffffffffffffe - uVar2" identifier <= (binary_expression "0xffffffffffffffe - uVar2" number_literal - identifier)) )) (compound_statement "{\n    if (((pwVar1 <= param_2) && (param_2 <= pwVar1 + uVar2)) && (pwVar1[-2] < L'\x01')) {\n      lVar5 = *(long *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __s2 = (wchar_t *)(*(long *)this + ((long)param_2 - lVar5));\n      __s1 = (wchar_t *)(*(long *)this + param_1 * 4);\n      pwVar1 = __s2 + param_3;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar5 = param_1 * 4 - ((long)param_2 - lVar5);\n          sVar4 = lVar5 >> 2;\n          if (sVar4 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }\n          sVar4 = param_3 - sVar4;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar5);\n          if (sVar4 == 1) {\n            *pwVar1 = __s1[param_3];\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }\n        }\n        else if (param_3 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_3 != 0) {\n        wmemcpy(__s1,__s2,param_3);\n      }\n      return this;\n    }\n    pwVar3 = (wstring *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    return pwVar3;\n  }" { (if_statement "if (((pwVar1 <= param_2) && (param_2 <= pwVar1 + uVar2)) && (pwVar1[-2] < L'\x01')) {\n      lVar5 = *(long *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __s2 = (wchar_t *)(*(long *)this + ((long)param_2 - lVar5));\n      __s1 = (wchar_t *)(*(long *)this + param_1 * 4);\n      pwVar1 = __s2 + param_3;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar5 = param_1 * 4 - ((long)param_2 - lVar5);\n          sVar4 = lVar5 >> 2;\n          if (sVar4 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }\n          sVar4 = param_3 - sVar4;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar5);\n          if (sVar4 == 1) {\n            *pwVar1 = __s1[param_3];\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }\n        }\n        else if (param_3 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_3 != 0) {\n        wmemcpy(__s1,__s2,param_3);\n      }\n      return this;\n    }" if (parenthesized_expression "(((pwVar1 <= param_2) && (param_2 <= pwVar1 + uVar2)) && (pwVar1[-2] < L'\x01'))" ( (binary_expression "((pwVar1 <= param_2) && (param_2 <= pwVar1 + uVar2)) && (pwVar1[-2] < L'\x01')" (parenthesized_expression "((pwVar1 <= param_2) && (param_2 <= pwVar1 + uVar2))" ( (binary_expression "(pwVar1 <= param_2) && (param_2 <= pwVar1 + uVar2)" (parenthesized_expression "(pwVar1 <= param_2)" ( (binary_expression "pwVar1 <= param_2" identifier <= identifier) )) && (parenthesized_expression "(param_2 <= pwVar1 + uVar2)" ( (binary_expression "param_2 <= pwVar1 + uVar2" identifier <= (binary_expression "pwVar1 + uVar2" identifier + identifier)) ))) )) && (parenthesized_expression "(pwVar1[-2] < L'\x01')" ( (binary_expression "pwVar1[-2] < L'\x01'" (subscript_expression "pwVar1[-2]" identifier [ number_literal ]) < (char_literal "L'\x01'" L' escape_sequence ')) ))) )) (compound_statement "{\n      lVar5 = *(long *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __s2 = (wchar_t *)(*(long *)this + ((long)param_2 - lVar5));\n      __s1 = (wchar_t *)(*(long *)this + param_1 * 4);\n      pwVar1 = __s2 + param_3;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar5 = param_1 * 4 - ((long)param_2 - lVar5);\n          sVar4 = lVar5 >> 2;\n          if (sVar4 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }\n          sVar4 = param_3 - sVar4;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar5);\n          if (sVar4 == 1) {\n            *pwVar1 = __s1[param_3];\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }\n        }\n        else if (param_3 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_3 != 0) {\n        wmemcpy(__s1,__s2,param_3);\n      }\n      return this;\n    }" { (expression_statement "lVar5 = *(long *)this;" (assignment_expression "lVar5 = *(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 "__s2 = (wchar_t *)(*(long *)this + ((long)param_2 - lVar5));" (assignment_expression "__s2 = (wchar_t *)(*(long *)this + ((long)param_2 - lVar5))" identifier = (cast_expression "(wchar_t *)(*(long *)this + ((long)param_2 - lVar5))" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(long *)this + ((long)param_2 - lVar5))" ( (binary_expression "*(long *)this + ((long)param_2 - lVar5)" (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 - lVar5)" ( (binary_expression "(long)param_2 - lVar5" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - identifier) ))) )))) ;) (expression_statement "__s1 = (wchar_t *)(*(long *)this + param_1 * 4);" (assignment_expression "__s1 = (wchar_t *)(*(long *)this + param_1 * 4)" identifier = (cast_expression "(wchar_t *)(*(long *)this + param_1 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(long *)this + param_1 * 4)" ( (binary_expression "*(long *)this + param_1 * 4" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + (binary_expression "param_1 * 4" identifier * number_literal)) )))) ;) (expression_statement "pwVar1 = __s2 + param_3;" (assignment_expression "pwVar1 = __s2 + param_3" identifier = (binary_expression "__s2 + param_3" identifier + identifier)) ;) (if_statement "if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar5 = param_1 * 4 - ((long)param_2 - lVar5);\n          sVar4 = lVar5 >> 2;\n          if (sVar4 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }\n          sVar4 = param_3 - sVar4;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar5);\n          if (sVar4 == 1) {\n            *pwVar1 = __s1[param_3];\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }\n        }\n        else if (param_3 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_3 != 0) {\n        wmemcpy(__s1,__s2,param_3);\n      }" if (parenthesized_expression "(__s1 < pwVar1)" ( (binary_expression "__s1 < pwVar1" identifier < identifier) )) (compound_statement "{\n        if (__s2 < __s1) {\n          lVar5 = param_1 * 4 - ((long)param_2 - lVar5);\n          sVar4 = lVar5 >> 2;\n          if (sVar4 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }\n          sVar4 = param_3 - sVar4;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar5);\n          if (sVar4 == 1) {\n            *pwVar1 = __s1[param_3];\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }\n        }\n        else if (param_3 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }\n      }" { (if_statement "if (__s2 < __s1) {\n          lVar5 = param_1 * 4 - ((long)param_2 - lVar5);\n          sVar4 = lVar5 >> 2;\n          if (sVar4 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }\n          sVar4 = param_3 - sVar4;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar5);\n          if (sVar4 == 1) {\n            *pwVar1 = __s1[param_3];\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }\n        }\n        else if (param_3 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }" if (parenthesized_expression "(__s2 < __s1)" ( (binary_expression "__s2 < __s1" identifier < identifier) )) (compound_statement "{\n          lVar5 = param_1 * 4 - ((long)param_2 - lVar5);\n          sVar4 = lVar5 >> 2;\n          if (sVar4 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }\n          sVar4 = param_3 - sVar4;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar5);\n          if (sVar4 == 1) {\n            *pwVar1 = __s1[param_3];\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }\n        }" { (expression_statement "lVar5 = param_1 * 4 - ((long)param_2 - lVar5);" (assignment_expression "lVar5 = param_1 * 4 - ((long)param_2 - lVar5)" identifier = (binary_expression "param_1 * 4 - ((long)param_2 - lVar5)" (binary_expression "param_1 * 4" identifier * number_literal) - (parenthesized_expression "((long)param_2 - lVar5)" ( (binary_expression "(long)param_2 - lVar5" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - identifier) )))) ;) (expression_statement "sVar4 = lVar5 >> 2;" (assignment_expression "sVar4 = lVar5 >> 2" identifier = (binary_expression "lVar5 >> 2" identifier >> number_literal)) ;) (if_statement "if (sVar4 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n            *__s1 = *__s2;\n          }" { (expression_statement "*__s1 = *__s2;" (assignment_expression "*__s1 = *__s2" (pointer_expression "*__s1" * identifier) = (pointer_expression "*__s2" * identifier)) ;) }) (else_clause "else if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }" else (if_statement "if (sVar4 != 0) {\n            wmemcpy(__s1,__s2,sVar4);\n          }" if (parenthesized_expression "(sVar4 != 0)" ( (binary_expression "sVar4 != 0" identifier != number_literal) )) (compound_statement "{\n            wmemcpy(__s1,__s2,sVar4);\n          }" { (expression_statement "wmemcpy(__s1,__s2,sVar4);" (call_expression "wmemcpy(__s1,__s2,sVar4)" identifier (argument_list "(__s1,__s2,sVar4)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "sVar4 = param_3 - sVar4;" (assignment_expression "sVar4 = param_3 - sVar4" identifier = (binary_expression "param_3 - sVar4" identifier - identifier)) ;) (expression_statement "pwVar1 = (wchar_t *)((long)__s1 + lVar5);" (assignment_expression "pwVar1 = (wchar_t *)((long)__s1 + lVar5)" identifier = (cast_expression "(wchar_t *)((long)__s1 + lVar5)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__s1 + lVar5)" ( (binary_expression "(long)__s1 + lVar5" (cast_expression "(long)__s1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) ;) (if_statement "if (sVar4 == 1) {\n            *pwVar1 = __s1[param_3];\n          }\n          else if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n            *pwVar1 = __s1[param_3];\n          }" { (expression_statement "*pwVar1 = __s1[param_3];" (assignment_expression "*pwVar1 = __s1[param_3]" (pointer_expression "*pwVar1" * identifier) = (subscript_expression "__s1[param_3]" identifier [ identifier ])) ;) }) (else_clause "else if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }" else (if_statement "if (sVar4 != 0) {\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }" if (parenthesized_expression "(sVar4 != 0)" ( (binary_expression "sVar4 != 0" identifier != number_literal) )) (compound_statement "{\n            wmemcpy(pwVar1,__s1 + param_3,sVar4);\n          }" { (expression_statement "wmemcpy(pwVar1,__s1 + param_3,sVar4);" (call_expression "wmemcpy(pwVar1,__s1 + param_3,sVar4)" identifier (argument_list "(pwVar1,__s1 + param_3,sVar4)" ( identifier , (binary_expression "__s1 + param_3" identifier + identifier) , identifier ))) ;) })))) }) (else_clause "else if (param_3 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }" else (if_statement "if (param_3 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n          *__s1 = *pwVar1;\n        }" { (expression_statement "*__s1 = *pwVar1;" (assignment_expression "*__s1 = *pwVar1" (pointer_expression "*__s1" * identifier) = (pointer_expression "*pwVar1" * identifier)) ;) }) (else_clause "else if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }" else (if_statement "if (param_3 != 0) {\n          wmemcpy(__s1,pwVar1,param_3);\n        }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n          wmemcpy(__s1,pwVar1,param_3);\n        }" { (expression_statement "wmemcpy(__s1,pwVar1,param_3);" (call_expression "wmemcpy(__s1,pwVar1,param_3)" identifier (argument_list "(__s1,pwVar1,param_3)" ( identifier , identifier , identifier ))) ;) })))))) }) (else_clause "else if (param_3 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_3 != 0) {\n        wmemcpy(__s1,__s2,param_3);\n      }" else (if_statement "if (param_3 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_3 != 0) {\n        wmemcpy(__s1,__s2,param_3);\n      }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n        *__s1 = *__s2;\n      }" { (expression_statement "*__s1 = *__s2;" (assignment_expression "*__s1 = *__s2" (pointer_expression "*__s1" * identifier) = (pointer_expression "*__s2" * identifier)) ;) }) (else_clause "else if (param_3 != 0) {\n        wmemcpy(__s1,__s2,param_3);\n      }" else (if_statement "if (param_3 != 0) {\n        wmemcpy(__s1,__s2,param_3);\n      }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n        wmemcpy(__s1,__s2,param_3);\n      }" { (expression_statement "wmemcpy(__s1,__s2,param_3);" (call_expression "wmemcpy(__s1,__s2,param_3)" identifier (argument_list "(__s1,__s2,param_3)" ( identifier , identifier , identifier ))) ;) })))))) (return_statement "return this;" return identifier ;) })) (expression_statement "pwVar3 = (wstring *)_M_replace_safe(this,param_1,0,param_2,param_3);" (assignment_expression "pwVar3 = (wstring *)_M_replace_safe(this,param_1,0,param_2,param_3)" identifier = (cast_expression "(wstring *)_M_replace_safe(this,param_1,0,param_2,param_3)" ( (type_descriptor "wstring *" 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 pwVar3;" 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_002f2770(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)\n\n{\n  wchar_t *__s2;\n  wchar_t *pwVar1;\n  ulong uVar2;\n  ulong uVar3;\n  ulong *puVar4;\n  size_t sVar5;\n  long lVar6;\n  wchar_t *__s1;\n  \n  uVar2 = *param_1;\n  uVar3 = *(ulong *)(uVar2 - 0x18);\n  if (uVar3 < param_2) {\n                    \n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0xffffffffffffffe - uVar3) {\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }\n                    \n  FUN_002b5650("basic_string::insert");\n}\n\n" (function_definition "ulong * FUN_002f2770(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)\n\n{\n  wchar_t *__s2;\n  wchar_t *pwVar1;\n  ulong uVar2;\n  ulong uVar3;\n  ulong *puVar4;\n  size_t sVar5;\n  long lVar6;\n  wchar_t *__s1;\n  \n  uVar2 = *param_1;\n  uVar3 = *(ulong *)(uVar2 - 0x18);\n  if (uVar3 < param_2) {\n                    \n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0xffffffffffffffe - uVar3) {\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }\n                    \n  FUN_002b5650("basic_string::insert");\n}" type_identifier (pointer_declarator "* FUN_002f2770(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" * (function_declarator "FUN_002f2770(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  wchar_t *__s2;\n  wchar_t *pwVar1;\n  ulong uVar2;\n  ulong uVar3;\n  ulong *puVar4;\n  size_t sVar5;\n  long lVar6;\n  wchar_t *__s1;\n  \n  uVar2 = *param_1;\n  uVar3 = *(ulong *)(uVar2 - 0x18);\n  if (uVar3 < param_2) {\n                    \n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0xffffffffffffffe - uVar3) {\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }\n                    \n  FUN_002b5650("basic_string::insert");\n}" { (declaration "wchar_t *__s2;" type_identifier (pointer_declarator "*__s2" * identifier) ;) (declaration "wchar_t *pwVar1;" type_identifier (pointer_declarator "*pwVar1" * identifier) ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "ulong uVar3;" type_identifier identifier ;) (declaration "ulong *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "size_t sVar5;" primitive_type identifier ;) (declaration "long lVar6;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar_t *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (expression_statement "uVar2 = *param_1;" (assignment_expression "uVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar3 = *(ulong *)(uVar2 - 0x18);" (assignment_expression "uVar3 = *(ulong *)(uVar2 - 0x18)" identifier = (pointer_expression "*(ulong *)(uVar2 - 0x18)" * (cast_expression "(ulong *)(uVar2 - 0x18)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar2 - 0x18)" ( (binary_expression "uVar2 - 0x18" identifier - number_literal) ))))) ;) (if_statement "if (uVar3 < param_2) {\n                    \n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }" if (parenthesized_expression "(uVar3 < param_2)" ( (binary_expression "uVar3 < param_2" identifier < identifier) )) (compound_statement "{\n                    \n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }" { (expression_statement "FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);" (call_expression "FUN_002b56d0("%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 <= 0xffffffffffffffe - uVar3) {\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }" if (parenthesized_expression "(param_4 <= 0xffffffffffffffe - uVar3)" ( (binary_expression "param_4 <= 0xffffffffffffffe - uVar3" identifier <= (binary_expression "0xffffffffffffffe - uVar3" number_literal - identifier)) )) (compound_statement "{\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }" { (if_statement "if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }" if (parenthesized_expression "(((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1))" ( (binary_expression "((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)" (parenthesized_expression "((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4))" ( (binary_expression "(uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)" (parenthesized_expression "(uVar2 <= param_3)" ( (binary_expression "uVar2 <= param_3" identifier <= identifier) )) && (parenthesized_expression "(param_3 <= uVar2 + uVar3 * 4)" ( (binary_expression "param_3 <= uVar2 + uVar3 * 4" identifier <= (binary_expression "uVar2 + uVar3 * 4" identifier + (binary_expression "uVar3 * 4" identifier * number_literal))) ))) )) && (parenthesized_expression "(*(int *)(uVar2 - 8) < 1)" ( (binary_expression "*(int *)(uVar2 - 8) < 1" (pointer_expression "*(int *)(uVar2 - 8)" * (cast_expression "(int *)(uVar2 - 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar2 - 8)" ( (binary_expression "uVar2 - 8" identifier - number_literal) )))) < number_literal) ))) )) (compound_statement "{\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }" { (expression_statement "uVar2 = *param_1;" (assignment_expression "uVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "FUN_002f1e60(param_1,param_2,0,param_4);" (call_expression "FUN_002f1e60(param_1,param_2,0,param_4)" identifier (argument_list "(param_1,param_2,0,param_4)" ( identifier , identifier , number_literal , identifier ))) ;) (expression_statement "__s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));" (assignment_expression "__s2 = (wchar_t *)(*param_1 + (param_3 - uVar2))" identifier = (cast_expression "(wchar_t *)(*param_1 + (param_3 - uVar2))" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + (param_3 - uVar2))" ( (binary_expression "*param_1 + (param_3 - uVar2)" (pointer_expression "*param_1" * identifier) + (parenthesized_expression "(param_3 - uVar2)" ( (binary_expression "param_3 - uVar2" identifier - identifier) ))) )))) ;) (expression_statement "__s1 = (wchar_t *)(*param_1 + param_2 * 4);" (assignment_expression "__s1 = (wchar_t *)(*param_1 + param_2 * 4)" identifier = (cast_expression "(wchar_t *)(*param_1 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + param_2 * 4)" ( (binary_expression "*param_1 + param_2 * 4" (pointer_expression "*param_1" * identifier) + (binary_expression "param_2 * 4" identifier * number_literal)) )))) ;) (expression_statement "pwVar1 = __s2 + param_4;" (assignment_expression "pwVar1 = __s2 + param_4" identifier = (binary_expression "__s2 + param_4" identifier + identifier)) ;) (if_statement "if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" if (parenthesized_expression "(__s1 < pwVar1)" ( (binary_expression "__s1 < pwVar1" identifier < identifier) )) (compound_statement "{\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }" { (if_statement "if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" if (parenthesized_expression "(__s2 < __s1)" ( (binary_expression "__s2 < __s1" identifier < identifier) )) (compound_statement "{\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }" { (expression_statement "lVar6 = param_2 * 4 - (param_3 - uVar2);" (assignment_expression "lVar6 = param_2 * 4 - (param_3 - uVar2)" identifier = (binary_expression "param_2 * 4 - (param_3 - uVar2)" (binary_expression "param_2 * 4" identifier * number_literal) - (parenthesized_expression "(param_3 - uVar2)" ( (binary_expression "param_3 - uVar2" identifier - identifier) )))) ;) (expression_statement "sVar5 = lVar6 >> 2;" (assignment_expression "sVar5 = lVar6 >> 2" identifier = (binary_expression "lVar6 >> 2" identifier >> number_literal)) ;) (if_statement "if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }" if (parenthesized_expression "(sVar5 == 1)" ( (binary_expression "sVar5 == 1" identifier == number_literal) )) (compound_statement "{\n            *__s1 = *__s2;\n          }" { (expression_statement "*__s1 = *__s2;" (assignment_expression "*__s1 = *__s2" (pointer_expression "*__s1" * identifier) = (pointer_expression "*__s2" * identifier)) ;) }) (else_clause "else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }" else (if_statement "if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }" if (parenthesized_expression "(sVar5 != 0)" ( (binary_expression "sVar5 != 0" identifier != number_literal) )) (compound_statement "{\n            wmemcpy(__s1,__s2,sVar5);\n          }" { (expression_statement "wmemcpy(__s1,__s2,sVar5);" (call_expression "wmemcpy(__s1,__s2,sVar5)" identifier (argument_list "(__s1,__s2,sVar5)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "sVar5 = param_4 - sVar5;" (assignment_expression "sVar5 = param_4 - sVar5" identifier = (binary_expression "param_4 - sVar5" identifier - identifier)) ;) (expression_statement "pwVar1 = (wchar_t *)((long)__s1 + lVar6);" (assignment_expression "pwVar1 = (wchar_t *)((long)__s1 + lVar6)" identifier = (cast_expression "(wchar_t *)((long)__s1 + lVar6)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__s1 + lVar6)" ( (binary_expression "(long)__s1 + lVar6" (cast_expression "(long)__s1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) ;) (if_statement "if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }" if (parenthesized_expression "(sVar5 == 1)" ( (binary_expression "sVar5 == 1" identifier == number_literal) )) (compound_statement "{\n            *pwVar1 = __s1[param_4];\n          }" { (expression_statement "*pwVar1 = __s1[param_4];" (assignment_expression "*pwVar1 = __s1[param_4]" (pointer_expression "*pwVar1" * identifier) = (subscript_expression "__s1[param_4]" identifier [ identifier ])) ;) }) (else_clause "else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }" else (if_statement "if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }" if (parenthesized_expression "(sVar5 != 0)" ( (binary_expression "sVar5 != 0" identifier != number_literal) )) (compound_statement "{\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }" { (expression_statement "wmemcpy(pwVar1,__s1 + param_4,sVar5);" (call_expression "wmemcpy(pwVar1,__s1 + param_4,sVar5)" identifier (argument_list "(pwVar1,__s1 + param_4,sVar5)" ( identifier , (binary_expression "__s1 + param_4" identifier + identifier) , identifier ))) ;) })))) }) (else_clause "else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" else (if_statement "if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n          *__s1 = *pwVar1;\n        }" { (expression_statement "*__s1 = *pwVar1;" (assignment_expression "*__s1 = *pwVar1" (pointer_expression "*__s1" * identifier) = (pointer_expression "*pwVar1" * identifier)) ;) }) (else_clause "else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" else (if_statement "if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n          wmemcpy(__s1,pwVar1,param_4);\n        }" { (expression_statement "wmemcpy(__s1,pwVar1,param_4);" (call_expression "wmemcpy(__s1,pwVar1,param_4)" identifier (argument_list "(__s1,pwVar1,param_4)" ( identifier , identifier , identifier ))) ;) })))))) }) (else_clause "else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" else (if_statement "if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *__s1 = *__s2;\n      }" { (expression_statement "*__s1 = *__s2;" (assignment_expression "*__s1 = *__s2" (pointer_expression "*__s1" * identifier) = (pointer_expression "*__s2" * identifier)) ;) }) (else_clause "else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" else (if_statement "if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n        wmemcpy(__s1,__s2,param_4);\n      }" { (expression_statement "wmemcpy(__s1,__s2,param_4);" (call_expression "wmemcpy(__s1,__s2,param_4)" identifier (argument_list "(__s1,__s2,param_4)" ( identifier , identifier , identifier ))) ;) })))))) (return_statement "return param_1;" return identifier ;) })) (expression_statement "puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);" (assignment_expression "puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3)" identifier = (cast_expression "(ulong *)FUN_002f2540(param_1,param_2,0,param_3)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_002f2540(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 puVar4;" return identifier ;) })) (expression_statement "FUN_002b5650("basic_string::insert");" (call_expression "FUN_002b5650("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 IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (pointer_declarator * 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 + (binary_expression IDENT * LIT))) ))) )) && (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) + (binary_expression IDENT * LIT)) )))) ;) (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 (binary_expression IDENT * LIT) - (parenthesized_expression ( (binary_expression IDENT - IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT >> LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * 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 ( 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_002f2770(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)\n\n{\n  wchar_t *__s2;\n  wchar_t *pwVar1;\n  ulong uVar2;\n  ulong uVar3;\n  ulong *puVar4;\n  size_t sVar5;\n  long lVar6;\n  wchar_t *__s1;\n  \n  uVar2 = *param_1;\n  uVar3 = *(ulong *)(uVar2 - 0x18);\n  if (uVar3 < param_2) {\n                    \n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0xffffffffffffffe - uVar3) {\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }\n                    \n  FUN_002b5650("basic_string::insert");\n}" (type_identifier "ulong") (pointer_declarator "* FUN_002f2770(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" (* "*") (function_declarator "FUN_002f2770(ulong *param_1,ulong param_2,ulong param_3,ulong param_4)" (identifier "FUN_002f2770") (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  wchar_t *__s2;\n  wchar_t *pwVar1;\n  ulong uVar2;\n  ulong uVar3;\n  ulong *puVar4;\n  size_t sVar5;\n  long lVar6;\n  wchar_t *__s1;\n  \n  uVar2 = *param_1;\n  uVar3 = *(ulong *)(uVar2 - 0x18);\n  if (uVar3 < param_2) {\n                    \n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }\n  if (param_4 <= 0xffffffffffffffe - uVar3) {\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }\n                    \n  FUN_002b5650("basic_string::insert");\n}" ({ "{") (declaration "wchar_t *__s2;" (type_identifier "wchar_t") (pointer_declarator "*__s2" (* "*") (identifier "__s2")) (; ";")) (declaration "wchar_t *pwVar1;" (type_identifier "wchar_t") (pointer_declarator "*pwVar1" (* "*") (identifier "pwVar1")) (; ";")) (declaration "ulong uVar2;" (type_identifier "ulong") (identifier "uVar2") (; ";")) (declaration "ulong uVar3;" (type_identifier "ulong") (identifier "uVar3") (; ";")) (declaration "ulong *puVar4;" (type_identifier "ulong") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "size_t sVar5;" (primitive_type "size_t") (identifier "sVar5") (; ";")) (declaration "long lVar6;" (sized_type_specifier "long" (long "long")) (identifier "lVar6") (; ";")) (declaration "wchar_t *__s1;" (type_identifier "wchar_t") (pointer_declarator "*__s1" (* "*") (identifier "__s1")) (; ";")) (expression_statement "uVar2 = *param_1;" (assignment_expression "uVar2 = *param_1" (identifier "uVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "uVar3 = *(ulong *)(uVar2 - 0x18);" (assignment_expression "uVar3 = *(ulong *)(uVar2 - 0x18)" (identifier "uVar3") (= "=") (pointer_expression "*(ulong *)(uVar2 - 0x18)" (* "*") (cast_expression "(ulong *)(uVar2 - 0x18)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(uVar2 - 0x18)" (( "(") (binary_expression "uVar2 - 0x18" (identifier "uVar2") (- "-") (number_literal "0x18")) () ")"))))) (; ";")) (if_statement "if (uVar3 < param_2) {\n                    \n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }" (if "if") (parenthesized_expression "(uVar3 < param_2)" (( "(") (binary_expression "uVar3 < param_2" (identifier "uVar3") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n                    \n    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);\n  }" ({ "{") (expression_statement "FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2);" (call_expression "FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2)" (identifier "FUN_002b56d0") (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 <= 0xffffffffffffffe - uVar3) {\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }" (if "if") (parenthesized_expression "(param_4 <= 0xffffffffffffffe - uVar3)" (( "(") (binary_expression "param_4 <= 0xffffffffffffffe - uVar3" (identifier "param_4") (<= "<=") (binary_expression "0xffffffffffffffe - uVar3" (number_literal "0xffffffffffffffe") (- "-") (identifier "uVar3"))) () ")")) (compound_statement "{\n    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }\n    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);\n    return puVar4;\n  }" ({ "{") (if_statement "if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }" (if "if") (parenthesized_expression "(((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1))" (( "(") (binary_expression "((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)" (parenthesized_expression "((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4))" (( "(") (binary_expression "(uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)" (parenthesized_expression "(uVar2 <= param_3)" (( "(") (binary_expression "uVar2 <= param_3" (identifier "uVar2") (<= "<=") (identifier "param_3")) () ")")) (&& "&&") (parenthesized_expression "(param_3 <= uVar2 + uVar3 * 4)" (( "(") (binary_expression "param_3 <= uVar2 + uVar3 * 4" (identifier "param_3") (<= "<=") (binary_expression "uVar2 + uVar3 * 4" (identifier "uVar2") (+ "+") (binary_expression "uVar3 * 4" (identifier "uVar3") (* "*") (number_literal "4")))) () ")"))) () ")")) (&& "&&") (parenthesized_expression "(*(int *)(uVar2 - 8) < 1)" (( "(") (binary_expression "*(int *)(uVar2 - 8) < 1" (pointer_expression "*(int *)(uVar2 - 8)" (* "*") (cast_expression "(int *)(uVar2 - 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(uVar2 - 8)" (( "(") (binary_expression "uVar2 - 8" (identifier "uVar2") (- "-") (number_literal "8")) () ")")))) (< "<") (number_literal "1")) () ")"))) () ")")) (compound_statement "{\n      uVar2 = *param_1;\n      FUN_002f1e60(param_1,param_2,0,param_4);\n      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));\n      __s1 = (wchar_t *)(*param_1 + param_2 * 4);\n      pwVar1 = __s2 + param_4;\n      if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }\n      return param_1;\n    }" ({ "{") (expression_statement "uVar2 = *param_1;" (assignment_expression "uVar2 = *param_1" (identifier "uVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "FUN_002f1e60(param_1,param_2,0,param_4);" (call_expression "FUN_002f1e60(param_1,param_2,0,param_4)" (identifier "FUN_002f1e60") (argument_list "(param_1,param_2,0,param_4)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (number_literal "0") (, ",") (identifier "param_4") () ")"))) (; ";")) (expression_statement "__s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));" (assignment_expression "__s2 = (wchar_t *)(*param_1 + (param_3 - uVar2))" (identifier "__s2") (= "=") (cast_expression "(wchar_t *)(*param_1 + (param_3 - uVar2))" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + (param_3 - uVar2))" (( "(") (binary_expression "*param_1 + (param_3 - uVar2)" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (parenthesized_expression "(param_3 - uVar2)" (( "(") (binary_expression "param_3 - uVar2" (identifier "param_3") (- "-") (identifier "uVar2")) () ")"))) () ")")))) (; ";")) (expression_statement "__s1 = (wchar_t *)(*param_1 + param_2 * 4);" (assignment_expression "__s1 = (wchar_t *)(*param_1 + param_2 * 4)" (identifier "__s1") (= "=") (cast_expression "(wchar_t *)(*param_1 + param_2 * 4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + param_2 * 4)" (( "(") (binary_expression "*param_1 + param_2 * 4" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4"))) () ")")))) (; ";")) (expression_statement "pwVar1 = __s2 + param_4;" (assignment_expression "pwVar1 = __s2 + param_4" (identifier "pwVar1") (= "=") (binary_expression "__s2 + param_4" (identifier "__s2") (+ "+") (identifier "param_4"))) (; ";")) (if_statement "if (__s1 < pwVar1) {\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" (if "if") (parenthesized_expression "(__s1 < pwVar1)" (( "(") (binary_expression "__s1 < pwVar1" (identifier "__s1") (< "<") (identifier "pwVar1")) () ")")) (compound_statement "{\n        if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }\n      }" ({ "{") (if_statement "if (__s2 < __s1) {\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }\n        else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" (if "if") (parenthesized_expression "(__s2 < __s1)" (( "(") (binary_expression "__s2 < __s1" (identifier "__s2") (< "<") (identifier "__s1")) () ")")) (compound_statement "{\n          lVar6 = param_2 * 4 - (param_3 - uVar2);\n          sVar5 = lVar6 >> 2;\n          if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }\n          sVar5 = param_4 - sVar5;\n          pwVar1 = (wchar_t *)((long)__s1 + lVar6);\n          if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }\n        }" ({ "{") (expression_statement "lVar6 = param_2 * 4 - (param_3 - uVar2);" (assignment_expression "lVar6 = param_2 * 4 - (param_3 - uVar2)" (identifier "lVar6") (= "=") (binary_expression "param_2 * 4 - (param_3 - uVar2)" (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4")) (- "-") (parenthesized_expression "(param_3 - uVar2)" (( "(") (binary_expression "param_3 - uVar2" (identifier "param_3") (- "-") (identifier "uVar2")) () ")")))) (; ";")) (expression_statement "sVar5 = lVar6 >> 2;" (assignment_expression "sVar5 = lVar6 >> 2" (identifier "sVar5") (= "=") (binary_expression "lVar6 >> 2" (identifier "lVar6") (>> ">>") (number_literal "2"))) (; ";")) (if_statement "if (sVar5 == 1) {\n            *__s1 = *__s2;\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }" (if "if") (parenthesized_expression "(sVar5 == 1)" (( "(") (binary_expression "sVar5 == 1" (identifier "sVar5") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n            *__s1 = *__s2;\n          }" ({ "{") (expression_statement "*__s1 = *__s2;" (assignment_expression "*__s1 = *__s2" (pointer_expression "*__s1" (* "*") (identifier "__s1")) (= "=") (pointer_expression "*__s2" (* "*") (identifier "__s2"))) (; ";")) (} "}")) (else_clause "else if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }" (else "else") (if_statement "if (sVar5 != 0) {\n            wmemcpy(__s1,__s2,sVar5);\n          }" (if "if") (parenthesized_expression "(sVar5 != 0)" (( "(") (binary_expression "sVar5 != 0" (identifier "sVar5") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n            wmemcpy(__s1,__s2,sVar5);\n          }" ({ "{") (expression_statement "wmemcpy(__s1,__s2,sVar5);" (call_expression "wmemcpy(__s1,__s2,sVar5)" (identifier "wmemcpy") (argument_list "(__s1,__s2,sVar5)" (( "(") (identifier "__s1") (, ",") (identifier "__s2") (, ",") (identifier "sVar5") () ")"))) (; ";")) (} "}"))))) (expression_statement "sVar5 = param_4 - sVar5;" (assignment_expression "sVar5 = param_4 - sVar5" (identifier "sVar5") (= "=") (binary_expression "param_4 - sVar5" (identifier "param_4") (- "-") (identifier "sVar5"))) (; ";")) (expression_statement "pwVar1 = (wchar_t *)((long)__s1 + lVar6);" (assignment_expression "pwVar1 = (wchar_t *)((long)__s1 + lVar6)" (identifier "pwVar1") (= "=") (cast_expression "(wchar_t *)((long)__s1 + lVar6)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)__s1 + lVar6)" (( "(") (binary_expression "(long)__s1 + lVar6" (cast_expression "(long)__s1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "__s1")) (+ "+") (identifier "lVar6")) () ")")))) (; ";")) (if_statement "if (sVar5 == 1) {\n            *pwVar1 = __s1[param_4];\n          }\n          else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }" (if "if") (parenthesized_expression "(sVar5 == 1)" (( "(") (binary_expression "sVar5 == 1" (identifier "sVar5") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n            *pwVar1 = __s1[param_4];\n          }" ({ "{") (expression_statement "*pwVar1 = __s1[param_4];" (assignment_expression "*pwVar1 = __s1[param_4]" (pointer_expression "*pwVar1" (* "*") (identifier "pwVar1")) (= "=") (subscript_expression "__s1[param_4]" (identifier "__s1") ([ "[") (identifier "param_4") (] "]"))) (; ";")) (} "}")) (else_clause "else if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }" (else "else") (if_statement "if (sVar5 != 0) {\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }" (if "if") (parenthesized_expression "(sVar5 != 0)" (( "(") (binary_expression "sVar5 != 0" (identifier "sVar5") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n            wmemcpy(pwVar1,__s1 + param_4,sVar5);\n          }" ({ "{") (expression_statement "wmemcpy(pwVar1,__s1 + param_4,sVar5);" (call_expression "wmemcpy(pwVar1,__s1 + param_4,sVar5)" (identifier "wmemcpy") (argument_list "(pwVar1,__s1 + param_4,sVar5)" (( "(") (identifier "pwVar1") (, ",") (binary_expression "__s1 + param_4" (identifier "__s1") (+ "+") (identifier "param_4")) (, ",") (identifier "sVar5") () ")"))) (; ";")) (} "}"))))) (} "}")) (else_clause "else if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" (else "else") (if_statement "if (param_4 == 1) {\n          *__s1 = *pwVar1;\n        }\n        else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" (if "if") (parenthesized_expression "(param_4 == 1)" (( "(") (binary_expression "param_4 == 1" (identifier "param_4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n          *__s1 = *pwVar1;\n        }" ({ "{") (expression_statement "*__s1 = *pwVar1;" (assignment_expression "*__s1 = *pwVar1" (pointer_expression "*__s1" (* "*") (identifier "__s1")) (= "=") (pointer_expression "*pwVar1" (* "*") (identifier "pwVar1"))) (; ";")) (} "}")) (else_clause "else if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" (else "else") (if_statement "if (param_4 != 0) {\n          wmemcpy(__s1,pwVar1,param_4);\n        }" (if "if") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n          wmemcpy(__s1,pwVar1,param_4);\n        }" ({ "{") (expression_statement "wmemcpy(__s1,pwVar1,param_4);" (call_expression "wmemcpy(__s1,pwVar1,param_4)" (identifier "wmemcpy") (argument_list "(__s1,pwVar1,param_4)" (( "(") (identifier "__s1") (, ",") (identifier "pwVar1") (, ",") (identifier "param_4") () ")"))) (; ";")) (} "}"))))))) (} "}")) (else_clause "else if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" (else "else") (if_statement "if (param_4 == 1) {\n        *__s1 = *__s2;\n      }\n      else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" (if "if") (parenthesized_expression "(param_4 == 1)" (( "(") (binary_expression "param_4 == 1" (identifier "param_4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *__s1 = *__s2;\n      }" ({ "{") (expression_statement "*__s1 = *__s2;" (assignment_expression "*__s1 = *__s2" (pointer_expression "*__s1" (* "*") (identifier "__s1")) (= "=") (pointer_expression "*__s2" (* "*") (identifier "__s2"))) (; ";")) (} "}")) (else_clause "else if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" (else "else") (if_statement "if (param_4 != 0) {\n        wmemcpy(__s1,__s2,param_4);\n      }" (if "if") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        wmemcpy(__s1,__s2,param_4);\n      }" ({ "{") (expression_statement "wmemcpy(__s1,__s2,param_4);" (call_expression "wmemcpy(__s1,__s2,param_4)" (identifier "wmemcpy") (argument_list "(__s1,__s2,param_4)" (( "(") (identifier "__s1") (, ",") (identifier "__s2") (, ",") (identifier "param_4") () ")"))) (; ";")) (} "}"))))))) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (expression_statement "puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);" (assignment_expression "puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3)" (identifier "puVar4") (= "=") (cast_expression "(ulong *)FUN_002f2540(param_1,param_2,0,param_3)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_002f2540(param_1,param_2,0,param_3)" (identifier "FUN_002f2540") (argument_list "(param_1,param_2,0,param_3)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (number_literal "0") (, ",") (identifier "param_3") () ")"))))) (; ";")) (return_statement "return puVar4;" (return "return") (identifier "puVar4") (; ";")) (} "}"))) (expression_statement "FUN_002b5650("basic_string::insert");" (call_expression "FUN_002b5650("basic_string::insert")" (identifier "FUN_002b5650") (argument_list "("basic_string::insert")" (( "(") (string_literal ""basic_string::insert"" (" """) (string_content "basic_string::insert") (" """)) () ")"))) (; ";")) (} "}")))

/* std::wstring::insert(unsigned long, wchar_t const*, unsigned long) */

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

{
  type_1 *var_9;
  type_1 *var_1;
  type_2 var_2;
  type_3 *pwVar3;
  size_t var_11;
  long var_8;
  type_1 *var_10;
  
  var_1 = *(type_1 **)this;
  var_2 = *(type_2 *)(var_1 + -6);
  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 <= 0xffffffffffffffe - var_2) {
    if (((var_1 <= var_6) && (var_6 <= var_1 + var_2)) && (var_1[-2] < L'\x01')) {
      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 * 4);
      var_1 = var_9 + var_5;
      if (var_10 < var_1) {
        if (var_9 < var_10) {
          var_8 = var_3 * 4 - ((long)var_6 - var_8);
          var_11 = var_8 >> 2;
          if (var_11 == 1) {
            *var_10 = *var_9;
          }
          else if (var_11 != 0) {
            var_12(var_10,var_9,var_11);
          }
          var_11 = var_5 - var_11;
          var_1 = (type_1 *)((long)var_10 + var_8);
          if (var_11 == 1) {
            *var_1 = var_10[var_5];
          }
          else if (var_11 != 0) {
            var_12(var_1,var_10 + var_5,var_11);
          }
        }
        else if (var_5 == 1) {
          *var_10 = *var_1;
        }
        else if (var_5 != 0) {
          var_12(var_10,var_1,var_5);
        }
      }
      else if (var_5 == 1) {
        *var_10 = *var_9;
      }
      else if (var_5 != 0) {
        var_12(var_10,var_9,var_5);
      }
      return this;
    }
    pwVar3 = (type_3 *)var_13(this,var_3,0,var_6,var_5);
    return pwVar3;
  }
                    /* WARNING: Subroutine does not return */
  var_14("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: (primitive_type) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator 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: (binary_expression left: (identifier) right: (number_literal))))))) 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: (binary_expression left: (identifier) right: (number_literal))))))) (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: (binary_expression left: (identifier) right: (number_literal)) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (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)))))))) (expression_statement (assignment_expression left: (identifier) right: (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: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (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: (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 (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)

{
  wchar_t *__s2;
  wchar_t *pwVar1;
  ulong uVar2;
  ulong uVar3;
  ulong *puVar4;
  size_t sVar5;
  long lVar6;
  wchar_t *__s1;
  
  uVar2 = *param_1;
  uVar3 = *(ulong *)(uVar2 - 0x18);
  if (uVar3 < param_2) {
                    /* WARNING: Subroutine does not return */
    FUN_002b56d0("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",
                 param_2);
  }
  if (param_4 <= 0xffffffffffffffe - uVar3) {
    if (((uVar2 <= param_3) && (param_3 <= uVar2 + uVar3 * 4)) && (*(int *)(uVar2 - 8) < 1)) {
      uVar2 = *param_1;
      FUN_002f1e60(param_1,param_2,0,param_4);
      __s2 = (wchar_t *)(*param_1 + (param_3 - uVar2));
      __s1 = (wchar_t *)(*param_1 + param_2 * 4);
      pwVar1 = __s2 + param_4;
      if (__s1 < pwVar1) {
        if (__s2 < __s1) {
          lVar6 = param_2 * 4 - (param_3 - uVar2);
          sVar5 = lVar6 >> 2;
          if (sVar5 == 1) {
            *__s1 = *__s2;
          }
          else if (sVar5 != 0) {
            wmemcpy(__s1,__s2,sVar5);
          }
          sVar5 = param_4 - sVar5;
          pwVar1 = (wchar_t *)((long)__s1 + lVar6);
          if (sVar5 == 1) {
            *pwVar1 = __s1[param_4];
          }
          else if (sVar5 != 0) {
            wmemcpy(pwVar1,__s1 + param_4,sVar5);
          }
        }
        else if (param_4 == 1) {
          *__s1 = *pwVar1;
        }
        else if (param_4 != 0) {
          wmemcpy(__s1,pwVar1,param_4);
        }
      }
      else if (param_4 == 1) {
        *__s1 = *__s2;
      }
      else if (param_4 != 0) {
        wmemcpy(__s1,__s2,param_4);
      }
      return param_1;
    }
    puVar4 = (ulong *)FUN_002f2540(param_1,param_2,0,param_3);
    return puVar4;
  }
                    /* WARNING: Subroutine does not return */
  FUN_002b5650("basic_string::insert");
}

