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

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

{
  int *piVar1;
  int iVar2;
  char *pcVar3;
  uint uVar4;
  
  if (param_2 == 0) {
    return this;
  }
  pcVar3 = *(char **)this;
  if (0x3ffffffcU - *(int *)(pcVar3 + -0xc) < param_2) {
                    /* WARNING: Subroutine does not return */
    __throw_length_error("basic_string::append");
  }
  uVar4 = *(int *)(pcVar3 + -0xc) + param_2;
  if ((*(uint *)(pcVar3 + -8) < uVar4) ||
     (piVar1 = (int *)(pcVar3 + -4), pcVar3 = *(char **)this, 0 < *piVar1)) {
    if ((pcVar3 <= param_1) && (param_1 <= pcVar3 + *(int *)(pcVar3 + -0xc))) {
      reserve(this,uVar4);
      iVar2 = *(int *)this;
      param_1 = param_1 + (iVar2 - (int)pcVar3);
      pcVar3 = (char *)(iVar2 + *(int *)(iVar2 + -0xc));
      goto joined_r0x0021fe09;
    }
    reserve(this,uVar4);
    pcVar3 = *(char **)this;
  }
  pcVar3 = pcVar3 + *(int *)(pcVar3 + -0xc);
joined_r0x0021fe09:
  if (param_2 == 1) {
    *pcVar3 = *param_1;
  }
  else {
    memcpy(pcVar3,param_1,param_2);
  }
  iVar2 = *(int *)this;
  if ((undefined *)(iVar2 + -0xc) != PTR__S_empty_rep_storage_0038ecdc) {
    *(undefined4 *)(iVar2 + -4) = 0;
    *(uint *)(iVar2 + -0xc) = uVar4;
    *(undefined1 *)(iVar2 + uVar4) = 0;
  }
  return this;
}



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

int * FUN_0021fd50(int *param_1,undefined1 *param_2,uint param_3)

{
  int *piVar1;
  int iVar2;
  undefined1 *puVar3;
  uint uVar4;
  
  if (param_3 == 0) {
    return param_1;
  }
  puVar3 = (undefined1 *)*param_1;
  if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {
                    /* WARNING: Subroutine does not return */
    FUN_0022c7a0("basic_string::append");
  }
  uVar4 = *(int *)(puVar3 + -0xc) + param_3;
  if ((*(uint *)(puVar3 + -8) < uVar4) ||
     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {
    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {
      FUN_0021fa60(param_1,uVar4);
      iVar2 = *param_1;
      param_2 = param_2 + (iVar2 - (int)puVar3);
      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));
      goto joined_r0x0021fe09;
    }
    FUN_0021fa60(param_1,uVar4);
    puVar3 = (undefined1 *)*param_1;
  }
  puVar3 = puVar3 + *(int *)(puVar3 + -0xc);
joined_r0x0021fe09:
  if (param_3 == 1) {
    *puVar3 = *param_2;
  }
  else {
    memcpy(puVar3,param_2,param_3);
  }
  iVar2 = *param_1;
  if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {
    *(undefined4 *)(iVar2 + -4) = 0;
    *(uint *)(iVar2 + -0xc) = uVar4;
    *(undefined1 *)(iVar2 + uVar4) = 0;
  }
  return param_1;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00035840
ADD EBX,0x16f2a7
SUB ESP,0x1c
MOV EBP,dword ptr [ESP + 0x38]
MOV ESI,dword ptr [ESP + 0x30]
TEST EBP,EBP
JZ 0x0021fdd3
MOV EDX,dword ptr [ESI]
MOV ECX,0x3ffffffc
MOV EDI,dword ptr [EDX + -0xc]
SUB ECX,EDI
CMP EBP,ECX
JA 0x0021fe48
ADD EDI,EBP
CMP EDI,dword ptr [EDX + -0x8]
JBE 0x0021fe20
CMP EDX,dword ptr [ESP + 0x34]
JA 0x0021fd9e
MOV ECX,dword ptr [EDX + -0xc]
ADD ECX,EDX
CMP dword ptr [ESP + 0x34],ECX
JBE 0x0021fde0
SUB ESP,0x8
PUSH EDI
PUSH ESI
CALL 0x0021fa60
MOV EDX,dword ptr [ESI]
ADD ESP,0x10
ADD EDX,dword ptr [EDX + -0xc]
CMP EBP,0x1
JZ 0x0021fe0b
SUB ESP,0x4
PUSH EBP
PUSH dword ptr [ESP + 0x3c]
PUSH EDX
CALL 0x000295c0
ADD ESP,0x10
MOV EAX,dword ptr [ESI]
LEA EDX,[EAX + -0xc]
CMP EDX,dword ptr [EBX + 0xfffffcdc]
JNZ 0x0021fe38
ADD ESP,0x1c
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EAX,dword ptr [ESP + 0x34]
SUB ESP,0x8
SUB EAX,EDX
MOV dword ptr [ESP + 0x14],EAX
PUSH EDI
PUSH ESI
CALL 0x0021fa60
MOV EDX,dword ptr [ESI]
MOV EAX,dword ptr [ESP + 0x1c]
ADD EAX,EDX
ADD EDX,dword ptr [EDX + -0xc]
MOV dword ptr [ESP + 0x44],EAX
ADD ESP,0x10
CMP EBP,0x1
JNZ 0x0021fdb5
MOV EAX,dword ptr [ESP + 0x34]
MOVZX EAX,byte ptr [EAX]
MOV byte ptr [EDX],AL
JMP 0x0021fdc6
MOV EDX,dword ptr [EDX + -0x4]
TEST EDX,EDX
MOV EDX,dword ptr [ESI]
JG 0x0021fd8d
JMP 0x0021fdad
MOV dword ptr [EAX + -0x4],0x0
MOV dword ptr [EAX + -0xc],EDI
MOV byte ptr [EAX + EDI*0x1],0x0
JMP 0x0021fdd3
SUB ESP,0xc
LEA EAX,[EBX + 0xffef7be2]
PUSH EAX
CALL 0x0022c7a0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint * FUN_0021fd50(int *param_1,undefined1 *param_2,uint param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return param_1;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::append");\n  }\n  uVar4 = *(int *)(puVar3 + -0xc) + param_3;\n  if ((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }\n  puVar3 = puVar3 + *(int *)(puVar3 + -0xc);\njoined_r0x0021fe09:\n  if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }\n  iVar2 = *param_1;\n  if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }\n  return param_1;\n}\n\n" comment (function_definition "int * FUN_0021fd50(int *param_1,undefined1 *param_2,uint param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return param_1;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::append");\n  }\n  uVar4 = *(int *)(puVar3 + -0xc) + param_3;\n  if ((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }\n  puVar3 = puVar3 + *(int *)(puVar3 + -0xc);\njoined_r0x0021fe09:\n  if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }\n  iVar2 = *param_1;\n  if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }\n  return param_1;\n}" primitive_type (pointer_declarator "* FUN_0021fd50(int *param_1,undefined1 *param_2,uint param_3)" * (function_declarator "FUN_0021fd50(int *param_1,undefined1 *param_2,uint param_3)" identifier (parameter_list "(int *param_1,undefined1 *param_2,uint param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) )))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return param_1;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::append");\n  }\n  uVar4 = *(int *)(puVar3 + -0xc) + param_3;\n  if ((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }\n  puVar3 = puVar3 + *(int *)(puVar3 + -0xc);\njoined_r0x0021fe09:\n  if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }\n  iVar2 = *param_1;\n  if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }\n  return param_1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (if_statement "if (param_3 == 0) {\n    return param_1;\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    return param_1;\n  }" { (return_statement "return param_1;" return identifier ;) })) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::append");\n  }" if (parenthesized_expression "(0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3)" ( (binary_expression "0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3" (binary_expression "0x3ffffffcU - *(int *)(puVar3 + -0xc)" number_literal - (pointer_expression "*(int *)(puVar3 + -0xc)" * (cast_expression "(int *)(puVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) ))))) < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::append");\n  }" { comment (expression_statement "FUN_0022c7a0("basic_string::append");" (call_expression "FUN_0022c7a0("basic_string::append")" identifier (argument_list "("basic_string::append")" ( (string_literal ""basic_string::append"" " string_content ") ))) ;) })) (expression_statement "uVar4 = *(int *)(puVar3 + -0xc) + param_3;" (assignment_expression "uVar4 = *(int *)(puVar3 + -0xc) + param_3" identifier = (binary_expression "*(int *)(puVar3 + -0xc) + param_3" (pointer_expression "*(int *)(puVar3 + -0xc)" * (cast_expression "(int *)(puVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))) + identifier)) ;) (if_statement "if ((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }" if (parenthesized_expression "((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1))" ( (binary_expression "(*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)" (parenthesized_expression "(*(uint *)(puVar3 + -8) < uVar4)" ( (binary_expression "*(uint *)(puVar3 + -8) < uVar4" (pointer_expression "*(uint *)(puVar3 + -8)" * (cast_expression "(uint *)(puVar3 + -8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -8)" ( (binary_expression "puVar3 + -8" identifier + number_literal) )))) < identifier) )) || (parenthesized_expression "(piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)" ( (comma_expression "piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1" (assignment_expression "piVar1 = (int *)(puVar3 + -4)" identifier = (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) , (comma_expression "puVar3 = (undefined1 *)*param_1, 0 < *piVar1" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) , (binary_expression "0 < *piVar1" number_literal < (pointer_expression "*piVar1" * identifier)))) ))) )) (compound_statement "{\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }" { (if_statement "if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }" if (parenthesized_expression "((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc)))" ( (binary_expression "(puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))" (parenthesized_expression "(puVar3 <= param_2)" ( (binary_expression "puVar3 <= param_2" identifier <= identifier) )) && (parenthesized_expression "(param_2 <= puVar3 + *(int *)(puVar3 + -0xc))" ( (binary_expression "param_2 <= puVar3 + *(int *)(puVar3 + -0xc)" identifier <= (binary_expression "puVar3 + *(int *)(puVar3 + -0xc)" identifier + (pointer_expression "*(int *)(puVar3 + -0xc)" * (cast_expression "(int *)(puVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))))) ))) )) (compound_statement "{\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }" { (expression_statement "FUN_0021fa60(param_1,uVar4);" (call_expression "FUN_0021fa60(param_1,uVar4)" identifier (argument_list "(param_1,uVar4)" ( identifier , identifier ))) ;) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "param_2 = param_2 + (iVar2 - (int)puVar3);" (assignment_expression "param_2 = param_2 + (iVar2 - (int)puVar3)" identifier = (binary_expression "param_2 + (iVar2 - (int)puVar3)" identifier + (parenthesized_expression "(iVar2 - (int)puVar3)" ( (binary_expression "iVar2 - (int)puVar3" identifier - (cast_expression "(int)puVar3" ( (type_descriptor "int" primitive_type) ) identifier)) )))) ;) (expression_statement "puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));" (assignment_expression "puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc))" identifier = (cast_expression "(undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + *(int *)(iVar2 + -0xc))" ( (binary_expression "iVar2 + *(int *)(iVar2 + -0xc)" identifier + (pointer_expression "*(int *)(iVar2 + -0xc)" * (cast_expression "(int *)(iVar2 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -0xc)" ( (binary_expression "iVar2 + -0xc" identifier + number_literal) ))))) )))) ;) (goto_statement "goto joined_r0x0021fe09;" goto statement_identifier ;) })) (expression_statement "FUN_0021fa60(param_1,uVar4);" (call_expression "FUN_0021fa60(param_1,uVar4)" identifier (argument_list "(param_1,uVar4)" ( identifier , identifier ))) ;) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) })) (expression_statement "puVar3 = puVar3 + *(int *)(puVar3 + -0xc);" (assignment_expression "puVar3 = puVar3 + *(int *)(puVar3 + -0xc)" identifier = (binary_expression "puVar3 + *(int *)(puVar3 + -0xc)" identifier + (pointer_expression "*(int *)(puVar3 + -0xc)" * (cast_expression "(int *)(puVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))))) ;) (labeled_statement "joined_r0x0021fe09:\n  if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }" statement_identifier : (if_statement "if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n    *puVar3 = *param_2;\n  }" { (expression_statement "*puVar3 = *param_2;" (assignment_expression "*puVar3 = *param_2" (pointer_expression "*puVar3" * identifier) = (pointer_expression "*param_2" * identifier)) ;) }) (else_clause "else {\n    memcpy(puVar3,param_2,param_3);\n  }" else (compound_statement "{\n    memcpy(puVar3,param_2,param_3);\n  }" { (expression_statement "memcpy(puVar3,param_2,param_3);" (call_expression "memcpy(puVar3,param_2,param_3)" identifier (argument_list "(puVar3,param_2,param_3)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }" if (parenthesized_expression "((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc)" ( (binary_expression "(undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc" (cast_expression "(undefined *)(iVar2 + -0xc)" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -0xc)" ( (binary_expression "iVar2 + -0xc" identifier + number_literal) ))) != identifier) )) (compound_statement "{\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }" { (expression_statement "*(undefined4 *)(iVar2 + -4) = 0;" (assignment_expression "*(undefined4 *)(iVar2 + -4) = 0" (pointer_expression "*(undefined4 *)(iVar2 + -4)" * (cast_expression "(undefined4 *)(iVar2 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -4)" ( (binary_expression "iVar2 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(iVar2 + -0xc) = uVar4;" (assignment_expression "*(uint *)(iVar2 + -0xc) = uVar4" (pointer_expression "*(uint *)(iVar2 + -0xc)" * (cast_expression "(uint *)(iVar2 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -0xc)" ( (binary_expression "iVar2 + -0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined1 *)(iVar2 + uVar4) = 0;" (assignment_expression "*(undefined1 *)(iVar2 + uVar4) = 0" (pointer_expression "*(undefined1 *)(iVar2 + uVar4)" * (cast_expression "(undefined1 *)(iVar2 + uVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + uVar4)" ( (binary_expression "iVar2 + uVar4" identifier + identifier) )))) = number_literal) ;) })) (return_statement "return param_1;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::string::append(char const*, unsigned int) */\n\nstring * __thiscall std::string::append(string *this,char *param_1,uint param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  char *pcVar3;\n  uint uVar4;\n  \n  if (param_2 == 0) {\n    return this;\n  }\n  pcVar3 = *(char **)this;\n  if (0x3ffffffcU - *(int *)(pcVar3 + -0xc) < param_2) {\n                    /* WARNING: Subroutine does not return */\n    __throw_length_error("basic_string::append");\n  }\n  uVar4 = *(int *)(pcVar3 + -0xc) + param_2;\n  if ((*(uint *)(pcVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(pcVar3 + -4), pcVar3 = *(char **)this, 0 < *piVar1)) {\n    if ((pcVar3 <= param_1) && (param_1 <= pcVar3 + *(int *)(pcVar3 + -0xc))) {\n      reserve(this,uVar4);\n      iVar2 = *(int *)this;\n      param_1 = param_1 + (iVar2 - (int)pcVar3);\n      pcVar3 = (char *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    reserve(this,uVar4);\n    pcVar3 = *(char **)this;\n  }\n  pcVar3 = pcVar3 + *(int *)(pcVar3 + -0xc);\njoined_r0x0021fe09:\n  if (param_2 == 1) {\n    *pcVar3 = *param_1;\n  }\n  else {\n    memcpy(pcVar3,param_1,param_2);\n  }\n  iVar2 = *(int *)this;\n  if ((undefined *)(iVar2 + -0xc) != PTR__S_empty_rep_storage_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }\n  return this;\n}\n\n" comment comment (ERROR "string * __thiscall std::string::append(string *this,char *param_1,uint param_2)" (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) , primitive_type (pointer_declarator "*param_1" * identifier) , identifier identifier )) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  char *pcVar3;\n  uint uVar4;\n  \n  if (param_2 == 0) {\n    return this;\n  }\n  pcVar3 = *(char **)this;\n  if (0x3ffffffcU - *(int *)(pcVar3 + -0xc) < param_2) {\n                    /* WARNING: Subroutine does not return */\n    __throw_length_error("basic_string::append");\n  }\n  uVar4 = *(int *)(pcVar3 + -0xc) + param_2;\n  if ((*(uint *)(pcVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(pcVar3 + -4), pcVar3 = *(char **)this, 0 < *piVar1)) {\n    if ((pcVar3 <= param_1) && (param_1 <= pcVar3 + *(int *)(pcVar3 + -0xc))) {\n      reserve(this,uVar4);\n      iVar2 = *(int *)this;\n      param_1 = param_1 + (iVar2 - (int)pcVar3);\n      pcVar3 = (char *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    reserve(this,uVar4);\n    pcVar3 = *(char **)this;\n  }\n  pcVar3 = pcVar3 + *(int *)(pcVar3 + -0xc);\njoined_r0x0021fe09:\n  if (param_2 == 1) {\n    *pcVar3 = *param_1;\n  }\n  else {\n    memcpy(pcVar3,param_1,param_2);\n  }\n  iVar2 = *(int *)this;\n  if ((undefined *)(iVar2 + -0xc) != PTR__S_empty_rep_storage_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }\n  return this;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (if_statement "if (param_2 == 0) {\n    return this;\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    return this;\n  }" { (return_statement "return this;" return identifier ;) })) (expression_statement "pcVar3 = *(char **)this;" (assignment_expression "pcVar3 = *(char **)this" identifier = (pointer_expression "*(char **)this" * (cast_expression "(char **)this" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (if_statement "if (0x3ffffffcU - *(int *)(pcVar3 + -0xc) < param_2) {\n                    /* WARNING: Subroutine does not return */\n    __throw_length_error("basic_string::append");\n  }" if (parenthesized_expression "(0x3ffffffcU - *(int *)(pcVar3 + -0xc) < param_2)" ( (binary_expression "0x3ffffffcU - *(int *)(pcVar3 + -0xc) < param_2" (binary_expression "0x3ffffffcU - *(int *)(pcVar3 + -0xc)" number_literal - (pointer_expression "*(int *)(pcVar3 + -0xc)" * (cast_expression "(int *)(pcVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar3 + -0xc)" ( (binary_expression "pcVar3 + -0xc" identifier + number_literal) ))))) < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __throw_length_error("basic_string::append");\n  }" { comment (expression_statement "__throw_length_error("basic_string::append");" (call_expression "__throw_length_error("basic_string::append")" identifier (argument_list "("basic_string::append")" ( (string_literal ""basic_string::append"" " string_content ") ))) ;) })) (expression_statement "uVar4 = *(int *)(pcVar3 + -0xc) + param_2;" (assignment_expression "uVar4 = *(int *)(pcVar3 + -0xc) + param_2" identifier = (binary_expression "*(int *)(pcVar3 + -0xc) + param_2" (pointer_expression "*(int *)(pcVar3 + -0xc)" * (cast_expression "(int *)(pcVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar3 + -0xc)" ( (binary_expression "pcVar3 + -0xc" identifier + number_literal) )))) + identifier)) ;) (if_statement "if ((*(uint *)(pcVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(pcVar3 + -4), pcVar3 = *(char **)this, 0 < *piVar1)) {\n    if ((pcVar3 <= param_1) && (param_1 <= pcVar3 + *(int *)(pcVar3 + -0xc))) {\n      reserve(this,uVar4);\n      iVar2 = *(int *)this;\n      param_1 = param_1 + (iVar2 - (int)pcVar3);\n      pcVar3 = (char *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    reserve(this,uVar4);\n    pcVar3 = *(char **)this;\n  }" if (parenthesized_expression "((*(uint *)(pcVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(pcVar3 + -4), pcVar3 = *(char **)this, 0 < *piVar1))" ( (binary_expression "(*(uint *)(pcVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(pcVar3 + -4), pcVar3 = *(char **)this, 0 < *piVar1)" (parenthesized_expression "(*(uint *)(pcVar3 + -8) < uVar4)" ( (binary_expression "*(uint *)(pcVar3 + -8) < uVar4" (pointer_expression "*(uint *)(pcVar3 + -8)" * (cast_expression "(uint *)(pcVar3 + -8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar3 + -8)" ( (binary_expression "pcVar3 + -8" identifier + number_literal) )))) < identifier) )) || (parenthesized_expression "(piVar1 = (int *)(pcVar3 + -4), pcVar3 = *(char **)this, 0 < *piVar1)" ( (comma_expression "piVar1 = (int *)(pcVar3 + -4), pcVar3 = *(char **)this, 0 < *piVar1" (assignment_expression "piVar1 = (int *)(pcVar3 + -4)" identifier = (cast_expression "(int *)(pcVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar3 + -4)" ( (binary_expression "pcVar3 + -4" identifier + number_literal) )))) , (comma_expression "pcVar3 = *(char **)this, 0 < *piVar1" (assignment_expression "pcVar3 = *(char **)this" identifier = (pointer_expression "*(char **)this" * (cast_expression "(char **)this" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) , (binary_expression "0 < *piVar1" number_literal < (pointer_expression "*piVar1" * identifier)))) ))) )) (compound_statement "{\n    if ((pcVar3 <= param_1) && (param_1 <= pcVar3 + *(int *)(pcVar3 + -0xc))) {\n      reserve(this,uVar4);\n      iVar2 = *(int *)this;\n      param_1 = param_1 + (iVar2 - (int)pcVar3);\n      pcVar3 = (char *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    reserve(this,uVar4);\n    pcVar3 = *(char **)this;\n  }" { (if_statement "if ((pcVar3 <= param_1) && (param_1 <= pcVar3 + *(int *)(pcVar3 + -0xc))) {\n      reserve(this,uVar4);\n      iVar2 = *(int *)this;\n      param_1 = param_1 + (iVar2 - (int)pcVar3);\n      pcVar3 = (char *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }" if (parenthesized_expression "((pcVar3 <= param_1) && (param_1 <= pcVar3 + *(int *)(pcVar3 + -0xc)))" ( (binary_expression "(pcVar3 <= param_1) && (param_1 <= pcVar3 + *(int *)(pcVar3 + -0xc))" (parenthesized_expression "(pcVar3 <= param_1)" ( (binary_expression "pcVar3 <= param_1" identifier <= identifier) )) && (parenthesized_expression "(param_1 <= pcVar3 + *(int *)(pcVar3 + -0xc))" ( (binary_expression "param_1 <= pcVar3 + *(int *)(pcVar3 + -0xc)" identifier <= (binary_expression "pcVar3 + *(int *)(pcVar3 + -0xc)" identifier + (pointer_expression "*(int *)(pcVar3 + -0xc)" * (cast_expression "(int *)(pcVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar3 + -0xc)" ( (binary_expression "pcVar3 + -0xc" identifier + number_literal) )))))) ))) )) (compound_statement "{\n      reserve(this,uVar4);\n      iVar2 = *(int *)this;\n      param_1 = param_1 + (iVar2 - (int)pcVar3);\n      pcVar3 = (char *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }" { (expression_statement "reserve(this,uVar4);" (call_expression "reserve(this,uVar4)" identifier (argument_list "(this,uVar4)" ( identifier , identifier ))) ;) (expression_statement "iVar2 = *(int *)this;" (assignment_expression "iVar2 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "param_1 = param_1 + (iVar2 - (int)pcVar3);" (assignment_expression "param_1 = param_1 + (iVar2 - (int)pcVar3)" identifier = (binary_expression "param_1 + (iVar2 - (int)pcVar3)" identifier + (parenthesized_expression "(iVar2 - (int)pcVar3)" ( (binary_expression "iVar2 - (int)pcVar3" identifier - (cast_expression "(int)pcVar3" ( (type_descriptor "int" primitive_type) ) identifier)) )))) ;) (expression_statement "pcVar3 = (char *)(iVar2 + *(int *)(iVar2 + -0xc));" (assignment_expression "pcVar3 = (char *)(iVar2 + *(int *)(iVar2 + -0xc))" identifier = (cast_expression "(char *)(iVar2 + *(int *)(iVar2 + -0xc))" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + *(int *)(iVar2 + -0xc))" ( (binary_expression "iVar2 + *(int *)(iVar2 + -0xc)" identifier + (pointer_expression "*(int *)(iVar2 + -0xc)" * (cast_expression "(int *)(iVar2 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -0xc)" ( (binary_expression "iVar2 + -0xc" identifier + number_literal) ))))) )))) ;) (goto_statement "goto joined_r0x0021fe09;" goto statement_identifier ;) })) (expression_statement "reserve(this,uVar4);" (call_expression "reserve(this,uVar4)" identifier (argument_list "(this,uVar4)" ( identifier , identifier ))) ;) (expression_statement "pcVar3 = *(char **)this;" (assignment_expression "pcVar3 = *(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 "pcVar3 = pcVar3 + *(int *)(pcVar3 + -0xc);" (assignment_expression "pcVar3 = pcVar3 + *(int *)(pcVar3 + -0xc)" identifier = (binary_expression "pcVar3 + *(int *)(pcVar3 + -0xc)" identifier + (pointer_expression "*(int *)(pcVar3 + -0xc)" * (cast_expression "(int *)(pcVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar3 + -0xc)" ( (binary_expression "pcVar3 + -0xc" identifier + number_literal) )))))) ;) (labeled_statement "joined_r0x0021fe09:\n  if (param_2 == 1) {\n    *pcVar3 = *param_1;\n  }\n  else {\n    memcpy(pcVar3,param_1,param_2);\n  }" statement_identifier : (if_statement "if (param_2 == 1) {\n    *pcVar3 = *param_1;\n  }\n  else {\n    memcpy(pcVar3,param_1,param_2);\n  }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n    *pcVar3 = *param_1;\n  }" { (expression_statement "*pcVar3 = *param_1;" (assignment_expression "*pcVar3 = *param_1" (pointer_expression "*pcVar3" * identifier) = (pointer_expression "*param_1" * identifier)) ;) }) (else_clause "else {\n    memcpy(pcVar3,param_1,param_2);\n  }" else (compound_statement "{\n    memcpy(pcVar3,param_1,param_2);\n  }" { (expression_statement "memcpy(pcVar3,param_1,param_2);" (call_expression "memcpy(pcVar3,param_1,param_2)" identifier (argument_list "(pcVar3,param_1,param_2)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "iVar2 = *(int *)this;" (assignment_expression "iVar2 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (if_statement "if ((undefined *)(iVar2 + -0xc) != PTR__S_empty_rep_storage_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }" if (parenthesized_expression "((undefined *)(iVar2 + -0xc) != PTR__S_empty_rep_storage_0038ecdc)" ( (binary_expression "(undefined *)(iVar2 + -0xc) != PTR__S_empty_rep_storage_0038ecdc" (cast_expression "(undefined *)(iVar2 + -0xc)" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -0xc)" ( (binary_expression "iVar2 + -0xc" identifier + number_literal) ))) != identifier) )) (compound_statement "{\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }" { (expression_statement "*(undefined4 *)(iVar2 + -4) = 0;" (assignment_expression "*(undefined4 *)(iVar2 + -4) = 0" (pointer_expression "*(undefined4 *)(iVar2 + -4)" * (cast_expression "(undefined4 *)(iVar2 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -4)" ( (binary_expression "iVar2 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(iVar2 + -0xc) = uVar4;" (assignment_expression "*(uint *)(iVar2 + -0xc) = uVar4" (pointer_expression "*(uint *)(iVar2 + -0xc)" * (cast_expression "(uint *)(iVar2 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -0xc)" ( (binary_expression "iVar2 + -0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined1 *)(iVar2 + uVar4) = 0;" (assignment_expression "*(undefined1 *)(iVar2 + uVar4) = 0" (pointer_expression "*(undefined1 *)(iVar2 + uVar4)" * (cast_expression "(undefined1 *)(iVar2 + uVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + uVar4)" ( (binary_expression "iVar2 + uVar4" identifier + identifier) )))) = number_literal) ;) })) (return_statement "return this;" return identifier ;) }))
(translation_unit "int * FUN_0021fd50(int *param_1,undefined1 *param_2,uint param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return param_1;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {\n                    \n    FUN_0022c7a0("basic_string::append");\n  }\n  uVar4 = *(int *)(puVar3 + -0xc) + param_3;\n  if ((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }\n  puVar3 = puVar3 + *(int *)(puVar3 + -0xc);\njoined_r0x0021fe09:\n  if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }\n  iVar2 = *param_1;\n  if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }\n  return param_1;\n}\n\n" (function_definition "int * FUN_0021fd50(int *param_1,undefined1 *param_2,uint param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return param_1;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {\n                    \n    FUN_0022c7a0("basic_string::append");\n  }\n  uVar4 = *(int *)(puVar3 + -0xc) + param_3;\n  if ((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }\n  puVar3 = puVar3 + *(int *)(puVar3 + -0xc);\njoined_r0x0021fe09:\n  if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }\n  iVar2 = *param_1;\n  if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }\n  return param_1;\n}" primitive_type (pointer_declarator "* FUN_0021fd50(int *param_1,undefined1 *param_2,uint param_3)" * (function_declarator "FUN_0021fd50(int *param_1,undefined1 *param_2,uint param_3)" identifier (parameter_list "(int *param_1,undefined1 *param_2,uint param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) )))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return param_1;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {\n                    \n    FUN_0022c7a0("basic_string::append");\n  }\n  uVar4 = *(int *)(puVar3 + -0xc) + param_3;\n  if ((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }\n  puVar3 = puVar3 + *(int *)(puVar3 + -0xc);\njoined_r0x0021fe09:\n  if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }\n  iVar2 = *param_1;\n  if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }\n  return param_1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (if_statement "if (param_3 == 0) {\n    return param_1;\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    return param_1;\n  }" { (return_statement "return param_1;" return identifier ;) })) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {\n                    \n    FUN_0022c7a0("basic_string::append");\n  }" if (parenthesized_expression "(0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3)" ( (binary_expression "0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3" (binary_expression "0x3ffffffcU - *(int *)(puVar3 + -0xc)" number_literal - (pointer_expression "*(int *)(puVar3 + -0xc)" * (cast_expression "(int *)(puVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) ))))) < identifier) )) (compound_statement "{\n                    \n    FUN_0022c7a0("basic_string::append");\n  }" { (expression_statement "FUN_0022c7a0("basic_string::append");" (call_expression "FUN_0022c7a0("basic_string::append")" identifier (argument_list "("basic_string::append")" ( (string_literal ""basic_string::append"" " string_content ") ))) ;) })) (expression_statement "uVar4 = *(int *)(puVar3 + -0xc) + param_3;" (assignment_expression "uVar4 = *(int *)(puVar3 + -0xc) + param_3" identifier = (binary_expression "*(int *)(puVar3 + -0xc) + param_3" (pointer_expression "*(int *)(puVar3 + -0xc)" * (cast_expression "(int *)(puVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))) + identifier)) ;) (if_statement "if ((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }" if (parenthesized_expression "((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1))" ( (binary_expression "(*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)" (parenthesized_expression "(*(uint *)(puVar3 + -8) < uVar4)" ( (binary_expression "*(uint *)(puVar3 + -8) < uVar4" (pointer_expression "*(uint *)(puVar3 + -8)" * (cast_expression "(uint *)(puVar3 + -8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -8)" ( (binary_expression "puVar3 + -8" identifier + number_literal) )))) < identifier) )) || (parenthesized_expression "(piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)" ( (comma_expression "piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1" (assignment_expression "piVar1 = (int *)(puVar3 + -4)" identifier = (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) , (comma_expression "puVar3 = (undefined1 *)*param_1, 0 < *piVar1" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) , (binary_expression "0 < *piVar1" number_literal < (pointer_expression "*piVar1" * identifier)))) ))) )) (compound_statement "{\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }" { (if_statement "if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }" if (parenthesized_expression "((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc)))" ( (binary_expression "(puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))" (parenthesized_expression "(puVar3 <= param_2)" ( (binary_expression "puVar3 <= param_2" identifier <= identifier) )) && (parenthesized_expression "(param_2 <= puVar3 + *(int *)(puVar3 + -0xc))" ( (binary_expression "param_2 <= puVar3 + *(int *)(puVar3 + -0xc)" identifier <= (binary_expression "puVar3 + *(int *)(puVar3 + -0xc)" identifier + (pointer_expression "*(int *)(puVar3 + -0xc)" * (cast_expression "(int *)(puVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))))) ))) )) (compound_statement "{\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }" { (expression_statement "FUN_0021fa60(param_1,uVar4);" (call_expression "FUN_0021fa60(param_1,uVar4)" identifier (argument_list "(param_1,uVar4)" ( identifier , identifier ))) ;) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "param_2 = param_2 + (iVar2 - (int)puVar3);" (assignment_expression "param_2 = param_2 + (iVar2 - (int)puVar3)" identifier = (binary_expression "param_2 + (iVar2 - (int)puVar3)" identifier + (parenthesized_expression "(iVar2 - (int)puVar3)" ( (binary_expression "iVar2 - (int)puVar3" identifier - (cast_expression "(int)puVar3" ( (type_descriptor "int" primitive_type) ) identifier)) )))) ;) (expression_statement "puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));" (assignment_expression "puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc))" identifier = (cast_expression "(undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + *(int *)(iVar2 + -0xc))" ( (binary_expression "iVar2 + *(int *)(iVar2 + -0xc)" identifier + (pointer_expression "*(int *)(iVar2 + -0xc)" * (cast_expression "(int *)(iVar2 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -0xc)" ( (binary_expression "iVar2 + -0xc" identifier + number_literal) ))))) )))) ;) (goto_statement "goto joined_r0x0021fe09;" goto statement_identifier ;) })) (expression_statement "FUN_0021fa60(param_1,uVar4);" (call_expression "FUN_0021fa60(param_1,uVar4)" identifier (argument_list "(param_1,uVar4)" ( identifier , identifier ))) ;) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) })) (expression_statement "puVar3 = puVar3 + *(int *)(puVar3 + -0xc);" (assignment_expression "puVar3 = puVar3 + *(int *)(puVar3 + -0xc)" identifier = (binary_expression "puVar3 + *(int *)(puVar3 + -0xc)" identifier + (pointer_expression "*(int *)(puVar3 + -0xc)" * (cast_expression "(int *)(puVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))))) ;) (labeled_statement "joined_r0x0021fe09:\n  if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }" statement_identifier : (if_statement "if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n    *puVar3 = *param_2;\n  }" { (expression_statement "*puVar3 = *param_2;" (assignment_expression "*puVar3 = *param_2" (pointer_expression "*puVar3" * identifier) = (pointer_expression "*param_2" * identifier)) ;) }) (else_clause "else {\n    memcpy(puVar3,param_2,param_3);\n  }" else (compound_statement "{\n    memcpy(puVar3,param_2,param_3);\n  }" { (expression_statement "memcpy(puVar3,param_2,param_3);" (call_expression "memcpy(puVar3,param_2,param_3)" identifier (argument_list "(puVar3,param_2,param_3)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }" if (parenthesized_expression "((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc)" ( (binary_expression "(undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc" (cast_expression "(undefined *)(iVar2 + -0xc)" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -0xc)" ( (binary_expression "iVar2 + -0xc" identifier + number_literal) ))) != identifier) )) (compound_statement "{\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }" { (expression_statement "*(undefined4 *)(iVar2 + -4) = 0;" (assignment_expression "*(undefined4 *)(iVar2 + -4) = 0" (pointer_expression "*(undefined4 *)(iVar2 + -4)" * (cast_expression "(undefined4 *)(iVar2 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -4)" ( (binary_expression "iVar2 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(iVar2 + -0xc) = uVar4;" (assignment_expression "*(uint *)(iVar2 + -0xc) = uVar4" (pointer_expression "*(uint *)(iVar2 + -0xc)" * (cast_expression "(uint *)(iVar2 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -0xc)" ( (binary_expression "iVar2 + -0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined1 *)(iVar2 + uVar4) = 0;" (assignment_expression "*(undefined1 *)(iVar2 + uVar4) = 0" (pointer_expression "*(undefined1 *)(iVar2 + uVar4)" * (cast_expression "(undefined1 *)(iVar2 + uVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + uVar4)" ( (binary_expression "iVar2 + uVar4" identifier + identifier) )))) = number_literal) ;) })) (return_statement "return param_1;" return 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) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression LIT - (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) })) (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 ( (comma_expression (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (comma_expression (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) , (binary_expression LIT < (pointer_expression * IDENT)))) ))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) && (parenthesized_expression ( (binary_expression IDENT <= (binary_expression IDENT + (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 = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (parenthesized_expression ( (binary_expression IDENT - (cast_expression ( (type_descriptor TYPE) ) IDENT)) )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )))) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , 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 ;) })))
(function_definition "int * FUN_0021fd50(int *param_1,undefined1 *param_2,uint param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return param_1;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {\n                    \n    FUN_0022c7a0("basic_string::append");\n  }\n  uVar4 = *(int *)(puVar3 + -0xc) + param_3;\n  if ((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }\n  puVar3 = puVar3 + *(int *)(puVar3 + -0xc);\njoined_r0x0021fe09:\n  if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }\n  iVar2 = *param_1;\n  if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }\n  return param_1;\n}" (primitive_type "int") (pointer_declarator "* FUN_0021fd50(int *param_1,undefined1 *param_2,uint param_3)" (* "*") (function_declarator "FUN_0021fd50(int *param_1,undefined1 *param_2,uint param_3)" (identifier "FUN_0021fd50") (parameter_list "(int *param_1,undefined1 *param_2,uint param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined1 *param_2" (type_identifier "undefined1") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")")))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return param_1;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {\n                    \n    FUN_0022c7a0("basic_string::append");\n  }\n  uVar4 = *(int *)(puVar3 + -0xc) + param_3;\n  if ((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }\n  puVar3 = puVar3 + *(int *)(puVar3 + -0xc);\njoined_r0x0021fe09:\n  if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }\n  iVar2 = *param_1;\n  if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }\n  return param_1;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined1 *puVar3;" (type_identifier "undefined1") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (if_statement "if (param_3 == 0) {\n    return param_1;\n  }" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    return param_1;\n  }" ({ "{") (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (if_statement "if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {\n                    \n    FUN_0022c7a0("basic_string::append");\n  }" (if "if") (parenthesized_expression "(0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3)" (( "(") (binary_expression "0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3" (binary_expression "0x3ffffffcU - *(int *)(puVar3 + -0xc)" (number_literal "0x3ffffffcU") (- "-") (pointer_expression "*(int *)(puVar3 + -0xc)" (* "*") (cast_expression "(int *)(puVar3 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -0xc)" (( "(") (binary_expression "puVar3 + -0xc" (identifier "puVar3") (+ "+") (number_literal "-0xc")) () ")"))))) (< "<") (identifier "param_3")) () ")")) (compound_statement "{\n                    \n    FUN_0022c7a0("basic_string::append");\n  }" ({ "{") (expression_statement "FUN_0022c7a0("basic_string::append");" (call_expression "FUN_0022c7a0("basic_string::append")" (identifier "FUN_0022c7a0") (argument_list "("basic_string::append")" (( "(") (string_literal ""basic_string::append"" (" """) (string_content "basic_string::append") (" """)) () ")"))) (; ";")) (} "}"))) (expression_statement "uVar4 = *(int *)(puVar3 + -0xc) + param_3;" (assignment_expression "uVar4 = *(int *)(puVar3 + -0xc) + param_3" (identifier "uVar4") (= "=") (binary_expression "*(int *)(puVar3 + -0xc) + param_3" (pointer_expression "*(int *)(puVar3 + -0xc)" (* "*") (cast_expression "(int *)(puVar3 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -0xc)" (( "(") (binary_expression "puVar3 + -0xc" (identifier "puVar3") (+ "+") (number_literal "-0xc")) () ")")))) (+ "+") (identifier "param_3"))) (; ";")) (if_statement "if ((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }" (if "if") (parenthesized_expression "((*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1))" (( "(") (binary_expression "(*(uint *)(puVar3 + -8) < uVar4) ||\n     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)" (parenthesized_expression "(*(uint *)(puVar3 + -8) < uVar4)" (( "(") (binary_expression "*(uint *)(puVar3 + -8) < uVar4" (pointer_expression "*(uint *)(puVar3 + -8)" (* "*") (cast_expression "(uint *)(puVar3 + -8)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -8)" (( "(") (binary_expression "puVar3 + -8" (identifier "puVar3") (+ "+") (number_literal "-8")) () ")")))) (< "<") (identifier "uVar4")) () ")")) (|| "||") (parenthesized_expression "(piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)" (( "(") (comma_expression "piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1" (assignment_expression "piVar1 = (int *)(puVar3 + -4)" (identifier "piVar1") (= "=") (cast_expression "(int *)(puVar3 + -4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -4)" (( "(") (binary_expression "puVar3 + -4" (identifier "puVar3") (+ "+") (number_literal "-4")) () ")")))) (, ",") (comma_expression "puVar3 = (undefined1 *)*param_1, 0 < *piVar1" (assignment_expression "puVar3 = (undefined1 *)*param_1" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (, ",") (binary_expression "0 < *piVar1" (number_literal "0") (< "<") (pointer_expression "*piVar1" (* "*") (identifier "piVar1"))))) () ")"))) () ")")) (compound_statement "{\n    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }\n    FUN_0021fa60(param_1,uVar4);\n    puVar3 = (undefined1 *)*param_1;\n  }" ({ "{") (if_statement "if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }" (if "if") (parenthesized_expression "((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc)))" (( "(") (binary_expression "(puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))" (parenthesized_expression "(puVar3 <= param_2)" (( "(") (binary_expression "puVar3 <= param_2" (identifier "puVar3") (<= "<=") (identifier "param_2")) () ")")) (&& "&&") (parenthesized_expression "(param_2 <= puVar3 + *(int *)(puVar3 + -0xc))" (( "(") (binary_expression "param_2 <= puVar3 + *(int *)(puVar3 + -0xc)" (identifier "param_2") (<= "<=") (binary_expression "puVar3 + *(int *)(puVar3 + -0xc)" (identifier "puVar3") (+ "+") (pointer_expression "*(int *)(puVar3 + -0xc)" (* "*") (cast_expression "(int *)(puVar3 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -0xc)" (( "(") (binary_expression "puVar3 + -0xc" (identifier "puVar3") (+ "+") (number_literal "-0xc")) () ")")))))) () ")"))) () ")")) (compound_statement "{\n      FUN_0021fa60(param_1,uVar4);\n      iVar2 = *param_1;\n      param_2 = param_2 + (iVar2 - (int)puVar3);\n      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));\n      goto joined_r0x0021fe09;\n    }" ({ "{") (expression_statement "FUN_0021fa60(param_1,uVar4);" (call_expression "FUN_0021fa60(param_1,uVar4)" (identifier "FUN_0021fa60") (argument_list "(param_1,uVar4)" (( "(") (identifier "param_1") (, ",") (identifier "uVar4") () ")"))) (; ";")) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" (identifier "iVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "param_2 = param_2 + (iVar2 - (int)puVar3);" (assignment_expression "param_2 = param_2 + (iVar2 - (int)puVar3)" (identifier "param_2") (= "=") (binary_expression "param_2 + (iVar2 - (int)puVar3)" (identifier "param_2") (+ "+") (parenthesized_expression "(iVar2 - (int)puVar3)" (( "(") (binary_expression "iVar2 - (int)puVar3" (identifier "iVar2") (- "-") (cast_expression "(int)puVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar3"))) () ")")))) (; ";")) (expression_statement "puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));" (assignment_expression "puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc))" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc))" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + *(int *)(iVar2 + -0xc))" (( "(") (binary_expression "iVar2 + *(int *)(iVar2 + -0xc)" (identifier "iVar2") (+ "+") (pointer_expression "*(int *)(iVar2 + -0xc)" (* "*") (cast_expression "(int *)(iVar2 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + -0xc)" (( "(") (binary_expression "iVar2 + -0xc" (identifier "iVar2") (+ "+") (number_literal "-0xc")) () ")"))))) () ")")))) (; ";")) (goto_statement "goto joined_r0x0021fe09;" (goto "goto") (statement_identifier "joined_r0x0021fe09") (; ";")) (} "}"))) (expression_statement "FUN_0021fa60(param_1,uVar4);" (call_expression "FUN_0021fa60(param_1,uVar4)" (identifier "FUN_0021fa60") (argument_list "(param_1,uVar4)" (( "(") (identifier "param_1") (, ",") (identifier "uVar4") () ")"))) (; ";")) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}"))) (expression_statement "puVar3 = puVar3 + *(int *)(puVar3 + -0xc);" (assignment_expression "puVar3 = puVar3 + *(int *)(puVar3 + -0xc)" (identifier "puVar3") (= "=") (binary_expression "puVar3 + *(int *)(puVar3 + -0xc)" (identifier "puVar3") (+ "+") (pointer_expression "*(int *)(puVar3 + -0xc)" (* "*") (cast_expression "(int *)(puVar3 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -0xc)" (( "(") (binary_expression "puVar3 + -0xc" (identifier "puVar3") (+ "+") (number_literal "-0xc")) () ")")))))) (; ";")) (labeled_statement "joined_r0x0021fe09:\n  if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }" (statement_identifier "joined_r0x0021fe09") (: ":") (if_statement "if (param_3 == 1) {\n    *puVar3 = *param_2;\n  }\n  else {\n    memcpy(puVar3,param_2,param_3);\n  }" (if "if") (parenthesized_expression "(param_3 == 1)" (( "(") (binary_expression "param_3 == 1" (identifier "param_3") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n    *puVar3 = *param_2;\n  }" ({ "{") (expression_statement "*puVar3 = *param_2;" (assignment_expression "*puVar3 = *param_2" (pointer_expression "*puVar3" (* "*") (identifier "puVar3")) (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (} "}")) (else_clause "else {\n    memcpy(puVar3,param_2,param_3);\n  }" (else "else") (compound_statement "{\n    memcpy(puVar3,param_2,param_3);\n  }" ({ "{") (expression_statement "memcpy(puVar3,param_2,param_3);" (call_expression "memcpy(puVar3,param_2,param_3)" (identifier "memcpy") (argument_list "(puVar3,param_2,param_3)" (( "(") (identifier "puVar3") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")"))) (; ";")) (} "}"))))) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" (identifier "iVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }" (if "if") (parenthesized_expression "((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc)" (( "(") (binary_expression "(undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc" (cast_expression "(undefined *)(iVar2 + -0xc)" (( "(") (type_descriptor "undefined *" (type_identifier "undefined") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + -0xc)" (( "(") (binary_expression "iVar2 + -0xc" (identifier "iVar2") (+ "+") (number_literal "-0xc")) () ")"))) (!= "!=") (identifier "PTR_DAT_0038ecdc")) () ")")) (compound_statement "{\n    *(undefined4 *)(iVar2 + -4) = 0;\n    *(uint *)(iVar2 + -0xc) = uVar4;\n    *(undefined1 *)(iVar2 + uVar4) = 0;\n  }" ({ "{") (expression_statement "*(undefined4 *)(iVar2 + -4) = 0;" (assignment_expression "*(undefined4 *)(iVar2 + -4) = 0" (pointer_expression "*(undefined4 *)(iVar2 + -4)" (* "*") (cast_expression "(undefined4 *)(iVar2 + -4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + -4)" (( "(") (binary_expression "iVar2 + -4" (identifier "iVar2") (+ "+") (number_literal "-4")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(uint *)(iVar2 + -0xc) = uVar4;" (assignment_expression "*(uint *)(iVar2 + -0xc) = uVar4" (pointer_expression "*(uint *)(iVar2 + -0xc)" (* "*") (cast_expression "(uint *)(iVar2 + -0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + -0xc)" (( "(") (binary_expression "iVar2 + -0xc" (identifier "iVar2") (+ "+") (number_literal "-0xc")) () ")")))) (= "=") (identifier "uVar4")) (; ";")) (expression_statement "*(undefined1 *)(iVar2 + uVar4) = 0;" (assignment_expression "*(undefined1 *)(iVar2 + uVar4) = 0" (pointer_expression "*(undefined1 *)(iVar2 + uVar4)" (* "*") (cast_expression "(undefined1 *)(iVar2 + uVar4)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + uVar4)" (( "(") (binary_expression "iVar2 + uVar4" (identifier "iVar2") (+ "+") (identifier "uVar4")) () ")")))) (= "=") (number_literal "0")) (; ";")) (} "}"))) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}")))

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

string * __thiscall std::string::append(string *this,char *var_5,type_1 var_1)

{
  int *piVar1;
  int var_7;
  char *var_2;
  type_1 var_4;
  
  if (var_1 == 0) {
    return this;
  }
  var_2 = *(char **)this;
  if (0x3ffffffcU - *(int *)(var_2 + -0xc) < var_1) {
                    /* WARNING: Subroutine does not return */
    var_3("basic_string::append");
  }
  var_4 = *(int *)(var_2 + -0xc) + var_1;
  if ((*(type_1 *)(var_2 + -8) < var_4) ||
     (piVar1 = (int *)(var_2 + -4), var_2 = *(char **)this, 0 < *piVar1)) {
    if ((var_2 <= var_5) && (var_5 <= var_2 + *(int *)(var_2 + -0xc))) {
      var_6(this,var_4);
      var_7 = *(int *)this;
      var_5 = var_5 + (var_7 - (int)var_2);
      var_2 = (char *)(var_7 + *(int *)(var_7 + -0xc));
      goto joined_r0x0021fe09;
    }
    var_6(this,var_4);
    var_2 = *(char **)this;
  }
  var_2 = var_2 + *(int *)(var_2 + -0xc);
joined_r0x0021fe09:
  if (var_1 == 1) {
    *var_2 = *var_5;
  }
  else {
    var_8(var_2,var_5,var_1);
  }
  var_7 = *(int *)this;
  if ((type_2 *)(var_7 + -0xc) != var_9) {
    *(type_3 *)(var_7 + -4) = 0;
    *(type_1 *)(var_7 + -0xc) = var_4;
    *(type_4 *)(var_7 + var_4) = 0;
  }
  return this;
}


(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: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (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)))))) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content))))))) (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 (comma_expression left: (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (comma_expression left: (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier)))) right: (binary_expression left: (number_literal) right: (pointer_expression argument: (identifier)))))))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (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: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (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: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))))) (goto_statement label: (statement_identifier)))) (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: (pointer_expression argument: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))) (labeled_statement label: (statement_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 (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (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)))))

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

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

{
  int *piVar1;
  int iVar2;
  undefined1 *puVar3;
  uint uVar4;
  
  if (param_3 == 0) {
    return param_1;
  }
  puVar3 = (undefined1 *)*param_1;
  if (0x3ffffffcU - *(int *)(puVar3 + -0xc) < param_3) {
                    /* WARNING: Subroutine does not return */
    FUN_0022c7a0("basic_string::append");
  }
  uVar4 = *(int *)(puVar3 + -0xc) + param_3;
  if ((*(uint *)(puVar3 + -8) < uVar4) ||
     (piVar1 = (int *)(puVar3 + -4), puVar3 = (undefined1 *)*param_1, 0 < *piVar1)) {
    if ((puVar3 <= param_2) && (param_2 <= puVar3 + *(int *)(puVar3 + -0xc))) {
      FUN_0021fa60(param_1,uVar4);
      iVar2 = *param_1;
      param_2 = param_2 + (iVar2 - (int)puVar3);
      puVar3 = (undefined1 *)(iVar2 + *(int *)(iVar2 + -0xc));
      goto joined_r0x0021fe09;
    }
    FUN_0021fa60(param_1,uVar4);
    puVar3 = (undefined1 *)*param_1;
  }
  puVar3 = puVar3 + *(int *)(puVar3 + -0xc);
joined_r0x0021fe09:
  if (param_3 == 1) {
    *puVar3 = *param_2;
  }
  else {
    memcpy(puVar3,param_2,param_3);
  }
  iVar2 = *param_1;
  if ((undefined *)(iVar2 + -0xc) != PTR_DAT_0038ecdc) {
    *(undefined4 *)(iVar2 + -4) = 0;
    *(uint *)(iVar2 + -0xc) = uVar4;
    *(undefined1 *)(iVar2 + uVar4) = 0;
  }
  return param_1;
}

