
void * xmemdup(void *input,size_t copy_size,size_t alloc_size)

{
  void *pvVar1;
  
  pvVar1 = xmalloc(alloc_size);
  if (copy_size < alloc_size) {
    memset((void *)((long)pvVar1 + copy_size),0,alloc_size - copy_size);
  }
  pvVar1 = memcpy(pvVar1,input,copy_size);
  return pvVar1;
}



void FUN_002751d0(void *param_1,size_t param_2,ulong param_3)

{
  void *__dest;
  
  __dest = (void *)FUN_00275110(param_3);
  if (param_2 < param_3) {
    memset((void *)((long)__dest + param_2),0,param_3 - param_2);
  }
  memcpy(__dest,param_1,param_2);
  return;
}


PUSH R13
MOV R13,RDI
MOV RDI,RDX
PUSH R12
PUSH RBP
MOV RBP,RSI
PUSH RBX
MOV RBX,RDX
SUB RSP,0x8
CALL 0x00275110
MOV R12,RAX
CMP RBX,RBP
JA 0x00275210
ADD RSP,0x8
MOV RDX,RBP
MOV RSI,R13
MOV RDI,R12
POP RBX
POP RBP
POP R12
POP R13
JMP 0x0013eaa0
MOV RDX,RBX
LEA RDI,[RAX + RBP*0x1]
XOR ESI,ESI
SUB RDX,RBP
CALL 0x0013e100
JMP 0x002751f3
(translation_unit "void FUN_002751d0(void *param_1,size_t param_2,ulong param_3)\n\n{\n  void *__dest;\n  \n  __dest = (void *)FUN_00275110(param_3);\n  if (param_2 < param_3) {\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }\n  memcpy(__dest,param_1,param_2);\n  return;\n}\n\n" (function_definition "void FUN_002751d0(void *param_1,size_t param_2,ulong param_3)\n\n{\n  void *__dest;\n  \n  __dest = (void *)FUN_00275110(param_3);\n  if (param_2 < param_3) {\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }\n  memcpy(__dest,param_1,param_2);\n  return;\n}" primitive_type (function_declarator "FUN_002751d0(void *param_1,size_t param_2,ulong param_3)" identifier (parameter_list "(void *param_1,size_t param_2,ulong param_3)" ( (parameter_declaration "void *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) ))) (compound_statement "{\n  void *__dest;\n  \n  __dest = (void *)FUN_00275110(param_3);\n  if (param_2 < param_3) {\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }\n  memcpy(__dest,param_1,param_2);\n  return;\n}" { (declaration "void *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (expression_statement "__dest = (void *)FUN_00275110(param_3);" (assignment_expression "__dest = (void *)FUN_00275110(param_3)" identifier = (cast_expression "(void *)FUN_00275110(param_3)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00275110(param_3)" identifier (argument_list "(param_3)" ( identifier ))))) ;) (if_statement "if (param_2 < param_3) {\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }" if (parenthesized_expression "(param_2 < param_3)" ( (binary_expression "param_2 < param_3" identifier < identifier) )) (compound_statement "{\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }" { (expression_statement "memset((void *)((long)__dest + param_2),0,param_3 - param_2);" (call_expression "memset((void *)((long)__dest + param_2),0,param_3 - param_2)" identifier (argument_list "((void *)((long)__dest + param_2),0,param_3 - param_2)" ( (cast_expression "(void *)((long)__dest + param_2)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + param_2)" ( (binary_expression "(long)__dest + param_2" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) ))) , number_literal , (binary_expression "param_3 - param_2" identifier - identifier) ))) ;) })) (expression_statement "memcpy(__dest,param_1,param_2);" (call_expression "memcpy(__dest,param_1,param_2)" identifier (argument_list "(__dest,param_1,param_2)" ( identifier , identifier , identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit "void * xmemdup(void *input,size_t copy_size,size_t alloc_size)\n\n{\n  void *pvVar1;\n  \n  pvVar1 = xmalloc(alloc_size);\n  if (copy_size < alloc_size) {\n    memset((void *)((long)pvVar1 + copy_size),0,alloc_size - copy_size);\n  }\n  pvVar1 = memcpy(pvVar1,input,copy_size);\n  return pvVar1;\n}\n\n" (function_definition "void * xmemdup(void *input,size_t copy_size,size_t alloc_size)\n\n{\n  void *pvVar1;\n  \n  pvVar1 = xmalloc(alloc_size);\n  if (copy_size < alloc_size) {\n    memset((void *)((long)pvVar1 + copy_size),0,alloc_size - copy_size);\n  }\n  pvVar1 = memcpy(pvVar1,input,copy_size);\n  return pvVar1;\n}" primitive_type (pointer_declarator "* xmemdup(void *input,size_t copy_size,size_t alloc_size)" * (function_declarator "xmemdup(void *input,size_t copy_size,size_t alloc_size)" identifier (parameter_list "(void *input,size_t copy_size,size_t alloc_size)" ( (parameter_declaration "void *input" primitive_type (pointer_declarator "*input" * identifier)) , (parameter_declaration "size_t copy_size" primitive_type identifier) , (parameter_declaration "size_t alloc_size" primitive_type identifier) )))) (compound_statement "{\n  void *pvVar1;\n  \n  pvVar1 = xmalloc(alloc_size);\n  if (copy_size < alloc_size) {\n    memset((void *)((long)pvVar1 + copy_size),0,alloc_size - copy_size);\n  }\n  pvVar1 = memcpy(pvVar1,input,copy_size);\n  return pvVar1;\n}" { (declaration "void *pvVar1;" primitive_type (pointer_declarator "*pvVar1" * identifier) ;) (expression_statement "pvVar1 = xmalloc(alloc_size);" (assignment_expression "pvVar1 = xmalloc(alloc_size)" identifier = (call_expression "xmalloc(alloc_size)" identifier (argument_list "(alloc_size)" ( identifier )))) ;) (if_statement "if (copy_size < alloc_size) {\n    memset((void *)((long)pvVar1 + copy_size),0,alloc_size - copy_size);\n  }" if (parenthesized_expression "(copy_size < alloc_size)" ( (binary_expression "copy_size < alloc_size" identifier < identifier) )) (compound_statement "{\n    memset((void *)((long)pvVar1 + copy_size),0,alloc_size - copy_size);\n  }" { (expression_statement "memset((void *)((long)pvVar1 + copy_size),0,alloc_size - copy_size);" (call_expression "memset((void *)((long)pvVar1 + copy_size),0,alloc_size - copy_size)" identifier (argument_list "((void *)((long)pvVar1 + copy_size),0,alloc_size - copy_size)" ( (cast_expression "(void *)((long)pvVar1 + copy_size)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)pvVar1 + copy_size)" ( (binary_expression "(long)pvVar1 + copy_size" (cast_expression "(long)pvVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) ))) , number_literal , (binary_expression "alloc_size - copy_size" identifier - identifier) ))) ;) })) (expression_statement "pvVar1 = memcpy(pvVar1,input,copy_size);" (assignment_expression "pvVar1 = memcpy(pvVar1,input,copy_size)" identifier = (call_expression "memcpy(pvVar1,input,copy_size)" identifier (argument_list "(pvVar1,input,copy_size)" ( identifier , identifier , identifier )))) ;) (return_statement "return pvVar1;" return identifier ;) })))
(translation_unit "void FUN_002751d0(void *param_1,size_t param_2,ulong param_3)\n\n{\n  void *__dest;\n  \n  __dest = (void *)FUN_00275110(param_3);\n  if (param_2 < param_3) {\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }\n  memcpy(__dest,param_1,param_2);\n  return;\n}\n\n" (function_definition "void FUN_002751d0(void *param_1,size_t param_2,ulong param_3)\n\n{\n  void *__dest;\n  \n  __dest = (void *)FUN_00275110(param_3);\n  if (param_2 < param_3) {\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }\n  memcpy(__dest,param_1,param_2);\n  return;\n}" primitive_type (function_declarator "FUN_002751d0(void *param_1,size_t param_2,ulong param_3)" identifier (parameter_list "(void *param_1,size_t param_2,ulong param_3)" ( (parameter_declaration "void *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) ))) (compound_statement "{\n  void *__dest;\n  \n  __dest = (void *)FUN_00275110(param_3);\n  if (param_2 < param_3) {\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }\n  memcpy(__dest,param_1,param_2);\n  return;\n}" { (declaration "void *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (expression_statement "__dest = (void *)FUN_00275110(param_3);" (assignment_expression "__dest = (void *)FUN_00275110(param_3)" identifier = (cast_expression "(void *)FUN_00275110(param_3)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00275110(param_3)" identifier (argument_list "(param_3)" ( identifier ))))) ;) (if_statement "if (param_2 < param_3) {\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }" if (parenthesized_expression "(param_2 < param_3)" ( (binary_expression "param_2 < param_3" identifier < identifier) )) (compound_statement "{\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }" { (expression_statement "memset((void *)((long)__dest + param_2),0,param_3 - param_2);" (call_expression "memset((void *)((long)__dest + param_2),0,param_3 - param_2)" identifier (argument_list "((void *)((long)__dest + param_2),0,param_3 - param_2)" ( (cast_expression "(void *)((long)__dest + param_2)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + param_2)" ( (binary_expression "(long)__dest + param_2" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) ))) , number_literal , (binary_expression "param_3 - param_2" identifier - identifier) ))) ;) })) (expression_statement "memcpy(__dest,param_1,param_2);" (call_expression "memcpy(__dest,param_1,param_2)" identifier (argument_list "(__dest,param_1,param_2)" ( identifier , 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) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + IDENT) ))) , LIT , (binary_expression IDENT - IDENT) ))) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (return_statement return ;) })))
(function_definition "void FUN_002751d0(void *param_1,size_t param_2,ulong param_3)\n\n{\n  void *__dest;\n  \n  __dest = (void *)FUN_00275110(param_3);\n  if (param_2 < param_3) {\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }\n  memcpy(__dest,param_1,param_2);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_002751d0(void *param_1,size_t param_2,ulong param_3)" (identifier "FUN_002751d0") (parameter_list "(void *param_1,size_t param_2,ulong param_3)" (( "(") (parameter_declaration "void *param_1" (primitive_type "void") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "size_t param_2" (primitive_type "size_t") (identifier "param_2")) (, ",") (parameter_declaration "ulong param_3" (type_identifier "ulong") (identifier "param_3")) () ")"))) (compound_statement "{\n  void *__dest;\n  \n  __dest = (void *)FUN_00275110(param_3);\n  if (param_2 < param_3) {\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }\n  memcpy(__dest,param_1,param_2);\n  return;\n}" ({ "{") (declaration "void *__dest;" (primitive_type "void") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (expression_statement "__dest = (void *)FUN_00275110(param_3);" (assignment_expression "__dest = (void *)FUN_00275110(param_3)" (identifier "__dest") (= "=") (cast_expression "(void *)FUN_00275110(param_3)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00275110(param_3)" (identifier "FUN_00275110") (argument_list "(param_3)" (( "(") (identifier "param_3") () ")"))))) (; ";")) (if_statement "if (param_2 < param_3) {\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }" (if "if") (parenthesized_expression "(param_2 < param_3)" (( "(") (binary_expression "param_2 < param_3" (identifier "param_2") (< "<") (identifier "param_3")) () ")")) (compound_statement "{\n    memset((void *)((long)__dest + param_2),0,param_3 - param_2);\n  }" ({ "{") (expression_statement "memset((void *)((long)__dest + param_2),0,param_3 - param_2);" (call_expression "memset((void *)((long)__dest + param_2),0,param_3 - param_2)" (identifier "memset") (argument_list "((void *)((long)__dest + param_2),0,param_3 - param_2)" (( "(") (cast_expression "(void *)((long)__dest + param_2)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)__dest + param_2)" (( "(") (binary_expression "(long)__dest + param_2" (cast_expression "(long)__dest" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "__dest")) (+ "+") (identifier "param_2")) () ")"))) (, ",") (number_literal "0") (, ",") (binary_expression "param_3 - param_2" (identifier "param_3") (- "-") (identifier "param_2")) () ")"))) (; ";")) (} "}"))) (expression_statement "memcpy(__dest,param_1,param_2);" (call_expression "memcpy(__dest,param_1,param_2)" (identifier "memcpy") (argument_list "(__dest,param_1,param_2)" (( "(") (identifier "__dest") (, ",") (identifier "param_1") (, ",") (identifier "param_2") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

void * function_1(void *input,size_t var_2,size_t var_3)

{
  void *pvVar1;
  
  pvVar1 = var_1(var_3);
  if (var_2 < var_3) {
    var_4((void *)((long)pvVar1 + var_2),0,var_3 - var_2);
  }
  pvVar1 = var_5(pvVar1,input,var_2);
  return pvVar1;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (identifier)))) (number_literal) (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (return_statement))))

void MASKED(void *param_1,size_t param_2,ulong param_3)

{
  void *__dest;
  
  __dest = (void *)FUN_00275110(param_3);
  if (param_2 < param_3) {
    memset((void *)((long)__dest + param_2),0,param_3 - param_2);
  }
  memcpy(__dest,param_1,param_2);
  return;
}

