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

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

{
  ulong uVar1;
  ulong uVar2;
  string *psVar3;
  ulong uVar4;
  
  uVar2 = *(ulong *)(this + 8);
  psVar3 = *(string **)this;
  uVar1 = uVar2 + param_2;
  if (psVar3 == this + 0x10) {
    uVar4 = 0xf;
  }
  else {
    uVar4 = *(ulong *)(this + 0x10);
  }
  if (uVar4 < uVar1) {
    _M_mutate(this,uVar2,0,param_1,param_2);
    psVar3 = *(string **)this;
  }
  else if (param_2 != 0) {
    if (param_2 == 1) {
      psVar3[uVar2] = (string)*param_1;
      psVar3 = *(string **)this;
    }
    else {
      memcpy(psVar3 + uVar2,param_1,param_2);
      psVar3 = *(string **)this;
    }
  }
  *(ulong *)(this + 8) = uVar1;
  psVar3[uVar1] = (string)0x0;
  return this;
}



long * FUN_002fa0e0(long *param_1,undefined1 *param_2,size_t param_3)

{
  ulong uVar1;
  long lVar2;
  long *plVar3;
  ulong uVar4;
  
  lVar2 = param_1[1];
  plVar3 = (long *)*param_1;
  uVar1 = lVar2 + param_3;
  if (plVar3 == param_1 + 2) {
    uVar4 = 0xf;
  }
  else {
    uVar4 = param_1[2];
  }
  if (uVar4 < uVar1) {
    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);
    plVar3 = (long *)*param_1;
  }
  else if (param_3 != 0) {
    if (param_3 == 1) {
      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;
      plVar3 = (long *)*param_1;
    }
    else {
      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);
      plVar3 = (long *)*param_1;
    }
  }
  param_1[1] = uVar1;
  *(undefined1 *)((long)plVar3 + uVar1) = 0;
  return param_1;
}


PUSH RBP
PUSH RBX
MOV RBX,RDI
LEA R8,[RBX + 0x10]
SUB RSP,0x8
MOV RAX,qword ptr [RDI + 0x8]
MOV RDI,qword ptr [RDI]
LEA RBP,[RAX + RDX*0x1]
CMP RDI,R8
JZ 0x002fa150
MOV R8,qword ptr [RBX + 0x10]
CMP RBP,R8
JA 0x002fa130
TEST RDX,RDX
JZ 0x002fa11c
ADD RDI,RAX
CMP RDX,0x1
JZ 0x002fa160
CALL 0x00149a90
MOV RDI,qword ptr [RBX]
MOV qword ptr [RBX + 0x8],RBP
MOV RAX,RBX
MOV byte ptr [RDI + RBP*0x1],0x0
ADD RSP,0x8
POP RBX
POP RBP
RET
MOV R8,RDX
MOV RCX,RSI
MOV RDI,RBX
XOR EDX,EDX
MOV RSI,RAX
CALL 0x002f8b50
MOV RDI,qword ptr [RBX]
JMP 0x002fa11c
MOV R8D,0xf
JMP 0x002fa101
MOVZX EAX,byte ptr [RSI]
MOV byte ptr [RDI],AL
MOV RDI,qword ptr [RBX]
JMP 0x002fa11c
(translation_unit "long * FUN_002fa0e0(long *param_1,undefined1 *param_2,size_t param_3)\n\n{\n  ulong uVar1;\n  long lVar2;\n  long *plVar3;\n  ulong uVar4;\n  \n  lVar2 = param_1[1];\n  plVar3 = (long *)*param_1;\n  uVar1 = lVar2 + param_3;\n  if (plVar3 == param_1 + 2) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined1 *)((long)plVar3 + uVar1) = 0;\n  return param_1;\n}\n\n" (function_definition "long * FUN_002fa0e0(long *param_1,undefined1 *param_2,size_t param_3)\n\n{\n  ulong uVar1;\n  long lVar2;\n  long *plVar3;\n  ulong uVar4;\n  \n  lVar2 = param_1[1];\n  plVar3 = (long *)*param_1;\n  uVar1 = lVar2 + param_3;\n  if (plVar3 == param_1 + 2) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined1 *)((long)plVar3 + uVar1) = 0;\n  return param_1;\n}" (sized_type_specifier "long" long) (pointer_declarator "* FUN_002fa0e0(long *param_1,undefined1 *param_2,size_t param_3)" * (function_declarator "FUN_002fa0e0(long *param_1,undefined1 *param_2,size_t param_3)" identifier (parameter_list "(long *param_1,undefined1 *param_2,size_t param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) )))) (compound_statement "{\n  ulong uVar1;\n  long lVar2;\n  long *plVar3;\n  ulong uVar4;\n  \n  lVar2 = param_1[1];\n  plVar3 = (long *)*param_1;\n  uVar1 = lVar2 + param_3;\n  if (plVar3 == param_1 + 2) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined1 *)((long)plVar3 + uVar1) = 0;\n  return param_1;\n}" { (declaration "ulong uVar1;" type_identifier identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "long *plVar3;" (sized_type_specifier "long" long) (pointer_declarator "*plVar3" * identifier) ;) (declaration "ulong uVar4;" type_identifier identifier ;) (expression_statement "lVar2 = param_1[1];" (assignment_expression "lVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "uVar1 = lVar2 + param_3;" (assignment_expression "uVar1 = lVar2 + param_3" identifier = (binary_expression "lVar2 + param_3" identifier + identifier)) ;) (if_statement "if (plVar3 == param_1 + 2) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = param_1[2];\n  }" if (parenthesized_expression "(plVar3 == param_1 + 2)" ( (binary_expression "plVar3 == param_1 + 2" identifier == (binary_expression "param_1 + 2" identifier + number_literal)) )) (compound_statement "{\n    uVar4 = 0xf;\n  }" { (expression_statement "uVar4 = 0xf;" (assignment_expression "uVar4 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n    uVar4 = param_1[2];\n  }" else (compound_statement "{\n    uVar4 = param_1[2];\n  }" { (expression_statement "uVar4 = param_1[2];" (assignment_expression "uVar4 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar4 < uVar1) {\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }" if (parenthesized_expression "(uVar4 < uVar1)" ( (binary_expression "uVar4 < uVar1" identifier < identifier) )) (compound_statement "{\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }" { (expression_statement "FUN_002f8b50(param_1,lVar2,0,param_2,param_3);" (call_expression "FUN_002f8b50(param_1,lVar2,0,param_2,param_3)" identifier (argument_list "(param_1,lVar2,0,param_2,param_3)" ( identifier , identifier , number_literal , identifier , identifier ))) ;) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }" else (if_statement "if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }" { (if_statement "if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }" { (expression_statement "*(undefined1 *)((long)plVar3 + lVar2) = *param_2;" (assignment_expression "*(undefined1 *)((long)plVar3 + lVar2) = *param_2" (pointer_expression "*(undefined1 *)((long)plVar3 + lVar2)" * (cast_expression "(undefined1 *)((long)plVar3 + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + lVar2)" ( (binary_expression "(long)plVar3 + lVar2" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) = (pointer_expression "*param_2" * identifier)) ;) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }" else (compound_statement "{\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }" { (expression_statement "memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);" (call_expression "memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3)" identifier (argument_list "((undefined1 *)((long)plVar3 + lVar2),param_2,param_3)" ( (cast_expression "(undefined1 *)((long)plVar3 + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + lVar2)" ( (binary_expression "(long)plVar3 + lVar2" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) ))) , identifier , identifier ))) ;) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })))) (expression_statement "param_1[1] = uVar1;" (assignment_expression "param_1[1] = uVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined1 *)((long)plVar3 + uVar1) = 0;" (assignment_expression "*(undefined1 *)((long)plVar3 + uVar1) = 0" (pointer_expression "*(undefined1 *)((long)plVar3 + uVar1)" * (cast_expression "(undefined1 *)((long)plVar3 + uVar1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + uVar1)" ( (binary_expression "(long)plVar3 + uVar1" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })))
(translation_unit "/* std::string::_M_append(char const*, unsigned long) */\n\nstring * __thiscall std::string::_M_append(string *this,char *param_1,ulong param_2)\n\n{\n  ulong uVar1;\n  ulong uVar2;\n  string *psVar3;\n  ulong uVar4;\n  \n  uVar2 = *(ulong *)(this + 8);\n  psVar3 = *(string **)this;\n  uVar1 = uVar2 + param_2;\n  if (psVar3 == this + 0x10) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = *(ulong *)(this + 0x10);\n  }\n  if (uVar4 < uVar1) {\n    _M_mutate(this,uVar2,0,param_1,param_2);\n    psVar3 = *(string **)this;\n  }\n  else if (param_2 != 0) {\n    if (param_2 == 1) {\n      psVar3[uVar2] = (string)*param_1;\n      psVar3 = *(string **)this;\n    }\n    else {\n      memcpy(psVar3 + uVar2,param_1,param_2);\n      psVar3 = *(string **)this;\n    }\n  }\n  *(ulong *)(this + 8) = uVar1;\n  psVar3[uVar1] = (string)0x0;\n  return this;\n}\n\n" comment (ERROR "string * __thiscall std::string::_M_append(string *this,char *param_1,ulong param_2)" (binary_expression "string * __thiscall std::string::_M_append(string *this" (binary_expression "string * __thiscall" identifier * identifier) (ERROR "std::string::_M_append(string" identifier : : identifier : : identifier ( identifier) * identifier) , primitive_type (pointer_declarator "*param_1" * identifier) , identifier identifier )) (compound_statement "{\n  ulong uVar1;\n  ulong uVar2;\n  string *psVar3;\n  ulong uVar4;\n  \n  uVar2 = *(ulong *)(this + 8);\n  psVar3 = *(string **)this;\n  uVar1 = uVar2 + param_2;\n  if (psVar3 == this + 0x10) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = *(ulong *)(this + 0x10);\n  }\n  if (uVar4 < uVar1) {\n    _M_mutate(this,uVar2,0,param_1,param_2);\n    psVar3 = *(string **)this;\n  }\n  else if (param_2 != 0) {\n    if (param_2 == 1) {\n      psVar3[uVar2] = (string)*param_1;\n      psVar3 = *(string **)this;\n    }\n    else {\n      memcpy(psVar3 + uVar2,param_1,param_2);\n      psVar3 = *(string **)this;\n    }\n  }\n  *(ulong *)(this + 8) = uVar1;\n  psVar3[uVar1] = (string)0x0;\n  return this;\n}" { (declaration "ulong uVar1;" type_identifier identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "string *psVar3;" type_identifier (pointer_declarator "*psVar3" * identifier) ;) (declaration "ulong uVar4;" type_identifier identifier ;) (expression_statement "uVar2 = *(ulong *)(this + 8);" (assignment_expression "uVar2 = *(ulong *)(this + 8)" identifier = (pointer_expression "*(ulong *)(this + 8)" * (cast_expression "(ulong *)(this + 8)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(string **)this" identifier = (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "uVar1 = uVar2 + param_2;" (assignment_expression "uVar1 = uVar2 + param_2" identifier = (binary_expression "uVar2 + param_2" identifier + identifier)) ;) (if_statement "if (psVar3 == this + 0x10) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = *(ulong *)(this + 0x10);\n  }" if (parenthesized_expression "(psVar3 == this + 0x10)" ( (binary_expression "psVar3 == this + 0x10" identifier == (binary_expression "this + 0x10" identifier + number_literal)) )) (compound_statement "{\n    uVar4 = 0xf;\n  }" { (expression_statement "uVar4 = 0xf;" (assignment_expression "uVar4 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n    uVar4 = *(ulong *)(this + 0x10);\n  }" else (compound_statement "{\n    uVar4 = *(ulong *)(this + 0x10);\n  }" { (expression_statement "uVar4 = *(ulong *)(this + 0x10);" (assignment_expression "uVar4 = *(ulong *)(this + 0x10)" identifier = (pointer_expression "*(ulong *)(this + 0x10)" * (cast_expression "(ulong *)(this + 0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x10)" ( (binary_expression "this + 0x10" identifier + number_literal) ))))) ;) }))) (if_statement "if (uVar4 < uVar1) {\n    _M_mutate(this,uVar2,0,param_1,param_2);\n    psVar3 = *(string **)this;\n  }\n  else if (param_2 != 0) {\n    if (param_2 == 1) {\n      psVar3[uVar2] = (string)*param_1;\n      psVar3 = *(string **)this;\n    }\n    else {\n      memcpy(psVar3 + uVar2,param_1,param_2);\n      psVar3 = *(string **)this;\n    }\n  }" if (parenthesized_expression "(uVar4 < uVar1)" ( (binary_expression "uVar4 < uVar1" identifier < identifier) )) (compound_statement "{\n    _M_mutate(this,uVar2,0,param_1,param_2);\n    psVar3 = *(string **)this;\n  }" { (expression_statement "_M_mutate(this,uVar2,0,param_1,param_2);" (call_expression "_M_mutate(this,uVar2,0,param_1,param_2)" identifier (argument_list "(this,uVar2,0,param_1,param_2)" ( identifier , identifier , number_literal , identifier , identifier ))) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(string **)this" identifier = (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }) (else_clause "else if (param_2 != 0) {\n    if (param_2 == 1) {\n      psVar3[uVar2] = (string)*param_1;\n      psVar3 = *(string **)this;\n    }\n    else {\n      memcpy(psVar3 + uVar2,param_1,param_2);\n      psVar3 = *(string **)this;\n    }\n  }" else (if_statement "if (param_2 != 0) {\n    if (param_2 == 1) {\n      psVar3[uVar2] = (string)*param_1;\n      psVar3 = *(string **)this;\n    }\n    else {\n      memcpy(psVar3 + uVar2,param_1,param_2);\n      psVar3 = *(string **)this;\n    }\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_2 == 1) {\n      psVar3[uVar2] = (string)*param_1;\n      psVar3 = *(string **)this;\n    }\n    else {\n      memcpy(psVar3 + uVar2,param_1,param_2);\n      psVar3 = *(string **)this;\n    }\n  }" { (if_statement "if (param_2 == 1) {\n      psVar3[uVar2] = (string)*param_1;\n      psVar3 = *(string **)this;\n    }\n    else {\n      memcpy(psVar3 + uVar2,param_1,param_2);\n      psVar3 = *(string **)this;\n    }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n      psVar3[uVar2] = (string)*param_1;\n      psVar3 = *(string **)this;\n    }" { (expression_statement "psVar3[uVar2] = (string)*param_1;" (assignment_expression "psVar3[uVar2] = (string)*param_1" (subscript_expression "psVar3[uVar2]" identifier [ identifier ]) = (binary_expression "(string)*param_1" (parenthesized_expression "(string)" ( identifier )) * identifier)) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(string **)this" identifier = (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }) (else_clause "else {\n      memcpy(psVar3 + uVar2,param_1,param_2);\n      psVar3 = *(string **)this;\n    }" else (compound_statement "{\n      memcpy(psVar3 + uVar2,param_1,param_2);\n      psVar3 = *(string **)this;\n    }" { (expression_statement "memcpy(psVar3 + uVar2,param_1,param_2);" (call_expression "memcpy(psVar3 + uVar2,param_1,param_2)" identifier (argument_list "(psVar3 + uVar2,param_1,param_2)" ( (binary_expression "psVar3 + uVar2" identifier + identifier) , identifier , identifier ))) ;) (expression_statement "psVar3 = *(string **)this;" (assignment_expression "psVar3 = *(string **)this" identifier = (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }))) })))) (expression_statement "*(ulong *)(this + 8) = uVar1;" (assignment_expression "*(ulong *)(this + 8) = uVar1" (pointer_expression "*(ulong *)(this + 8)" * (cast_expression "(ulong *)(this + 8)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "psVar3[uVar1] = (string)0x0;" (assignment_expression "psVar3[uVar1] = (string)0x0" (subscript_expression "psVar3[uVar1]" identifier [ identifier ]) = (cast_expression "(string)0x0" ( (type_descriptor "string" type_identifier) ) number_literal)) ;) (return_statement "return this;" return identifier ;) }))
(translation_unit "long * FUN_002fa0e0(long *param_1,undefined1 *param_2,size_t param_3)\n\n{\n  ulong uVar1;\n  long lVar2;\n  long *plVar3;\n  ulong uVar4;\n  \n  lVar2 = param_1[1];\n  plVar3 = (long *)*param_1;\n  uVar1 = lVar2 + param_3;\n  if (plVar3 == param_1 + 2) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined1 *)((long)plVar3 + uVar1) = 0;\n  return param_1;\n}\n\n" (function_definition "long * FUN_002fa0e0(long *param_1,undefined1 *param_2,size_t param_3)\n\n{\n  ulong uVar1;\n  long lVar2;\n  long *plVar3;\n  ulong uVar4;\n  \n  lVar2 = param_1[1];\n  plVar3 = (long *)*param_1;\n  uVar1 = lVar2 + param_3;\n  if (plVar3 == param_1 + 2) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined1 *)((long)plVar3 + uVar1) = 0;\n  return param_1;\n}" (sized_type_specifier "long" long) (pointer_declarator "* FUN_002fa0e0(long *param_1,undefined1 *param_2,size_t param_3)" * (function_declarator "FUN_002fa0e0(long *param_1,undefined1 *param_2,size_t param_3)" identifier (parameter_list "(long *param_1,undefined1 *param_2,size_t param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) )))) (compound_statement "{\n  ulong uVar1;\n  long lVar2;\n  long *plVar3;\n  ulong uVar4;\n  \n  lVar2 = param_1[1];\n  plVar3 = (long *)*param_1;\n  uVar1 = lVar2 + param_3;\n  if (plVar3 == param_1 + 2) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined1 *)((long)plVar3 + uVar1) = 0;\n  return param_1;\n}" { (declaration "ulong uVar1;" type_identifier identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "long *plVar3;" (sized_type_specifier "long" long) (pointer_declarator "*plVar3" * identifier) ;) (declaration "ulong uVar4;" type_identifier identifier ;) (expression_statement "lVar2 = param_1[1];" (assignment_expression "lVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "uVar1 = lVar2 + param_3;" (assignment_expression "uVar1 = lVar2 + param_3" identifier = (binary_expression "lVar2 + param_3" identifier + identifier)) ;) (if_statement "if (plVar3 == param_1 + 2) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = param_1[2];\n  }" if (parenthesized_expression "(plVar3 == param_1 + 2)" ( (binary_expression "plVar3 == param_1 + 2" identifier == (binary_expression "param_1 + 2" identifier + number_literal)) )) (compound_statement "{\n    uVar4 = 0xf;\n  }" { (expression_statement "uVar4 = 0xf;" (assignment_expression "uVar4 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n    uVar4 = param_1[2];\n  }" else (compound_statement "{\n    uVar4 = param_1[2];\n  }" { (expression_statement "uVar4 = param_1[2];" (assignment_expression "uVar4 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar4 < uVar1) {\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }" if (parenthesized_expression "(uVar4 < uVar1)" ( (binary_expression "uVar4 < uVar1" identifier < identifier) )) (compound_statement "{\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }" { (expression_statement "FUN_002f8b50(param_1,lVar2,0,param_2,param_3);" (call_expression "FUN_002f8b50(param_1,lVar2,0,param_2,param_3)" identifier (argument_list "(param_1,lVar2,0,param_2,param_3)" ( identifier , identifier , number_literal , identifier , identifier ))) ;) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }" else (if_statement "if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }" { (if_statement "if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }" { (expression_statement "*(undefined1 *)((long)plVar3 + lVar2) = *param_2;" (assignment_expression "*(undefined1 *)((long)plVar3 + lVar2) = *param_2" (pointer_expression "*(undefined1 *)((long)plVar3 + lVar2)" * (cast_expression "(undefined1 *)((long)plVar3 + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + lVar2)" ( (binary_expression "(long)plVar3 + lVar2" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) = (pointer_expression "*param_2" * identifier)) ;) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }" else (compound_statement "{\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }" { (expression_statement "memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);" (call_expression "memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3)" identifier (argument_list "((undefined1 *)((long)plVar3 + lVar2),param_2,param_3)" ( (cast_expression "(undefined1 *)((long)plVar3 + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + lVar2)" ( (binary_expression "(long)plVar3 + lVar2" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) ))) , identifier , identifier ))) ;) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })))) (expression_statement "param_1[1] = uVar1;" (assignment_expression "param_1[1] = uVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined1 *)((long)plVar3 + uVar1) = 0;" (assignment_expression "*(undefined1 *)((long)plVar3 + uVar1) = 0" (pointer_expression "*(undefined1 *)((long)plVar3 + uVar1)" * (cast_expression "(undefined1 *)((long)plVar3 + uVar1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + uVar1)" ( (binary_expression "(long)plVar3 + uVar1" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })))
(translation_unit (function_definition (sized_type_specifier long) (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration (sized_type_specifier long) (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (binary_expression IDENT + LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + IDENT) )))) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + IDENT) ))) , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }))) })))) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + IDENT) )))) = LIT) ;) (return_statement return IDENT ;) })))
(function_definition "long * FUN_002fa0e0(long *param_1,undefined1 *param_2,size_t param_3)\n\n{\n  ulong uVar1;\n  long lVar2;\n  long *plVar3;\n  ulong uVar4;\n  \n  lVar2 = param_1[1];\n  plVar3 = (long *)*param_1;\n  uVar1 = lVar2 + param_3;\n  if (plVar3 == param_1 + 2) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined1 *)((long)plVar3 + uVar1) = 0;\n  return param_1;\n}" (sized_type_specifier "long" (long "long")) (pointer_declarator "* FUN_002fa0e0(long *param_1,undefined1 *param_2,size_t param_3)" (* "*") (function_declarator "FUN_002fa0e0(long *param_1,undefined1 *param_2,size_t param_3)" (identifier "FUN_002fa0e0") (parameter_list "(long *param_1,undefined1 *param_2,size_t param_3)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined1 *param_2" (type_identifier "undefined1") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "size_t param_3" (primitive_type "size_t") (identifier "param_3")) () ")")))) (compound_statement "{\n  ulong uVar1;\n  long lVar2;\n  long *plVar3;\n  ulong uVar4;\n  \n  lVar2 = param_1[1];\n  plVar3 = (long *)*param_1;\n  uVar1 = lVar2 + param_3;\n  if (plVar3 == param_1 + 2) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = param_1[2];\n  }\n  if (uVar4 < uVar1) {\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }\n  param_1[1] = uVar1;\n  *(undefined1 *)((long)plVar3 + uVar1) = 0;\n  return param_1;\n}" ({ "{") (declaration "ulong uVar1;" (type_identifier "ulong") (identifier "uVar1") (; ";")) (declaration "long lVar2;" (sized_type_specifier "long" (long "long")) (identifier "lVar2") (; ";")) (declaration "long *plVar3;" (sized_type_specifier "long" (long "long")) (pointer_declarator "*plVar3" (* "*") (identifier "plVar3")) (; ";")) (declaration "ulong uVar4;" (type_identifier "ulong") (identifier "uVar4") (; ";")) (expression_statement "lVar2 = param_1[1];" (assignment_expression "lVar2 = param_1[1]" (identifier "lVar2") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" (identifier "plVar3") (= "=") (cast_expression "(long *)*param_1" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "uVar1 = lVar2 + param_3;" (assignment_expression "uVar1 = lVar2 + param_3" (identifier "uVar1") (= "=") (binary_expression "lVar2 + param_3" (identifier "lVar2") (+ "+") (identifier "param_3"))) (; ";")) (if_statement "if (plVar3 == param_1 + 2) {\n    uVar4 = 0xf;\n  }\n  else {\n    uVar4 = param_1[2];\n  }" (if "if") (parenthesized_expression "(plVar3 == param_1 + 2)" (( "(") (binary_expression "plVar3 == param_1 + 2" (identifier "plVar3") (== "==") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2"))) () ")")) (compound_statement "{\n    uVar4 = 0xf;\n  }" ({ "{") (expression_statement "uVar4 = 0xf;" (assignment_expression "uVar4 = 0xf" (identifier "uVar4") (= "=") (number_literal "0xf")) (; ";")) (} "}")) (else_clause "else {\n    uVar4 = param_1[2];\n  }" (else "else") (compound_statement "{\n    uVar4 = param_1[2];\n  }" ({ "{") (expression_statement "uVar4 = param_1[2];" (assignment_expression "uVar4 = param_1[2]" (identifier "uVar4") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (} "}")))) (if_statement "if (uVar4 < uVar1) {\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }\n  else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }" (if "if") (parenthesized_expression "(uVar4 < uVar1)" (( "(") (binary_expression "uVar4 < uVar1" (identifier "uVar4") (< "<") (identifier "uVar1")) () ")")) (compound_statement "{\n    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);\n    plVar3 = (long *)*param_1;\n  }" ({ "{") (expression_statement "FUN_002f8b50(param_1,lVar2,0,param_2,param_3);" (call_expression "FUN_002f8b50(param_1,lVar2,0,param_2,param_3)" (identifier "FUN_002f8b50") (argument_list "(param_1,lVar2,0,param_2,param_3)" (( "(") (identifier "param_1") (, ",") (identifier "lVar2") (, ",") (number_literal "0") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")"))) (; ";")) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" (identifier "plVar3") (= "=") (cast_expression "(long *)*param_1" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }" (else "else") (if_statement "if (param_3 != 0) {\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }" (if "if") (parenthesized_expression "(param_3 != 0)" (( "(") (binary_expression "param_3 != 0" (identifier "param_3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }\n  }" ({ "{") (if_statement "if (param_3 == 1) {\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }\n    else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }" (if "if") (parenthesized_expression "(param_3 == 1)" (( "(") (binary_expression "param_3 == 1" (identifier "param_3") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;\n      plVar3 = (long *)*param_1;\n    }" ({ "{") (expression_statement "*(undefined1 *)((long)plVar3 + lVar2) = *param_2;" (assignment_expression "*(undefined1 *)((long)plVar3 + lVar2) = *param_2" (pointer_expression "*(undefined1 *)((long)plVar3 + lVar2)" (* "*") (cast_expression "(undefined1 *)((long)plVar3 + lVar2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)plVar3 + lVar2)" (( "(") (binary_expression "(long)plVar3 + lVar2" (cast_expression "(long)plVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "plVar3")) (+ "+") (identifier "lVar2")) () ")")))) (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" (identifier "plVar3") (= "=") (cast_expression "(long *)*param_1" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else {\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }" (else "else") (compound_statement "{\n      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);\n      plVar3 = (long *)*param_1;\n    }" ({ "{") (expression_statement "memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);" (call_expression "memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3)" (identifier "memcpy") (argument_list "((undefined1 *)((long)plVar3 + lVar2),param_2,param_3)" (( "(") (cast_expression "(undefined1 *)((long)plVar3 + lVar2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)plVar3 + lVar2)" (( "(") (binary_expression "(long)plVar3 + lVar2" (cast_expression "(long)plVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "plVar3")) (+ "+") (identifier "lVar2")) () ")"))) (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")"))) (; ";")) (expression_statement "plVar3 = (long *)*param_1;" (assignment_expression "plVar3 = (long *)*param_1" (identifier "plVar3") (= "=") (cast_expression "(long *)*param_1" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")))) (} "}"))))) (expression_statement "param_1[1] = uVar1;" (assignment_expression "param_1[1] = uVar1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "uVar1")) (; ";")) (expression_statement "*(undefined1 *)((long)plVar3 + uVar1) = 0;" (assignment_expression "*(undefined1 *)((long)plVar3 + uVar1) = 0" (pointer_expression "*(undefined1 *)((long)plVar3 + uVar1)" (* "*") (cast_expression "(undefined1 *)((long)plVar3 + uVar1)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)plVar3 + uVar1)" (( "(") (binary_expression "(long)plVar3 + uVar1" (cast_expression "(long)plVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "plVar3")) (+ "+") (identifier "uVar1")) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}")))

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

type_2 * __thiscall std::type_2::_M_append(type_2 *var_1,char *var_8,type_1 var_3)

{
  type_1 var_6;
  type_1 var_2;
  type_2 *var_4;
  type_1 var_5;
  
  var_2 = *(type_1 *)(var_1 + 8);
  var_4 = *(type_2 **)var_1;
  var_6 = var_2 + var_3;
  if (var_4 == var_1 + 0x10) {
    var_5 = 0xf;
  }
  else {
    var_5 = *(type_1 *)(var_1 + 0x10);
  }
  if (var_5 < var_6) {
    var_7(var_1,var_2,0,var_8,var_3);
    var_4 = *(type_2 **)var_1;
  }
  else if (var_3 != 0) {
    if (var_3 == 1) {
      var_4[var_2] = (type_2)*var_8;
      var_4 = *(type_2 **)var_1;
    }
    else {
      var_9(var_4 + var_2,var_8,var_3);
      var_4 = *(type_2 **)var_1;
    }
  }
  *(type_1 *)(var_1 + 8) = var_6;
  var_4[var_6] = (type_2)0x0;
  return var_1;
}


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

long * MASKED(long *param_1,undefined1 *param_2,size_t param_3)

{
  ulong uVar1;
  long lVar2;
  long *plVar3;
  ulong uVar4;
  
  lVar2 = param_1[1];
  plVar3 = (long *)*param_1;
  uVar1 = lVar2 + param_3;
  if (plVar3 == param_1 + 2) {
    uVar4 = 0xf;
  }
  else {
    uVar4 = param_1[2];
  }
  if (uVar4 < uVar1) {
    FUN_002f8b50(param_1,lVar2,0,param_2,param_3);
    plVar3 = (long *)*param_1;
  }
  else if (param_3 != 0) {
    if (param_3 == 1) {
      *(undefined1 *)((long)plVar3 + lVar2) = *param_2;
      plVar3 = (long *)*param_1;
    }
    else {
      memcpy((undefined1 *)((long)plVar3 + lVar2),param_2,param_3);
      plVar3 = (long *)*param_1;
    }
  }
  param_1[1] = uVar1;
  *(undefined1 *)((long)plVar3 + uVar1) = 0;
  return param_1;
}

