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

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

{
  int iVar1;
  undefined1 *__dest;
  uint uVar2;
  uint __n;
  
  uVar2 = *(uint *)(*(int *)param_1 + -0xc);
  if (param_2 <= uVar2) {
    __n = uVar2 - param_2;
    if (param_3 < uVar2 - param_2) {
      __n = param_3;
    }
    if (__n != 0) {
      iVar1 = *(int *)this;
      uVar2 = *(int *)(iVar1 + -0xc) + __n;
      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {
        reserve(this,uVar2);
      }
      __dest = (undefined1 *)(*(int *)this + *(int *)(*(int *)this + -0xc));
      if (__n == 1) {
        *__dest = *(undefined1 *)(param_2 + *(int *)param_1);
      }
      else {
        memcpy(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n);
      }
      iVar1 = *(int *)this;
      if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_0038ecdc) {
        *(undefined4 *)(iVar1 + -4) = 0;
        *(uint *)(iVar1 + -0xc) = uVar2;
        *(undefined1 *)(iVar1 + uVar2) = 0;
      }
    }
    return this;
  }
                    /* WARNING: Subroutine does not return */
  __throw_out_of_range_fmt
            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",param_2
             ,uVar2);
}



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

int * FUN_0021fc60(int *param_1,int *param_2,uint param_3,uint param_4)

{
  int iVar1;
  undefined1 *__dest;
  uint uVar2;
  uint __n;
  
  uVar2 = *(uint *)(*param_2 + -0xc);
  if (param_3 <= uVar2) {
    __n = uVar2 - param_3;
    if (param_4 < uVar2 - param_3) {
      __n = param_4;
    }
    if (__n != 0) {
      iVar1 = *param_1;
      uVar2 = *(int *)(iVar1 + -0xc) + __n;
      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {
        FUN_0021fa60(param_1,uVar2);
      }
      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));
      if (__n == 1) {
        *__dest = *(undefined1 *)(param_3 + *param_2);
      }
      else {
        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);
      }
      iVar1 = *param_1;
      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {
        *(undefined4 *)(iVar1 + -4) = 0;
        *(uint *)(iVar1 + -0xc) = uVar2;
        *(undefined1 *)(iVar1 + uVar2) = 0;
      }
    }
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",
               param_3,uVar2);
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00035840
ADD EBX,0x16f397
SUB ESP,0x1c
MOV EAX,dword ptr [ESP + 0x34]
MOV EDI,dword ptr [ESP + 0x38]
MOV EBP,dword ptr [ESP + 0x30]
MOV EDX,dword ptr [ESP + 0x3c]
MOV ECX,dword ptr [EAX]
MOV ESI,dword ptr [ECX + -0xc]
CMP EDI,ESI
JA 0x0021fd30
SUB ESI,EDI
CMP ESI,EDX
CMOVA ESI,EDX
TEST ESI,ESI
JZ 0x0021fcfc
MOV ECX,dword ptr [EBP]
MOV EDX,dword ptr [ECX + -0xc]
ADD EDX,ESI
CMP dword ptr [ECX + -0x8],EDX
JC 0x0021fcae
MOV ECX,dword ptr [ECX + -0x4]
TEST ECX,ECX
JLE 0x0021fccb
MOV dword ptr [ESP + 0x34],EAX
SUB ESP,0x8
PUSH EDX
MOV dword ptr [ESP + 0x18],EDX
PUSH EBP
CALL 0x0021fa60
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0xc]
MOV EAX,dword ptr [ESP + 0x34]
ADD EDI,dword ptr [EAX]
MOV EAX,dword ptr [EBP]
ADD EAX,dword ptr [EAX + -0xc]
CMP ESI,0x1
JZ 0x0021fd10
MOV dword ptr [ESP + 0xc],EDX
SUB ESP,0x4
PUSH ESI
PUSH EDI
PUSH EAX
CALL 0x000295c0
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0xc]
MOV EAX,dword ptr [EBP]
LEA ECX,[EAX + -0xc]
CMP ECX,dword ptr [EBX + 0xfffffcdc]
JNZ 0x0021fd20
ADD ESP,0x1c
MOV EAX,EBP
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOVZX ECX,byte ptr [EDI]
MOV byte ptr [EAX],CL
JMP 0x0021fcee
MOV dword ptr [EAX + -0x4],0x0
MOV dword ptr [EAX + -0xc],EDX
MOV byte ptr [EAX + EDX*0x1],0x0
JMP 0x0021fcfc
LEA EAX,[EBX + 0xffef7be2]
PUSH ESI
PUSH EDI
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\nint * FUN_0021fc60(int *param_1,int *param_2,uint param_3,uint param_4)\n\n{\n  int iVar1;\n  undefined1 *__dest;\n  uint uVar2;\n  uint __n;\n  \n  uVar2 = *(uint *)(*param_2 + -0xc);\n  if (param_3 <= uVar2) {\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2);\n}\n\n" comment (function_definition "int * FUN_0021fc60(int *param_1,int *param_2,uint param_3,uint param_4)\n\n{\n  int iVar1;\n  undefined1 *__dest;\n  uint uVar2;\n  uint __n;\n  \n  uVar2 = *(uint *)(*param_2 + -0xc);\n  if (param_3 <= uVar2) {\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2);\n}" primitive_type (pointer_declarator "* FUN_0021fc60(int *param_1,int *param_2,uint param_3,uint param_4)" * (function_declarator "FUN_0021fc60(int *param_1,int *param_2,uint param_3,uint param_4)" identifier (parameter_list "(int *param_1,int *param_2,uint param_3,uint param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) )))) (compound_statement "{\n  int iVar1;\n  undefined1 *__dest;\n  uint uVar2;\n  uint __n;\n  \n  uVar2 = *(uint *)(*param_2 + -0xc);\n  if (param_3 <= uVar2) {\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint __n;" type_identifier identifier ;) (expression_statement "uVar2 = *(uint *)(*param_2 + -0xc);" (assignment_expression "uVar2 = *(uint *)(*param_2 + -0xc)" identifier = (pointer_expression "*(uint *)(*param_2 + -0xc)" * (cast_expression "(uint *)(*param_2 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_2 + -0xc)" ( (binary_expression "*param_2 + -0xc" (pointer_expression "*param_2" * identifier) + number_literal) ))))) ;) (if_statement "if (param_3 <= uVar2) {\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }" if (parenthesized_expression "(param_3 <= uVar2)" ( (binary_expression "param_3 <= uVar2" identifier <= identifier) )) (compound_statement "{\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }" { (expression_statement "__n = uVar2 - param_3;" (assignment_expression "__n = uVar2 - param_3" identifier = (binary_expression "uVar2 - param_3" identifier - identifier)) ;) (if_statement "if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }" if (parenthesized_expression "(param_4 < uVar2 - param_3)" ( (binary_expression "param_4 < uVar2 - param_3" identifier < (binary_expression "uVar2 - param_3" identifier - identifier)) )) (compound_statement "{\n      __n = param_4;\n    }" { (expression_statement "__n = param_4;" (assignment_expression "__n = param_4" identifier = identifier) ;) })) (if_statement "if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }" { (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar2 = *(int *)(iVar1 + -0xc) + __n;" (assignment_expression "uVar2 = *(int *)(iVar1 + -0xc) + __n" identifier = (binary_expression "*(int *)(iVar1 + -0xc) + __n" (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) + identifier)) ;) (if_statement "if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }" if (parenthesized_expression "((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4)))" ( (binary_expression "(*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))" (parenthesized_expression "(*(uint *)(iVar1 + -8) < uVar2)" ( (binary_expression "*(uint *)(iVar1 + -8) < uVar2" (pointer_expression "*(uint *)(iVar1 + -8)" * (cast_expression "(uint *)(iVar1 + -8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -8)" ( (binary_expression "iVar1 + -8" identifier + number_literal) )))) < identifier) )) || (parenthesized_expression "(0 < *(int *)(iVar1 + -4))" ( (binary_expression "0 < *(int *)(iVar1 + -4)" number_literal < (pointer_expression "*(int *)(iVar1 + -4)" * (cast_expression "(int *)(iVar1 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -4)" ( (binary_expression "iVar1 + -4" identifier + number_literal) ))))) ))) )) (compound_statement "{\n        FUN_0021fa60(param_1,uVar2);\n      }" { (expression_statement "FUN_0021fa60(param_1,uVar2);" (call_expression "FUN_0021fa60(param_1,uVar2)" identifier (argument_list "(param_1,uVar2)" ( identifier , identifier ))) ;) })) (expression_statement "__dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));" (assignment_expression "__dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc))" identifier = (cast_expression "(undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + *(int *)(*param_1 + -0xc))" ( (binary_expression "*param_1 + *(int *)(*param_1 + -0xc)" (pointer_expression "*param_1" * identifier) + (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )))) ;) (if_statement "if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }" { (expression_statement "*__dest = *(undefined1 *)(param_3 + *param_2);" (assignment_expression "*__dest = *(undefined1 *)(param_3 + *param_2)" (pointer_expression "*__dest" * identifier) = (pointer_expression "*(undefined1 *)(param_3 + *param_2)" * (cast_expression "(undefined1 *)(param_3 + *param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + *param_2)" ( (binary_expression "param_3 + *param_2" identifier + (pointer_expression "*param_2" * identifier)) ))))) ;) }) (else_clause "else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }" else (compound_statement "{\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }" { (expression_statement "memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);" (call_expression "memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n)" identifier (argument_list "(__dest,(undefined1 *)(param_3 + *param_2),__n)" ( identifier , (cast_expression "(undefined1 *)(param_3 + *param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + *param_2)" ( (binary_expression "param_3 + *param_2" identifier + (pointer_expression "*param_2" * identifier)) ))) , identifier ))) ;) }))) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }" if (parenthesized_expression "((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc)" ( (binary_expression "(undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc" (cast_expression "(undefined *)(iVar1 + -0xc)" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) ))) != identifier) )) (compound_statement "{\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }" { (expression_statement "*(undefined4 *)(iVar1 + -4) = 0;" (assignment_expression "*(undefined4 *)(iVar1 + -4) = 0" (pointer_expression "*(undefined4 *)(iVar1 + -4)" * (cast_expression "(undefined4 *)(iVar1 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -4)" ( (binary_expression "iVar1 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(iVar1 + -0xc) = uVar2;" (assignment_expression "*(uint *)(iVar1 + -0xc) = uVar2" (pointer_expression "*(uint *)(iVar1 + -0xc)" * (cast_expression "(uint *)(iVar1 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined1 *)(iVar1 + uVar2) = 0;" (assignment_expression "*(undefined1 *)(iVar1 + uVar2) = 0" (pointer_expression "*(undefined1 *)(iVar1 + uVar2)" * (cast_expression "(undefined1 *)(iVar1 + uVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + uVar2)" ( (binary_expression "iVar1 + uVar2" identifier + identifier) )))) = number_literal) ;) })) })) (return_statement "return param_1;" return identifier ;) })) comment (expression_statement "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2);" (call_expression "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::append"" " string_content ") , identifier , identifier ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::string::append(std::string const&, unsigned int, unsigned int) */\n\nstring * __thiscall std::string::append(string *this,string *param_1,uint param_2,uint param_3)\n\n{\n  int iVar1;\n  undefined1 *__dest;\n  uint uVar2;\n  uint __n;\n  \n  uVar2 = *(uint *)(*(int *)param_1 + -0xc);\n  if (param_2 <= uVar2) {\n    __n = uVar2 - param_2;\n    if (param_3 < uVar2 - param_2) {\n      __n = param_3;\n    }\n    if (__n != 0) {\n      iVar1 = *(int *)this;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        reserve(this,uVar2);\n      }\n      __dest = (undefined1 *)(*(int *)this + *(int *)(*(int *)this + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_2 + *(int *)param_1);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n);\n      }\n      iVar1 = *(int *)this;\n      if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return this;\n  }\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::append",param_2\n             ,uVar2);\n}\n\n" comment comment (ERROR "string * __thiscall std::string::append(string *this,string *param_1,uint param_2,uint param_3)" (binary_expression "string * __thiscall std::string::append(string *this" (binary_expression "string * __thiscall" identifier * identifier) (ERROR "std::string::append(string" identifier : : identifier : : identifier ( identifier) * identifier) , type_identifier (pointer_declarator "*param_1" * identifier) , (ERROR "uint" identifier) identifier , identifier identifier )) (compound_statement "{\n  int iVar1;\n  undefined1 *__dest;\n  uint uVar2;\n  uint __n;\n  \n  uVar2 = *(uint *)(*(int *)param_1 + -0xc);\n  if (param_2 <= uVar2) {\n    __n = uVar2 - param_2;\n    if (param_3 < uVar2 - param_2) {\n      __n = param_3;\n    }\n    if (__n != 0) {\n      iVar1 = *(int *)this;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        reserve(this,uVar2);\n      }\n      __dest = (undefined1 *)(*(int *)this + *(int *)(*(int *)this + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_2 + *(int *)param_1);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n);\n      }\n      iVar1 = *(int *)this;\n      if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return this;\n  }\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::append",param_2\n             ,uVar2);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint __n;" type_identifier identifier ;) (expression_statement "uVar2 = *(uint *)(*(int *)param_1 + -0xc);" (assignment_expression "uVar2 = *(uint *)(*(int *)param_1 + -0xc)" identifier = (pointer_expression "*(uint *)(*(int *)param_1 + -0xc)" * (cast_expression "(uint *)(*(int *)param_1 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)param_1 + -0xc)" ( (binary_expression "*(int *)param_1 + -0xc" (pointer_expression "*(int *)param_1" * (cast_expression "(int *)param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (param_2 <= uVar2) {\n    __n = uVar2 - param_2;\n    if (param_3 < uVar2 - param_2) {\n      __n = param_3;\n    }\n    if (__n != 0) {\n      iVar1 = *(int *)this;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        reserve(this,uVar2);\n      }\n      __dest = (undefined1 *)(*(int *)this + *(int *)(*(int *)this + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_2 + *(int *)param_1);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n);\n      }\n      iVar1 = *(int *)this;\n      if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return this;\n  }" if (parenthesized_expression "(param_2 <= uVar2)" ( (binary_expression "param_2 <= uVar2" identifier <= identifier) )) (compound_statement "{\n    __n = uVar2 - param_2;\n    if (param_3 < uVar2 - param_2) {\n      __n = param_3;\n    }\n    if (__n != 0) {\n      iVar1 = *(int *)this;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        reserve(this,uVar2);\n      }\n      __dest = (undefined1 *)(*(int *)this + *(int *)(*(int *)this + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_2 + *(int *)param_1);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n);\n      }\n      iVar1 = *(int *)this;\n      if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return this;\n  }" { (expression_statement "__n = uVar2 - param_2;" (assignment_expression "__n = uVar2 - param_2" identifier = (binary_expression "uVar2 - param_2" identifier - identifier)) ;) (if_statement "if (param_3 < uVar2 - param_2) {\n      __n = param_3;\n    }" if (parenthesized_expression "(param_3 < uVar2 - param_2)" ( (binary_expression "param_3 < uVar2 - param_2" identifier < (binary_expression "uVar2 - param_2" identifier - identifier)) )) (compound_statement "{\n      __n = param_3;\n    }" { (expression_statement "__n = param_3;" (assignment_expression "__n = param_3" identifier = identifier) ;) })) (if_statement "if (__n != 0) {\n      iVar1 = *(int *)this;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        reserve(this,uVar2);\n      }\n      __dest = (undefined1 *)(*(int *)this + *(int *)(*(int *)this + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_2 + *(int *)param_1);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n);\n      }\n      iVar1 = *(int *)this;\n      if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n      iVar1 = *(int *)this;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        reserve(this,uVar2);\n      }\n      __dest = (undefined1 *)(*(int *)this + *(int *)(*(int *)this + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_2 + *(int *)param_1);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n);\n      }\n      iVar1 = *(int *)this;\n      if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }" { (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "uVar2 = *(int *)(iVar1 + -0xc) + __n;" (assignment_expression "uVar2 = *(int *)(iVar1 + -0xc) + __n" identifier = (binary_expression "*(int *)(iVar1 + -0xc) + __n" (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) + identifier)) ;) (if_statement "if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        reserve(this,uVar2);\n      }" if (parenthesized_expression "((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4)))" ( (binary_expression "(*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))" (parenthesized_expression "(*(uint *)(iVar1 + -8) < uVar2)" ( (binary_expression "*(uint *)(iVar1 + -8) < uVar2" (pointer_expression "*(uint *)(iVar1 + -8)" * (cast_expression "(uint *)(iVar1 + -8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -8)" ( (binary_expression "iVar1 + -8" identifier + number_literal) )))) < identifier) )) || (parenthesized_expression "(0 < *(int *)(iVar1 + -4))" ( (binary_expression "0 < *(int *)(iVar1 + -4)" number_literal < (pointer_expression "*(int *)(iVar1 + -4)" * (cast_expression "(int *)(iVar1 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -4)" ( (binary_expression "iVar1 + -4" identifier + number_literal) ))))) ))) )) (compound_statement "{\n        reserve(this,uVar2);\n      }" { (expression_statement "reserve(this,uVar2);" (call_expression "reserve(this,uVar2)" identifier (argument_list "(this,uVar2)" ( identifier , identifier ))) ;) })) (expression_statement "__dest = (undefined1 *)(*(int *)this + *(int *)(*(int *)this + -0xc));" (assignment_expression "__dest = (undefined1 *)(*(int *)this + *(int *)(*(int *)this + -0xc))" identifier = (cast_expression "(undefined1 *)(*(int *)this + *(int *)(*(int *)this + -0xc))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + *(int *)(*(int *)this + -0xc))" ( (binary_expression "*(int *)this + *(int *)(*(int *)this + -0xc)" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + (pointer_expression "*(int *)(*(int *)this + -0xc)" * (cast_expression "(int *)(*(int *)this + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + -0xc)" ( (binary_expression "*(int *)this + -0xc" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) )))) ;) (if_statement "if (__n == 1) {\n        *__dest = *(undefined1 *)(param_2 + *(int *)param_1);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n);\n      }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n        *__dest = *(undefined1 *)(param_2 + *(int *)param_1);\n      }" { (expression_statement "*__dest = *(undefined1 *)(param_2 + *(int *)param_1);" (assignment_expression "*__dest = *(undefined1 *)(param_2 + *(int *)param_1)" (pointer_expression "*__dest" * identifier) = (pointer_expression "*(undefined1 *)(param_2 + *(int *)param_1)" * (cast_expression "(undefined1 *)(param_2 + *(int *)param_1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + *(int *)param_1)" ( (binary_expression "param_2 + *(int *)param_1" identifier + (pointer_expression "*(int *)param_1" * (cast_expression "(int *)param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ))))) ;) }) (else_clause "else {\n        memcpy(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n);\n      }" else (compound_statement "{\n        memcpy(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n);\n      }" { (expression_statement "memcpy(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n);" (call_expression "memcpy(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n)" identifier (argument_list "(__dest,(undefined1 *)(param_2 + *(int *)param_1),__n)" ( identifier , (cast_expression "(undefined1 *)(param_2 + *(int *)param_1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + *(int *)param_1)" ( (binary_expression "param_2 + *(int *)param_1" identifier + (pointer_expression "*(int *)param_1" * (cast_expression "(int *)param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ))) , identifier ))) ;) }))) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (if_statement "if ((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }" if (parenthesized_expression "((undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_0038ecdc)" ( (binary_expression "(undefined *)(iVar1 + -0xc) != PTR__S_empty_rep_storage_0038ecdc" (cast_expression "(undefined *)(iVar1 + -0xc)" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) ))) != identifier) )) (compound_statement "{\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }" { (expression_statement "*(undefined4 *)(iVar1 + -4) = 0;" (assignment_expression "*(undefined4 *)(iVar1 + -4) = 0" (pointer_expression "*(undefined4 *)(iVar1 + -4)" * (cast_expression "(undefined4 *)(iVar1 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -4)" ( (binary_expression "iVar1 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(iVar1 + -0xc) = uVar2;" (assignment_expression "*(uint *)(iVar1 + -0xc) = uVar2" (pointer_expression "*(uint *)(iVar1 + -0xc)" * (cast_expression "(uint *)(iVar1 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined1 *)(iVar1 + uVar2) = 0;" (assignment_expression "*(undefined1 *)(iVar1 + uVar2) = 0" (pointer_expression "*(undefined1 *)(iVar1 + uVar2)" * (cast_expression "(undefined1 *)(iVar1 + uVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + uVar2)" ( (binary_expression "iVar1 + uVar2" identifier + identifier) )))) = number_literal) ;) })) })) (return_statement "return this;" return identifier ;) })) comment (expression_statement "__throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",param_2\n             ,uVar2);" (call_expression "__throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",param_2\n             ,uVar2)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",param_2\n             ,uVar2)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::append"" " string_content ") , identifier , identifier ))) ;) }))
(translation_unit "int * FUN_0021fc60(int *param_1,int *param_2,uint param_3,uint param_4)\n\n{\n  int iVar1;\n  undefined1 *__dest;\n  uint uVar2;\n  uint __n;\n  \n  uVar2 = *(uint *)(*param_2 + -0xc);\n  if (param_3 <= uVar2) {\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }\n                    \n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2);\n}\n\n" (function_definition "int * FUN_0021fc60(int *param_1,int *param_2,uint param_3,uint param_4)\n\n{\n  int iVar1;\n  undefined1 *__dest;\n  uint uVar2;\n  uint __n;\n  \n  uVar2 = *(uint *)(*param_2 + -0xc);\n  if (param_3 <= uVar2) {\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }\n                    \n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2);\n}" primitive_type (pointer_declarator "* FUN_0021fc60(int *param_1,int *param_2,uint param_3,uint param_4)" * (function_declarator "FUN_0021fc60(int *param_1,int *param_2,uint param_3,uint param_4)" identifier (parameter_list "(int *param_1,int *param_2,uint param_3,uint param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) )))) (compound_statement "{\n  int iVar1;\n  undefined1 *__dest;\n  uint uVar2;\n  uint __n;\n  \n  uVar2 = *(uint *)(*param_2 + -0xc);\n  if (param_3 <= uVar2) {\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }\n                    \n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint __n;" type_identifier identifier ;) (expression_statement "uVar2 = *(uint *)(*param_2 + -0xc);" (assignment_expression "uVar2 = *(uint *)(*param_2 + -0xc)" identifier = (pointer_expression "*(uint *)(*param_2 + -0xc)" * (cast_expression "(uint *)(*param_2 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_2 + -0xc)" ( (binary_expression "*param_2 + -0xc" (pointer_expression "*param_2" * identifier) + number_literal) ))))) ;) (if_statement "if (param_3 <= uVar2) {\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }" if (parenthesized_expression "(param_3 <= uVar2)" ( (binary_expression "param_3 <= uVar2" identifier <= identifier) )) (compound_statement "{\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }" { (expression_statement "__n = uVar2 - param_3;" (assignment_expression "__n = uVar2 - param_3" identifier = (binary_expression "uVar2 - param_3" identifier - identifier)) ;) (if_statement "if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }" if (parenthesized_expression "(param_4 < uVar2 - param_3)" ( (binary_expression "param_4 < uVar2 - param_3" identifier < (binary_expression "uVar2 - param_3" identifier - identifier)) )) (compound_statement "{\n      __n = param_4;\n    }" { (expression_statement "__n = param_4;" (assignment_expression "__n = param_4" identifier = identifier) ;) })) (if_statement "if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }" { (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar2 = *(int *)(iVar1 + -0xc) + __n;" (assignment_expression "uVar2 = *(int *)(iVar1 + -0xc) + __n" identifier = (binary_expression "*(int *)(iVar1 + -0xc) + __n" (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) + identifier)) ;) (if_statement "if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }" if (parenthesized_expression "((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4)))" ( (binary_expression "(*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))" (parenthesized_expression "(*(uint *)(iVar1 + -8) < uVar2)" ( (binary_expression "*(uint *)(iVar1 + -8) < uVar2" (pointer_expression "*(uint *)(iVar1 + -8)" * (cast_expression "(uint *)(iVar1 + -8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -8)" ( (binary_expression "iVar1 + -8" identifier + number_literal) )))) < identifier) )) || (parenthesized_expression "(0 < *(int *)(iVar1 + -4))" ( (binary_expression "0 < *(int *)(iVar1 + -4)" number_literal < (pointer_expression "*(int *)(iVar1 + -4)" * (cast_expression "(int *)(iVar1 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -4)" ( (binary_expression "iVar1 + -4" identifier + number_literal) ))))) ))) )) (compound_statement "{\n        FUN_0021fa60(param_1,uVar2);\n      }" { (expression_statement "FUN_0021fa60(param_1,uVar2);" (call_expression "FUN_0021fa60(param_1,uVar2)" identifier (argument_list "(param_1,uVar2)" ( identifier , identifier ))) ;) })) (expression_statement "__dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));" (assignment_expression "__dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc))" identifier = (cast_expression "(undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + *(int *)(*param_1 + -0xc))" ( (binary_expression "*param_1 + *(int *)(*param_1 + -0xc)" (pointer_expression "*param_1" * identifier) + (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )))) ;) (if_statement "if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }" { (expression_statement "*__dest = *(undefined1 *)(param_3 + *param_2);" (assignment_expression "*__dest = *(undefined1 *)(param_3 + *param_2)" (pointer_expression "*__dest" * identifier) = (pointer_expression "*(undefined1 *)(param_3 + *param_2)" * (cast_expression "(undefined1 *)(param_3 + *param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + *param_2)" ( (binary_expression "param_3 + *param_2" identifier + (pointer_expression "*param_2" * identifier)) ))))) ;) }) (else_clause "else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }" else (compound_statement "{\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }" { (expression_statement "memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);" (call_expression "memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n)" identifier (argument_list "(__dest,(undefined1 *)(param_3 + *param_2),__n)" ( identifier , (cast_expression "(undefined1 *)(param_3 + *param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + *param_2)" ( (binary_expression "param_3 + *param_2" identifier + (pointer_expression "*param_2" * identifier)) ))) , identifier ))) ;) }))) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }" if (parenthesized_expression "((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc)" ( (binary_expression "(undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc" (cast_expression "(undefined *)(iVar1 + -0xc)" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) ))) != identifier) )) (compound_statement "{\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }" { (expression_statement "*(undefined4 *)(iVar1 + -4) = 0;" (assignment_expression "*(undefined4 *)(iVar1 + -4) = 0" (pointer_expression "*(undefined4 *)(iVar1 + -4)" * (cast_expression "(undefined4 *)(iVar1 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -4)" ( (binary_expression "iVar1 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(iVar1 + -0xc) = uVar2;" (assignment_expression "*(uint *)(iVar1 + -0xc) = uVar2" (pointer_expression "*(uint *)(iVar1 + -0xc)" * (cast_expression "(uint *)(iVar1 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined1 *)(iVar1 + uVar2) = 0;" (assignment_expression "*(undefined1 *)(iVar1 + uVar2) = 0" (pointer_expression "*(undefined1 *)(iVar1 + uVar2)" * (cast_expression "(undefined1 *)(iVar1 + uVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + uVar2)" ( (binary_expression "iVar1 + uVar2" identifier + identifier) )))) = number_literal) ;) })) })) (return_statement "return param_1;" return identifier ;) })) (expression_statement "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2);" (call_expression "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::append"" " string_content ") , identifier , identifier ))) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (binary_expression IDENT - IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) < 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 (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (pointer_expression * IDENT)) ))))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (pointer_expression * IDENT)) ))) , IDENT ))) ;) }))) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))) != IDENT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) = LIT) ;) })) })) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , IDENT , IDENT ))) ;) })))
(function_definition "int * FUN_0021fc60(int *param_1,int *param_2,uint param_3,uint param_4)\n\n{\n  int iVar1;\n  undefined1 *__dest;\n  uint uVar2;\n  uint __n;\n  \n  uVar2 = *(uint *)(*param_2 + -0xc);\n  if (param_3 <= uVar2) {\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }\n                    \n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2);\n}" (primitive_type "int") (pointer_declarator "* FUN_0021fc60(int *param_1,int *param_2,uint param_3,uint param_4)" (* "*") (function_declarator "FUN_0021fc60(int *param_1,int *param_2,uint param_3,uint param_4)" (identifier "FUN_0021fc60") (parameter_list "(int *param_1,int *param_2,uint param_3,uint param_4)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (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  int iVar1;\n  undefined1 *__dest;\n  uint uVar2;\n  uint __n;\n  \n  uVar2 = *(uint *)(*param_2 + -0xc);\n  if (param_3 <= uVar2) {\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }\n                    \n  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2);\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined1 *__dest;" (type_identifier "undefined1") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "uint __n;" (type_identifier "uint") (identifier "__n") (; ";")) (expression_statement "uVar2 = *(uint *)(*param_2 + -0xc);" (assignment_expression "uVar2 = *(uint *)(*param_2 + -0xc)" (identifier "uVar2") (= "=") (pointer_expression "*(uint *)(*param_2 + -0xc)" (* "*") (cast_expression "(uint *)(*param_2 + -0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_2 + -0xc)" (( "(") (binary_expression "*param_2 + -0xc" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (+ "+") (number_literal "-0xc")) () ")"))))) (; ";")) (if_statement "if (param_3 <= uVar2) {\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }" (if "if") (parenthesized_expression "(param_3 <= uVar2)" (( "(") (binary_expression "param_3 <= uVar2" (identifier "param_3") (<= "<=") (identifier "uVar2")) () ")")) (compound_statement "{\n    __n = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }\n    if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }\n    return param_1;\n  }" ({ "{") (expression_statement "__n = uVar2 - param_3;" (assignment_expression "__n = uVar2 - param_3" (identifier "__n") (= "=") (binary_expression "uVar2 - param_3" (identifier "uVar2") (- "-") (identifier "param_3"))) (; ";")) (if_statement "if (param_4 < uVar2 - param_3) {\n      __n = param_4;\n    }" (if "if") (parenthesized_expression "(param_4 < uVar2 - param_3)" (( "(") (binary_expression "param_4 < uVar2 - param_3" (identifier "param_4") (< "<") (binary_expression "uVar2 - param_3" (identifier "uVar2") (- "-") (identifier "param_3"))) () ")")) (compound_statement "{\n      __n = param_4;\n    }" ({ "{") (expression_statement "__n = param_4;" (assignment_expression "__n = param_4" (identifier "__n") (= "=") (identifier "param_4")) (; ";")) (} "}"))) (if_statement "if (__n != 0) {\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }" (if "if") (parenthesized_expression "(__n != 0)" (( "(") (binary_expression "__n != 0" (identifier "__n") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      iVar1 = *param_1;\n      uVar2 = *(int *)(iVar1 + -0xc) + __n;\n      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }\n      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));\n      if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }\n      iVar1 = *param_1;\n      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }\n    }" ({ "{") (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" (identifier "iVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "uVar2 = *(int *)(iVar1 + -0xc) + __n;" (assignment_expression "uVar2 = *(int *)(iVar1 + -0xc) + __n" (identifier "uVar2") (= "=") (binary_expression "*(int *)(iVar1 + -0xc) + __n" (pointer_expression "*(int *)(iVar1 + -0xc)" (* "*") (cast_expression "(int *)(iVar1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -0xc)" (( "(") (binary_expression "iVar1 + -0xc" (identifier "iVar1") (+ "+") (number_literal "-0xc")) () ")")))) (+ "+") (identifier "__n"))) (; ";")) (if_statement "if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {\n        FUN_0021fa60(param_1,uVar2);\n      }" (if "if") (parenthesized_expression "((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4)))" (( "(") (binary_expression "(*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))" (parenthesized_expression "(*(uint *)(iVar1 + -8) < uVar2)" (( "(") (binary_expression "*(uint *)(iVar1 + -8) < uVar2" (pointer_expression "*(uint *)(iVar1 + -8)" (* "*") (cast_expression "(uint *)(iVar1 + -8)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -8)" (( "(") (binary_expression "iVar1 + -8" (identifier "iVar1") (+ "+") (number_literal "-8")) () ")")))) (< "<") (identifier "uVar2")) () ")")) (|| "||") (parenthesized_expression "(0 < *(int *)(iVar1 + -4))" (( "(") (binary_expression "0 < *(int *)(iVar1 + -4)" (number_literal "0") (< "<") (pointer_expression "*(int *)(iVar1 + -4)" (* "*") (cast_expression "(int *)(iVar1 + -4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -4)" (( "(") (binary_expression "iVar1 + -4" (identifier "iVar1") (+ "+") (number_literal "-4")) () ")"))))) () ")"))) () ")")) (compound_statement "{\n        FUN_0021fa60(param_1,uVar2);\n      }" ({ "{") (expression_statement "FUN_0021fa60(param_1,uVar2);" (call_expression "FUN_0021fa60(param_1,uVar2)" (identifier "FUN_0021fa60") (argument_list "(param_1,uVar2)" (( "(") (identifier "param_1") (, ",") (identifier "uVar2") () ")"))) (; ";")) (} "}"))) (expression_statement "__dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));" (assignment_expression "__dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc))" (identifier "__dest") (= "=") (cast_expression "(undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc))" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + *(int *)(*param_1 + -0xc))" (( "(") (binary_expression "*param_1 + *(int *)(*param_1 + -0xc)" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (pointer_expression "*(int *)(*param_1 + -0xc)" (* "*") (cast_expression "(int *)(*param_1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0xc)" (( "(") (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0xc")) () ")"))))) () ")")))) (; ";")) (if_statement "if (__n == 1) {\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }\n      else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }" (if "if") (parenthesized_expression "(__n == 1)" (( "(") (binary_expression "__n == 1" (identifier "__n") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *__dest = *(undefined1 *)(param_3 + *param_2);\n      }" ({ "{") (expression_statement "*__dest = *(undefined1 *)(param_3 + *param_2);" (assignment_expression "*__dest = *(undefined1 *)(param_3 + *param_2)" (pointer_expression "*__dest" (* "*") (identifier "__dest")) (= "=") (pointer_expression "*(undefined1 *)(param_3 + *param_2)" (* "*") (cast_expression "(undefined1 *)(param_3 + *param_2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + *param_2)" (( "(") (binary_expression "param_3 + *param_2" (identifier "param_3") (+ "+") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) () ")"))))) (; ";")) (} "}")) (else_clause "else {\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }" (else "else") (compound_statement "{\n        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);\n      }" ({ "{") (expression_statement "memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);" (call_expression "memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n)" (identifier "memcpy") (argument_list "(__dest,(undefined1 *)(param_3 + *param_2),__n)" (( "(") (identifier "__dest") (, ",") (cast_expression "(undefined1 *)(param_3 + *param_2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + *param_2)" (( "(") (binary_expression "param_3 + *param_2" (identifier "param_3") (+ "+") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) () ")"))) (, ",") (identifier "__n") () ")"))) (; ";")) (} "}")))) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" (identifier "iVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }" (if "if") (parenthesized_expression "((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc)" (( "(") (binary_expression "(undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc" (cast_expression "(undefined *)(iVar1 + -0xc)" (( "(") (type_descriptor "undefined *" (type_identifier "undefined") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -0xc)" (( "(") (binary_expression "iVar1 + -0xc" (identifier "iVar1") (+ "+") (number_literal "-0xc")) () ")"))) (!= "!=") (identifier "PTR_DAT_0038ecdc")) () ")")) (compound_statement "{\n        *(undefined4 *)(iVar1 + -4) = 0;\n        *(uint *)(iVar1 + -0xc) = uVar2;\n        *(undefined1 *)(iVar1 + uVar2) = 0;\n      }" ({ "{") (expression_statement "*(undefined4 *)(iVar1 + -4) = 0;" (assignment_expression "*(undefined4 *)(iVar1 + -4) = 0" (pointer_expression "*(undefined4 *)(iVar1 + -4)" (* "*") (cast_expression "(undefined4 *)(iVar1 + -4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -4)" (( "(") (binary_expression "iVar1 + -4" (identifier "iVar1") (+ "+") (number_literal "-4")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(uint *)(iVar1 + -0xc) = uVar2;" (assignment_expression "*(uint *)(iVar1 + -0xc) = uVar2" (pointer_expression "*(uint *)(iVar1 + -0xc)" (* "*") (cast_expression "(uint *)(iVar1 + -0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -0xc)" (( "(") (binary_expression "iVar1 + -0xc" (identifier "iVar1") (+ "+") (number_literal "-0xc")) () ")")))) (= "=") (identifier "uVar2")) (; ";")) (expression_statement "*(undefined1 *)(iVar1 + uVar2) = 0;" (assignment_expression "*(undefined1 *)(iVar1 + uVar2) = 0" (pointer_expression "*(undefined1 *)(iVar1 + uVar2)" (* "*") (cast_expression "(undefined1 *)(iVar1 + uVar2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + uVar2)" (( "(") (binary_expression "iVar1 + uVar2" (identifier "iVar1") (+ "+") (identifier "uVar2")) () ")")))) (= "=") (number_literal "0")) (; ";")) (} "}"))) (} "}"))) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (expression_statement "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2);" (call_expression "FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,uVar2)" (identifier "FUN_0022c840") (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",\n               param_3,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::append"" (" """) (string_content "basic_string::append") (" """)) (, ",") (identifier "param_3") (, ",") (identifier "uVar2") () ")"))) (; ";")) (} "}")))

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

string * __thiscall std::string::append(string *this,string *param_1,type_2 var_1,type_2 var_3)

{
  int var_5;
  type_1 *__dest;
  type_2 var_2;
  type_2 var_4;
  
  var_2 = *(type_2 *)(*(int *)param_1 + -0xc);
  if (var_1 <= var_2) {
    var_4 = var_2 - var_1;
    if (var_3 < var_2 - var_1) {
      var_4 = var_3;
    }
    if (var_4 != 0) {
      var_5 = *(int *)this;
      var_2 = *(int *)(var_5 + -0xc) + var_4;
      if ((*(type_2 *)(var_5 + -8) < var_2) || (0 < *(int *)(var_5 + -4))) {
        var_6(this,var_2);
      }
      __dest = (type_1 *)(*(int *)this + *(int *)(*(int *)this + -0xc));
      if (var_4 == 1) {
        *__dest = *(type_1 *)(var_1 + *(int *)param_1);
      }
      else {
        var_7(__dest,(type_1 *)(var_1 + *(int *)param_1),var_4);
      }
      var_5 = *(int *)this;
      if ((type_3 *)(var_5 + -0xc) != var_8) {
        *(type_4 *)(var_5 + -4) = 0;
        *(type_2 *)(var_5 + -0xc) = var_2;
        *(type_1 *)(var_5 + var_2) = 0;
      }
    }
    return this;
  }
                    /* WARNING: Subroutine does not return */
  var_9
            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",var_1
             ,var_2);
}


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

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

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

{
  int iVar1;
  undefined1 *__dest;
  uint uVar2;
  uint __n;
  
  uVar2 = *(uint *)(*param_2 + -0xc);
  if (param_3 <= uVar2) {
    __n = uVar2 - param_3;
    if (param_4 < uVar2 - param_3) {
      __n = param_4;
    }
    if (__n != 0) {
      iVar1 = *param_1;
      uVar2 = *(int *)(iVar1 + -0xc) + __n;
      if ((*(uint *)(iVar1 + -8) < uVar2) || (0 < *(int *)(iVar1 + -4))) {
        FUN_0021fa60(param_1,uVar2);
      }
      __dest = (undefined1 *)(*param_1 + *(int *)(*param_1 + -0xc));
      if (__n == 1) {
        *__dest = *(undefined1 *)(param_3 + *param_2);
      }
      else {
        memcpy(__dest,(undefined1 *)(param_3 + *param_2),__n);
      }
      iVar1 = *param_1;
      if ((undefined *)(iVar1 + -0xc) != PTR_DAT_0038ecdc) {
        *(undefined4 *)(iVar1 + -4) = 0;
        *(uint *)(iVar1 + -0xc) = uVar2;
        *(undefined1 *)(iVar1 + uVar2) = 0;
      }
    }
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0022c840("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::append",
               param_3,uVar2);
}

