
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::string::insert(unsigned int, char const*, unsigned int) */

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

{
  undefined1 *__src;
  undefined1 *__src_00;
  char *pcVar1;
  uint uVar2;
  int iVar3;
  size_t __n;
  size_t __n_00;
  undefined1 *__dest;
  
  pcVar1 = *(char **)this;
  uVar2 = *(uint *)(pcVar1 + -0xc);
  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,uVar2);
  }
  if (param_3 <= 0x3ffffffc - uVar2) {
    if (((param_2 < pcVar1) || (pcVar1 + uVar2 < param_2)) || (0 < *(int *)(pcVar1 + -4))) {
      this = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);
    }
    else {
      iVar3 = *(int *)this;
      _M_mutate(this,param_1,0,param_3);
      __src_00 = (undefined1 *)(*(int *)this + ((int)param_2 - iVar3));
      __dest = (undefined1 *)(*(int *)this + param_1);
      __src = __src_00 + param_3;
      if (__dest < __src) {
        if (__src_00 < __dest) {
          __n_00 = param_1 - ((int)param_2 - iVar3);
          if (__n_00 == 1) {
            *__dest = *__src_00;
          }
          else if (__n_00 != 0) {
            memcpy(__dest,__src_00,__n_00);
          }
          __n = param_3 - __n_00;
          if (__n == 1) {
            __dest[__n_00] = __dest[param_3];
          }
          else if (__n != 0) {
            memcpy(__dest + __n_00,__dest + param_3,__n);
          }
        }
        else if (param_3 == 1) {
          *__dest = *__src;
        }
        else if (param_3 != 0) {
          memcpy(__dest,__src,param_3);
        }
      }
      else if (param_3 == 1) {
        *__dest = *__src_00;
      }
      else if (param_3 != 0) {
        memcpy(__dest,__src_00,param_3);
      }
    }
    return this;
  }
                    /* WARNING: Subroutine does not return */
  __throw_length_error("basic_string::insert");
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

uint * FUN_0021f6b0(uint *param_1,uint param_2,uint param_3,uint param_4)

{
  undefined1 *__src;
  undefined1 *__src_00;
  uint uVar1;
  uint uVar2;
  size_t __n;
  size_t __n_00;
  undefined1 *__dest;
  
  uVar1 = *param_1;
  uVar2 = *(uint *)(uVar1 - 0xc);
  if (uVar2 < param_2) {
                    /* WARNING: Subroutine does not return */
    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",
                 param_2,uVar2);
  }
  if (param_4 <= 0x3ffffffc - uVar2) {
    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {
      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);
    }
    else {
      uVar1 = *param_1;
      FUN_0021eb90(param_1,param_2,0,param_4);
      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));
      __dest = (undefined1 *)(*param_1 + param_2);
      __src = __src_00 + param_4;
      if (__dest < __src) {
        if (__src_00 < __dest) {
          __n_00 = param_2 - (param_3 - uVar1);
          if (__n_00 == 1) {
            *__dest = *__src_00;
          }
          else if (__n_00 != 0) {
            memcpy(__dest,__src_00,__n_00);
          }
          __n = param_4 - __n_00;
          if (__n == 1) {
            __dest[__n_00] = __dest[param_4];
          }
          else if (__n != 0) {
            memcpy(__dest + __n_00,__dest + param_4,__n);
          }
        }
        else if (param_4 == 1) {
          *__dest = *__src;
        }
        else if (param_4 != 0) {
          memcpy(__dest,__src,param_4);
        }
      }
      else if (param_4 == 1) {
        *__dest = *__src_00;
      }
      else if (param_4 != 0) {
        memcpy(__dest,__src_00,param_4);
      }
    }
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0022c7a0("basic_string::insert");
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00035840
ADD EBX,0x16f947
SUB ESP,0x1c
MOV ESI,dword ptr [ESP + 0x30]
MOV EBP,dword ptr [ESP + 0x38]
MOV EDI,dword ptr [ESP + 0x3c]
MOV ECX,dword ptr [ESI]
MOV EAX,dword ptr [ECX + -0xc]
CMP dword ptr [ESP + 0x34],EAX
JA 0x0021f824
MOV EDX,0x3ffffffc
SUB EDX,EAX
CMP EDI,EDX
JA 0x0021f815
CMP ECX,EBP
JBE 0x0021f710
SUB ESP,0xc
PUSH EDI
PUSH EBP
PUSH 0x0
PUSH dword ptr [ESP + 0x4c]
PUSH ESI
CALL 0x0021f430
ADD ESP,0x20
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
ADD EAX,ECX
CMP EBP,EAX
JA 0x0021f6f0
MOV EAX,dword ptr [ECX + -0x4]
TEST EAX,EAX
JG 0x0021f6f0
MOV ECX,EBP
SUB ECX,dword ptr [ESI]
MOV dword ptr [ESP + 0xc],ECX
PUSH EDI
PUSH 0x0
PUSH dword ptr [ESP + 0x3c]
PUSH ESI
CALL 0x0021eb90
MOV EBP,dword ptr [ESI]
MOV ECX,dword ptr [ESP + 0x1c]
LEA EAX,[EBP + ECX*0x1]
ADD EBP,dword ptr [ESP + 0x44]
ADD ESP,0x10
LEA EDX,[EAX + EDI*0x1]
CMP EDX,EBP
JA 0x0021f770
CMP EDI,0x1
JZ 0x0021f7e7
TEST EDI,EDI
JZ 0x0021f7e0
SUB ESP,0x4
PUSH EDI
PUSH EAX
PUSH EBP
CALL 0x000295c0
ADD ESP,0x10
MOV EAX,ESI
JMP 0x0021f704
CMP EAX,EBP
JC 0x0021f796
CMP EDI,0x1
JZ 0x0021f7fc
TEST EDI,EDI
JZ 0x0021f7e0
SUB ESP,0x4
PUSH EDI
PUSH EDX
PUSH EBP
CALL 0x000295c0
ADD ESP,0x10
MOV EAX,ESI
JMP 0x0021f704
MOV EDX,dword ptr [ESP + 0x34]
SUB EDX,ECX
CMP EDX,0x1
JZ 0x0021f7f4
TEST EDX,EDX
JZ 0x0021f7bb
SUB ESP,0x4
PUSH EDX
MOV dword ptr [ESP + 0x14],EDX
PUSH EAX
PUSH EBP
CALL 0x000295c0
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0xc]
MOV EAX,EDI
ADD EDI,EBP
SUB EAX,EDX
ADD EDX,EBP
CMP EAX,0x1
JZ 0x0021f809
TEST EAX,EAX
JZ 0x0021f7e0
SUB ESP,0x4
PUSH EAX
PUSH EDI
PUSH EDX
CALL 0x000295c0
ADD ESP,0x10
LEA ESI,[ESI]
MOV EAX,ESI
JMP 0x0021f704
MOVZX EAX,byte ptr [EAX]
MOV byte ptr [EBP],AL
MOV EAX,ESI
JMP 0x0021f704
MOVZX EAX,byte ptr [EAX]
MOV byte ptr [EBP],AL
JMP 0x0021f7bb
MOVZX EAX,byte ptr [EDX]
MOV byte ptr [EBP],AL
MOV EAX,ESI
JMP 0x0021f704
MOVZX EAX,byte ptr [EDI]
MOV byte ptr [EDX],AL
MOV EAX,ESI
JMP 0x0021f704
SUB ESP,0xc
LEA EAX,[EBX + 0xfff14d3d]
PUSH EAX
CALL 0x0022c7a0
PUSH EAX
LEA EAX,[EBX + 0xfff14d3d]
PUSH dword ptr [ESP + 0x38]
PUSH EAX
LEA EAX,[EBX + 0xffefbec4]
PUSH EAX
CALL 0x0022c840
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nuint * FUN_0021f6b0(uint *param_1,uint param_2,uint param_3,uint param_4)\n\n{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  uint uVar1;\n  uint uVar2;\n  size_t __n;\n  size_t __n_00;\n  undefined1 *__dest;\n  \n  uVar1 = *param_1;\n  uVar2 = *(uint *)(uVar1 - 0xc);\n  if (uVar2 < param_2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }\n  if (param_4 <= 0x3ffffffc - uVar2) {\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0022c7a0("basic_string::insert");\n}\n\n" comment (function_definition "uint * FUN_0021f6b0(uint *param_1,uint param_2,uint param_3,uint param_4)\n\n{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  uint uVar1;\n  uint uVar2;\n  size_t __n;\n  size_t __n_00;\n  undefined1 *__dest;\n  \n  uVar1 = *param_1;\n  uVar2 = *(uint *)(uVar1 - 0xc);\n  if (uVar2 < param_2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }\n  if (param_4 <= 0x3ffffffc - uVar2) {\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0022c7a0("basic_string::insert");\n}" type_identifier (pointer_declarator "* FUN_0021f6b0(uint *param_1,uint param_2,uint param_3,uint param_4)" * (function_declarator "FUN_0021f6b0(uint *param_1,uint param_2,uint param_3,uint param_4)" identifier (parameter_list "(uint *param_1,uint param_2,uint param_3,uint param_4)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) )))) (compound_statement "{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  uint uVar1;\n  uint uVar2;\n  size_t __n;\n  size_t __n_00;\n  undefined1 *__dest;\n  \n  uVar1 = *param_1;\n  uVar2 = *(uint *)(uVar1 - 0xc);\n  if (uVar2 < param_2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }\n  if (param_4 <= 0x3ffffffc - uVar2) {\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0022c7a0("basic_string::insert");\n}" { (declaration "undefined1 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "undefined1 *__src_00;" type_identifier (pointer_declarator "*__src_00" * identifier) ;) (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "size_t __n_00;" primitive_type identifier ;) (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (expression_statement "uVar1 = *param_1;" (assignment_expression "uVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar2 = *(uint *)(uVar1 - 0xc);" (assignment_expression "uVar2 = *(uint *)(uVar1 - 0xc)" identifier = (pointer_expression "*(uint *)(uVar1 - 0xc)" * (cast_expression "(uint *)(uVar1 - 0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 - 0xc)" ( (binary_expression "uVar1 - 0xc" identifier - number_literal) ))))) ;) (if_statement "if (uVar2 < param_2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }" if (parenthesized_expression "(uVar2 < param_2)" ( (binary_expression "uVar2 < param_2" identifier < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }" { comment (expression_statement "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);" (call_expression "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::insert"" " string_content ") , identifier , identifier ))) ;) })) (if_statement "if (param_4 <= 0x3ffffffc - uVar2) {\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }" if (parenthesized_expression "(param_4 <= 0x3ffffffc - uVar2)" ( (binary_expression "param_4 <= 0x3ffffffc - uVar2" identifier <= (binary_expression "0x3ffffffc - uVar2" number_literal - identifier)) )) (compound_statement "{\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }" { (if_statement "if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }" if (parenthesized_expression "(((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4)))" ( (binary_expression "((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))" (parenthesized_expression "((param_3 < uVar1) || (uVar2 + uVar1 < param_3))" ( (binary_expression "(param_3 < uVar1) || (uVar2 + uVar1 < param_3)" (parenthesized_expression "(param_3 < uVar1)" ( (binary_expression "param_3 < uVar1" identifier < identifier) )) || (parenthesized_expression "(uVar2 + uVar1 < param_3)" ( (binary_expression "uVar2 + uVar1 < param_3" (binary_expression "uVar2 + uVar1" identifier + identifier) < identifier) ))) )) || (parenthesized_expression "(0 < *(int *)(uVar1 - 4))" ( (binary_expression "0 < *(int *)(uVar1 - 4)" number_literal < (pointer_expression "*(int *)(uVar1 - 4)" * (cast_expression "(int *)(uVar1 - 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 - 4)" ( (binary_expression "uVar1 - 4" identifier - number_literal) ))))) ))) )) (compound_statement "{\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }" { (expression_statement "param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);" (assignment_expression "param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4)" identifier = (cast_expression "(uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0021f430(param_1,param_2,0,param_3,param_4)" identifier (argument_list "(param_1,param_2,0,param_3,param_4)" ( identifier , identifier , number_literal , identifier , identifier ))))) ;) }) (else_clause "else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }" else (compound_statement "{\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }" { (expression_statement "uVar1 = *param_1;" (assignment_expression "uVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "FUN_0021eb90(param_1,param_2,0,param_4);" (call_expression "FUN_0021eb90(param_1,param_2,0,param_4)" identifier (argument_list "(param_1,param_2,0,param_4)" ( identifier , identifier , number_literal , identifier ))) ;) (expression_statement "__src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));" (assignment_expression "__src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1))" identifier = (cast_expression "(undefined1 *)(*param_1 + (param_3 - uVar1))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + (param_3 - uVar1))" ( (binary_expression "*param_1 + (param_3 - uVar1)" (pointer_expression "*param_1" * identifier) + (parenthesized_expression "(param_3 - uVar1)" ( (binary_expression "param_3 - uVar1" identifier - identifier) ))) )))) ;) (expression_statement "__dest = (undefined1 *)(*param_1 + param_2);" (assignment_expression "__dest = (undefined1 *)(*param_1 + param_2)" identifier = (cast_expression "(undefined1 *)(*param_1 + param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + param_2)" ( (binary_expression "*param_1 + param_2" (pointer_expression "*param_1" * identifier) + identifier) )))) ;) (expression_statement "__src = __src_00 + param_4;" (assignment_expression "__src = __src_00 + param_4" identifier = (binary_expression "__src_00 + param_4" identifier + identifier)) ;) (if_statement "if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" if (parenthesized_expression "(__dest < __src)" ( (binary_expression "__dest < __src" identifier < identifier) )) (compound_statement "{\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }" { (if_statement "if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" if (parenthesized_expression "(__src_00 < __dest)" ( (binary_expression "__src_00 < __dest" identifier < identifier) )) (compound_statement "{\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }" { (expression_statement "__n_00 = param_2 - (param_3 - uVar1);" (assignment_expression "__n_00 = param_2 - (param_3 - uVar1)" identifier = (binary_expression "param_2 - (param_3 - uVar1)" identifier - (parenthesized_expression "(param_3 - uVar1)" ( (binary_expression "param_3 - uVar1" identifier - identifier) )))) ;) (if_statement "if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }" if (parenthesized_expression "(__n_00 == 1)" ( (binary_expression "__n_00 == 1" identifier == number_literal) )) (compound_statement "{\n            *__dest = *__src_00;\n          }" { (expression_statement "*__dest = *__src_00;" (assignment_expression "*__dest = *__src_00" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src_00" * identifier)) ;) }) (else_clause "else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }" else (if_statement "if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }" if (parenthesized_expression "(__n_00 != 0)" ( (binary_expression "__n_00 != 0" identifier != number_literal) )) (compound_statement "{\n            memcpy(__dest,__src_00,__n_00);\n          }" { (expression_statement "memcpy(__dest,__src_00,__n_00);" (call_expression "memcpy(__dest,__src_00,__n_00)" identifier (argument_list "(__dest,__src_00,__n_00)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "__n = param_4 - __n_00;" (assignment_expression "__n = param_4 - __n_00" identifier = (binary_expression "param_4 - __n_00" identifier - identifier)) ;) (if_statement "if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n            __dest[__n_00] = __dest[param_4];\n          }" { (expression_statement "__dest[__n_00] = __dest[param_4];" (assignment_expression "__dest[__n_00] = __dest[param_4]" (subscript_expression "__dest[__n_00]" identifier [ identifier ]) = (subscript_expression "__dest[param_4]" identifier [ identifier ])) ;) }) (else_clause "else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" else (if_statement "if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" { (expression_statement "memcpy(__dest + __n_00,__dest + param_4,__n);" (call_expression "memcpy(__dest + __n_00,__dest + param_4,__n)" identifier (argument_list "(__dest + __n_00,__dest + param_4,__n)" ( (binary_expression "__dest + __n_00" identifier + identifier) , (binary_expression "__dest + param_4" identifier + identifier) , identifier ))) ;) })))) }) (else_clause "else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" else (if_statement "if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n          *__dest = *__src;\n        }" { (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src" * identifier)) ;) }) (else_clause "else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" else (if_statement "if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n          memcpy(__dest,__src,param_4);\n        }" { (expression_statement "memcpy(__dest,__src,param_4);" (call_expression "memcpy(__dest,__src,param_4)" identifier (argument_list "(__dest,__src,param_4)" ( identifier , identifier , identifier ))) ;) })))))) }) (else_clause "else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" else (if_statement "if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *__dest = *__src_00;\n      }" { (expression_statement "*__dest = *__src_00;" (assignment_expression "*__dest = *__src_00" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src_00" * identifier)) ;) }) (else_clause "else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" else (if_statement "if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n        memcpy(__dest,__src_00,param_4);\n      }" { (expression_statement "memcpy(__dest,__src_00,param_4);" (call_expression "memcpy(__dest,__src_00,param_4)" identifier (argument_list "(__dest,__src_00,param_4)" ( identifier , identifier , identifier ))) ;) })))))) }))) (return_statement "return param_1;" return identifier ;) })) comment (expression_statement "FUN_0022c7a0("basic_string::insert");" (call_expression "FUN_0022c7a0("basic_string::insert")" identifier (argument_list "("basic_string::insert")" ( (string_literal ""basic_string::insert"" " string_content ") ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::string::insert(unsigned int, char const*, unsigned int) */\n\nstring * __thiscall std::string::insert(string *this,uint param_1,char *param_2,uint param_3)\n\n{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  char *pcVar1;\n  uint uVar2;\n  int iVar3;\n  size_t __n;\n  size_t __n_00;\n  undefined1 *__dest;\n  \n  pcVar1 = *(char **)this;\n  uVar2 = *(uint *)(pcVar1 + -0xc);\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,uVar2);\n  }\n  if (param_3 <= 0x3ffffffc - uVar2) {\n    if (((param_2 < pcVar1) || (pcVar1 + uVar2 < param_2)) || (0 < *(int *)(pcVar1 + -4))) {\n      this = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    }\n    else {\n      iVar3 = *(int *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src_00 = (undefined1 *)(*(int *)this + ((int)param_2 - iVar3));\n      __dest = (undefined1 *)(*(int *)this + param_1);\n      __src = __src_00 + param_3;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_1 - ((int)param_2 - iVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src_00,param_3);\n      }\n    }\n    return this;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_length_error("basic_string::insert");\n}\n\n" comment comment (ERROR "string * __thiscall std::string::insert(string *this,uint param_1,char *param_2,uint param_3)" (binary_expression "string * __thiscall std::string::insert(string *this" (binary_expression "string * __thiscall" identifier * identifier) (ERROR "std::string::insert(string" identifier : : identifier : : identifier ( identifier) * identifier) , type_identifier identifier , (ERROR "char" identifier) (pointer_declarator "*param_2" * identifier) , identifier identifier )) (compound_statement "{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  char *pcVar1;\n  uint uVar2;\n  int iVar3;\n  size_t __n;\n  size_t __n_00;\n  undefined1 *__dest;\n  \n  pcVar1 = *(char **)this;\n  uVar2 = *(uint *)(pcVar1 + -0xc);\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,uVar2);\n  }\n  if (param_3 <= 0x3ffffffc - uVar2) {\n    if (((param_2 < pcVar1) || (pcVar1 + uVar2 < param_2)) || (0 < *(int *)(pcVar1 + -4))) {\n      this = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    }\n    else {\n      iVar3 = *(int *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src_00 = (undefined1 *)(*(int *)this + ((int)param_2 - iVar3));\n      __dest = (undefined1 *)(*(int *)this + param_1);\n      __src = __src_00 + param_3;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_1 - ((int)param_2 - iVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src_00,param_3);\n      }\n    }\n    return this;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_length_error("basic_string::insert");\n}" { (declaration "undefined1 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "undefined1 *__src_00;" type_identifier (pointer_declarator "*__src_00" * identifier) ;) (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "size_t __n_00;" primitive_type identifier ;) (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (expression_statement "pcVar1 = *(char **)this;" (assignment_expression "pcVar1 = *(char **)this" identifier = (pointer_expression "*(char **)this" * (cast_expression "(char **)this" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "uVar2 = *(uint *)(pcVar1 + -0xc);" (assignment_expression "uVar2 = *(uint *)(pcVar1 + -0xc)" identifier = (pointer_expression "*(uint *)(pcVar1 + -0xc)" * (cast_expression "(uint *)(pcVar1 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar1 + -0xc)" ( (binary_expression "pcVar1 + -0xc" 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,uVar2);\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,uVar2);\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,uVar2);" (call_expression "__throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n               param_1,uVar2)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n               param_1,uVar2)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::insert"" " string_content ") , identifier , identifier ))) ;) })) (if_statement "if (param_3 <= 0x3ffffffc - uVar2) {\n    if (((param_2 < pcVar1) || (pcVar1 + uVar2 < param_2)) || (0 < *(int *)(pcVar1 + -4))) {\n      this = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    }\n    else {\n      iVar3 = *(int *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src_00 = (undefined1 *)(*(int *)this + ((int)param_2 - iVar3));\n      __dest = (undefined1 *)(*(int *)this + param_1);\n      __src = __src_00 + param_3;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_1 - ((int)param_2 - iVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src_00,param_3);\n      }\n    }\n    return this;\n  }" if (parenthesized_expression "(param_3 <= 0x3ffffffc - uVar2)" ( (binary_expression "param_3 <= 0x3ffffffc - uVar2" identifier <= (binary_expression "0x3ffffffc - uVar2" number_literal - identifier)) )) (compound_statement "{\n    if (((param_2 < pcVar1) || (pcVar1 + uVar2 < param_2)) || (0 < *(int *)(pcVar1 + -4))) {\n      this = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    }\n    else {\n      iVar3 = *(int *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src_00 = (undefined1 *)(*(int *)this + ((int)param_2 - iVar3));\n      __dest = (undefined1 *)(*(int *)this + param_1);\n      __src = __src_00 + param_3;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_1 - ((int)param_2 - iVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src_00,param_3);\n      }\n    }\n    return this;\n  }" { (if_statement "if (((param_2 < pcVar1) || (pcVar1 + uVar2 < param_2)) || (0 < *(int *)(pcVar1 + -4))) {\n      this = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    }\n    else {\n      iVar3 = *(int *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src_00 = (undefined1 *)(*(int *)this + ((int)param_2 - iVar3));\n      __dest = (undefined1 *)(*(int *)this + param_1);\n      __src = __src_00 + param_3;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_1 - ((int)param_2 - iVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src_00,param_3);\n      }\n    }" if (parenthesized_expression "(((param_2 < pcVar1) || (pcVar1 + uVar2 < param_2)) || (0 < *(int *)(pcVar1 + -4)))" ( (binary_expression "((param_2 < pcVar1) || (pcVar1 + uVar2 < param_2)) || (0 < *(int *)(pcVar1 + -4))" (parenthesized_expression "((param_2 < pcVar1) || (pcVar1 + uVar2 < param_2))" ( (binary_expression "(param_2 < pcVar1) || (pcVar1 + uVar2 < param_2)" (parenthesized_expression "(param_2 < pcVar1)" ( (binary_expression "param_2 < pcVar1" identifier < identifier) )) || (parenthesized_expression "(pcVar1 + uVar2 < param_2)" ( (binary_expression "pcVar1 + uVar2 < param_2" (binary_expression "pcVar1 + uVar2" identifier + identifier) < identifier) ))) )) || (parenthesized_expression "(0 < *(int *)(pcVar1 + -4))" ( (binary_expression "0 < *(int *)(pcVar1 + -4)" number_literal < (pointer_expression "*(int *)(pcVar1 + -4)" * (cast_expression "(int *)(pcVar1 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar1 + -4)" ( (binary_expression "pcVar1 + -4" identifier + number_literal) ))))) ))) )) (compound_statement "{\n      this = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);\n    }" { (expression_statement "this = (string *)_M_replace_safe(this,param_1,0,param_2,param_3);" (assignment_expression "this = (string *)_M_replace_safe(this,param_1,0,param_2,param_3)" identifier = (cast_expression "(string *)_M_replace_safe(this,param_1,0,param_2,param_3)" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "_M_replace_safe(this,param_1,0,param_2,param_3)" identifier (argument_list "(this,param_1,0,param_2,param_3)" ( identifier , identifier , number_literal , identifier , identifier ))))) ;) }) (else_clause "else {\n      iVar3 = *(int *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src_00 = (undefined1 *)(*(int *)this + ((int)param_2 - iVar3));\n      __dest = (undefined1 *)(*(int *)this + param_1);\n      __src = __src_00 + param_3;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_1 - ((int)param_2 - iVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src_00,param_3);\n      }\n    }" else (compound_statement "{\n      iVar3 = *(int *)this;\n      _M_mutate(this,param_1,0,param_3);\n      __src_00 = (undefined1 *)(*(int *)this + ((int)param_2 - iVar3));\n      __dest = (undefined1 *)(*(int *)this + param_1);\n      __src = __src_00 + param_3;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_1 - ((int)param_2 - iVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src_00,param_3);\n      }\n    }" { (expression_statement "iVar3 = *(int *)this;" (assignment_expression "iVar3 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "_M_mutate(this,param_1,0,param_3);" (call_expression "_M_mutate(this,param_1,0,param_3)" identifier (argument_list "(this,param_1,0,param_3)" ( identifier , identifier , number_literal , identifier ))) ;) (expression_statement "__src_00 = (undefined1 *)(*(int *)this + ((int)param_2 - iVar3));" (assignment_expression "__src_00 = (undefined1 *)(*(int *)this + ((int)param_2 - iVar3))" identifier = (cast_expression "(undefined1 *)(*(int *)this + ((int)param_2 - iVar3))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + ((int)param_2 - iVar3))" ( (binary_expression "*(int *)this + ((int)param_2 - iVar3)" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + (parenthesized_expression "((int)param_2 - iVar3)" ( (binary_expression "(int)param_2 - iVar3" (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier) - identifier) ))) )))) ;) (expression_statement "__dest = (undefined1 *)(*(int *)this + param_1);" (assignment_expression "__dest = (undefined1 *)(*(int *)this + param_1)" identifier = (cast_expression "(undefined1 *)(*(int *)this + param_1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + param_1)" ( (binary_expression "*(int *)this + param_1" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + identifier) )))) ;) (expression_statement "__src = __src_00 + param_3;" (assignment_expression "__src = __src_00 + param_3" identifier = (binary_expression "__src_00 + param_3" identifier + identifier)) ;) (if_statement "if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_1 - ((int)param_2 - iVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }\n      }\n      else if (param_3 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src_00,param_3);\n      }" if (parenthesized_expression "(__dest < __src)" ( (binary_expression "__dest < __src" identifier < identifier) )) (compound_statement "{\n        if (__src_00 < __dest) {\n          __n_00 = param_1 - ((int)param_2 - iVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }\n      }" { (if_statement "if (__src_00 < __dest) {\n          __n_00 = param_1 - ((int)param_2 - iVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }\n        else if (param_3 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }" if (parenthesized_expression "(__src_00 < __dest)" ( (binary_expression "__src_00 < __dest" identifier < identifier) )) (compound_statement "{\n          __n_00 = param_1 - ((int)param_2 - iVar3);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_3 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }\n        }" { (expression_statement "__n_00 = param_1 - ((int)param_2 - iVar3);" (assignment_expression "__n_00 = param_1 - ((int)param_2 - iVar3)" identifier = (binary_expression "param_1 - ((int)param_2 - iVar3)" identifier - (parenthesized_expression "((int)param_2 - iVar3)" ( (binary_expression "(int)param_2 - iVar3" (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier) - identifier) )))) ;) (if_statement "if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }" if (parenthesized_expression "(__n_00 == 1)" ( (binary_expression "__n_00 == 1" identifier == number_literal) )) (compound_statement "{\n            *__dest = *__src_00;\n          }" { (expression_statement "*__dest = *__src_00;" (assignment_expression "*__dest = *__src_00" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src_00" * identifier)) ;) }) (else_clause "else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }" else (if_statement "if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }" if (parenthesized_expression "(__n_00 != 0)" ( (binary_expression "__n_00 != 0" identifier != number_literal) )) (compound_statement "{\n            memcpy(__dest,__src_00,__n_00);\n          }" { (expression_statement "memcpy(__dest,__src_00,__n_00);" (call_expression "memcpy(__dest,__src_00,__n_00)" identifier (argument_list "(__dest,__src_00,__n_00)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "__n = param_3 - __n_00;" (assignment_expression "__n = param_3 - __n_00" identifier = (binary_expression "param_3 - __n_00" identifier - identifier)) ;) (if_statement "if (__n == 1) {\n            __dest[__n_00] = __dest[param_3];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n            __dest[__n_00] = __dest[param_3];\n          }" { (expression_statement "__dest[__n_00] = __dest[param_3];" (assignment_expression "__dest[__n_00] = __dest[param_3]" (subscript_expression "__dest[__n_00]" identifier [ identifier ]) = (subscript_expression "__dest[param_3]" identifier [ identifier ])) ;) }) (else_clause "else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }" else (if_statement "if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n            memcpy(__dest + __n_00,__dest + param_3,__n);\n          }" { (expression_statement "memcpy(__dest + __n_00,__dest + param_3,__n);" (call_expression "memcpy(__dest + __n_00,__dest + param_3,__n)" identifier (argument_list "(__dest + __n_00,__dest + param_3,__n)" ( (binary_expression "__dest + __n_00" identifier + identifier) , (binary_expression "__dest + param_3" identifier + identifier) , identifier ))) ;) })))) }) (else_clause "else if (param_3 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }" else (if_statement "if (param_3 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n          *__dest = *__src;\n        }" { (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src" * identifier)) ;) }) (else_clause "else if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }" else (if_statement "if (param_3 != 0) {\n          memcpy(__dest,__src,param_3);\n        }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n          memcpy(__dest,__src,param_3);\n        }" { (expression_statement "memcpy(__dest,__src,param_3);" (call_expression "memcpy(__dest,__src,param_3)" identifier (argument_list "(__dest,__src,param_3)" ( identifier , identifier , identifier ))) ;) })))))) }) (else_clause "else if (param_3 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src_00,param_3);\n      }" else (if_statement "if (param_3 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_3 != 0) {\n        memcpy(__dest,__src_00,param_3);\n      }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n        *__dest = *__src_00;\n      }" { (expression_statement "*__dest = *__src_00;" (assignment_expression "*__dest = *__src_00" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src_00" * identifier)) ;) }) (else_clause "else if (param_3 != 0) {\n        memcpy(__dest,__src_00,param_3);\n      }" else (if_statement "if (param_3 != 0) {\n        memcpy(__dest,__src_00,param_3);\n      }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n        memcpy(__dest,__src_00,param_3);\n      }" { (expression_statement "memcpy(__dest,__src_00,param_3);" (call_expression "memcpy(__dest,__src_00,param_3)" identifier (argument_list "(__dest,__src_00,param_3)" ( identifier , identifier , identifier ))) ;) })))))) }))) (return_statement "return this;" 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 "uint * FUN_0021f6b0(uint *param_1,uint param_2,uint param_3,uint param_4)\n\n{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  uint uVar1;\n  uint uVar2;\n  size_t __n;\n  size_t __n_00;\n  undefined1 *__dest;\n  \n  uVar1 = *param_1;\n  uVar2 = *(uint *)(uVar1 - 0xc);\n  if (uVar2 < param_2) {\n                    \n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }\n  if (param_4 <= 0x3ffffffc - uVar2) {\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }\n                    \n  FUN_0022c7a0("basic_string::insert");\n}\n\n" (function_definition "uint * FUN_0021f6b0(uint *param_1,uint param_2,uint param_3,uint param_4)\n\n{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  uint uVar1;\n  uint uVar2;\n  size_t __n;\n  size_t __n_00;\n  undefined1 *__dest;\n  \n  uVar1 = *param_1;\n  uVar2 = *(uint *)(uVar1 - 0xc);\n  if (uVar2 < param_2) {\n                    \n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }\n  if (param_4 <= 0x3ffffffc - uVar2) {\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }\n                    \n  FUN_0022c7a0("basic_string::insert");\n}" type_identifier (pointer_declarator "* FUN_0021f6b0(uint *param_1,uint param_2,uint param_3,uint param_4)" * (function_declarator "FUN_0021f6b0(uint *param_1,uint param_2,uint param_3,uint param_4)" identifier (parameter_list "(uint *param_1,uint param_2,uint param_3,uint param_4)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) )))) (compound_statement "{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  uint uVar1;\n  uint uVar2;\n  size_t __n;\n  size_t __n_00;\n  undefined1 *__dest;\n  \n  uVar1 = *param_1;\n  uVar2 = *(uint *)(uVar1 - 0xc);\n  if (uVar2 < param_2) {\n                    \n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }\n  if (param_4 <= 0x3ffffffc - uVar2) {\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }\n                    \n  FUN_0022c7a0("basic_string::insert");\n}" { (declaration "undefined1 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "undefined1 *__src_00;" type_identifier (pointer_declarator "*__src_00" * identifier) ;) (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "size_t __n_00;" primitive_type identifier ;) (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (expression_statement "uVar1 = *param_1;" (assignment_expression "uVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar2 = *(uint *)(uVar1 - 0xc);" (assignment_expression "uVar2 = *(uint *)(uVar1 - 0xc)" identifier = (pointer_expression "*(uint *)(uVar1 - 0xc)" * (cast_expression "(uint *)(uVar1 - 0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 - 0xc)" ( (binary_expression "uVar1 - 0xc" identifier - number_literal) ))))) ;) (if_statement "if (uVar2 < param_2) {\n                    \n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }" if (parenthesized_expression "(uVar2 < param_2)" ( (binary_expression "uVar2 < param_2" identifier < identifier) )) (compound_statement "{\n                    \n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }" { (expression_statement "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);" (call_expression "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::insert"" " string_content ") , identifier , identifier ))) ;) })) (if_statement "if (param_4 <= 0x3ffffffc - uVar2) {\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }" if (parenthesized_expression "(param_4 <= 0x3ffffffc - uVar2)" ( (binary_expression "param_4 <= 0x3ffffffc - uVar2" identifier <= (binary_expression "0x3ffffffc - uVar2" number_literal - identifier)) )) (compound_statement "{\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }" { (if_statement "if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }" if (parenthesized_expression "(((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4)))" ( (binary_expression "((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))" (parenthesized_expression "((param_3 < uVar1) || (uVar2 + uVar1 < param_3))" ( (binary_expression "(param_3 < uVar1) || (uVar2 + uVar1 < param_3)" (parenthesized_expression "(param_3 < uVar1)" ( (binary_expression "param_3 < uVar1" identifier < identifier) )) || (parenthesized_expression "(uVar2 + uVar1 < param_3)" ( (binary_expression "uVar2 + uVar1 < param_3" (binary_expression "uVar2 + uVar1" identifier + identifier) < identifier) ))) )) || (parenthesized_expression "(0 < *(int *)(uVar1 - 4))" ( (binary_expression "0 < *(int *)(uVar1 - 4)" number_literal < (pointer_expression "*(int *)(uVar1 - 4)" * (cast_expression "(int *)(uVar1 - 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 - 4)" ( (binary_expression "uVar1 - 4" identifier - number_literal) ))))) ))) )) (compound_statement "{\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }" { (expression_statement "param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);" (assignment_expression "param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4)" identifier = (cast_expression "(uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0021f430(param_1,param_2,0,param_3,param_4)" identifier (argument_list "(param_1,param_2,0,param_3,param_4)" ( identifier , identifier , number_literal , identifier , identifier ))))) ;) }) (else_clause "else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }" else (compound_statement "{\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }" { (expression_statement "uVar1 = *param_1;" (assignment_expression "uVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "FUN_0021eb90(param_1,param_2,0,param_4);" (call_expression "FUN_0021eb90(param_1,param_2,0,param_4)" identifier (argument_list "(param_1,param_2,0,param_4)" ( identifier , identifier , number_literal , identifier ))) ;) (expression_statement "__src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));" (assignment_expression "__src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1))" identifier = (cast_expression "(undefined1 *)(*param_1 + (param_3 - uVar1))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + (param_3 - uVar1))" ( (binary_expression "*param_1 + (param_3 - uVar1)" (pointer_expression "*param_1" * identifier) + (parenthesized_expression "(param_3 - uVar1)" ( (binary_expression "param_3 - uVar1" identifier - identifier) ))) )))) ;) (expression_statement "__dest = (undefined1 *)(*param_1 + param_2);" (assignment_expression "__dest = (undefined1 *)(*param_1 + param_2)" identifier = (cast_expression "(undefined1 *)(*param_1 + param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + param_2)" ( (binary_expression "*param_1 + param_2" (pointer_expression "*param_1" * identifier) + identifier) )))) ;) (expression_statement "__src = __src_00 + param_4;" (assignment_expression "__src = __src_00 + param_4" identifier = (binary_expression "__src_00 + param_4" identifier + identifier)) ;) (if_statement "if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" if (parenthesized_expression "(__dest < __src)" ( (binary_expression "__dest < __src" identifier < identifier) )) (compound_statement "{\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }" { (if_statement "if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" if (parenthesized_expression "(__src_00 < __dest)" ( (binary_expression "__src_00 < __dest" identifier < identifier) )) (compound_statement "{\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }" { (expression_statement "__n_00 = param_2 - (param_3 - uVar1);" (assignment_expression "__n_00 = param_2 - (param_3 - uVar1)" identifier = (binary_expression "param_2 - (param_3 - uVar1)" identifier - (parenthesized_expression "(param_3 - uVar1)" ( (binary_expression "param_3 - uVar1" identifier - identifier) )))) ;) (if_statement "if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }" if (parenthesized_expression "(__n_00 == 1)" ( (binary_expression "__n_00 == 1" identifier == number_literal) )) (compound_statement "{\n            *__dest = *__src_00;\n          }" { (expression_statement "*__dest = *__src_00;" (assignment_expression "*__dest = *__src_00" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src_00" * identifier)) ;) }) (else_clause "else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }" else (if_statement "if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }" if (parenthesized_expression "(__n_00 != 0)" ( (binary_expression "__n_00 != 0" identifier != number_literal) )) (compound_statement "{\n            memcpy(__dest,__src_00,__n_00);\n          }" { (expression_statement "memcpy(__dest,__src_00,__n_00);" (call_expression "memcpy(__dest,__src_00,__n_00)" identifier (argument_list "(__dest,__src_00,__n_00)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "__n = param_4 - __n_00;" (assignment_expression "__n = param_4 - __n_00" identifier = (binary_expression "param_4 - __n_00" identifier - identifier)) ;) (if_statement "if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n            __dest[__n_00] = __dest[param_4];\n          }" { (expression_statement "__dest[__n_00] = __dest[param_4];" (assignment_expression "__dest[__n_00] = __dest[param_4]" (subscript_expression "__dest[__n_00]" identifier [ identifier ]) = (subscript_expression "__dest[param_4]" identifier [ identifier ])) ;) }) (else_clause "else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" else (if_statement "if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" { (expression_statement "memcpy(__dest + __n_00,__dest + param_4,__n);" (call_expression "memcpy(__dest + __n_00,__dest + param_4,__n)" identifier (argument_list "(__dest + __n_00,__dest + param_4,__n)" ( (binary_expression "__dest + __n_00" identifier + identifier) , (binary_expression "__dest + param_4" identifier + identifier) , identifier ))) ;) })))) }) (else_clause "else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" else (if_statement "if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n          *__dest = *__src;\n        }" { (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src" * identifier)) ;) }) (else_clause "else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" else (if_statement "if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n          memcpy(__dest,__src,param_4);\n        }" { (expression_statement "memcpy(__dest,__src,param_4);" (call_expression "memcpy(__dest,__src,param_4)" identifier (argument_list "(__dest,__src,param_4)" ( identifier , identifier , identifier ))) ;) })))))) }) (else_clause "else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" else (if_statement "if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *__dest = *__src_00;\n      }" { (expression_statement "*__dest = *__src_00;" (assignment_expression "*__dest = *__src_00" (pointer_expression "*__dest" * identifier) = (pointer_expression "*__src_00" * identifier)) ;) }) (else_clause "else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" else (if_statement "if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n        memcpy(__dest,__src_00,param_4);\n      }" { (expression_statement "memcpy(__dest,__src_00,param_4);" (call_expression "memcpy(__dest,__src_00,param_4)" identifier (argument_list "(__dest,__src_00,param_4)" ( identifier , identifier , identifier ))) ;) })))))) }))) (return_statement "return param_1;" return identifier ;) })) (expression_statement "FUN_0022c7a0("basic_string::insert");" (call_expression "FUN_0022c7a0("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 IDENT ;) (declaration TYPE 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 , 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 (binary_expression IDENT + IDENT) < IDENT) ))) )) || (parenthesized_expression ( (binary_expression LIT < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT - LIT) ))))) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , IDENT , LIT , IDENT , IDENT ))))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + (parenthesized_expression ( (binary_expression IDENT - IDENT) ))) )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (parenthesized_expression ( (binary_expression IDENT - IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (subscript_expression IDENT [ IDENT ])) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + IDENT) , (binary_expression IDENT + IDENT) , IDENT ))) ;) })))) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })))))) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })))))) }))) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) })))
(function_definition "uint * FUN_0021f6b0(uint *param_1,uint param_2,uint param_3,uint param_4)\n\n{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  uint uVar1;\n  uint uVar2;\n  size_t __n;\n  size_t __n_00;\n  undefined1 *__dest;\n  \n  uVar1 = *param_1;\n  uVar2 = *(uint *)(uVar1 - 0xc);\n  if (uVar2 < param_2) {\n                    \n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }\n  if (param_4 <= 0x3ffffffc - uVar2) {\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }\n                    \n  FUN_0022c7a0("basic_string::insert");\n}" (type_identifier "uint") (pointer_declarator "* FUN_0021f6b0(uint *param_1,uint param_2,uint param_3,uint param_4)" (* "*") (function_declarator "FUN_0021f6b0(uint *param_1,uint param_2,uint param_3,uint param_4)" (identifier "FUN_0021f6b0") (parameter_list "(uint *param_1,uint param_2,uint param_3,uint param_4)" (( "(") (parameter_declaration "uint *param_1" (type_identifier "uint") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) (, ",") (parameter_declaration "uint param_4" (type_identifier "uint") (identifier "param_4")) () ")")))) (compound_statement "{\n  undefined1 *__src;\n  undefined1 *__src_00;\n  uint uVar1;\n  uint uVar2;\n  size_t __n;\n  size_t __n_00;\n  undefined1 *__dest;\n  \n  uVar1 = *param_1;\n  uVar2 = *(uint *)(uVar1 - 0xc);\n  if (uVar2 < param_2) {\n                    \n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }\n  if (param_4 <= 0x3ffffffc - uVar2) {\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }\n                    \n  FUN_0022c7a0("basic_string::insert");\n}" ({ "{") (declaration "undefined1 *__src;" (type_identifier "undefined1") (pointer_declarator "*__src" (* "*") (identifier "__src")) (; ";")) (declaration "undefined1 *__src_00;" (type_identifier "undefined1") (pointer_declarator "*__src_00" (* "*") (identifier "__src_00")) (; ";")) (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "size_t __n_00;" (primitive_type "size_t") (identifier "__n_00") (; ";")) (declaration "undefined1 *__dest;" (type_identifier "undefined1") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (expression_statement "uVar1 = *param_1;" (assignment_expression "uVar1 = *param_1" (identifier "uVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "uVar2 = *(uint *)(uVar1 - 0xc);" (assignment_expression "uVar2 = *(uint *)(uVar1 - 0xc)" (identifier "uVar2") (= "=") (pointer_expression "*(uint *)(uVar1 - 0xc)" (* "*") (cast_expression "(uint *)(uVar1 - 0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(uVar1 - 0xc)" (( "(") (binary_expression "uVar1 - 0xc" (identifier "uVar1") (- "-") (number_literal "0xc")) () ")"))))) (; ";")) (if_statement "if (uVar2 < param_2) {\n                    \n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }" (if "if") (parenthesized_expression "(uVar2 < param_2)" (( "(") (binary_expression "uVar2 < param_2" (identifier "uVar2") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n                    \n    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);\n  }" ({ "{") (expression_statement "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2);" (call_expression "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2)" (identifier "FUN_0022c840") (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",\n                 param_2,uVar2)" (( "(") (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") (, ",") (identifier "uVar2") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_4 <= 0x3ffffffc - uVar2) {\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }" (if "if") (parenthesized_expression "(param_4 <= 0x3ffffffc - uVar2)" (( "(") (binary_expression "param_4 <= 0x3ffffffc - uVar2" (identifier "param_4") (<= "<=") (binary_expression "0x3ffffffc - uVar2" (number_literal "0x3ffffffc") (- "-") (identifier "uVar2"))) () ")")) (compound_statement "{\n    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }\n    return param_1;\n  }" ({ "{") (if_statement "if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }\n    else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }" (if "if") (parenthesized_expression "(((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4)))" (( "(") (binary_expression "((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))" (parenthesized_expression "((param_3 < uVar1) || (uVar2 + uVar1 < param_3))" (( "(") (binary_expression "(param_3 < uVar1) || (uVar2 + uVar1 < param_3)" (parenthesized_expression "(param_3 < uVar1)" (( "(") (binary_expression "param_3 < uVar1" (identifier "param_3") (< "<") (identifier "uVar1")) () ")")) (|| "||") (parenthesized_expression "(uVar2 + uVar1 < param_3)" (( "(") (binary_expression "uVar2 + uVar1 < param_3" (binary_expression "uVar2 + uVar1" (identifier "uVar2") (+ "+") (identifier "uVar1")) (< "<") (identifier "param_3")) () ")"))) () ")")) (|| "||") (parenthesized_expression "(0 < *(int *)(uVar1 - 4))" (( "(") (binary_expression "0 < *(int *)(uVar1 - 4)" (number_literal "0") (< "<") (pointer_expression "*(int *)(uVar1 - 4)" (* "*") (cast_expression "(int *)(uVar1 - 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(uVar1 - 4)" (( "(") (binary_expression "uVar1 - 4" (identifier "uVar1") (- "-") (number_literal "4")) () ")"))))) () ")"))) () ")")) (compound_statement "{\n      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);\n    }" ({ "{") (expression_statement "param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);" (assignment_expression "param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4)" (identifier "param_1") (= "=") (cast_expression "(uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0021f430(param_1,param_2,0,param_3,param_4)" (identifier "FUN_0021f430") (argument_list "(param_1,param_2,0,param_3,param_4)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (number_literal "0") (, ",") (identifier "param_3") (, ",") (identifier "param_4") () ")"))))) (; ";")) (} "}")) (else_clause "else {\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }" (else "else") (compound_statement "{\n      uVar1 = *param_1;\n      FUN_0021eb90(param_1,param_2,0,param_4);\n      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));\n      __dest = (undefined1 *)(*param_1 + param_2);\n      __src = __src_00 + param_4;\n      if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }\n    }" ({ "{") (expression_statement "uVar1 = *param_1;" (assignment_expression "uVar1 = *param_1" (identifier "uVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "FUN_0021eb90(param_1,param_2,0,param_4);" (call_expression "FUN_0021eb90(param_1,param_2,0,param_4)" (identifier "FUN_0021eb90") (argument_list "(param_1,param_2,0,param_4)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (number_literal "0") (, ",") (identifier "param_4") () ")"))) (; ";")) (expression_statement "__src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));" (assignment_expression "__src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1))" (identifier "__src_00") (= "=") (cast_expression "(undefined1 *)(*param_1 + (param_3 - uVar1))" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + (param_3 - uVar1))" (( "(") (binary_expression "*param_1 + (param_3 - uVar1)" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (parenthesized_expression "(param_3 - uVar1)" (( "(") (binary_expression "param_3 - uVar1" (identifier "param_3") (- "-") (identifier "uVar1")) () ")"))) () ")")))) (; ";")) (expression_statement "__dest = (undefined1 *)(*param_1 + param_2);" (assignment_expression "__dest = (undefined1 *)(*param_1 + param_2)" (identifier "__dest") (= "=") (cast_expression "(undefined1 *)(*param_1 + param_2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + param_2)" (( "(") (binary_expression "*param_1 + param_2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (identifier "param_2")) () ")")))) (; ";")) (expression_statement "__src = __src_00 + param_4;" (assignment_expression "__src = __src_00 + param_4" (identifier "__src") (= "=") (binary_expression "__src_00 + param_4" (identifier "__src_00") (+ "+") (identifier "param_4"))) (; ";")) (if_statement "if (__dest < __src) {\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }\n      else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" (if "if") (parenthesized_expression "(__dest < __src)" (( "(") (binary_expression "__dest < __src" (identifier "__dest") (< "<") (identifier "__src")) () ")")) (compound_statement "{\n        if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }\n      }" ({ "{") (if_statement "if (__src_00 < __dest) {\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }\n        else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" (if "if") (parenthesized_expression "(__src_00 < __dest)" (( "(") (binary_expression "__src_00 < __dest" (identifier "__src_00") (< "<") (identifier "__dest")) () ")")) (compound_statement "{\n          __n_00 = param_2 - (param_3 - uVar1);\n          if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }\n          __n = param_4 - __n_00;\n          if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }\n        }" ({ "{") (expression_statement "__n_00 = param_2 - (param_3 - uVar1);" (assignment_expression "__n_00 = param_2 - (param_3 - uVar1)" (identifier "__n_00") (= "=") (binary_expression "param_2 - (param_3 - uVar1)" (identifier "param_2") (- "-") (parenthesized_expression "(param_3 - uVar1)" (( "(") (binary_expression "param_3 - uVar1" (identifier "param_3") (- "-") (identifier "uVar1")) () ")")))) (; ";")) (if_statement "if (__n_00 == 1) {\n            *__dest = *__src_00;\n          }\n          else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }" (if "if") (parenthesized_expression "(__n_00 == 1)" (( "(") (binary_expression "__n_00 == 1" (identifier "__n_00") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n            *__dest = *__src_00;\n          }" ({ "{") (expression_statement "*__dest = *__src_00;" (assignment_expression "*__dest = *__src_00" (pointer_expression "*__dest" (* "*") (identifier "__dest")) (= "=") (pointer_expression "*__src_00" (* "*") (identifier "__src_00"))) (; ";")) (} "}")) (else_clause "else if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }" (else "else") (if_statement "if (__n_00 != 0) {\n            memcpy(__dest,__src_00,__n_00);\n          }" (if "if") (parenthesized_expression "(__n_00 != 0)" (( "(") (binary_expression "__n_00 != 0" (identifier "__n_00") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n            memcpy(__dest,__src_00,__n_00);\n          }" ({ "{") (expression_statement "memcpy(__dest,__src_00,__n_00);" (call_expression "memcpy(__dest,__src_00,__n_00)" (identifier "memcpy") (argument_list "(__dest,__src_00,__n_00)" (( "(") (identifier "__dest") (, ",") (identifier "__src_00") (, ",") (identifier "__n_00") () ")"))) (; ";")) (} "}"))))) (expression_statement "__n = param_4 - __n_00;" (assignment_expression "__n = param_4 - __n_00" (identifier "__n") (= "=") (binary_expression "param_4 - __n_00" (identifier "param_4") (- "-") (identifier "__n_00"))) (; ";")) (if_statement "if (__n == 1) {\n            __dest[__n_00] = __dest[param_4];\n          }\n          else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" (if "if") (parenthesized_expression "(__n == 1)" (( "(") (binary_expression "__n == 1" (identifier "__n") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n            __dest[__n_00] = __dest[param_4];\n          }" ({ "{") (expression_statement "__dest[__n_00] = __dest[param_4];" (assignment_expression "__dest[__n_00] = __dest[param_4]" (subscript_expression "__dest[__n_00]" (identifier "__dest") ([ "[") (identifier "__n_00") (] "]")) (= "=") (subscript_expression "__dest[param_4]" (identifier "__dest") ([ "[") (identifier "param_4") (] "]"))) (; ";")) (} "}")) (else_clause "else if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" (else "else") (if_statement "if (__n != 0) {\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" (if "if") (parenthesized_expression "(__n != 0)" (( "(") (binary_expression "__n != 0" (identifier "__n") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n            memcpy(__dest + __n_00,__dest + param_4,__n);\n          }" ({ "{") (expression_statement "memcpy(__dest + __n_00,__dest + param_4,__n);" (call_expression "memcpy(__dest + __n_00,__dest + param_4,__n)" (identifier "memcpy") (argument_list "(__dest + __n_00,__dest + param_4,__n)" (( "(") (binary_expression "__dest + __n_00" (identifier "__dest") (+ "+") (identifier "__n_00")) (, ",") (binary_expression "__dest + param_4" (identifier "__dest") (+ "+") (identifier "param_4")) (, ",") (identifier "__n") () ")"))) (; ";")) (} "}"))))) (} "}")) (else_clause "else if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" (else "else") (if_statement "if (param_4 == 1) {\n          *__dest = *__src;\n        }\n        else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" (if "if") (parenthesized_expression "(param_4 == 1)" (( "(") (binary_expression "param_4 == 1" (identifier "param_4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n          *__dest = *__src;\n        }" ({ "{") (expression_statement "*__dest = *__src;" (assignment_expression "*__dest = *__src" (pointer_expression "*__dest" (* "*") (identifier "__dest")) (= "=") (pointer_expression "*__src" (* "*") (identifier "__src"))) (; ";")) (} "}")) (else_clause "else if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" (else "else") (if_statement "if (param_4 != 0) {\n          memcpy(__dest,__src,param_4);\n        }" (if "if") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n          memcpy(__dest,__src,param_4);\n        }" ({ "{") (expression_statement "memcpy(__dest,__src,param_4);" (call_expression "memcpy(__dest,__src,param_4)" (identifier "memcpy") (argument_list "(__dest,__src,param_4)" (( "(") (identifier "__dest") (, ",") (identifier "__src") (, ",") (identifier "param_4") () ")"))) (; ";")) (} "}"))))))) (} "}")) (else_clause "else if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" (else "else") (if_statement "if (param_4 == 1) {\n        *__dest = *__src_00;\n      }\n      else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" (if "if") (parenthesized_expression "(param_4 == 1)" (( "(") (binary_expression "param_4 == 1" (identifier "param_4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *__dest = *__src_00;\n      }" ({ "{") (expression_statement "*__dest = *__src_00;" (assignment_expression "*__dest = *__src_00" (pointer_expression "*__dest" (* "*") (identifier "__dest")) (= "=") (pointer_expression "*__src_00" (* "*") (identifier "__src_00"))) (; ";")) (} "}")) (else_clause "else if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" (else "else") (if_statement "if (param_4 != 0) {\n        memcpy(__dest,__src_00,param_4);\n      }" (if "if") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        memcpy(__dest,__src_00,param_4);\n      }" ({ "{") (expression_statement "memcpy(__dest,__src_00,param_4);" (call_expression "memcpy(__dest,__src_00,param_4)" (identifier "memcpy") (argument_list "(__dest,__src_00,param_4)" (( "(") (identifier "__dest") (, ",") (identifier "__src_00") (, ",") (identifier "param_4") () ")"))) (; ";")) (} "}"))))))) (} "}")))) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (expression_statement "FUN_0022c7a0("basic_string::insert");" (call_expression "FUN_0022c7a0("basic_string::insert")" (identifier "FUN_0022c7a0") (argument_list "("basic_string::insert")" (( "(") (string_literal ""basic_string::insert"" (" """) (string_content "basic_string::insert") (" """)) () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::string::insert(unsigned int, char const*, unsigned int) */

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

{
  type_1 *var_12;
  type_1 *var_10;
  char *var_1;
  type_2 var_2;
  int var_9;
  size_t var_15;
  size_t var_13;
  type_1 *var_11;
  
  var_1 = *(char **)this;
  var_2 = *(type_2 *)(var_1 + -0xc);
  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,var_2);
  }
  if (var_5 <= 0x3ffffffc - var_2) {
    if (((var_6 < var_1) || (var_1 + var_2 < var_6)) || (0 < *(int *)(var_1 + -4))) {
      this = (type_3 *)var_7(this,var_3,0,var_6,var_5);
    }
    else {
      var_9 = *(int *)this;
      var_8(this,var_3,0,var_5);
      var_10 = (type_1 *)(*(int *)this + ((int)var_6 - var_9));
      var_11 = (type_1 *)(*(int *)this + var_3);
      var_12 = var_10 + var_5;
      if (var_11 < var_12) {
        if (var_10 < var_11) {
          var_13 = var_3 - ((int)var_6 - var_9);
          if (var_13 == 1) {
            *var_11 = *var_10;
          }
          else if (var_13 != 0) {
            var_14(var_11,var_10,var_13);
          }
          var_15 = var_5 - var_13;
          if (var_15 == 1) {
            var_11[var_13] = var_11[var_5];
          }
          else if (var_15 != 0) {
            var_14(var_11 + var_13,var_11 + var_5,var_15);
          }
        }
        else if (var_5 == 1) {
          *var_11 = *var_12;
        }
        else if (var_5 != 0) {
          var_14(var_11,var_12,var_5);
        }
      }
      else if (var_5 == 1) {
        *var_11 = *var_10;
      }
      else if (var_5 != 0) {
        var_14(var_11,var_10,var_5);
      }
    }
    return this;
  }
                    /* WARNING: Subroutine does not return */
  var_16("basic_string::insert");
}


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

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

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

{
  undefined1 *__src;
  undefined1 *__src_00;
  uint uVar1;
  uint uVar2;
  size_t __n;
  size_t __n_00;
  undefined1 *__dest;
  
  uVar1 = *param_1;
  uVar2 = *(uint *)(uVar1 - 0xc);
  if (uVar2 < param_2) {
                    /* WARNING: Subroutine does not return */
    FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::insert",
                 param_2,uVar2);
  }
  if (param_4 <= 0x3ffffffc - uVar2) {
    if (((param_3 < uVar1) || (uVar2 + uVar1 < param_3)) || (0 < *(int *)(uVar1 - 4))) {
      param_1 = (uint *)FUN_0021f430(param_1,param_2,0,param_3,param_4);
    }
    else {
      uVar1 = *param_1;
      FUN_0021eb90(param_1,param_2,0,param_4);
      __src_00 = (undefined1 *)(*param_1 + (param_3 - uVar1));
      __dest = (undefined1 *)(*param_1 + param_2);
      __src = __src_00 + param_4;
      if (__dest < __src) {
        if (__src_00 < __dest) {
          __n_00 = param_2 - (param_3 - uVar1);
          if (__n_00 == 1) {
            *__dest = *__src_00;
          }
          else if (__n_00 != 0) {
            memcpy(__dest,__src_00,__n_00);
          }
          __n = param_4 - __n_00;
          if (__n == 1) {
            __dest[__n_00] = __dest[param_4];
          }
          else if (__n != 0) {
            memcpy(__dest + __n_00,__dest + param_4,__n);
          }
        }
        else if (param_4 == 1) {
          *__dest = *__src;
        }
        else if (param_4 != 0) {
          memcpy(__dest,__src,param_4);
        }
      }
      else if (param_4 == 1) {
        *__dest = *__src_00;
      }
      else if (param_4 != 0) {
        memcpy(__dest,__src_00,param_4);
      }
    }
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0022c7a0("basic_string::insert");
}

