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

void __thiscall
std::string::_M_mutate(string *this,ulong param_1,ulong param_2,char *param_3,ulong param_4)

{
  undefined1 *__dest;
  ulong uVar1;
  string *psVar2;
  size_t __n;
  ulong local_40 [2];
  
  __n = *(long *)(this + 8) - (param_1 + param_2);
  local_40[0] = (param_4 - param_2) + *(long *)(this + 8);
  if (this + 0x10 == *(string **)this) {
    uVar1 = 0xf;
  }
  else {
    uVar1 = *(ulong *)(this + 0x10);
  }
  __dest = (undefined1 *)_M_create(this,local_40,uVar1);
  if (param_1 != 0) {
    if (param_1 == 1) {
      *__dest = **(undefined1 **)this;
    }
    else {
      memcpy(__dest,*(undefined1 **)this,param_1);
    }
  }
  if ((param_3 != (char *)0x0) && (param_4 != 0)) {
    if (param_4 == 1) {
      __dest[param_1] = *param_3;
    }
    else {
      memcpy(__dest + param_1,param_3,param_4);
    }
  }
  psVar2 = *(string **)this;
  if (__n != 0) {
    if (__n == 1) {
      *(string *)(__dest + param_1 + param_4) = psVar2[param_1 + param_2];
      psVar2 = *(string **)this;
    }
    else {
      memcpy((string *)(__dest + param_1 + param_4),psVar2 + param_1 + param_2,__n);
      psVar2 = *(string **)this;
    }
  }
  if (this + 0x10 != psVar2) {
    operator_delete(psVar2);
  }
  *(undefined1 **)this = __dest;
  *(ulong *)(this + 0x10) = local_40[0];
  return;
}



void FUN_0027da10(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5
                 )

{
  undefined1 *__dest;
  undefined8 uVar1;
  undefined1 *__src;
  undefined8 *puVar2;
  size_t __n;
  long local_40 [2];
  
  __n = param_1[1] - (param_2 + param_3);
  local_40[0] = (param_5 - param_3) + param_1[1];
  if (param_1 + 2 == (undefined8 *)*param_1) {
    uVar1 = 0xf;
  }
  else {
    uVar1 = param_1[2];
  }
  __dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);
  if (param_2 != 0) {
    if (param_2 == 1) {
      *__dest = *(undefined1 *)*param_1;
    }
    else {
      memcpy(__dest,(undefined1 *)*param_1,param_2);
    }
  }
  if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {
    if (param_5 == 1) {
      __dest[param_2] = *param_4;
    }
    else {
      memcpy(__dest + param_2,param_4,param_5);
    }
  }
  puVar2 = (undefined8 *)*param_1;
  if (__n != 0) {
    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);
    if (__n == 1) {
      __dest[param_2 + param_5] = *__src;
      puVar2 = (undefined8 *)*param_1;
    }
    else {
      memcpy(__dest + param_2 + param_5,__src,__n);
      puVar2 = (undefined8 *)*param_1;
    }
  }
  if (param_1 + 2 != puVar2) {
    FUN_00276d20();
  }
  *param_1 = __dest;
  param_1[2] = local_40[0];
  return;
}


PUSH R15
PUSH R14
MOV R14,R8
PUSH R13
PUSH R12
LEA R12,[RDI + 0x10]
PUSH RBP
MOV RBP,RSI
PUSH RBX
LEA RAX,[RBP + RDX*0x1]
MOV RBX,RDI
SUB RSP,0x28
MOV RSI,qword ptr [RDI + 0x8]
MOV qword ptr [RSP + 0x8],RAX
MOV R13,RSI
SUB R13,RAX
MOV RAX,R8
SUB RAX,RDX
ADD RAX,RSI
MOV qword ptr [RSP + 0x18],RAX
CMP R12,qword ptr [RDI]
JZ 0x0027db30
MOV RDX,qword ptr [RDI + 0x10]
LEA RSI,[RSP + 0x18]
MOV RDI,RBX
MOV qword ptr [RSP],RCX
CALL 0x0027d650
TEST RBP,RBP
MOV RCX,qword ptr [RSP]
MOV R15,RAX
JZ 0x0027da97
MOV RSI,qword ptr [RBX]
CMP RBP,0x1
JZ 0x0027db20
MOV RDX,RBP
MOV RDI,RAX
MOV qword ptr [RSP],RCX
CALL 0x0013eaa0
MOV RCX,qword ptr [RSP]
TEST RCX,RCX
JZ 0x0027daba
TEST R14,R14
JZ 0x0027daba
LEA RDI,[R15 + RBP*0x1]
CMP R14,0x1
JZ 0x0027db40
MOV RDX,R14
MOV RSI,RCX
CALL 0x0013eaa0
MOV RDI,qword ptr [RBX]
TEST R13,R13
JZ 0x0027dae2
MOV RSI,qword ptr [RSP + 0x8]
ADD RBP,R14
ADD RSI,RDI
LEA RDI,[R15 + RBP*0x1]
CMP R13,0x1
JZ 0x0027db10
MOV RDX,R13
CALL 0x0013eaa0
MOV RDI,qword ptr [RBX]
CMP R12,RDI
JZ 0x0027daec
CALL 0x00276d20
MOV RAX,qword ptr [RSP + 0x18]
MOV qword ptr [RBX],R15
MOV qword ptr [RBX + 0x10],RAX
ADD RSP,0x28
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
MOVZX EAX,byte ptr [RSI]
MOV byte ptr [RDI],AL
MOV RDI,qword ptr [RBX]
JMP 0x0027dae2
MOVZX EAX,byte ptr [RSI]
MOV byte ptr [R15],AL
JMP 0x0027da97
MOV EDX,0xf
JMP 0x0027da5a
MOVZX EAX,byte ptr [RCX]
MOV byte ptr [RDI],AL
JMP 0x0027daba
(translation_unit "void FUN_0027da10(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5\n                 )\n\n{\n  undefined1 *__dest;\n  undefined8 uVar1;\n  undefined1 *__src;\n  undefined8 *puVar2;\n  size_t __n;\n  long local_40 [2];\n  \n  __n = param_1[1] - (param_2 + param_3);\n  local_40[0] = (param_5 - param_3) + param_1[1];\n  if (param_1 + 2 == (undefined8 *)*param_1) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = param_1[2];\n  }\n  __dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }\n  if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }\n  puVar2 = (undefined8 *)*param_1;\n  if (__n != 0) {\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }\n  if (param_1 + 2 != puVar2) {\n    FUN_00276d20();\n  }\n  *param_1 = __dest;\n  param_1[2] = local_40[0];\n  return;\n}\n\n" (function_definition "void FUN_0027da10(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5\n                 )\n\n{\n  undefined1 *__dest;\n  undefined8 uVar1;\n  undefined1 *__src;\n  undefined8 *puVar2;\n  size_t __n;\n  long local_40 [2];\n  \n  __n = param_1[1] - (param_2 + param_3);\n  local_40[0] = (param_5 - param_3) + param_1[1];\n  if (param_1 + 2 == (undefined8 *)*param_1) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = param_1[2];\n  }\n  __dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }\n  if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }\n  puVar2 = (undefined8 *)*param_1;\n  if (__n != 0) {\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }\n  if (param_1 + 2 != puVar2) {\n    FUN_00276d20();\n  }\n  *param_1 = __dest;\n  param_1[2] = local_40[0];\n  return;\n}" primitive_type (function_declarator "FUN_0027da10(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5\n                 )" identifier (parameter_list "(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5\n                 )" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined1 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) , (parameter_declaration "size_t param_5" primitive_type identifier) ))) (compound_statement "{\n  undefined1 *__dest;\n  undefined8 uVar1;\n  undefined1 *__src;\n  undefined8 *puVar2;\n  size_t __n;\n  long local_40 [2];\n  \n  __n = param_1[1] - (param_2 + param_3);\n  local_40[0] = (param_5 - param_3) + param_1[1];\n  if (param_1 + 2 == (undefined8 *)*param_1) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = param_1[2];\n  }\n  __dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }\n  if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }\n  puVar2 = (undefined8 *)*param_1;\n  if (__n != 0) {\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }\n  if (param_1 + 2 != puVar2) {\n    FUN_00276d20();\n  }\n  *param_1 = __dest;\n  param_1[2] = local_40[0];\n  return;\n}" { (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "undefined8 uVar1;" type_identifier identifier ;) (declaration "undefined1 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "undefined8 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "long local_40 [2];" (sized_type_specifier "long" long) (array_declarator "local_40 [2]" identifier [ number_literal ]) ;) (expression_statement "__n = param_1[1] - (param_2 + param_3);" (assignment_expression "__n = param_1[1] - (param_2 + param_3)" identifier = (binary_expression "param_1[1] - (param_2 + param_3)" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (parenthesized_expression "(param_2 + param_3)" ( (binary_expression "param_2 + param_3" identifier + identifier) )))) ;) (expression_statement "local_40[0] = (param_5 - param_3) + param_1[1];" (assignment_expression "local_40[0] = (param_5 - param_3) + param_1[1]" (subscript_expression "local_40[0]" identifier [ number_literal ]) = (binary_expression "(param_5 - param_3) + param_1[1]" (parenthesized_expression "(param_5 - param_3)" ( (binary_expression "param_5 - param_3" identifier - identifier) )) + (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) (if_statement "if (param_1 + 2 == (undefined8 *)*param_1) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = param_1[2];\n  }" if (parenthesized_expression "(param_1 + 2 == (undefined8 *)*param_1)" ( (binary_expression "param_1 + 2 == (undefined8 *)*param_1" (binary_expression "param_1 + 2" identifier + number_literal) == (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) )) (compound_statement "{\n    uVar1 = 0xf;\n  }" { (expression_statement "uVar1 = 0xf;" (assignment_expression "uVar1 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n    uVar1 = param_1[2];\n  }" else (compound_statement "{\n    uVar1 = param_1[2];\n  }" { (expression_statement "uVar1 = param_1[2];" (assignment_expression "uVar1 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (expression_statement "__dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);" (assignment_expression "__dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1)" identifier = (cast_expression "(undefined1 *)FUN_0027d650(param_1,local_40,uVar1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0027d650(param_1,local_40,uVar1)" identifier (argument_list "(param_1,local_40,uVar1)" ( identifier , identifier , identifier ))))) ;) (if_statement "if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }" { (if_statement "if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n      *__dest = *(undefined1 *)*param_1;\n    }" { (expression_statement "*__dest = *(undefined1 *)*param_1;" (assignment_expression "*__dest = *(undefined1 *)*param_1" (pointer_expression "*__dest" * identifier) = (pointer_expression "*(undefined1 *)*param_1" * (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)))) ;) }) (else_clause "else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }" else (compound_statement "{\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }" { (expression_statement "memcpy(__dest,(undefined1 *)*param_1,param_2);" (call_expression "memcpy(__dest,(undefined1 *)*param_1,param_2)" identifier (argument_list "(__dest,(undefined1 *)*param_1,param_2)" ( identifier , (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) , identifier ))) ;) }))) })) (if_statement "if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }" if (parenthesized_expression "((param_4 != (undefined1 *)0x0) && (param_5 != 0))" ( (binary_expression "(param_4 != (undefined1 *)0x0) && (param_5 != 0)" (parenthesized_expression "(param_4 != (undefined1 *)0x0)" ( (binary_expression "param_4 != (undefined1 *)0x0" identifier != (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(param_5 != 0)" ( (binary_expression "param_5 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }" { (if_statement "if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }" if (parenthesized_expression "(param_5 == 1)" ( (binary_expression "param_5 == 1" identifier == number_literal) )) (compound_statement "{\n      __dest[param_2] = *param_4;\n    }" { (expression_statement "__dest[param_2] = *param_4;" (assignment_expression "__dest[param_2] = *param_4" (subscript_expression "__dest[param_2]" identifier [ identifier ]) = (pointer_expression "*param_4" * identifier)) ;) }) (else_clause "else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }" else (compound_statement "{\n      memcpy(__dest + param_2,param_4,param_5);\n    }" { (expression_statement "memcpy(__dest + param_2,param_4,param_5);" (call_expression "memcpy(__dest + param_2,param_4,param_5)" identifier (argument_list "(__dest + param_2,param_4,param_5)" ( (binary_expression "__dest + param_2" identifier + identifier) , identifier , identifier ))) ;) }))) })) (expression_statement "puVar2 = (undefined8 *)*param_1;" (assignment_expression "puVar2 = (undefined8 *)*param_1" identifier = (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if (__n != 0) {\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }" { (expression_statement "__src = (undefined1 *)(param_2 + param_3 + (long)puVar2);" (assignment_expression "__src = (undefined1 *)(param_2 + param_3 + (long)puVar2)" identifier = (cast_expression "(undefined1 *)(param_2 + param_3 + (long)puVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + param_3 + (long)puVar2)" ( (binary_expression "param_2 + param_3 + (long)puVar2" (binary_expression "param_2 + param_3" identifier + identifier) + (cast_expression "(long)puVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) ;) (if_statement "if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }" { (expression_statement "__dest[param_2 + param_5] = *__src;" (assignment_expression "__dest[param_2 + param_5] = *__src" (subscript_expression "__dest[param_2 + param_5]" identifier [ (binary_expression "param_2 + param_5" identifier + identifier) ]) = (pointer_expression "*__src" * identifier)) ;) (expression_statement "puVar2 = (undefined8 *)*param_1;" (assignment_expression "puVar2 = (undefined8 *)*param_1" identifier = (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }" else (compound_statement "{\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }" { (expression_statement "memcpy(__dest + param_2 + param_5,__src,__n);" (call_expression "memcpy(__dest + param_2 + param_5,__src,__n)" identifier (argument_list "(__dest + param_2 + param_5,__src,__n)" ( (binary_expression "__dest + param_2 + param_5" (binary_expression "__dest + param_2" identifier + identifier) + identifier) , identifier , identifier ))) ;) (expression_statement "puVar2 = (undefined8 *)*param_1;" (assignment_expression "puVar2 = (undefined8 *)*param_1" identifier = (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })) (if_statement "if (param_1 + 2 != puVar2) {\n    FUN_00276d20();\n  }" if (parenthesized_expression "(param_1 + 2 != puVar2)" ( (binary_expression "param_1 + 2 != puVar2" (binary_expression "param_1 + 2" identifier + number_literal) != identifier) )) (compound_statement "{\n    FUN_00276d20();\n  }" { (expression_statement "FUN_00276d20();" (call_expression "FUN_00276d20()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "*param_1 = __dest;" (assignment_expression "*param_1 = __dest" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1[2] = local_40[0];" (assignment_expression "param_1[2] = local_40[0]" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (subscript_expression "local_40[0]" identifier [ number_literal ])) ;) (return_statement "return;" return ;) })))
(translation_unit "/* std::string::_M_mutate(unsigned long, unsigned long, char const*, unsigned long) */\n\nvoid __thiscall\nstd::string::_M_mutate(string *this,ulong param_1,ulong param_2,char *param_3,ulong param_4)\n\n{\n  undefined1 *__dest;\n  ulong uVar1;\n  string *psVar2;\n  size_t __n;\n  ulong local_40 [2];\n  \n  __n = *(long *)(this + 8) - (param_1 + param_2);\n  local_40[0] = (param_4 - param_2) + *(long *)(this + 8);\n  if (this + 0x10 == *(string **)this) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = *(ulong *)(this + 0x10);\n  }\n  __dest = (undefined1 *)_M_create(this,local_40,uVar1);\n  if (param_1 != 0) {\n    if (param_1 == 1) {\n      *__dest = **(undefined1 **)this;\n    }\n    else {\n      memcpy(__dest,*(undefined1 **)this,param_1);\n    }\n  }\n  if ((param_3 != (char *)0x0) && (param_4 != 0)) {\n    if (param_4 == 1) {\n      __dest[param_1] = *param_3;\n    }\n    else {\n      memcpy(__dest + param_1,param_3,param_4);\n    }\n  }\n  psVar2 = *(string **)this;\n  if (__n != 0) {\n    if (__n == 1) {\n      *(string *)(__dest + param_1 + param_4) = psVar2[param_1 + param_2];\n      psVar2 = *(string **)this;\n    }\n    else {\n      memcpy((string *)(__dest + param_1 + param_4),psVar2 + param_1 + param_2,__n);\n      psVar2 = *(string **)this;\n    }\n  }\n  if (this + 0x10 != psVar2) {\n    operator_delete(psVar2);\n  }\n  *(undefined1 **)this = __dest;\n  *(ulong *)(this + 0x10) = local_40[0];\n  return;\n}\n\n" comment (function_definition "void __thiscall\nstd::string::_M_mutate(string *this,ulong param_1,ulong param_2,char *param_3,ulong param_4)\n\n{\n  undefined1 *__dest;\n  ulong uVar1;\n  string *psVar2;\n  size_t __n;\n  ulong local_40 [2];\n  \n  __n = *(long *)(this + 8) - (param_1 + param_2);\n  local_40[0] = (param_4 - param_2) + *(long *)(this + 8);\n  if (this + 0x10 == *(string **)this) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = *(ulong *)(this + 0x10);\n  }\n  __dest = (undefined1 *)_M_create(this,local_40,uVar1);\n  if (param_1 != 0) {\n    if (param_1 == 1) {\n      *__dest = **(undefined1 **)this;\n    }\n    else {\n      memcpy(__dest,*(undefined1 **)this,param_1);\n    }\n  }\n  if ((param_3 != (char *)0x0) && (param_4 != 0)) {\n    if (param_4 == 1) {\n      __dest[param_1] = *param_3;\n    }\n    else {\n      memcpy(__dest + param_1,param_3,param_4);\n    }\n  }\n  psVar2 = *(string **)this;\n  if (__n != 0) {\n    if (__n == 1) {\n      *(string *)(__dest + param_1 + param_4) = psVar2[param_1 + param_2];\n      psVar2 = *(string **)this;\n    }\n    else {\n      memcpy((string *)(__dest + param_1 + param_4),psVar2 + param_1 + param_2,__n);\n      psVar2 = *(string **)this;\n    }\n  }\n  if (this + 0x10 != psVar2) {\n    operator_delete(psVar2);\n  }\n  *(undefined1 **)this = __dest;\n  *(ulong *)(this + 0x10) = local_40[0];\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::string::" identifier : : identifier : :) (function_declarator "_M_mutate(string *this,ulong param_1,ulong param_2,char *param_3,ulong param_4)" identifier (parameter_list "(string *this,ulong param_1,ulong param_2,char *param_3,ulong param_4)" ( (parameter_declaration "string *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "ulong param_1" type_identifier identifier) , (parameter_declaration "ulong param_2" type_identifier identifier) , (parameter_declaration "char *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "ulong param_4" type_identifier identifier) ))) (compound_statement "{\n  undefined1 *__dest;\n  ulong uVar1;\n  string *psVar2;\n  size_t __n;\n  ulong local_40 [2];\n  \n  __n = *(long *)(this + 8) - (param_1 + param_2);\n  local_40[0] = (param_4 - param_2) + *(long *)(this + 8);\n  if (this + 0x10 == *(string **)this) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = *(ulong *)(this + 0x10);\n  }\n  __dest = (undefined1 *)_M_create(this,local_40,uVar1);\n  if (param_1 != 0) {\n    if (param_1 == 1) {\n      *__dest = **(undefined1 **)this;\n    }\n    else {\n      memcpy(__dest,*(undefined1 **)this,param_1);\n    }\n  }\n  if ((param_3 != (char *)0x0) && (param_4 != 0)) {\n    if (param_4 == 1) {\n      __dest[param_1] = *param_3;\n    }\n    else {\n      memcpy(__dest + param_1,param_3,param_4);\n    }\n  }\n  psVar2 = *(string **)this;\n  if (__n != 0) {\n    if (__n == 1) {\n      *(string *)(__dest + param_1 + param_4) = psVar2[param_1 + param_2];\n      psVar2 = *(string **)this;\n    }\n    else {\n      memcpy((string *)(__dest + param_1 + param_4),psVar2 + param_1 + param_2,__n);\n      psVar2 = *(string **)this;\n    }\n  }\n  if (this + 0x10 != psVar2) {\n    operator_delete(psVar2);\n  }\n  *(undefined1 **)this = __dest;\n  *(ulong *)(this + 0x10) = local_40[0];\n  return;\n}" { (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "ulong uVar1;" type_identifier identifier ;) (declaration "string *psVar2;" type_identifier (pointer_declarator "*psVar2" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "ulong local_40 [2];" type_identifier (array_declarator "local_40 [2]" identifier [ number_literal ]) ;) (expression_statement "__n = *(long *)(this + 8) - (param_1 + param_2);" (assignment_expression "__n = *(long *)(this + 8) - (param_1 + param_2)" identifier = (binary_expression "*(long *)(this + 8) - (param_1 + param_2)" (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) )))) - (parenthesized_expression "(param_1 + param_2)" ( (binary_expression "param_1 + param_2" identifier + identifier) )))) ;) (expression_statement "local_40[0] = (param_4 - param_2) + *(long *)(this + 8);" (assignment_expression "local_40[0] = (param_4 - param_2) + *(long *)(this + 8)" (subscript_expression "local_40[0]" identifier [ number_literal ]) = (binary_expression "(param_4 - param_2) + *(long *)(this + 8)" (parenthesized_expression "(param_4 - param_2)" ( (binary_expression "param_4 - param_2" identifier - identifier) )) + (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) )))))) ;) (if_statement "if (this + 0x10 == *(string **)this) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = *(ulong *)(this + 0x10);\n  }" if (parenthesized_expression "(this + 0x10 == *(string **)this)" ( (binary_expression "this + 0x10 == *(string **)this" (binary_expression "this + 0x10" identifier + number_literal) == (pointer_expression "*(string **)this" * (cast_expression "(string **)this" ( (type_descriptor "string **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) )) (compound_statement "{\n    uVar1 = 0xf;\n  }" { (expression_statement "uVar1 = 0xf;" (assignment_expression "uVar1 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n    uVar1 = *(ulong *)(this + 0x10);\n  }" else (compound_statement "{\n    uVar1 = *(ulong *)(this + 0x10);\n  }" { (expression_statement "uVar1 = *(ulong *)(this + 0x10);" (assignment_expression "uVar1 = *(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) ))))) ;) }))) (expression_statement "__dest = (undefined1 *)_M_create(this,local_40,uVar1);" (assignment_expression "__dest = (undefined1 *)_M_create(this,local_40,uVar1)" identifier = (cast_expression "(undefined1 *)_M_create(this,local_40,uVar1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "_M_create(this,local_40,uVar1)" identifier (argument_list "(this,local_40,uVar1)" ( identifier , identifier , identifier ))))) ;) (if_statement "if (param_1 != 0) {\n    if (param_1 == 1) {\n      *__dest = **(undefined1 **)this;\n    }\n    else {\n      memcpy(__dest,*(undefined1 **)this,param_1);\n    }\n  }" if (parenthesized_expression "(param_1 != 0)" ( (binary_expression "param_1 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_1 == 1) {\n      *__dest = **(undefined1 **)this;\n    }\n    else {\n      memcpy(__dest,*(undefined1 **)this,param_1);\n    }\n  }" { (if_statement "if (param_1 == 1) {\n      *__dest = **(undefined1 **)this;\n    }\n    else {\n      memcpy(__dest,*(undefined1 **)this,param_1);\n    }" if (parenthesized_expression "(param_1 == 1)" ( (binary_expression "param_1 == 1" identifier == number_literal) )) (compound_statement "{\n      *__dest = **(undefined1 **)this;\n    }" { (expression_statement "*__dest = **(undefined1 **)this;" (assignment_expression "*__dest = **(undefined1 **)this" (pointer_expression "*__dest" * identifier) = (pointer_expression "**(undefined1 **)this" * (pointer_expression "*(undefined1 **)this" * (cast_expression "(undefined1 **)this" ( (type_descriptor "undefined1 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)))) ;) }) (else_clause "else {\n      memcpy(__dest,*(undefined1 **)this,param_1);\n    }" else (compound_statement "{\n      memcpy(__dest,*(undefined1 **)this,param_1);\n    }" { (expression_statement "memcpy(__dest,*(undefined1 **)this,param_1);" (call_expression "memcpy(__dest,*(undefined1 **)this,param_1)" identifier (argument_list "(__dest,*(undefined1 **)this,param_1)" ( identifier , (pointer_expression "*(undefined1 **)this" * (cast_expression "(undefined1 **)this" ( (type_descriptor "undefined1 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) , identifier ))) ;) }))) })) (if_statement "if ((param_3 != (char *)0x0) && (param_4 != 0)) {\n    if (param_4 == 1) {\n      __dest[param_1] = *param_3;\n    }\n    else {\n      memcpy(__dest + param_1,param_3,param_4);\n    }\n  }" if (parenthesized_expression "((param_3 != (char *)0x0) && (param_4 != 0))" ( (binary_expression "(param_3 != (char *)0x0) && (param_4 != 0)" (parenthesized_expression "(param_3 != (char *)0x0)" ( (binary_expression "param_3 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    if (param_4 == 1) {\n      __dest[param_1] = *param_3;\n    }\n    else {\n      memcpy(__dest + param_1,param_3,param_4);\n    }\n  }" { (if_statement "if (param_4 == 1) {\n      __dest[param_1] = *param_3;\n    }\n    else {\n      memcpy(__dest + param_1,param_3,param_4);\n    }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n      __dest[param_1] = *param_3;\n    }" { (expression_statement "__dest[param_1] = *param_3;" (assignment_expression "__dest[param_1] = *param_3" (subscript_expression "__dest[param_1]" identifier [ identifier ]) = (pointer_expression "*param_3" * identifier)) ;) }) (else_clause "else {\n      memcpy(__dest + param_1,param_3,param_4);\n    }" else (compound_statement "{\n      memcpy(__dest + param_1,param_3,param_4);\n    }" { (expression_statement "memcpy(__dest + param_1,param_3,param_4);" (call_expression "memcpy(__dest + param_1,param_3,param_4)" identifier (argument_list "(__dest + param_1,param_3,param_4)" ( (binary_expression "__dest + param_1" identifier + identifier) , identifier , identifier ))) ;) }))) })) (expression_statement "psVar2 = *(string **)this;" (assignment_expression "psVar2 = *(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 (__n != 0) {\n    if (__n == 1) {\n      *(string *)(__dest + param_1 + param_4) = psVar2[param_1 + param_2];\n      psVar2 = *(string **)this;\n    }\n    else {\n      memcpy((string *)(__dest + param_1 + param_4),psVar2 + param_1 + param_2,__n);\n      psVar2 = *(string **)this;\n    }\n  }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n    if (__n == 1) {\n      *(string *)(__dest + param_1 + param_4) = psVar2[param_1 + param_2];\n      psVar2 = *(string **)this;\n    }\n    else {\n      memcpy((string *)(__dest + param_1 + param_4),psVar2 + param_1 + param_2,__n);\n      psVar2 = *(string **)this;\n    }\n  }" { (if_statement "if (__n == 1) {\n      *(string *)(__dest + param_1 + param_4) = psVar2[param_1 + param_2];\n      psVar2 = *(string **)this;\n    }\n    else {\n      memcpy((string *)(__dest + param_1 + param_4),psVar2 + param_1 + param_2,__n);\n      psVar2 = *(string **)this;\n    }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n      *(string *)(__dest + param_1 + param_4) = psVar2[param_1 + param_2];\n      psVar2 = *(string **)this;\n    }" { (expression_statement "*(string *)(__dest + param_1 + param_4) = psVar2[param_1 + param_2];" (assignment_expression "*(string *)(__dest + param_1 + param_4) = psVar2[param_1 + param_2]" (pointer_expression "*(string *)(__dest + param_1 + param_4)" * (cast_expression "(string *)(__dest + param_1 + param_4)" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__dest + param_1 + param_4)" ( (binary_expression "__dest + param_1 + param_4" (binary_expression "__dest + param_1" identifier + identifier) + identifier) )))) = (subscript_expression "psVar2[param_1 + param_2]" identifier [ (binary_expression "param_1 + param_2" identifier + identifier) ])) ;) (expression_statement "psVar2 = *(string **)this;" (assignment_expression "psVar2 = *(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((string *)(__dest + param_1 + param_4),psVar2 + param_1 + param_2,__n);\n      psVar2 = *(string **)this;\n    }" else (compound_statement "{\n      memcpy((string *)(__dest + param_1 + param_4),psVar2 + param_1 + param_2,__n);\n      psVar2 = *(string **)this;\n    }" { (expression_statement "memcpy((string *)(__dest + param_1 + param_4),psVar2 + param_1 + param_2,__n);" (call_expression "memcpy((string *)(__dest + param_1 + param_4),psVar2 + param_1 + param_2,__n)" identifier (argument_list "((string *)(__dest + param_1 + param_4),psVar2 + param_1 + param_2,__n)" ( (cast_expression "(string *)(__dest + param_1 + param_4)" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__dest + param_1 + param_4)" ( (binary_expression "__dest + param_1 + param_4" (binary_expression "__dest + param_1" identifier + identifier) + identifier) ))) , (binary_expression "psVar2 + param_1 + param_2" (binary_expression "psVar2 + param_1" identifier + identifier) + identifier) , identifier ))) ;) (expression_statement "psVar2 = *(string **)this;" (assignment_expression "psVar2 = *(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 (this + 0x10 != psVar2) {\n    operator_delete(psVar2);\n  }" if (parenthesized_expression "(this + 0x10 != psVar2)" ( (binary_expression "this + 0x10 != psVar2" (binary_expression "this + 0x10" identifier + number_literal) != identifier) )) (compound_statement "{\n    operator_delete(psVar2);\n  }" { (expression_statement "operator_delete(psVar2);" (call_expression "operator_delete(psVar2)" identifier (argument_list "(psVar2)" ( identifier ))) ;) })) (expression_statement "*(undefined1 **)this = __dest;" (assignment_expression "*(undefined1 **)this = __dest" (pointer_expression "*(undefined1 **)this" * (cast_expression "(undefined1 **)this" ( (type_descriptor "undefined1 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) (expression_statement "*(ulong *)(this + 0x10) = local_40[0];" (assignment_expression "*(ulong *)(this + 0x10) = local_40[0]" (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) )))) = (subscript_expression "local_40[0]" identifier [ number_literal ])) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_0027da10(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5\n                 )\n\n{\n  undefined1 *__dest;\n  undefined8 uVar1;\n  undefined1 *__src;\n  undefined8 *puVar2;\n  size_t __n;\n  long local_40 [2];\n  \n  __n = param_1[1] - (param_2 + param_3);\n  local_40[0] = (param_5 - param_3) + param_1[1];\n  if (param_1 + 2 == (undefined8 *)*param_1) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = param_1[2];\n  }\n  __dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }\n  if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }\n  puVar2 = (undefined8 *)*param_1;\n  if (__n != 0) {\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }\n  if (param_1 + 2 != puVar2) {\n    FUN_00276d20();\n  }\n  *param_1 = __dest;\n  param_1[2] = local_40[0];\n  return;\n}\n\n" (function_definition "void FUN_0027da10(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5\n                 )\n\n{\n  undefined1 *__dest;\n  undefined8 uVar1;\n  undefined1 *__src;\n  undefined8 *puVar2;\n  size_t __n;\n  long local_40 [2];\n  \n  __n = param_1[1] - (param_2 + param_3);\n  local_40[0] = (param_5 - param_3) + param_1[1];\n  if (param_1 + 2 == (undefined8 *)*param_1) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = param_1[2];\n  }\n  __dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }\n  if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }\n  puVar2 = (undefined8 *)*param_1;\n  if (__n != 0) {\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }\n  if (param_1 + 2 != puVar2) {\n    FUN_00276d20();\n  }\n  *param_1 = __dest;\n  param_1[2] = local_40[0];\n  return;\n}" primitive_type (function_declarator "FUN_0027da10(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5\n                 )" identifier (parameter_list "(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5\n                 )" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined1 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) , (parameter_declaration "size_t param_5" primitive_type identifier) ))) (compound_statement "{\n  undefined1 *__dest;\n  undefined8 uVar1;\n  undefined1 *__src;\n  undefined8 *puVar2;\n  size_t __n;\n  long local_40 [2];\n  \n  __n = param_1[1] - (param_2 + param_3);\n  local_40[0] = (param_5 - param_3) + param_1[1];\n  if (param_1 + 2 == (undefined8 *)*param_1) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = param_1[2];\n  }\n  __dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }\n  if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }\n  puVar2 = (undefined8 *)*param_1;\n  if (__n != 0) {\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }\n  if (param_1 + 2 != puVar2) {\n    FUN_00276d20();\n  }\n  *param_1 = __dest;\n  param_1[2] = local_40[0];\n  return;\n}" { (declaration "undefined1 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "undefined8 uVar1;" type_identifier identifier ;) (declaration "undefined1 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "undefined8 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "long local_40 [2];" (sized_type_specifier "long" long) (array_declarator "local_40 [2]" identifier [ number_literal ]) ;) (expression_statement "__n = param_1[1] - (param_2 + param_3);" (assignment_expression "__n = param_1[1] - (param_2 + param_3)" identifier = (binary_expression "param_1[1] - (param_2 + param_3)" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (parenthesized_expression "(param_2 + param_3)" ( (binary_expression "param_2 + param_3" identifier + identifier) )))) ;) (expression_statement "local_40[0] = (param_5 - param_3) + param_1[1];" (assignment_expression "local_40[0] = (param_5 - param_3) + param_1[1]" (subscript_expression "local_40[0]" identifier [ number_literal ]) = (binary_expression "(param_5 - param_3) + param_1[1]" (parenthesized_expression "(param_5 - param_3)" ( (binary_expression "param_5 - param_3" identifier - identifier) )) + (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) (if_statement "if (param_1 + 2 == (undefined8 *)*param_1) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = param_1[2];\n  }" if (parenthesized_expression "(param_1 + 2 == (undefined8 *)*param_1)" ( (binary_expression "param_1 + 2 == (undefined8 *)*param_1" (binary_expression "param_1 + 2" identifier + number_literal) == (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) )) (compound_statement "{\n    uVar1 = 0xf;\n  }" { (expression_statement "uVar1 = 0xf;" (assignment_expression "uVar1 = 0xf" identifier = number_literal) ;) }) (else_clause "else {\n    uVar1 = param_1[2];\n  }" else (compound_statement "{\n    uVar1 = param_1[2];\n  }" { (expression_statement "uVar1 = param_1[2];" (assignment_expression "uVar1 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (expression_statement "__dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);" (assignment_expression "__dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1)" identifier = (cast_expression "(undefined1 *)FUN_0027d650(param_1,local_40,uVar1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0027d650(param_1,local_40,uVar1)" identifier (argument_list "(param_1,local_40,uVar1)" ( identifier , identifier , identifier ))))) ;) (if_statement "if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }" { (if_statement "if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n      *__dest = *(undefined1 *)*param_1;\n    }" { (expression_statement "*__dest = *(undefined1 *)*param_1;" (assignment_expression "*__dest = *(undefined1 *)*param_1" (pointer_expression "*__dest" * identifier) = (pointer_expression "*(undefined1 *)*param_1" * (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)))) ;) }) (else_clause "else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }" else (compound_statement "{\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }" { (expression_statement "memcpy(__dest,(undefined1 *)*param_1,param_2);" (call_expression "memcpy(__dest,(undefined1 *)*param_1,param_2)" identifier (argument_list "(__dest,(undefined1 *)*param_1,param_2)" ( identifier , (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) , identifier ))) ;) }))) })) (if_statement "if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }" if (parenthesized_expression "((param_4 != (undefined1 *)0x0) && (param_5 != 0))" ( (binary_expression "(param_4 != (undefined1 *)0x0) && (param_5 != 0)" (parenthesized_expression "(param_4 != (undefined1 *)0x0)" ( (binary_expression "param_4 != (undefined1 *)0x0" identifier != (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(param_5 != 0)" ( (binary_expression "param_5 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }" { (if_statement "if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }" if (parenthesized_expression "(param_5 == 1)" ( (binary_expression "param_5 == 1" identifier == number_literal) )) (compound_statement "{\n      __dest[param_2] = *param_4;\n    }" { (expression_statement "__dest[param_2] = *param_4;" (assignment_expression "__dest[param_2] = *param_4" (subscript_expression "__dest[param_2]" identifier [ identifier ]) = (pointer_expression "*param_4" * identifier)) ;) }) (else_clause "else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }" else (compound_statement "{\n      memcpy(__dest + param_2,param_4,param_5);\n    }" { (expression_statement "memcpy(__dest + param_2,param_4,param_5);" (call_expression "memcpy(__dest + param_2,param_4,param_5)" identifier (argument_list "(__dest + param_2,param_4,param_5)" ( (binary_expression "__dest + param_2" identifier + identifier) , identifier , identifier ))) ;) }))) })) (expression_statement "puVar2 = (undefined8 *)*param_1;" (assignment_expression "puVar2 = (undefined8 *)*param_1" identifier = (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if (__n != 0) {\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }" { (expression_statement "__src = (undefined1 *)(param_2 + param_3 + (long)puVar2);" (assignment_expression "__src = (undefined1 *)(param_2 + param_3 + (long)puVar2)" identifier = (cast_expression "(undefined1 *)(param_2 + param_3 + (long)puVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + param_3 + (long)puVar2)" ( (binary_expression "param_2 + param_3 + (long)puVar2" (binary_expression "param_2 + param_3" identifier + identifier) + (cast_expression "(long)puVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) ;) (if_statement "if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }" { (expression_statement "__dest[param_2 + param_5] = *__src;" (assignment_expression "__dest[param_2 + param_5] = *__src" (subscript_expression "__dest[param_2 + param_5]" identifier [ (binary_expression "param_2 + param_5" identifier + identifier) ]) = (pointer_expression "*__src" * identifier)) ;) (expression_statement "puVar2 = (undefined8 *)*param_1;" (assignment_expression "puVar2 = (undefined8 *)*param_1" identifier = (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }) (else_clause "else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }" else (compound_statement "{\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }" { (expression_statement "memcpy(__dest + param_2 + param_5,__src,__n);" (call_expression "memcpy(__dest + param_2 + param_5,__src,__n)" identifier (argument_list "(__dest + param_2 + param_5,__src,__n)" ( (binary_expression "__dest + param_2 + param_5" (binary_expression "__dest + param_2" identifier + identifier) + identifier) , identifier , identifier ))) ;) (expression_statement "puVar2 = (undefined8 *)*param_1;" (assignment_expression "puVar2 = (undefined8 *)*param_1" identifier = (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) }))) })) (if_statement "if (param_1 + 2 != puVar2) {\n    FUN_00276d20();\n  }" if (parenthesized_expression "(param_1 + 2 != puVar2)" ( (binary_expression "param_1 + 2 != puVar2" (binary_expression "param_1 + 2" identifier + number_literal) != identifier) )) (compound_statement "{\n    FUN_00276d20();\n  }" { (expression_statement "FUN_00276d20();" (call_expression "FUN_00276d20()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "*param_1 = __dest;" (assignment_expression "*param_1 = __dest" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1[2] = local_40[0];" (assignment_expression "param_1[2] = local_40[0]" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (subscript_expression "local_40[0]" identifier [ number_literal ])) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) (array_declarator IDENT [ LIT ]) ;) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) - (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (parenthesized_expression ( (binary_expression IDENT - IDENT) )) + (subscript_expression IDENT [ LIT ]))) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) }))) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))))) ;) (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 * IDENT) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)) , IDENT ))) ;) }))) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) && (parenthesized_expression ( (binary_expression IDENT != LIT) ))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (pointer_expression * IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + 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 != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + IDENT) + (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ (binary_expression IDENT + IDENT) ]) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression (binary_expression IDENT + IDENT) + 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 (binary_expression IDENT + LIT) != 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 ]) = (subscript_expression IDENT [ LIT ])) ;) (return_statement return ;) })))
(function_definition "void FUN_0027da10(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5\n                 )\n\n{\n  undefined1 *__dest;\n  undefined8 uVar1;\n  undefined1 *__src;\n  undefined8 *puVar2;\n  size_t __n;\n  long local_40 [2];\n  \n  __n = param_1[1] - (param_2 + param_3);\n  local_40[0] = (param_5 - param_3) + param_1[1];\n  if (param_1 + 2 == (undefined8 *)*param_1) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = param_1[2];\n  }\n  __dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }\n  if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }\n  puVar2 = (undefined8 *)*param_1;\n  if (__n != 0) {\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }\n  if (param_1 + 2 != puVar2) {\n    FUN_00276d20();\n  }\n  *param_1 = __dest;\n  param_1[2] = local_40[0];\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0027da10(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5\n                 )" (identifier "FUN_0027da10") (parameter_list "(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5\n                 )" (( "(") (parameter_declaration "undefined8 *param_1" (type_identifier "undefined8") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "size_t param_2" (primitive_type "size_t") (identifier "param_2")) (, ",") (parameter_declaration "long param_3" (sized_type_specifier "long" (long "long")) (identifier "param_3")) (, ",") (parameter_declaration "undefined1 *param_4" (type_identifier "undefined1") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) (, ",") (parameter_declaration "size_t param_5" (primitive_type "size_t") (identifier "param_5")) () ")"))) (compound_statement "{\n  undefined1 *__dest;\n  undefined8 uVar1;\n  undefined1 *__src;\n  undefined8 *puVar2;\n  size_t __n;\n  long local_40 [2];\n  \n  __n = param_1[1] - (param_2 + param_3);\n  local_40[0] = (param_5 - param_3) + param_1[1];\n  if (param_1 + 2 == (undefined8 *)*param_1) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = param_1[2];\n  }\n  __dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);\n  if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }\n  if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }\n  puVar2 = (undefined8 *)*param_1;\n  if (__n != 0) {\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }\n  if (param_1 + 2 != puVar2) {\n    FUN_00276d20();\n  }\n  *param_1 = __dest;\n  param_1[2] = local_40[0];\n  return;\n}" ({ "{") (declaration "undefined1 *__dest;" (type_identifier "undefined1") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (declaration "undefined8 uVar1;" (type_identifier "undefined8") (identifier "uVar1") (; ";")) (declaration "undefined1 *__src;" (type_identifier "undefined1") (pointer_declarator "*__src" (* "*") (identifier "__src")) (; ";")) (declaration "undefined8 *puVar2;" (type_identifier "undefined8") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "long local_40 [2];" (sized_type_specifier "long" (long "long")) (array_declarator "local_40 [2]" (identifier "local_40") ([ "[") (number_literal "2") (] "]")) (; ";")) (expression_statement "__n = param_1[1] - (param_2 + param_3);" (assignment_expression "__n = param_1[1] - (param_2 + param_3)" (identifier "__n") (= "=") (binary_expression "param_1[1] - (param_2 + param_3)" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (parenthesized_expression "(param_2 + param_3)" (( "(") (binary_expression "param_2 + param_3" (identifier "param_2") (+ "+") (identifier "param_3")) () ")")))) (; ";")) (expression_statement "local_40[0] = (param_5 - param_3) + param_1[1];" (assignment_expression "local_40[0] = (param_5 - param_3) + param_1[1]" (subscript_expression "local_40[0]" (identifier "local_40") ([ "[") (number_literal "0") (] "]")) (= "=") (binary_expression "(param_5 - param_3) + param_1[1]" (parenthesized_expression "(param_5 - param_3)" (( "(") (binary_expression "param_5 - param_3" (identifier "param_5") (- "-") (identifier "param_3")) () ")")) (+ "+") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) (; ";")) (if_statement "if (param_1 + 2 == (undefined8 *)*param_1) {\n    uVar1 = 0xf;\n  }\n  else {\n    uVar1 = param_1[2];\n  }" (if "if") (parenthesized_expression "(param_1 + 2 == (undefined8 *)*param_1)" (( "(") (binary_expression "param_1 + 2 == (undefined8 *)*param_1" (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2")) (== "==") (cast_expression "(undefined8 *)*param_1" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) () ")")) (compound_statement "{\n    uVar1 = 0xf;\n  }" ({ "{") (expression_statement "uVar1 = 0xf;" (assignment_expression "uVar1 = 0xf" (identifier "uVar1") (= "=") (number_literal "0xf")) (; ";")) (} "}")) (else_clause "else {\n    uVar1 = param_1[2];\n  }" (else "else") (compound_statement "{\n    uVar1 = param_1[2];\n  }" ({ "{") (expression_statement "uVar1 = param_1[2];" (assignment_expression "uVar1 = param_1[2]" (identifier "uVar1") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (} "}")))) (expression_statement "__dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);" (assignment_expression "__dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1)" (identifier "__dest") (= "=") (cast_expression "(undefined1 *)FUN_0027d650(param_1,local_40,uVar1)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0027d650(param_1,local_40,uVar1)" (identifier "FUN_0027d650") (argument_list "(param_1,local_40,uVar1)" (( "(") (identifier "param_1") (, ",") (identifier "local_40") (, ",") (identifier "uVar1") () ")"))))) (; ";")) (if_statement "if (param_2 != 0) {\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }" (if "if") (parenthesized_expression "(param_2 != 0)" (( "(") (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }\n  }" ({ "{") (if_statement "if (param_2 == 1) {\n      *__dest = *(undefined1 *)*param_1;\n    }\n    else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }" (if "if") (parenthesized_expression "(param_2 == 1)" (( "(") (binary_expression "param_2 == 1" (identifier "param_2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      *__dest = *(undefined1 *)*param_1;\n    }" ({ "{") (expression_statement "*__dest = *(undefined1 *)*param_1;" (assignment_expression "*__dest = *(undefined1 *)*param_1" (pointer_expression "*__dest" (* "*") (identifier "__dest")) (= "=") (pointer_expression "*(undefined1 *)*param_1" (* "*") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1"))))) (; ";")) (} "}")) (else_clause "else {\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }" (else "else") (compound_statement "{\n      memcpy(__dest,(undefined1 *)*param_1,param_2);\n    }" ({ "{") (expression_statement "memcpy(__dest,(undefined1 *)*param_1,param_2);" (call_expression "memcpy(__dest,(undefined1 *)*param_1,param_2)" (identifier "memcpy") (argument_list "(__dest,(undefined1 *)*param_1,param_2)" (( "(") (identifier "__dest") (, ",") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (, ",") (identifier "param_2") () ")"))) (; ";")) (} "}")))) (} "}"))) (if_statement "if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }" (if "if") (parenthesized_expression "((param_4 != (undefined1 *)0x0) && (param_5 != 0))" (( "(") (binary_expression "(param_4 != (undefined1 *)0x0) && (param_5 != 0)" (parenthesized_expression "(param_4 != (undefined1 *)0x0)" (( "(") (binary_expression "param_4 != (undefined1 *)0x0" (identifier "param_4") (!= "!=") (cast_expression "(undefined1 *)0x0" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (&& "&&") (parenthesized_expression "(param_5 != 0)" (( "(") (binary_expression "param_5 != 0" (identifier "param_5") (!= "!=") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n    if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }\n  }" ({ "{") (if_statement "if (param_5 == 1) {\n      __dest[param_2] = *param_4;\n    }\n    else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }" (if "if") (parenthesized_expression "(param_5 == 1)" (( "(") (binary_expression "param_5 == 1" (identifier "param_5") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      __dest[param_2] = *param_4;\n    }" ({ "{") (expression_statement "__dest[param_2] = *param_4;" (assignment_expression "__dest[param_2] = *param_4" (subscript_expression "__dest[param_2]" (identifier "__dest") ([ "[") (identifier "param_2") (] "]")) (= "=") (pointer_expression "*param_4" (* "*") (identifier "param_4"))) (; ";")) (} "}")) (else_clause "else {\n      memcpy(__dest + param_2,param_4,param_5);\n    }" (else "else") (compound_statement "{\n      memcpy(__dest + param_2,param_4,param_5);\n    }" ({ "{") (expression_statement "memcpy(__dest + param_2,param_4,param_5);" (call_expression "memcpy(__dest + param_2,param_4,param_5)" (identifier "memcpy") (argument_list "(__dest + param_2,param_4,param_5)" (( "(") (binary_expression "__dest + param_2" (identifier "__dest") (+ "+") (identifier "param_2")) (, ",") (identifier "param_4") (, ",") (identifier "param_5") () ")"))) (; ";")) (} "}")))) (} "}"))) (expression_statement "puVar2 = (undefined8 *)*param_1;" (assignment_expression "puVar2 = (undefined8 *)*param_1" (identifier "puVar2") (= "=") (cast_expression "(undefined8 *)*param_1" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (if_statement "if (__n != 0) {\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }" (if "if") (parenthesized_expression "(__n != 0)" (( "(") (binary_expression "__n != 0" (identifier "__n") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);\n    if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }\n  }" ({ "{") (expression_statement "__src = (undefined1 *)(param_2 + param_3 + (long)puVar2);" (assignment_expression "__src = (undefined1 *)(param_2 + param_3 + (long)puVar2)" (identifier "__src") (= "=") (cast_expression "(undefined1 *)(param_2 + param_3 + (long)puVar2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 + param_3 + (long)puVar2)" (( "(") (binary_expression "param_2 + param_3 + (long)puVar2" (binary_expression "param_2 + param_3" (identifier "param_2") (+ "+") (identifier "param_3")) (+ "+") (cast_expression "(long)puVar2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar2"))) () ")")))) (; ";")) (if_statement "if (__n == 1) {\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }\n    else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }" (if "if") (parenthesized_expression "(__n == 1)" (( "(") (binary_expression "__n == 1" (identifier "__n") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      __dest[param_2 + param_5] = *__src;\n      puVar2 = (undefined8 *)*param_1;\n    }" ({ "{") (expression_statement "__dest[param_2 + param_5] = *__src;" (assignment_expression "__dest[param_2 + param_5] = *__src" (subscript_expression "__dest[param_2 + param_5]" (identifier "__dest") ([ "[") (binary_expression "param_2 + param_5" (identifier "param_2") (+ "+") (identifier "param_5")) (] "]")) (= "=") (pointer_expression "*__src" (* "*") (identifier "__src"))) (; ";")) (expression_statement "puVar2 = (undefined8 *)*param_1;" (assignment_expression "puVar2 = (undefined8 *)*param_1" (identifier "puVar2") (= "=") (cast_expression "(undefined8 *)*param_1" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else {\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }" (else "else") (compound_statement "{\n      memcpy(__dest + param_2 + param_5,__src,__n);\n      puVar2 = (undefined8 *)*param_1;\n    }" ({ "{") (expression_statement "memcpy(__dest + param_2 + param_5,__src,__n);" (call_expression "memcpy(__dest + param_2 + param_5,__src,__n)" (identifier "memcpy") (argument_list "(__dest + param_2 + param_5,__src,__n)" (( "(") (binary_expression "__dest + param_2 + param_5" (binary_expression "__dest + param_2" (identifier "__dest") (+ "+") (identifier "param_2")) (+ "+") (identifier "param_5")) (, ",") (identifier "__src") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "puVar2 = (undefined8 *)*param_1;" (assignment_expression "puVar2 = (undefined8 *)*param_1" (identifier "puVar2") (= "=") (cast_expression "(undefined8 *)*param_1" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")))) (} "}"))) (if_statement "if (param_1 + 2 != puVar2) {\n    FUN_00276d20();\n  }" (if "if") (parenthesized_expression "(param_1 + 2 != puVar2)" (( "(") (binary_expression "param_1 + 2 != puVar2" (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2")) (!= "!=") (identifier "puVar2")) () ")")) (compound_statement "{\n    FUN_00276d20();\n  }" ({ "{") (expression_statement "FUN_00276d20();" (call_expression "FUN_00276d20()" (identifier "FUN_00276d20") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "*param_1 = __dest;" (assignment_expression "*param_1 = __dest" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "__dest")) (; ";")) (expression_statement "param_1[2] = local_40[0];" (assignment_expression "param_1[2] = local_40[0]" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (subscript_expression "local_40[0]" (identifier "local_40") ([ "[") (number_literal "0") (] "]"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

void __thiscall
std::type_1::function_1(type_1 *var_1,type_2 var_2,type_2 var_3,char *var_7,type_2 var_4)

{
  type_3 *var_8;
  type_2 uVar1;
  type_1 *var_10;
  size_t var_9;
  type_2 local_40 [2];
  
  var_9 = *(long *)(var_1 + 8) - (var_2 + var_3);
  local_40[0] = (var_4 - var_3) + *(long *)(var_1 + 8);
  if (var_1 + 0x10 == *(type_1 **)var_1) {
    uVar1 = 0xf;
  }
  else {
    uVar1 = *(type_2 *)(var_1 + 0x10);
  }
  var_8 = (type_3 *)var_5(var_1,local_40,uVar1);
  if (var_2 != 0) {
    if (var_2 == 1) {
      *var_8 = **(type_3 **)var_1;
    }
    else {
      var_6(var_8,*(type_3 **)var_1,var_2);
    }
  }
  if ((var_7 != (char *)0x0) && (var_4 != 0)) {
    if (var_4 == 1) {
      var_8[var_2] = *var_7;
    }
    else {
      var_6(var_8 + var_2,var_7,var_4);
    }
  }
  var_10 = *(type_1 **)var_1;
  if (var_9 != 0) {
    if (var_9 == 1) {
      *(type_1 *)(var_8 + var_2 + var_4) = var_10[var_2 + var_3];
      var_10 = *(type_1 **)var_1;
    }
    else {
      var_6((type_1 *)(var_8 + var_2 + var_4),var_10 + var_2 + var_3,var_9);
      var_10 = *(type_1 **)var_1;
    }
  }
  if (var_1 + 0x10 != var_10) {
    var_11(var_10);
  }
  *(type_3 **)var_1 = var_8;
  *(type_2 *)(var_1 + 0x10) = local_40[0];
  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: (primitive_type) declarator: (identifier)) (parameter_declaration type: (sized_type_specifier) 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: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (subscript_expression argument: (identifier) index: (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (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))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))))) (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: (identifier)) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))) (identifier))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) right: (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: (subscript_expression argument: (identifier) index: (identifier)) right: (pointer_expression argument: (identifier))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (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: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (binary_expression left: (identifier) right: (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 (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (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: (binary_expression left: (identifier) right: (number_literal)) right: (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: (subscript_expression argument: (identifier) index: (number_literal)))) (return_statement))))

void MASKED(undefined8 *param_1,size_t param_2,long param_3,undefined1 *param_4,size_t param_5
                 )

{
  undefined1 *__dest;
  undefined8 uVar1;
  undefined1 *__src;
  undefined8 *puVar2;
  size_t __n;
  long local_40 [2];
  
  __n = param_1[1] - (param_2 + param_3);
  local_40[0] = (param_5 - param_3) + param_1[1];
  if (param_1 + 2 == (undefined8 *)*param_1) {
    uVar1 = 0xf;
  }
  else {
    uVar1 = param_1[2];
  }
  __dest = (undefined1 *)FUN_0027d650(param_1,local_40,uVar1);
  if (param_2 != 0) {
    if (param_2 == 1) {
      *__dest = *(undefined1 *)*param_1;
    }
    else {
      memcpy(__dest,(undefined1 *)*param_1,param_2);
    }
  }
  if ((param_4 != (undefined1 *)0x0) && (param_5 != 0)) {
    if (param_5 == 1) {
      __dest[param_2] = *param_4;
    }
    else {
      memcpy(__dest + param_2,param_4,param_5);
    }
  }
  puVar2 = (undefined8 *)*param_1;
  if (__n != 0) {
    __src = (undefined1 *)(param_2 + param_3 + (long)puVar2);
    if (__n == 1) {
      __dest[param_2 + param_5] = *__src;
      puVar2 = (undefined8 *)*param_1;
    }
    else {
      memcpy(__dest + param_2 + param_5,__src,__n);
      puVar2 = (undefined8 *)*param_1;
    }
  }
  if (param_1 + 2 != puVar2) {
    FUN_00276d20();
  }
  *param_1 = __dest;
  param_1[2] = local_40[0];
  return;
}

