
void mb_copy(mbchar_t *new_mbc,mbchar_t *old_mbc)

{
  _Bool _Var1;
  
  if (old_mbc->ptr == old_mbc->buf) {
    memcpy(new_mbc->buf,old_mbc->buf,old_mbc->bytes);
    new_mbc->ptr = new_mbc->buf;
  }
  else {
    new_mbc->ptr = old_mbc->ptr;
  }
  new_mbc->bytes = old_mbc->bytes;
  _Var1 = old_mbc->wc_valid;
  new_mbc->wc_valid = _Var1;
  if (_Var1 != false) {
    new_mbc->wc = old_mbc->wc;
  }
  return;
}



void FUN_00105fc3(undefined8 *param_1,undefined8 *param_2)

{
  char cVar1;
  
  if ((undefined8 *)*param_2 == param_2 + 3) {
    memcpy(param_1 + 3,param_2 + 3,param_2[1]);
    *param_1 = param_1 + 3;
  }
  else {
    *param_1 = (void *)*param_2;
  }
  param_1[1] = param_2[1];
  cVar1 = *(char *)(param_2 + 2);
  *(char *)(param_1 + 2) = cVar1;
  if (cVar1 != '\0') {
    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);
  }
  return;
}


PUSH R12
PUSH RBP
PUSH RBX
MOV RBP,RDI
MOV RBX,RSI
MOV RAX,qword ptr [RSI]
LEA RSI,[RSI + 0x18]
CMP RAX,RSI
JZ 0x00105ffa
MOV qword ptr [RDI],RAX
MOV RAX,qword ptr [RBX + 0x8]
MOV qword ptr [RBP + 0x8],RAX
MOVZX EAX,byte ptr [RBX + 0x10]
MOV byte ptr [RBP + 0x10],AL
TEST AL,AL
JZ 0x00105ff5
MOV EAX,dword ptr [RBX + 0x14]
MOV dword ptr [RBP + 0x14],EAX
POP RBX
POP RBP
POP R12
RET
LEA R12,[RDI + 0x18]
MOV RDX,qword ptr [RBX + 0x8]
MOV RDI,R12
CALL 0x001022c0
MOV qword ptr [RBP],R12
JMP 0x00105fdc
(translation_unit "void FUN_00105fc3(undefined8 *param_1,undefined8 *param_2)\n\n{\n  char cVar1;\n  \n  if ((undefined8 *)*param_2 == param_2 + 3) {\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }\n  else {\n    *param_1 = (void *)*param_2;\n  }\n  param_1[1] = param_2[1];\n  cVar1 = *(char *)(param_2 + 2);\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }\n  return;\n}\n\n" (function_definition "void FUN_00105fc3(undefined8 *param_1,undefined8 *param_2)\n\n{\n  char cVar1;\n  \n  if ((undefined8 *)*param_2 == param_2 + 3) {\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }\n  else {\n    *param_1 = (void *)*param_2;\n  }\n  param_1[1] = param_2[1];\n  cVar1 = *(char *)(param_2 + 2);\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }\n  return;\n}" primitive_type (function_declarator "FUN_00105fc3(undefined8 *param_1,undefined8 *param_2)" identifier (parameter_list "(undefined8 *param_1,undefined8 *param_2)" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  \n  if ((undefined8 *)*param_2 == param_2 + 3) {\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }\n  else {\n    *param_1 = (void *)*param_2;\n  }\n  param_1[1] = param_2[1];\n  cVar1 = *(char *)(param_2 + 2);\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }\n  return;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (if_statement "if ((undefined8 *)*param_2 == param_2 + 3) {\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }\n  else {\n    *param_1 = (void *)*param_2;\n  }" if (parenthesized_expression "((undefined8 *)*param_2 == param_2 + 3)" ( (binary_expression "(undefined8 *)*param_2 == param_2 + 3" (cast_expression "(undefined8 *)*param_2" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier)) == (binary_expression "param_2 + 3" identifier + number_literal)) )) (compound_statement "{\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }" { (expression_statement "memcpy(param_1 + 3,param_2 + 3,param_2[1]);" (call_expression "memcpy(param_1 + 3,param_2 + 3,param_2[1])" identifier (argument_list "(param_1 + 3,param_2 + 3,param_2[1])" ( (binary_expression "param_1 + 3" identifier + number_literal) , (binary_expression "param_2 + 3" identifier + number_literal) , (subscript_expression "param_2[1]" identifier [ number_literal ]) ))) ;) (expression_statement "*param_1 = param_1 + 3;" (assignment_expression "*param_1 = param_1 + 3" (pointer_expression "*param_1" * identifier) = (binary_expression "param_1 + 3" identifier + number_literal)) ;) }) (else_clause "else {\n    *param_1 = (void *)*param_2;\n  }" else (compound_statement "{\n    *param_1 = (void *)*param_2;\n  }" { (expression_statement "*param_1 = (void *)*param_2;" (assignment_expression "*param_1 = (void *)*param_2" (pointer_expression "*param_1" * identifier) = (cast_expression "(void *)*param_2" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) }))) (expression_statement "param_1[1] = param_2[1];" (assignment_expression "param_1[1] = param_2[1]" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (subscript_expression "param_2[1]" identifier [ number_literal ])) ;) (expression_statement "cVar1 = *(char *)(param_2 + 2);" (assignment_expression "cVar1 = *(char *)(param_2 + 2)" identifier = (pointer_expression "*(char *)(param_2 + 2)" * (cast_expression "(char *)(param_2 + 2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + 2)" ( (binary_expression "param_2 + 2" identifier + number_literal) ))))) ;) (expression_statement "*(char *)(param_1 + 2) = cVar1;" (assignment_expression "*(char *)(param_1 + 2) = cVar1" (pointer_expression "*(char *)(param_1 + 2)" * (cast_expression "(char *)(param_1 + 2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) = identifier) ;) (if_statement "if (cVar1 != '\0') {\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }" if (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }" { (expression_statement "*(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);" (assignment_expression "*(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14)" (pointer_expression "*(undefined4 *)((long)param_1 + 0x14)" * (cast_expression "(undefined4 *)((long)param_1 + 0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 + 0x14)" ( (binary_expression "(long)param_1 + 0x14" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) = (pointer_expression "*(undefined4 *)((long)param_2 + 0x14)" * (cast_expression "(undefined4 *)((long)param_2 + 0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 + 0x14)" ( (binary_expression "(long)param_2 + 0x14" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) ))))) ;) })) (return_statement "return;" return ;) })))
(translation_unit "void mb_copy(mbchar_t *new_mbc,mbchar_t *old_mbc)\n\n{\n  _Bool _Var1;\n  \n  if (old_mbc->ptr == old_mbc->buf) {\n    memcpy(new_mbc->buf,old_mbc->buf,old_mbc->bytes);\n    new_mbc->ptr = new_mbc->buf;\n  }\n  else {\n    new_mbc->ptr = old_mbc->ptr;\n  }\n  new_mbc->bytes = old_mbc->bytes;\n  _Var1 = old_mbc->wc_valid;\n  new_mbc->wc_valid = _Var1;\n  if (_Var1 != false) {\n    new_mbc->wc = old_mbc->wc;\n  }\n  return;\n}\n\n" (function_definition "void mb_copy(mbchar_t *new_mbc,mbchar_t *old_mbc)\n\n{\n  _Bool _Var1;\n  \n  if (old_mbc->ptr == old_mbc->buf) {\n    memcpy(new_mbc->buf,old_mbc->buf,old_mbc->bytes);\n    new_mbc->ptr = new_mbc->buf;\n  }\n  else {\n    new_mbc->ptr = old_mbc->ptr;\n  }\n  new_mbc->bytes = old_mbc->bytes;\n  _Var1 = old_mbc->wc_valid;\n  new_mbc->wc_valid = _Var1;\n  if (_Var1 != false) {\n    new_mbc->wc = old_mbc->wc;\n  }\n  return;\n}" primitive_type (function_declarator "mb_copy(mbchar_t *new_mbc,mbchar_t *old_mbc)" identifier (parameter_list "(mbchar_t *new_mbc,mbchar_t *old_mbc)" ( (parameter_declaration "mbchar_t *new_mbc" type_identifier (pointer_declarator "*new_mbc" * identifier)) , (parameter_declaration "mbchar_t *old_mbc" type_identifier (pointer_declarator "*old_mbc" * identifier)) ))) (compound_statement "{\n  _Bool _Var1;\n  \n  if (old_mbc->ptr == old_mbc->buf) {\n    memcpy(new_mbc->buf,old_mbc->buf,old_mbc->bytes);\n    new_mbc->ptr = new_mbc->buf;\n  }\n  else {\n    new_mbc->ptr = old_mbc->ptr;\n  }\n  new_mbc->bytes = old_mbc->bytes;\n  _Var1 = old_mbc->wc_valid;\n  new_mbc->wc_valid = _Var1;\n  if (_Var1 != false) {\n    new_mbc->wc = old_mbc->wc;\n  }\n  return;\n}" { (declaration "_Bool _Var1;" type_identifier identifier ;) (if_statement "if (old_mbc->ptr == old_mbc->buf) {\n    memcpy(new_mbc->buf,old_mbc->buf,old_mbc->bytes);\n    new_mbc->ptr = new_mbc->buf;\n  }\n  else {\n    new_mbc->ptr = old_mbc->ptr;\n  }" if (parenthesized_expression "(old_mbc->ptr == old_mbc->buf)" ( (binary_expression "old_mbc->ptr == old_mbc->buf" (field_expression "old_mbc->ptr" identifier -> field_identifier) == (field_expression "old_mbc->buf" identifier -> field_identifier)) )) (compound_statement "{\n    memcpy(new_mbc->buf,old_mbc->buf,old_mbc->bytes);\n    new_mbc->ptr = new_mbc->buf;\n  }" { (expression_statement "memcpy(new_mbc->buf,old_mbc->buf,old_mbc->bytes);" (call_expression "memcpy(new_mbc->buf,old_mbc->buf,old_mbc->bytes)" identifier (argument_list "(new_mbc->buf,old_mbc->buf,old_mbc->bytes)" ( (field_expression "new_mbc->buf" identifier -> field_identifier) , (field_expression "old_mbc->buf" identifier -> field_identifier) , (field_expression "old_mbc->bytes" identifier -> field_identifier) ))) ;) (expression_statement "new_mbc->ptr = new_mbc->buf;" (assignment_expression "new_mbc->ptr = new_mbc->buf" (field_expression "new_mbc->ptr" identifier -> field_identifier) = (field_expression "new_mbc->buf" identifier -> field_identifier)) ;) }) (else_clause "else {\n    new_mbc->ptr = old_mbc->ptr;\n  }" else (compound_statement "{\n    new_mbc->ptr = old_mbc->ptr;\n  }" { (expression_statement "new_mbc->ptr = old_mbc->ptr;" (assignment_expression "new_mbc->ptr = old_mbc->ptr" (field_expression "new_mbc->ptr" identifier -> field_identifier) = (field_expression "old_mbc->ptr" identifier -> field_identifier)) ;) }))) (expression_statement "new_mbc->bytes = old_mbc->bytes;" (assignment_expression "new_mbc->bytes = old_mbc->bytes" (field_expression "new_mbc->bytes" identifier -> field_identifier) = (field_expression "old_mbc->bytes" identifier -> field_identifier)) ;) (expression_statement "_Var1 = old_mbc->wc_valid;" (assignment_expression "_Var1 = old_mbc->wc_valid" identifier = (field_expression "old_mbc->wc_valid" identifier -> field_identifier)) ;) (expression_statement "new_mbc->wc_valid = _Var1;" (assignment_expression "new_mbc->wc_valid = _Var1" (field_expression "new_mbc->wc_valid" identifier -> field_identifier) = identifier) ;) (if_statement "if (_Var1 != false) {\n    new_mbc->wc = old_mbc->wc;\n  }" if (parenthesized_expression "(_Var1 != false)" ( (binary_expression "_Var1 != false" identifier != false) )) (compound_statement "{\n    new_mbc->wc = old_mbc->wc;\n  }" { (expression_statement "new_mbc->wc = old_mbc->wc;" (assignment_expression "new_mbc->wc = old_mbc->wc" (field_expression "new_mbc->wc" identifier -> field_identifier) = (field_expression "old_mbc->wc" identifier -> field_identifier)) ;) })) (return_statement "return;" return ;) })))
(translation_unit "void FUN_00105fc3(undefined8 *param_1,undefined8 *param_2)\n\n{\n  char cVar1;\n  \n  if ((undefined8 *)*param_2 == param_2 + 3) {\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }\n  else {\n    *param_1 = (void *)*param_2;\n  }\n  param_1[1] = param_2[1];\n  cVar1 = *(char *)(param_2 + 2);\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }\n  return;\n}\n\n" (function_definition "void FUN_00105fc3(undefined8 *param_1,undefined8 *param_2)\n\n{\n  char cVar1;\n  \n  if ((undefined8 *)*param_2 == param_2 + 3) {\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }\n  else {\n    *param_1 = (void *)*param_2;\n  }\n  param_1[1] = param_2[1];\n  cVar1 = *(char *)(param_2 + 2);\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }\n  return;\n}" primitive_type (function_declarator "FUN_00105fc3(undefined8 *param_1,undefined8 *param_2)" identifier (parameter_list "(undefined8 *param_1,undefined8 *param_2)" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  \n  if ((undefined8 *)*param_2 == param_2 + 3) {\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }\n  else {\n    *param_1 = (void *)*param_2;\n  }\n  param_1[1] = param_2[1];\n  cVar1 = *(char *)(param_2 + 2);\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }\n  return;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (if_statement "if ((undefined8 *)*param_2 == param_2 + 3) {\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }\n  else {\n    *param_1 = (void *)*param_2;\n  }" if (parenthesized_expression "((undefined8 *)*param_2 == param_2 + 3)" ( (binary_expression "(undefined8 *)*param_2 == param_2 + 3" (cast_expression "(undefined8 *)*param_2" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier)) == (binary_expression "param_2 + 3" identifier + number_literal)) )) (compound_statement "{\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }" { (expression_statement "memcpy(param_1 + 3,param_2 + 3,param_2[1]);" (call_expression "memcpy(param_1 + 3,param_2 + 3,param_2[1])" identifier (argument_list "(param_1 + 3,param_2 + 3,param_2[1])" ( (binary_expression "param_1 + 3" identifier + number_literal) , (binary_expression "param_2 + 3" identifier + number_literal) , (subscript_expression "param_2[1]" identifier [ number_literal ]) ))) ;) (expression_statement "*param_1 = param_1 + 3;" (assignment_expression "*param_1 = param_1 + 3" (pointer_expression "*param_1" * identifier) = (binary_expression "param_1 + 3" identifier + number_literal)) ;) }) (else_clause "else {\n    *param_1 = (void *)*param_2;\n  }" else (compound_statement "{\n    *param_1 = (void *)*param_2;\n  }" { (expression_statement "*param_1 = (void *)*param_2;" (assignment_expression "*param_1 = (void *)*param_2" (pointer_expression "*param_1" * identifier) = (cast_expression "(void *)*param_2" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) }))) (expression_statement "param_1[1] = param_2[1];" (assignment_expression "param_1[1] = param_2[1]" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (subscript_expression "param_2[1]" identifier [ number_literal ])) ;) (expression_statement "cVar1 = *(char *)(param_2 + 2);" (assignment_expression "cVar1 = *(char *)(param_2 + 2)" identifier = (pointer_expression "*(char *)(param_2 + 2)" * (cast_expression "(char *)(param_2 + 2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + 2)" ( (binary_expression "param_2 + 2" identifier + number_literal) ))))) ;) (expression_statement "*(char *)(param_1 + 2) = cVar1;" (assignment_expression "*(char *)(param_1 + 2) = cVar1" (pointer_expression "*(char *)(param_1 + 2)" * (cast_expression "(char *)(param_1 + 2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) = identifier) ;) (if_statement "if (cVar1 != '\0') {\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }" if (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }" { (expression_statement "*(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);" (assignment_expression "*(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14)" (pointer_expression "*(undefined4 *)((long)param_1 + 0x14)" * (cast_expression "(undefined4 *)((long)param_1 + 0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 + 0x14)" ( (binary_expression "(long)param_1 + 0x14" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) = (pointer_expression "*(undefined4 *)((long)param_2 + 0x14)" * (cast_expression "(undefined4 *)((long)param_2 + 0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 + 0x14)" ( (binary_expression "(long)param_2 + 0x14" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) 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 (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)) == (binary_expression IDENT + LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , (binary_expression IDENT + LIT) , (subscript_expression IDENT [ LIT ]) ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression IDENT + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }))) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) )))) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) ))))) ;) })) (return_statement return ;) })))
(function_definition "void FUN_00105fc3(undefined8 *param_1,undefined8 *param_2)\n\n{\n  char cVar1;\n  \n  if ((undefined8 *)*param_2 == param_2 + 3) {\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }\n  else {\n    *param_1 = (void *)*param_2;\n  }\n  param_1[1] = param_2[1];\n  cVar1 = *(char *)(param_2 + 2);\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00105fc3(undefined8 *param_1,undefined8 *param_2)" (identifier "FUN_00105fc3") (parameter_list "(undefined8 *param_1,undefined8 *param_2)" (( "(") (parameter_declaration "undefined8 *param_1" (type_identifier "undefined8") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined8 *param_2" (type_identifier "undefined8") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  char cVar1;\n  \n  if ((undefined8 *)*param_2 == param_2 + 3) {\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }\n  else {\n    *param_1 = (void *)*param_2;\n  }\n  param_1[1] = param_2[1];\n  cVar1 = *(char *)(param_2 + 2);\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }\n  return;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (if_statement "if ((undefined8 *)*param_2 == param_2 + 3) {\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }\n  else {\n    *param_1 = (void *)*param_2;\n  }" (if "if") (parenthesized_expression "((undefined8 *)*param_2 == param_2 + 3)" (( "(") (binary_expression "(undefined8 *)*param_2 == param_2 + 3" (cast_expression "(undefined8 *)*param_2" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (== "==") (binary_expression "param_2 + 3" (identifier "param_2") (+ "+") (number_literal "3"))) () ")")) (compound_statement "{\n    memcpy(param_1 + 3,param_2 + 3,param_2[1]);\n    *param_1 = param_1 + 3;\n  }" ({ "{") (expression_statement "memcpy(param_1 + 3,param_2 + 3,param_2[1]);" (call_expression "memcpy(param_1 + 3,param_2 + 3,param_2[1])" (identifier "memcpy") (argument_list "(param_1 + 3,param_2 + 3,param_2[1])" (( "(") (binary_expression "param_1 + 3" (identifier "param_1") (+ "+") (number_literal "3")) (, ",") (binary_expression "param_2 + 3" (identifier "param_2") (+ "+") (number_literal "3")) (, ",") (subscript_expression "param_2[1]" (identifier "param_2") ([ "[") (number_literal "1") (] "]")) () ")"))) (; ";")) (expression_statement "*param_1 = param_1 + 3;" (assignment_expression "*param_1 = param_1 + 3" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (binary_expression "param_1 + 3" (identifier "param_1") (+ "+") (number_literal "3"))) (; ";")) (} "}")) (else_clause "else {\n    *param_1 = (void *)*param_2;\n  }" (else "else") (compound_statement "{\n    *param_1 = (void *)*param_2;\n  }" ({ "{") (expression_statement "*param_1 = (void *)*param_2;" (assignment_expression "*param_1 = (void *)*param_2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(void *)*param_2" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_2" (* "*") (identifier "param_2")))) (; ";")) (} "}")))) (expression_statement "param_1[1] = param_2[1];" (assignment_expression "param_1[1] = param_2[1]" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (subscript_expression "param_2[1]" (identifier "param_2") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "cVar1 = *(char *)(param_2 + 2);" (assignment_expression "cVar1 = *(char *)(param_2 + 2)" (identifier "cVar1") (= "=") (pointer_expression "*(char *)(param_2 + 2)" (* "*") (cast_expression "(char *)(param_2 + 2)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 + 2)" (( "(") (binary_expression "param_2 + 2" (identifier "param_2") (+ "+") (number_literal "2")) () ")"))))) (; ";")) (expression_statement "*(char *)(param_1 + 2) = cVar1;" (assignment_expression "*(char *)(param_1 + 2) = cVar1" (pointer_expression "*(char *)(param_1 + 2)" (* "*") (cast_expression "(char *)(param_1 + 2)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 2)" (( "(") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2")) () ")")))) (= "=") (identifier "cVar1")) (; ";")) (if_statement "if (cVar1 != '\0') {\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }" (if "if") (parenthesized_expression "(cVar1 != '\0')" (( "(") (binary_expression "cVar1 != '\0'" (identifier "cVar1") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);\n  }" ({ "{") (expression_statement "*(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);" (assignment_expression "*(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14)" (pointer_expression "*(undefined4 *)((long)param_1 + 0x14)" (* "*") (cast_expression "(undefined4 *)((long)param_1 + 0x14)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_1 + 0x14)" (( "(") (binary_expression "(long)param_1 + 0x14" (cast_expression "(long)param_1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_1")) (+ "+") (number_literal "0x14")) () ")")))) (= "=") (pointer_expression "*(undefined4 *)((long)param_2 + 0x14)" (* "*") (cast_expression "(undefined4 *)((long)param_2 + 0x14)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_2 + 0x14)" (( "(") (binary_expression "(long)param_2 + 0x14" (cast_expression "(long)param_2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_2")) (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

void function_1(type_1 *new_mbc,type_1 *old_mbc)

{
  type_2 var_2;
  
  if (old_mbc->ptr == old_mbc->buf) {
    var_1(new_mbc->buf,old_mbc->buf,old_mbc->bytes);
    new_mbc->ptr = new_mbc->buf;
  }
  else {
    new_mbc->ptr = old_mbc->ptr;
  }
  new_mbc->bytes = old_mbc->bytes;
  var_2 = old_mbc->wc_valid;
  new_mbc->wc_valid = var_2;
  if (var_2 != false) {
    new_mbc->wc = old_mbc->wc;
  }
  return;
}


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

void MASKED(undefined8 *param_1,undefined8 *param_2)

{
  char cVar1;
  
  if ((undefined8 *)*param_2 == param_2 + 3) {
    memcpy(param_1 + 3,param_2 + 3,param_2[1]);
    *param_1 = param_1 + 3;
  }
  else {
    *param_1 = (void *)*param_2;
  }
  param_1[1] = param_2[1];
  cVar1 = *(char *)(param_2 + 2);
  *(char *)(param_1 + 2) = cVar1;
  if (cVar1 != '\0') {
    *(undefined4 *)((long)param_1 + 0x14) = *(undefined4 *)((long)param_2 + 0x14);
  }
  return;
}

