
/* std::string::reserve(unsigned long) */

void __thiscall std::string::reserve(string *this,ulong param_1)

{
  string *__dest;
  size_t sVar1;
  ulong uVar2;
  string *__dest_00;
  ulong uVar3;
  string *psVar4;
  ulong local_20;
  
  uVar2 = *(ulong *)(this + 8);
  local_20 = param_1;
  if (param_1 < uVar2) {
    local_20 = uVar2;
  }
  psVar4 = *(string **)this;
  __dest = this + 0x10;
  if (__dest == psVar4) {
    uVar3 = 0xf;
  }
  else {
    uVar3 = *(ulong *)(this + 0x10);
  }
  if (uVar3 != local_20) {
    if ((0xf < local_20) || (uVar3 < local_20)) {
      __dest_00 = (string *)_M_create(this,&local_20,uVar3);
      psVar4 = *(string **)this;
      sVar1 = *(long *)(this + 8) + 1;
      if (sVar1 == 1) {
        *__dest_00 = *psVar4;
        psVar4 = *(string **)this;
      }
      else if (sVar1 != 0) {
        memcpy(__dest_00,psVar4,sVar1);
        psVar4 = *(string **)this;
      }
      if (__dest != psVar4) {
        operator_delete(psVar4);
      }
      *(string **)this = __dest_00;
      *(ulong *)(this + 0x10) = local_20;
      return;
    }
    if (__dest != psVar4) {
      sVar1 = uVar2 + 1;
      if (sVar1 == 1) {
        this[0x10] = *psVar4;
      }
      else if (sVar1 != 0) {
        memcpy(__dest,psVar4,sVar1);
      }
      operator_delete(psVar4);
      *(string **)this = __dest;
    }
  }
  return;
}



void FUN_0027dec0(undefined8 *param_1,ulong param_2)

{
  undefined8 *__dest;
  size_t sVar1;
  ulong uVar2;
  undefined1 *__dest_00;
  ulong uVar3;
  undefined1 *puVar4;
  ulong local_20;
  
  uVar2 = param_1[1];
  local_20 = param_2;
  if (param_2 < uVar2) {
    local_20 = uVar2;
  }
  puVar4 = (undefined1 *)*param_1;
  __dest = param_1 + 2;
  if (__dest == (undefined8 *)puVar4) {
    uVar3 = 0xf;
  }
  else {
    uVar3 = param_1[2];
  }
  if (uVar3 != local_20) {
    if ((0xf < local_20) || (uVar3 < local_20)) {
      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);
      puVar4 = (undefined1 *)*param_1;
      sVar1 = param_1[1] + 1;
      if (sVar1 == 1) {
        *__dest_00 = *puVar4;
        puVar4 = (undefined1 *)*param_1;
      }
      else if (sVar1 != 0) {
        memcpy(__dest_00,puVar4,sVar1);
        puVar4 = (undefined1 *)*param_1;
      }
      if (__dest != (undefined8 *)puVar4) {
        FUN_00276d20();
      }
      *param_1 = __dest_00;
      param_1[2] = local_20;
      return;
    }
    if (__dest != (undefined8 *)puVar4) {
      sVar1 = uVar2 + 1;
      if (sVar1 == 1) {
        *(undefined1 *)(param_1 + 2) = *puVar4;
      }
      else if (sVar1 != 0) {
        memcpy(__dest,puVar4,sVar1);
      }
      FUN_00276d20(puVar4);
      *param_1 = __dest;
    }
  }
  return;
}


PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x10
MOV RCX,qword ptr [RDI + 0x8]
MOV qword ptr [RSP + 0x8],RSI
CMP RSI,RCX
JNC 0x0027dede
MOV qword ptr [RSP + 0x8],RCX
MOV RSI,RCX
MOV R12,qword ptr [RDI]
LEA RBP,[RDI + 0x10]
CMP RBP,R12
JZ 0x0027dfa0
MOV RDX,qword ptr [RDI + 0x10]
CMP RDX,RSI
JZ 0x0027df33
MOV RBX,RDI
CMP RSI,0xf
JA 0x0027df40
CMP RDX,RSI
JC 0x0027df40
CMP RBP,R12
JZ 0x0027df33
LEA RDX,[RCX + 0x1]
CMP RDX,0x1
JZ 0x0027dfc0
TEST RDX,RDX
JZ 0x0027df28
MOV RSI,R12
MOV RDI,RBP
CALL 0x0013eaa0
MOV RDI,R12
CALL 0x00276d20
MOV qword ptr [RBX],RBP
ADD RSP,0x10
POP RBX
POP RBP
POP R12
RET
MOV RDI,RBX
LEA RSI,[RSP + 0x8]
CALL 0x0027d650
MOV RDI,qword ptr [RBX]
MOV R12,RAX
MOV RAX,qword ptr [RBX + 0x8]
LEA RDX,[RAX + 0x1]
CMP RDX,0x1
JZ 0x0027dfb0
TEST RDX,RDX
JNZ 0x0027df88
CMP RBP,RDI
JZ 0x0027df70
CALL 0x00276d20
MOV RAX,qword ptr [RSP + 0x8]
MOV qword ptr [RBX],R12
MOV qword ptr [RBX + 0x10],RAX
ADD RSP,0x10
POP RBX
POP RBP
POP R12
RET
MOV RSI,RDI
MOV RDI,R12
CALL 0x0013eaa0
MOV RDI,qword ptr [RBX]
JMP 0x0027df66
MOV EDX,0xf
JMP 0x0027def2
MOVZX EAX,byte ptr [RDI]
MOV byte ptr [R12],AL
MOV RDI,qword ptr [RBX]
JMP 0x0027df66
MOVZX EAX,byte ptr [R12]
MOV byte ptr [RDI + 0x10],AL
JMP 0x0027df28
(translation_unit "void FUN_0027dec0(undefined8 *param_1,ulong param_2)\n\n{\n  undefined8 *__dest;\n  size_t sVar1;\n  ulong uVar2;\n  undefined1 *__dest_00;\n  ulong uVar3;\n  undefined1 *puVar4;\n  ulong local_20;\n  \n  uVar2 = param_1[1];\n  local_20 = param_2;\n  if (param_2 < uVar2) {\n    local_20 = uVar2;\n  }\n  puVar4 = (undefined1 *)*param_1;\n  __dest = param_1 + 2;\n  if (__dest == (undefined8 *)puVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = param_1[2];\n  }\n  if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }\n  return;\n}\n\n" (function_definition "void FUN_0027dec0(undefined8 *param_1,ulong param_2)\n\n{\n  undefined8 *__dest;\n  size_t sVar1;\n  ulong uVar2;\n  undefined1 *__dest_00;\n  ulong uVar3;\n  undefined1 *puVar4;\n  ulong local_20;\n  \n  uVar2 = param_1[1];\n  local_20 = param_2;\n  if (param_2 < uVar2) {\n    local_20 = uVar2;\n  }\n  puVar4 = (undefined1 *)*param_1;\n  __dest = param_1 + 2;\n  if (__dest == (undefined8 *)puVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = param_1[2];\n  }\n  if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0027dec0(undefined8 *param_1,ulong param_2)" identifier (parameter_list "(undefined8 *param_1,ulong param_2)" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "ulong param_2" type_identifier identifier) ))) (compound_statement "{\n  undefined8 *__dest;\n  size_t sVar1;\n  ulong uVar2;\n  undefined1 *__dest_00;\n  ulong uVar3;\n  undefined1 *puVar4;\n  ulong local_20;\n  \n  uVar2 = param_1[1];\n  local_20 = param_2;\n  if (param_2 < uVar2) {\n    local_20 = uVar2;\n  }\n  puVar4 = (undefined1 *)*param_1;\n  __dest = param_1 + 2;\n  if (__dest == (undefined8 *)puVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = param_1[2];\n  }\n  if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }\n  return;\n}" { (declaration "undefined8 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "undefined1 *__dest_00;" type_identifier (pointer_declarator "*__dest_00" * identifier) ;) (declaration "ulong uVar3;" type_identifier identifier ;) (declaration "undefined1 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "ulong local_20;" type_identifier identifier ;) (expression_statement "uVar2 = param_1[1];" (assignment_expression "uVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "local_20 = param_2;" (assignment_expression "local_20 = param_2" identifier = identifier) ;) (if_statement "if (param_2 < uVar2) {\n    local_20 = uVar2;\n  }" if (parenthesized_expression "(param_2 < uVar2)" ( (binary_expression "param_2 < uVar2" identifier < identifier) )) (compound_statement "{\n    local_20 = uVar2;\n  }" { (expression_statement "local_20 = uVar2;" (assignment_expression "local_20 = uVar2" identifier = identifier) ;) })) (expression_statement "puVar4 = (undefined1 *)*param_1;" (assignment_expression "puVar4 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "__dest = param_1 + 2;" (assignment_expression "__dest = param_1 + 2" identifier = (binary_expression "param_1 + 2" identifier + number_literal)) ;) (if_statement "if (__dest == (undefined8 *)puVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = param_1[2];\n  }" if (parenthesized_expression "(__dest == (undefined8 *)puVar4)" ( (binary_expression "__dest == (undefined8 *)puVar4" identifier == (cast_expression "(undefined8 *)puVar4" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n    uVar3 = 0xf;\n  }" { (expression_statement "uVar3 = 0xf;" (assignment_expression "uVar3 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n    uVar3 = param_1[2];\n  }" else (compound_statement "{\n    uVar3 = param_1[2];\n  }" { (expression_statement "uVar3 = param_1[2];" (assignment_expression "uVar3 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }" if (parenthesized_expression "(uVar3 != local_20)" ( (binary_expression "uVar3 != local_20" identifier != identifier) )) (compound_statement "{\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }" { (if_statement "if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }" if (parenthesized_expression "((0xf < local_20) || (uVar3 < local_20))" ( (binary_expression "(0xf < local_20) || (uVar3 < local_20)" (parenthesized_expression "(0xf < local_20)" ( (binary_expression "0xf < local_20" number_literal < identifier) )) || (parenthesized_expression "(uVar3 < local_20)" ( (binary_expression "uVar3 < local_20" identifier < identifier) ))) )) (compound_statement "{\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }" { (expression_statement "__dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);" (assignment_expression "__dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20)" identifier = (cast_expression "(undefined1 *)FUN_0027d650(param_1,&local_20)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0027d650(param_1,&local_20)" identifier (argument_list "(param_1,&local_20)" ( identifier , (pointer_expression "&local_20" & identifier) ))))) ;) (expression_statement "puVar4 = (undefined1 *)*param_1;" (assignment_expression "puVar4 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "sVar1 = param_1[1] + 1;" (assignment_expression "sVar1 = param_1[1] + 1" identifier = (binary_expression "param_1[1] + 1" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal)) ;) (if_statement "if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }" if (parenthesized_expression "(sVar1 == 1)" ( (binary_expression "sVar1 == 1" identifier == number_literal) )) (compound_statement "{\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }" { (expression_statement "*__dest_00 = *puVar4;" (assignment_expression "*__dest_00 = *puVar4" (pointer_expression "*__dest_00" * identifier) = (pointer_expression "*puVar4" * identifier)) ;) (expression_statement "puVar4 = (undefined1 *)*param_1;" (assignment_expression "puVar4 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }" else (if_statement "if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }" if (parenthesized_expression "(sVar1 != 0)" ( (binary_expression "sVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }" { (expression_statement "memcpy(__dest_00,puVar4,sVar1);" (call_expression "memcpy(__dest_00,puVar4,sVar1)" identifier (argument_list "(__dest_00,puVar4,sVar1)" ( identifier , identifier , identifier ))) ;) (expression_statement "puVar4 = (undefined1 *)*param_1;" (assignment_expression "puVar4 = (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 (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }" if (parenthesized_expression "(__dest != (undefined8 *)puVar4)" ( (binary_expression "__dest != (undefined8 *)puVar4" identifier != (cast_expression "(undefined8 *)puVar4" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n        FUN_00276d20();\n      }" { (expression_statement "FUN_00276d20();" (call_expression "FUN_00276d20()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "*param_1 = __dest_00;" (assignment_expression "*param_1 = __dest_00" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1[2] = local_20;" (assignment_expression "param_1[2] = local_20" (subscript_expression "param_1[2]" identifier [ number_literal ]) = identifier) ;) (return_statement "return;" return ;) })) (if_statement "if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }" if (parenthesized_expression "(__dest != (undefined8 *)puVar4)" ( (binary_expression "__dest != (undefined8 *)puVar4" identifier != (cast_expression "(undefined8 *)puVar4" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }" { (expression_statement "sVar1 = uVar2 + 1;" (assignment_expression "sVar1 = uVar2 + 1" identifier = (binary_expression "uVar2 + 1" identifier + number_literal)) ;) (if_statement "if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }" if (parenthesized_expression "(sVar1 == 1)" ( (binary_expression "sVar1 == 1" identifier == number_literal) )) (compound_statement "{\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }" { (expression_statement "*(undefined1 *)(param_1 + 2) = *puVar4;" (assignment_expression "*(undefined1 *)(param_1 + 2) = *puVar4" (pointer_expression "*(undefined1 *)(param_1 + 2)" * (cast_expression "(undefined1 *)(param_1 + 2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) = (pointer_expression "*puVar4" * identifier)) ;) }) (else_clause "else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }" else (if_statement "if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }" if (parenthesized_expression "(sVar1 != 0)" ( (binary_expression "sVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        memcpy(__dest,puVar4,sVar1);\n      }" { (expression_statement "memcpy(__dest,puVar4,sVar1);" (call_expression "memcpy(__dest,puVar4,sVar1)" identifier (argument_list "(__dest,puVar4,sVar1)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "FUN_00276d20(puVar4);" (call_expression "FUN_00276d20(puVar4)" identifier (argument_list "(puVar4)" ( identifier ))) ;) (expression_statement "*param_1 = __dest;" (assignment_expression "*param_1 = __dest" (pointer_expression "*param_1" * identifier) = identifier) ;) })) })) (return_statement "return;" return ;) })))
(translation_unit "/* std::string::reserve(unsigned long) */\n\nvoid __thiscall std::string::reserve(string *this,ulong param_1)\n\n{\n  string *__dest;\n  size_t sVar1;\n  ulong uVar2;\n  string *__dest_00;\n  ulong uVar3;\n  string *psVar4;\n  ulong local_20;\n  \n  uVar2 = *(ulong *)(this + 8);\n  local_20 = param_1;\n  if (param_1 < uVar2) {\n    local_20 = uVar2;\n  }\n  psVar4 = *(string **)this;\n  __dest = this + 0x10;\n  if (__dest == psVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = *(ulong *)(this + 0x10);\n  }\n  if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (string *)_M_create(this,&local_20,uVar3);\n      psVar4 = *(string **)this;\n      sVar1 = *(long *)(this + 8) + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *psVar4;\n        psVar4 = *(string **)this;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,psVar4,sVar1);\n        psVar4 = *(string **)this;\n      }\n      if (__dest != psVar4) {\n        operator_delete(psVar4);\n      }\n      *(string **)this = __dest_00;\n      *(ulong *)(this + 0x10) = local_20;\n      return;\n    }\n    if (__dest != psVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        this[0x10] = *psVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,psVar4,sVar1);\n      }\n      operator_delete(psVar4);\n      *(string **)this = __dest;\n    }\n  }\n  return;\n}\n\n" comment (function_definition "void __thiscall std::string::reserve(string *this,ulong param_1)\n\n{\n  string *__dest;\n  size_t sVar1;\n  ulong uVar2;\n  string *__dest_00;\n  ulong uVar3;\n  string *psVar4;\n  ulong local_20;\n  \n  uVar2 = *(ulong *)(this + 8);\n  local_20 = param_1;\n  if (param_1 < uVar2) {\n    local_20 = uVar2;\n  }\n  psVar4 = *(string **)this;\n  __dest = this + 0x10;\n  if (__dest == psVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = *(ulong *)(this + 0x10);\n  }\n  if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (string *)_M_create(this,&local_20,uVar3);\n      psVar4 = *(string **)this;\n      sVar1 = *(long *)(this + 8) + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *psVar4;\n        psVar4 = *(string **)this;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,psVar4,sVar1);\n        psVar4 = *(string **)this;\n      }\n      if (__dest != psVar4) {\n        operator_delete(psVar4);\n      }\n      *(string **)this = __dest_00;\n      *(ulong *)(this + 0x10) = local_20;\n      return;\n    }\n    if (__dest != psVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        this[0x10] = *psVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,psVar4,sVar1);\n      }\n      operator_delete(psVar4);\n      *(string **)this = __dest;\n    }\n  }\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::string::" identifier : : identifier : :) (function_declarator "reserve(string *this,ulong param_1)" identifier (parameter_list "(string *this,ulong param_1)" ( (parameter_declaration "string *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "ulong param_1" type_identifier identifier) ))) (compound_statement "{\n  string *__dest;\n  size_t sVar1;\n  ulong uVar2;\n  string *__dest_00;\n  ulong uVar3;\n  string *psVar4;\n  ulong local_20;\n  \n  uVar2 = *(ulong *)(this + 8);\n  local_20 = param_1;\n  if (param_1 < uVar2) {\n    local_20 = uVar2;\n  }\n  psVar4 = *(string **)this;\n  __dest = this + 0x10;\n  if (__dest == psVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = *(ulong *)(this + 0x10);\n  }\n  if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (string *)_M_create(this,&local_20,uVar3);\n      psVar4 = *(string **)this;\n      sVar1 = *(long *)(this + 8) + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *psVar4;\n        psVar4 = *(string **)this;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,psVar4,sVar1);\n        psVar4 = *(string **)this;\n      }\n      if (__dest != psVar4) {\n        operator_delete(psVar4);\n      }\n      *(string **)this = __dest_00;\n      *(ulong *)(this + 0x10) = local_20;\n      return;\n    }\n    if (__dest != psVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        this[0x10] = *psVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,psVar4,sVar1);\n      }\n      operator_delete(psVar4);\n      *(string **)this = __dest;\n    }\n  }\n  return;\n}" { (declaration "string *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "string *__dest_00;" type_identifier (pointer_declarator "*__dest_00" * identifier) ;) (declaration "ulong uVar3;" type_identifier identifier ;) (declaration "string *psVar4;" type_identifier (pointer_declarator "*psVar4" * identifier) ;) (declaration "ulong local_20;" 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 "local_20 = param_1;" (assignment_expression "local_20 = param_1" identifier = identifier) ;) (if_statement "if (param_1 < uVar2) {\n    local_20 = uVar2;\n  }" if (parenthesized_expression "(param_1 < uVar2)" ( (binary_expression "param_1 < uVar2" identifier < identifier) )) (compound_statement "{\n    local_20 = uVar2;\n  }" { (expression_statement "local_20 = uVar2;" (assignment_expression "local_20 = uVar2" identifier = identifier) ;) })) (expression_statement "psVar4 = *(string **)this;" (assignment_expression "psVar4 = *(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 "__dest = this + 0x10;" (assignment_expression "__dest = this + 0x10" identifier = (binary_expression "this + 0x10" identifier + number_literal)) ;) (if_statement "if (__dest == psVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = *(ulong *)(this + 0x10);\n  }" if (parenthesized_expression "(__dest == psVar4)" ( (binary_expression "__dest == psVar4" identifier == identifier) )) (compound_statement "{\n    uVar3 = 0xf;\n  }" { (expression_statement "uVar3 = 0xf;" (assignment_expression "uVar3 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n    uVar3 = *(ulong *)(this + 0x10);\n  }" else (compound_statement "{\n    uVar3 = *(ulong *)(this + 0x10);\n  }" { (expression_statement "uVar3 = *(ulong *)(this + 0x10);" (assignment_expression "uVar3 = *(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 (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (string *)_M_create(this,&local_20,uVar3);\n      psVar4 = *(string **)this;\n      sVar1 = *(long *)(this + 8) + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *psVar4;\n        psVar4 = *(string **)this;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,psVar4,sVar1);\n        psVar4 = *(string **)this;\n      }\n      if (__dest != psVar4) {\n        operator_delete(psVar4);\n      }\n      *(string **)this = __dest_00;\n      *(ulong *)(this + 0x10) = local_20;\n      return;\n    }\n    if (__dest != psVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        this[0x10] = *psVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,psVar4,sVar1);\n      }\n      operator_delete(psVar4);\n      *(string **)this = __dest;\n    }\n  }" if (parenthesized_expression "(uVar3 != local_20)" ( (binary_expression "uVar3 != local_20" identifier != identifier) )) (compound_statement "{\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (string *)_M_create(this,&local_20,uVar3);\n      psVar4 = *(string **)this;\n      sVar1 = *(long *)(this + 8) + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *psVar4;\n        psVar4 = *(string **)this;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,psVar4,sVar1);\n        psVar4 = *(string **)this;\n      }\n      if (__dest != psVar4) {\n        operator_delete(psVar4);\n      }\n      *(string **)this = __dest_00;\n      *(ulong *)(this + 0x10) = local_20;\n      return;\n    }\n    if (__dest != psVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        this[0x10] = *psVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,psVar4,sVar1);\n      }\n      operator_delete(psVar4);\n      *(string **)this = __dest;\n    }\n  }" { (if_statement "if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (string *)_M_create(this,&local_20,uVar3);\n      psVar4 = *(string **)this;\n      sVar1 = *(long *)(this + 8) + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *psVar4;\n        psVar4 = *(string **)this;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,psVar4,sVar1);\n        psVar4 = *(string **)this;\n      }\n      if (__dest != psVar4) {\n        operator_delete(psVar4);\n      }\n      *(string **)this = __dest_00;\n      *(ulong *)(this + 0x10) = local_20;\n      return;\n    }" if (parenthesized_expression "((0xf < local_20) || (uVar3 < local_20))" ( (binary_expression "(0xf < local_20) || (uVar3 < local_20)" (parenthesized_expression "(0xf < local_20)" ( (binary_expression "0xf < local_20" number_literal < identifier) )) || (parenthesized_expression "(uVar3 < local_20)" ( (binary_expression "uVar3 < local_20" identifier < identifier) ))) )) (compound_statement "{\n      __dest_00 = (string *)_M_create(this,&local_20,uVar3);\n      psVar4 = *(string **)this;\n      sVar1 = *(long *)(this + 8) + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *psVar4;\n        psVar4 = *(string **)this;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,psVar4,sVar1);\n        psVar4 = *(string **)this;\n      }\n      if (__dest != psVar4) {\n        operator_delete(psVar4);\n      }\n      *(string **)this = __dest_00;\n      *(ulong *)(this + 0x10) = local_20;\n      return;\n    }" { (expression_statement "__dest_00 = (string *)_M_create(this,&local_20,uVar3);" (assignment_expression "__dest_00 = (string *)_M_create(this,&local_20,uVar3)" identifier = (cast_expression "(string *)_M_create(this,&local_20,uVar3)" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "_M_create(this,&local_20,uVar3)" identifier (argument_list "(this,&local_20,uVar3)" ( identifier , (pointer_expression "&local_20" & identifier) , identifier ))))) ;) (expression_statement "psVar4 = *(string **)this;" (assignment_expression "psVar4 = *(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 "sVar1 = *(long *)(this + 8) + 1;" (assignment_expression "sVar1 = *(long *)(this + 8) + 1" identifier = (binary_expression "*(long *)(this + 8) + 1" (pointer_expression "*(long *)(this + 8)" * (cast_expression "(long *)(this + 8)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) + number_literal)) ;) (if_statement "if (sVar1 == 1) {\n        *__dest_00 = *psVar4;\n        psVar4 = *(string **)this;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,psVar4,sVar1);\n        psVar4 = *(string **)this;\n      }" if (parenthesized_expression "(sVar1 == 1)" ( (binary_expression "sVar1 == 1" identifier == number_literal) )) (compound_statement "{\n        *__dest_00 = *psVar4;\n        psVar4 = *(string **)this;\n      }" { (expression_statement "*__dest_00 = *psVar4;" (assignment_expression "*__dest_00 = *psVar4" (pointer_expression "*__dest_00" * identifier) = (pointer_expression "*psVar4" * identifier)) ;) (expression_statement "psVar4 = *(string **)this;" (assignment_expression "psVar4 = *(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 (sVar1 != 0) {\n        memcpy(__dest_00,psVar4,sVar1);\n        psVar4 = *(string **)this;\n      }" else (if_statement "if (sVar1 != 0) {\n        memcpy(__dest_00,psVar4,sVar1);\n        psVar4 = *(string **)this;\n      }" if (parenthesized_expression "(sVar1 != 0)" ( (binary_expression "sVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        memcpy(__dest_00,psVar4,sVar1);\n        psVar4 = *(string **)this;\n      }" { (expression_statement "memcpy(__dest_00,psVar4,sVar1);" (call_expression "memcpy(__dest_00,psVar4,sVar1)" identifier (argument_list "(__dest_00,psVar4,sVar1)" ( identifier , identifier , identifier ))) ;) (expression_statement "psVar4 = *(string **)this;" (assignment_expression "psVar4 = *(string **)this" identifier = (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) })))) (if_statement "if (__dest != psVar4) {\n        operator_delete(psVar4);\n      }" if (parenthesized_expression "(__dest != psVar4)" ( (binary_expression "__dest != psVar4" identifier != identifier) )) (compound_statement "{\n        operator_delete(psVar4);\n      }" { (expression_statement "operator_delete(psVar4);" (call_expression "operator_delete(psVar4)" identifier (argument_list "(psVar4)" ( identifier ))) ;) })) (expression_statement "*(string **)this = __dest_00;" (assignment_expression "*(string **)this = __dest_00" (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) (expression_statement "*(ulong *)(this + 0x10) = local_20;" (assignment_expression "*(ulong *)(this + 0x10) = local_20" (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) )))) = identifier) ;) (return_statement "return;" return ;) })) (if_statement "if (__dest != psVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        this[0x10] = *psVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,psVar4,sVar1);\n      }\n      operator_delete(psVar4);\n      *(string **)this = __dest;\n    }" if (parenthesized_expression "(__dest != psVar4)" ( (binary_expression "__dest != psVar4" identifier != identifier) )) (compound_statement "{\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        this[0x10] = *psVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,psVar4,sVar1);\n      }\n      operator_delete(psVar4);\n      *(string **)this = __dest;\n    }" { (expression_statement "sVar1 = uVar2 + 1;" (assignment_expression "sVar1 = uVar2 + 1" identifier = (binary_expression "uVar2 + 1" identifier + number_literal)) ;) (if_statement "if (sVar1 == 1) {\n        this[0x10] = *psVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,psVar4,sVar1);\n      }" if (parenthesized_expression "(sVar1 == 1)" ( (binary_expression "sVar1 == 1" identifier == number_literal) )) (compound_statement "{\n        this[0x10] = *psVar4;\n      }" { (expression_statement "this[0x10] = *psVar4;" (assignment_expression "this[0x10] = *psVar4" (subscript_expression "this[0x10]" identifier [ number_literal ]) = (pointer_expression "*psVar4" * identifier)) ;) }) (else_clause "else if (sVar1 != 0) {\n        memcpy(__dest,psVar4,sVar1);\n      }" else (if_statement "if (sVar1 != 0) {\n        memcpy(__dest,psVar4,sVar1);\n      }" if (parenthesized_expression "(sVar1 != 0)" ( (binary_expression "sVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        memcpy(__dest,psVar4,sVar1);\n      }" { (expression_statement "memcpy(__dest,psVar4,sVar1);" (call_expression "memcpy(__dest,psVar4,sVar1)" identifier (argument_list "(__dest,psVar4,sVar1)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "operator_delete(psVar4);" (call_expression "operator_delete(psVar4)" identifier (argument_list "(psVar4)" ( identifier ))) ;) (expression_statement "*(string **)this = __dest;" (assignment_expression "*(string **)this = __dest" (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) })) })) (return_statement "return;" return ;) })))
(translation_unit "void FUN_0027dec0(undefined8 *param_1,ulong param_2)\n\n{\n  undefined8 *__dest;\n  size_t sVar1;\n  ulong uVar2;\n  undefined1 *__dest_00;\n  ulong uVar3;\n  undefined1 *puVar4;\n  ulong local_20;\n  \n  uVar2 = param_1[1];\n  local_20 = param_2;\n  if (param_2 < uVar2) {\n    local_20 = uVar2;\n  }\n  puVar4 = (undefined1 *)*param_1;\n  __dest = param_1 + 2;\n  if (__dest == (undefined8 *)puVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = param_1[2];\n  }\n  if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }\n  return;\n}\n\n" (function_definition "void FUN_0027dec0(undefined8 *param_1,ulong param_2)\n\n{\n  undefined8 *__dest;\n  size_t sVar1;\n  ulong uVar2;\n  undefined1 *__dest_00;\n  ulong uVar3;\n  undefined1 *puVar4;\n  ulong local_20;\n  \n  uVar2 = param_1[1];\n  local_20 = param_2;\n  if (param_2 < uVar2) {\n    local_20 = uVar2;\n  }\n  puVar4 = (undefined1 *)*param_1;\n  __dest = param_1 + 2;\n  if (__dest == (undefined8 *)puVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = param_1[2];\n  }\n  if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0027dec0(undefined8 *param_1,ulong param_2)" identifier (parameter_list "(undefined8 *param_1,ulong param_2)" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "ulong param_2" type_identifier identifier) ))) (compound_statement "{\n  undefined8 *__dest;\n  size_t sVar1;\n  ulong uVar2;\n  undefined1 *__dest_00;\n  ulong uVar3;\n  undefined1 *puVar4;\n  ulong local_20;\n  \n  uVar2 = param_1[1];\n  local_20 = param_2;\n  if (param_2 < uVar2) {\n    local_20 = uVar2;\n  }\n  puVar4 = (undefined1 *)*param_1;\n  __dest = param_1 + 2;\n  if (__dest == (undefined8 *)puVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = param_1[2];\n  }\n  if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }\n  return;\n}" { (declaration "undefined8 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "undefined1 *__dest_00;" type_identifier (pointer_declarator "*__dest_00" * identifier) ;) (declaration "ulong uVar3;" type_identifier identifier ;) (declaration "undefined1 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "ulong local_20;" type_identifier identifier ;) (expression_statement "uVar2 = param_1[1];" (assignment_expression "uVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "local_20 = param_2;" (assignment_expression "local_20 = param_2" identifier = identifier) ;) (if_statement "if (param_2 < uVar2) {\n    local_20 = uVar2;\n  }" if (parenthesized_expression "(param_2 < uVar2)" ( (binary_expression "param_2 < uVar2" identifier < identifier) )) (compound_statement "{\n    local_20 = uVar2;\n  }" { (expression_statement "local_20 = uVar2;" (assignment_expression "local_20 = uVar2" identifier = identifier) ;) })) (expression_statement "puVar4 = (undefined1 *)*param_1;" (assignment_expression "puVar4 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "__dest = param_1 + 2;" (assignment_expression "__dest = param_1 + 2" identifier = (binary_expression "param_1 + 2" identifier + number_literal)) ;) (if_statement "if (__dest == (undefined8 *)puVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = param_1[2];\n  }" if (parenthesized_expression "(__dest == (undefined8 *)puVar4)" ( (binary_expression "__dest == (undefined8 *)puVar4" identifier == (cast_expression "(undefined8 *)puVar4" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n    uVar3 = 0xf;\n  }" { (expression_statement "uVar3 = 0xf;" (assignment_expression "uVar3 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n    uVar3 = param_1[2];\n  }" else (compound_statement "{\n    uVar3 = param_1[2];\n  }" { (expression_statement "uVar3 = param_1[2];" (assignment_expression "uVar3 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }" if (parenthesized_expression "(uVar3 != local_20)" ( (binary_expression "uVar3 != local_20" identifier != identifier) )) (compound_statement "{\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }" { (if_statement "if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }" if (parenthesized_expression "((0xf < local_20) || (uVar3 < local_20))" ( (binary_expression "(0xf < local_20) || (uVar3 < local_20)" (parenthesized_expression "(0xf < local_20)" ( (binary_expression "0xf < local_20" number_literal < identifier) )) || (parenthesized_expression "(uVar3 < local_20)" ( (binary_expression "uVar3 < local_20" identifier < identifier) ))) )) (compound_statement "{\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }" { (expression_statement "__dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);" (assignment_expression "__dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20)" identifier = (cast_expression "(undefined1 *)FUN_0027d650(param_1,&local_20)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0027d650(param_1,&local_20)" identifier (argument_list "(param_1,&local_20)" ( identifier , (pointer_expression "&local_20" & identifier) ))))) ;) (expression_statement "puVar4 = (undefined1 *)*param_1;" (assignment_expression "puVar4 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "sVar1 = param_1[1] + 1;" (assignment_expression "sVar1 = param_1[1] + 1" identifier = (binary_expression "param_1[1] + 1" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal)) ;) (if_statement "if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }" if (parenthesized_expression "(sVar1 == 1)" ( (binary_expression "sVar1 == 1" identifier == number_literal) )) (compound_statement "{\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }" { (expression_statement "*__dest_00 = *puVar4;" (assignment_expression "*__dest_00 = *puVar4" (pointer_expression "*__dest_00" * identifier) = (pointer_expression "*puVar4" * identifier)) ;) (expression_statement "puVar4 = (undefined1 *)*param_1;" (assignment_expression "puVar4 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }" else (if_statement "if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }" if (parenthesized_expression "(sVar1 != 0)" ( (binary_expression "sVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }" { (expression_statement "memcpy(__dest_00,puVar4,sVar1);" (call_expression "memcpy(__dest_00,puVar4,sVar1)" identifier (argument_list "(__dest_00,puVar4,sVar1)" ( identifier , identifier , identifier ))) ;) (expression_statement "puVar4 = (undefined1 *)*param_1;" (assignment_expression "puVar4 = (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 (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }" if (parenthesized_expression "(__dest != (undefined8 *)puVar4)" ( (binary_expression "__dest != (undefined8 *)puVar4" identifier != (cast_expression "(undefined8 *)puVar4" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n        FUN_00276d20();\n      }" { (expression_statement "FUN_00276d20();" (call_expression "FUN_00276d20()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "*param_1 = __dest_00;" (assignment_expression "*param_1 = __dest_00" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1[2] = local_20;" (assignment_expression "param_1[2] = local_20" (subscript_expression "param_1[2]" identifier [ number_literal ]) = identifier) ;) (return_statement "return;" return ;) })) (if_statement "if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }" if (parenthesized_expression "(__dest != (undefined8 *)puVar4)" ( (binary_expression "__dest != (undefined8 *)puVar4" identifier != (cast_expression "(undefined8 *)puVar4" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }" { (expression_statement "sVar1 = uVar2 + 1;" (assignment_expression "sVar1 = uVar2 + 1" identifier = (binary_expression "uVar2 + 1" identifier + number_literal)) ;) (if_statement "if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }" if (parenthesized_expression "(sVar1 == 1)" ( (binary_expression "sVar1 == 1" identifier == number_literal) )) (compound_statement "{\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }" { (expression_statement "*(undefined1 *)(param_1 + 2) = *puVar4;" (assignment_expression "*(undefined1 *)(param_1 + 2) = *puVar4" (pointer_expression "*(undefined1 *)(param_1 + 2)" * (cast_expression "(undefined1 *)(param_1 + 2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) = (pointer_expression "*puVar4" * identifier)) ;) }) (else_clause "else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }" else (if_statement "if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }" if (parenthesized_expression "(sVar1 != 0)" ( (binary_expression "sVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        memcpy(__dest,puVar4,sVar1);\n      }" { (expression_statement "memcpy(__dest,puVar4,sVar1);" (call_expression "memcpy(__dest,puVar4,sVar1)" identifier (argument_list "(__dest,puVar4,sVar1)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "FUN_00276d20(puVar4);" (call_expression "FUN_00276d20(puVar4)" identifier (argument_list "(puVar4)" ( identifier ))) ;) (expression_statement "*param_1 = __dest;" (assignment_expression "*param_1 = __dest" (pointer_expression "*param_1" * identifier) = identifier) ;) })) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression 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 + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (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 { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) || (parenthesized_expression ( (binary_expression IDENT < IDENT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) })))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (return_statement return ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (pointer_expression * IDENT)) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })))) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) })) })) (return_statement return ;) })))
(function_definition "void FUN_0027dec0(undefined8 *param_1,ulong param_2)\n\n{\n  undefined8 *__dest;\n  size_t sVar1;\n  ulong uVar2;\n  undefined1 *__dest_00;\n  ulong uVar3;\n  undefined1 *puVar4;\n  ulong local_20;\n  \n  uVar2 = param_1[1];\n  local_20 = param_2;\n  if (param_2 < uVar2) {\n    local_20 = uVar2;\n  }\n  puVar4 = (undefined1 *)*param_1;\n  __dest = param_1 + 2;\n  if (__dest == (undefined8 *)puVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = param_1[2];\n  }\n  if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0027dec0(undefined8 *param_1,ulong param_2)" (identifier "FUN_0027dec0") (parameter_list "(undefined8 *param_1,ulong param_2)" (( "(") (parameter_declaration "undefined8 *param_1" (type_identifier "undefined8") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "ulong param_2" (type_identifier "ulong") (identifier "param_2")) () ")"))) (compound_statement "{\n  undefined8 *__dest;\n  size_t sVar1;\n  ulong uVar2;\n  undefined1 *__dest_00;\n  ulong uVar3;\n  undefined1 *puVar4;\n  ulong local_20;\n  \n  uVar2 = param_1[1];\n  local_20 = param_2;\n  if (param_2 < uVar2) {\n    local_20 = uVar2;\n  }\n  puVar4 = (undefined1 *)*param_1;\n  __dest = param_1 + 2;\n  if (__dest == (undefined8 *)puVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = param_1[2];\n  }\n  if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }\n  return;\n}" ({ "{") (declaration "undefined8 *__dest;" (type_identifier "undefined8") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (declaration "size_t sVar1;" (primitive_type "size_t") (identifier "sVar1") (; ";")) (declaration "ulong uVar2;" (type_identifier "ulong") (identifier "uVar2") (; ";")) (declaration "undefined1 *__dest_00;" (type_identifier "undefined1") (pointer_declarator "*__dest_00" (* "*") (identifier "__dest_00")) (; ";")) (declaration "ulong uVar3;" (type_identifier "ulong") (identifier "uVar3") (; ";")) (declaration "undefined1 *puVar4;" (type_identifier "undefined1") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "ulong local_20;" (type_identifier "ulong") (identifier "local_20") (; ";")) (expression_statement "uVar2 = param_1[1];" (assignment_expression "uVar2 = param_1[1]" (identifier "uVar2") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "local_20 = param_2;" (assignment_expression "local_20 = param_2" (identifier "local_20") (= "=") (identifier "param_2")) (; ";")) (if_statement "if (param_2 < uVar2) {\n    local_20 = uVar2;\n  }" (if "if") (parenthesized_expression "(param_2 < uVar2)" (( "(") (binary_expression "param_2 < uVar2" (identifier "param_2") (< "<") (identifier "uVar2")) () ")")) (compound_statement "{\n    local_20 = uVar2;\n  }" ({ "{") (expression_statement "local_20 = uVar2;" (assignment_expression "local_20 = uVar2" (identifier "local_20") (= "=") (identifier "uVar2")) (; ";")) (} "}"))) (expression_statement "puVar4 = (undefined1 *)*param_1;" (assignment_expression "puVar4 = (undefined1 *)*param_1" (identifier "puVar4") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "__dest = param_1 + 2;" (assignment_expression "__dest = param_1 + 2" (identifier "__dest") (= "=") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2"))) (; ";")) (if_statement "if (__dest == (undefined8 *)puVar4) {\n    uVar3 = 0xf;\n  }\n  else {\n    uVar3 = param_1[2];\n  }" (if "if") (parenthesized_expression "(__dest == (undefined8 *)puVar4)" (( "(") (binary_expression "__dest == (undefined8 *)puVar4" (identifier "__dest") (== "==") (cast_expression "(undefined8 *)puVar4" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar4"))) () ")")) (compound_statement "{\n    uVar3 = 0xf;\n  }" ({ "{") (expression_statement "uVar3 = 0xf;" (assignment_expression "uVar3 = 0xf" (identifier "uVar3") (= "=") (number_literal "0xf")) (; ";")) (} "}")) (else_clause "else {\n    uVar3 = param_1[2];\n  }" (else "else") (compound_statement "{\n    uVar3 = param_1[2];\n  }" ({ "{") (expression_statement "uVar3 = param_1[2];" (assignment_expression "uVar3 = param_1[2]" (identifier "uVar3") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (} "}")))) (if_statement "if (uVar3 != local_20) {\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }" (if "if") (parenthesized_expression "(uVar3 != local_20)" (( "(") (binary_expression "uVar3 != local_20" (identifier "uVar3") (!= "!=") (identifier "local_20")) () ")")) (compound_statement "{\n    if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }\n    if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }\n  }" ({ "{") (if_statement "if ((0xf < local_20) || (uVar3 < local_20)) {\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }" (if "if") (parenthesized_expression "((0xf < local_20) || (uVar3 < local_20))" (( "(") (binary_expression "(0xf < local_20) || (uVar3 < local_20)" (parenthesized_expression "(0xf < local_20)" (( "(") (binary_expression "0xf < local_20" (number_literal "0xf") (< "<") (identifier "local_20")) () ")")) (|| "||") (parenthesized_expression "(uVar3 < local_20)" (( "(") (binary_expression "uVar3 < local_20" (identifier "uVar3") (< "<") (identifier "local_20")) () ")"))) () ")")) (compound_statement "{\n      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);\n      puVar4 = (undefined1 *)*param_1;\n      sVar1 = param_1[1] + 1;\n      if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }\n      if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }\n      *param_1 = __dest_00;\n      param_1[2] = local_20;\n      return;\n    }" ({ "{") (expression_statement "__dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);" (assignment_expression "__dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20)" (identifier "__dest_00") (= "=") (cast_expression "(undefined1 *)FUN_0027d650(param_1,&local_20)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0027d650(param_1,&local_20)" (identifier "FUN_0027d650") (argument_list "(param_1,&local_20)" (( "(") (identifier "param_1") (, ",") (pointer_expression "&local_20" (& "&") (identifier "local_20")) () ")"))))) (; ";")) (expression_statement "puVar4 = (undefined1 *)*param_1;" (assignment_expression "puVar4 = (undefined1 *)*param_1" (identifier "puVar4") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "sVar1 = param_1[1] + 1;" (assignment_expression "sVar1 = param_1[1] + 1" (identifier "sVar1") (= "=") (binary_expression "param_1[1] + 1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (sVar1 == 1) {\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }" (if "if") (parenthesized_expression "(sVar1 == 1)" (( "(") (binary_expression "sVar1 == 1" (identifier "sVar1") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *__dest_00 = *puVar4;\n        puVar4 = (undefined1 *)*param_1;\n      }" ({ "{") (expression_statement "*__dest_00 = *puVar4;" (assignment_expression "*__dest_00 = *puVar4" (pointer_expression "*__dest_00" (* "*") (identifier "__dest_00")) (= "=") (pointer_expression "*puVar4" (* "*") (identifier "puVar4"))) (; ";")) (expression_statement "puVar4 = (undefined1 *)*param_1;" (assignment_expression "puVar4 = (undefined1 *)*param_1" (identifier "puVar4") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }" (else "else") (if_statement "if (sVar1 != 0) {\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }" (if "if") (parenthesized_expression "(sVar1 != 0)" (( "(") (binary_expression "sVar1 != 0" (identifier "sVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        memcpy(__dest_00,puVar4,sVar1);\n        puVar4 = (undefined1 *)*param_1;\n      }" ({ "{") (expression_statement "memcpy(__dest_00,puVar4,sVar1);" (call_expression "memcpy(__dest_00,puVar4,sVar1)" (identifier "memcpy") (argument_list "(__dest_00,puVar4,sVar1)" (( "(") (identifier "__dest_00") (, ",") (identifier "puVar4") (, ",") (identifier "sVar1") () ")"))) (; ";")) (expression_statement "puVar4 = (undefined1 *)*param_1;" (assignment_expression "puVar4 = (undefined1 *)*param_1" (identifier "puVar4") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}"))))) (if_statement "if (__dest != (undefined8 *)puVar4) {\n        FUN_00276d20();\n      }" (if "if") (parenthesized_expression "(__dest != (undefined8 *)puVar4)" (( "(") (binary_expression "__dest != (undefined8 *)puVar4" (identifier "__dest") (!= "!=") (cast_expression "(undefined8 *)puVar4" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar4"))) () ")")) (compound_statement "{\n        FUN_00276d20();\n      }" ({ "{") (expression_statement "FUN_00276d20();" (call_expression "FUN_00276d20()" (identifier "FUN_00276d20") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "*param_1 = __dest_00;" (assignment_expression "*param_1 = __dest_00" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "__dest_00")) (; ";")) (expression_statement "param_1[2] = local_20;" (assignment_expression "param_1[2] = local_20" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "local_20")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (if_statement "if (__dest != (undefined8 *)puVar4) {\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }" (if "if") (parenthesized_expression "(__dest != (undefined8 *)puVar4)" (( "(") (binary_expression "__dest != (undefined8 *)puVar4" (identifier "__dest") (!= "!=") (cast_expression "(undefined8 *)puVar4" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar4"))) () ")")) (compound_statement "{\n      sVar1 = uVar2 + 1;\n      if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }\n      FUN_00276d20(puVar4);\n      *param_1 = __dest;\n    }" ({ "{") (expression_statement "sVar1 = uVar2 + 1;" (assignment_expression "sVar1 = uVar2 + 1" (identifier "sVar1") (= "=") (binary_expression "uVar2 + 1" (identifier "uVar2") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (sVar1 == 1) {\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }\n      else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }" (if "if") (parenthesized_expression "(sVar1 == 1)" (( "(") (binary_expression "sVar1 == 1" (identifier "sVar1") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *(undefined1 *)(param_1 + 2) = *puVar4;\n      }" ({ "{") (expression_statement "*(undefined1 *)(param_1 + 2) = *puVar4;" (assignment_expression "*(undefined1 *)(param_1 + 2) = *puVar4" (pointer_expression "*(undefined1 *)(param_1 + 2)" (* "*") (cast_expression "(undefined1 *)(param_1 + 2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 2)" (( "(") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2")) () ")")))) (= "=") (pointer_expression "*puVar4" (* "*") (identifier "puVar4"))) (; ";")) (} "}")) (else_clause "else if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }" (else "else") (if_statement "if (sVar1 != 0) {\n        memcpy(__dest,puVar4,sVar1);\n      }" (if "if") (parenthesized_expression "(sVar1 != 0)" (( "(") (binary_expression "sVar1 != 0" (identifier "sVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        memcpy(__dest,puVar4,sVar1);\n      }" ({ "{") (expression_statement "memcpy(__dest,puVar4,sVar1);" (call_expression "memcpy(__dest,puVar4,sVar1)" (identifier "memcpy") (argument_list "(__dest,puVar4,sVar1)" (( "(") (identifier "__dest") (, ",") (identifier "puVar4") (, ",") (identifier "sVar1") () ")"))) (; ";")) (} "}"))))) (expression_statement "FUN_00276d20(puVar4);" (call_expression "FUN_00276d20(puVar4)" (identifier "FUN_00276d20") (argument_list "(puVar4)" (( "(") (identifier "puVar4") () ")"))) (; ";")) (expression_statement "*param_1 = __dest;" (assignment_expression "*param_1 = __dest" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "__dest")) (; ";")) (} "}"))) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* std::string::reserve(unsigned long) */

void __thiscall std::type_1::function_1(type_1 *var_1,type_2 var_2)

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


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

void MASKED(undefined8 *param_1,ulong param_2)

{
  undefined8 *__dest;
  size_t sVar1;
  ulong uVar2;
  undefined1 *__dest_00;
  ulong uVar3;
  undefined1 *puVar4;
  ulong local_20;
  
  uVar2 = param_1[1];
  local_20 = param_2;
  if (param_2 < uVar2) {
    local_20 = uVar2;
  }
  puVar4 = (undefined1 *)*param_1;
  __dest = param_1 + 2;
  if (__dest == (undefined8 *)puVar4) {
    uVar3 = 0xf;
  }
  else {
    uVar3 = param_1[2];
  }
  if (uVar3 != local_20) {
    if ((0xf < local_20) || (uVar3 < local_20)) {
      __dest_00 = (undefined1 *)FUN_0027d650(param_1,&local_20);
      puVar4 = (undefined1 *)*param_1;
      sVar1 = param_1[1] + 1;
      if (sVar1 == 1) {
        *__dest_00 = *puVar4;
        puVar4 = (undefined1 *)*param_1;
      }
      else if (sVar1 != 0) {
        memcpy(__dest_00,puVar4,sVar1);
        puVar4 = (undefined1 *)*param_1;
      }
      if (__dest != (undefined8 *)puVar4) {
        FUN_00276d20();
      }
      *param_1 = __dest_00;
      param_1[2] = local_20;
      return;
    }
    if (__dest != (undefined8 *)puVar4) {
      sVar1 = uVar2 + 1;
      if (sVar1 == 1) {
        *(undefined1 *)(param_1 + 2) = *puVar4;
      }
      else if (sVar1 != 0) {
        memcpy(__dest,puVar4,sVar1);
      }
      FUN_00276d20(puVar4);
      *param_1 = __dest;
    }
  }
  return;
}

