
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

void mb_copy(mbchar_t *new_mbc,mbchar_t *old_mbc)

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



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void FUN_00020390(undefined4 *param_1,undefined4 *param_2)

{
  char cVar1;
  undefined4 *__src;
  size_t __n;
  
  __src = (undefined4 *)*param_2;
  __n = param_2[1];
  if (__src == param_2 + 4) {
    memcpy(param_1 + 4,__src,__n);
    *param_1 = param_1 + 4;
    __n = param_2[1];
  }
  else {
    *param_1 = __src;
  }
  cVar1 = *(char *)(param_2 + 2);
  param_1[1] = __n;
  *(char *)(param_1 + 2) = cVar1;
  if (cVar1 != '\0') {
    param_1[3] = param_2[3];
  }
  return;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00012890
ADD EBX,0xcc67
SUB ESP,0xc
MOV ESI,dword ptr [ESP + 0x24]
MOV EDI,dword ptr [ESP + 0x20]
MOV EAX,dword ptr [ESI]
LEA ECX,[ESI + 0x10]
MOV EDX,dword ptr [ESI + 0x4]
CMP EAX,ECX
JZ 0x000203d8
MOV dword ptr [EDI],EAX
MOVZX EAX,byte ptr [ESI + 0x8]
MOV dword ptr [EDI + 0x4],EDX
MOV byte ptr [EDI + 0x8],AL
TEST AL,AL
JZ 0x000203cc
MOV EAX,dword ptr [ESI + 0xc]
MOV dword ptr [EDI + 0xc],EAX
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x4
LEA EBP,[EDI + 0x10]
PUSH EDX
PUSH EAX
PUSH EBP
CALL 0x000120f0
MOV dword ptr [EDI],EBP
MOV EDX,dword ptr [ESI + 0x4]
ADD ESP,0x10
JMP 0x000203b8
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_00020390(undefined4 *param_1,undefined4 *param_2)\n\n{\n  char cVar1;\n  undefined4 *__src;\n  size_t __n;\n  \n  __src = (undefined4 *)*param_2;\n  __n = param_2[1];\n  if (__src == param_2 + 4) {\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }\n  else {\n    *param_1 = __src;\n  }\n  cVar1 = *(char *)(param_2 + 2);\n  param_1[1] = __n;\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    param_1[3] = param_2[3];\n  }\n  return;\n}\n\n" comment (function_definition "void FUN_00020390(undefined4 *param_1,undefined4 *param_2)\n\n{\n  char cVar1;\n  undefined4 *__src;\n  size_t __n;\n  \n  __src = (undefined4 *)*param_2;\n  __n = param_2[1];\n  if (__src == param_2 + 4) {\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }\n  else {\n    *param_1 = __src;\n  }\n  cVar1 = *(char *)(param_2 + 2);\n  param_1[1] = __n;\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    param_1[3] = param_2[3];\n  }\n  return;\n}" primitive_type (function_declarator "FUN_00020390(undefined4 *param_1,undefined4 *param_2)" identifier (parameter_list "(undefined4 *param_1,undefined4 *param_2)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  undefined4 *__src;\n  size_t __n;\n  \n  __src = (undefined4 *)*param_2;\n  __n = param_2[1];\n  if (__src == param_2 + 4) {\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }\n  else {\n    *param_1 = __src;\n  }\n  cVar1 = *(char *)(param_2 + 2);\n  param_1[1] = __n;\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    param_1[3] = param_2[3];\n  }\n  return;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "undefined4 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (expression_statement "__src = (undefined4 *)*param_2;" (assignment_expression "__src = (undefined4 *)*param_2" identifier = (cast_expression "(undefined4 *)*param_2" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) (expression_statement "__n = param_2[1];" (assignment_expression "__n = param_2[1]" identifier = (subscript_expression "param_2[1]" identifier [ number_literal ])) ;) (if_statement "if (__src == param_2 + 4) {\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }\n  else {\n    *param_1 = __src;\n  }" if (parenthesized_expression "(__src == param_2 + 4)" ( (binary_expression "__src == param_2 + 4" identifier == (binary_expression "param_2 + 4" identifier + number_literal)) )) (compound_statement "{\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }" { (expression_statement "memcpy(param_1 + 4,__src,__n);" (call_expression "memcpy(param_1 + 4,__src,__n)" identifier (argument_list "(param_1 + 4,__src,__n)" ( (binary_expression "param_1 + 4" identifier + number_literal) , identifier , identifier ))) ;) (expression_statement "*param_1 = param_1 + 4;" (assignment_expression "*param_1 = param_1 + 4" (pointer_expression "*param_1" * identifier) = (binary_expression "param_1 + 4" identifier + number_literal)) ;) (expression_statement "__n = param_2[1];" (assignment_expression "__n = param_2[1]" identifier = (subscript_expression "param_2[1]" identifier [ number_literal ])) ;) }) (else_clause "else {\n    *param_1 = __src;\n  }" else (compound_statement "{\n    *param_1 = __src;\n  }" { (expression_statement "*param_1 = __src;" (assignment_expression "*param_1 = __src" (pointer_expression "*param_1" * identifier) = identifier) ;) }))) (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 "param_1[1] = __n;" (assignment_expression "param_1[1] = __n" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (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    param_1[3] = param_2[3];\n  }" if (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    param_1[3] = param_2[3];\n  }" { (expression_statement "param_1[3] = param_2[3];" (assignment_expression "param_1[3] = param_2[3]" (subscript_expression "param_1[3]" identifier [ number_literal ]) = (subscript_expression "param_2[3]" identifier [ number_literal ])) ;) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nvoid mb_copy(mbchar_t *new_mbc,mbchar_t *old_mbc)\n\n{\n  _Bool _Var1;\n  char *__src;\n  size_t __n;\n  \n  __src = old_mbc->ptr;\n  __n = old_mbc->bytes;\n  if (__src == old_mbc->buf) {\n    memcpy(new_mbc->buf,__src,__n);\n    new_mbc->ptr = new_mbc->buf;\n    __n = old_mbc->bytes;\n  }\n  else {\n    new_mbc->ptr = __src;\n  }\n  _Var1 = old_mbc->wc_valid;\n  new_mbc->bytes = __n;\n  new_mbc->wc_valid = _Var1;\n  if (_Var1 != false) {\n    new_mbc->wc = old_mbc->wc;\n  }\n  return;\n}\n\n" comment comment (function_definition "void mb_copy(mbchar_t *new_mbc,mbchar_t *old_mbc)\n\n{\n  _Bool _Var1;\n  char *__src;\n  size_t __n;\n  \n  __src = old_mbc->ptr;\n  __n = old_mbc->bytes;\n  if (__src == old_mbc->buf) {\n    memcpy(new_mbc->buf,__src,__n);\n    new_mbc->ptr = new_mbc->buf;\n    __n = old_mbc->bytes;\n  }\n  else {\n    new_mbc->ptr = __src;\n  }\n  _Var1 = old_mbc->wc_valid;\n  new_mbc->bytes = __n;\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  char *__src;\n  size_t __n;\n  \n  __src = old_mbc->ptr;\n  __n = old_mbc->bytes;\n  if (__src == old_mbc->buf) {\n    memcpy(new_mbc->buf,__src,__n);\n    new_mbc->ptr = new_mbc->buf;\n    __n = old_mbc->bytes;\n  }\n  else {\n    new_mbc->ptr = __src;\n  }\n  _Var1 = old_mbc->wc_valid;\n  new_mbc->bytes = __n;\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 ;) (declaration "char *__src;" primitive_type (pointer_declarator "*__src" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (expression_statement "__src = old_mbc->ptr;" (assignment_expression "__src = old_mbc->ptr" identifier = (field_expression "old_mbc->ptr" identifier -> field_identifier)) ;) (expression_statement "__n = old_mbc->bytes;" (assignment_expression "__n = old_mbc->bytes" identifier = (field_expression "old_mbc->bytes" identifier -> field_identifier)) ;) (if_statement "if (__src == old_mbc->buf) {\n    memcpy(new_mbc->buf,__src,__n);\n    new_mbc->ptr = new_mbc->buf;\n    __n = old_mbc->bytes;\n  }\n  else {\n    new_mbc->ptr = __src;\n  }" if (parenthesized_expression "(__src == old_mbc->buf)" ( (binary_expression "__src == old_mbc->buf" identifier == (field_expression "old_mbc->buf" identifier -> field_identifier)) )) (compound_statement "{\n    memcpy(new_mbc->buf,__src,__n);\n    new_mbc->ptr = new_mbc->buf;\n    __n = old_mbc->bytes;\n  }" { (expression_statement "memcpy(new_mbc->buf,__src,__n);" (call_expression "memcpy(new_mbc->buf,__src,__n)" identifier (argument_list "(new_mbc->buf,__src,__n)" ( (field_expression "new_mbc->buf" identifier -> field_identifier) , identifier , 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)) ;) (expression_statement "__n = old_mbc->bytes;" (assignment_expression "__n = old_mbc->bytes" identifier = (field_expression "old_mbc->bytes" identifier -> field_identifier)) ;) }) (else_clause "else {\n    new_mbc->ptr = __src;\n  }" else (compound_statement "{\n    new_mbc->ptr = __src;\n  }" { (expression_statement "new_mbc->ptr = __src;" (assignment_expression "new_mbc->ptr = __src" (field_expression "new_mbc->ptr" identifier -> field_identifier) = 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->bytes = __n;" (assignment_expression "new_mbc->bytes = __n" (field_expression "new_mbc->bytes" identifier -> field_identifier) = 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_00020390(undefined4 *param_1,undefined4 *param_2)\n\n{\n  char cVar1;\n  undefined4 *__src;\n  size_t __n;\n  \n  __src = (undefined4 *)*param_2;\n  __n = param_2[1];\n  if (__src == param_2 + 4) {\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }\n  else {\n    *param_1 = __src;\n  }\n  cVar1 = *(char *)(param_2 + 2);\n  param_1[1] = __n;\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    param_1[3] = param_2[3];\n  }\n  return;\n}\n\n" (function_definition "void FUN_00020390(undefined4 *param_1,undefined4 *param_2)\n\n{\n  char cVar1;\n  undefined4 *__src;\n  size_t __n;\n  \n  __src = (undefined4 *)*param_2;\n  __n = param_2[1];\n  if (__src == param_2 + 4) {\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }\n  else {\n    *param_1 = __src;\n  }\n  cVar1 = *(char *)(param_2 + 2);\n  param_1[1] = __n;\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    param_1[3] = param_2[3];\n  }\n  return;\n}" primitive_type (function_declarator "FUN_00020390(undefined4 *param_1,undefined4 *param_2)" identifier (parameter_list "(undefined4 *param_1,undefined4 *param_2)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  undefined4 *__src;\n  size_t __n;\n  \n  __src = (undefined4 *)*param_2;\n  __n = param_2[1];\n  if (__src == param_2 + 4) {\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }\n  else {\n    *param_1 = __src;\n  }\n  cVar1 = *(char *)(param_2 + 2);\n  param_1[1] = __n;\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    param_1[3] = param_2[3];\n  }\n  return;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "undefined4 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (expression_statement "__src = (undefined4 *)*param_2;" (assignment_expression "__src = (undefined4 *)*param_2" identifier = (cast_expression "(undefined4 *)*param_2" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) (expression_statement "__n = param_2[1];" (assignment_expression "__n = param_2[1]" identifier = (subscript_expression "param_2[1]" identifier [ number_literal ])) ;) (if_statement "if (__src == param_2 + 4) {\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }\n  else {\n    *param_1 = __src;\n  }" if (parenthesized_expression "(__src == param_2 + 4)" ( (binary_expression "__src == param_2 + 4" identifier == (binary_expression "param_2 + 4" identifier + number_literal)) )) (compound_statement "{\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }" { (expression_statement "memcpy(param_1 + 4,__src,__n);" (call_expression "memcpy(param_1 + 4,__src,__n)" identifier (argument_list "(param_1 + 4,__src,__n)" ( (binary_expression "param_1 + 4" identifier + number_literal) , identifier , identifier ))) ;) (expression_statement "*param_1 = param_1 + 4;" (assignment_expression "*param_1 = param_1 + 4" (pointer_expression "*param_1" * identifier) = (binary_expression "param_1 + 4" identifier + number_literal)) ;) (expression_statement "__n = param_2[1];" (assignment_expression "__n = param_2[1]" identifier = (subscript_expression "param_2[1]" identifier [ number_literal ])) ;) }) (else_clause "else {\n    *param_1 = __src;\n  }" else (compound_statement "{\n    *param_1 = __src;\n  }" { (expression_statement "*param_1 = __src;" (assignment_expression "*param_1 = __src" (pointer_expression "*param_1" * identifier) = identifier) ;) }))) (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 "param_1[1] = __n;" (assignment_expression "param_1[1] = __n" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (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    param_1[3] = param_2[3];\n  }" if (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    param_1[3] = param_2[3];\n  }" { (expression_statement "param_1[3] = param_2[3];" (assignment_expression "param_1[3] = param_2[3]" (subscript_expression "param_1[3]" identifier [ number_literal ]) = (subscript_expression "param_2[3]" 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 ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (binary_expression IDENT + LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , IDENT , IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) }))) (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 (subscript_expression IDENT [ LIT ]) = IDENT) ;) (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 (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) })) (return_statement return ;) })))
(function_definition "void FUN_00020390(undefined4 *param_1,undefined4 *param_2)\n\n{\n  char cVar1;\n  undefined4 *__src;\n  size_t __n;\n  \n  __src = (undefined4 *)*param_2;\n  __n = param_2[1];\n  if (__src == param_2 + 4) {\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }\n  else {\n    *param_1 = __src;\n  }\n  cVar1 = *(char *)(param_2 + 2);\n  param_1[1] = __n;\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    param_1[3] = param_2[3];\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00020390(undefined4 *param_1,undefined4 *param_2)" (identifier "FUN_00020390") (parameter_list "(undefined4 *param_1,undefined4 *param_2)" (( "(") (parameter_declaration "undefined4 *param_1" (type_identifier "undefined4") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 *param_2" (type_identifier "undefined4") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  char cVar1;\n  undefined4 *__src;\n  size_t __n;\n  \n  __src = (undefined4 *)*param_2;\n  __n = param_2[1];\n  if (__src == param_2 + 4) {\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }\n  else {\n    *param_1 = __src;\n  }\n  cVar1 = *(char *)(param_2 + 2);\n  param_1[1] = __n;\n  *(char *)(param_1 + 2) = cVar1;\n  if (cVar1 != '\0') {\n    param_1[3] = param_2[3];\n  }\n  return;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "undefined4 *__src;" (type_identifier "undefined4") (pointer_declarator "*__src" (* "*") (identifier "__src")) (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (expression_statement "__src = (undefined4 *)*param_2;" (assignment_expression "__src = (undefined4 *)*param_2" (identifier "__src") (= "=") (cast_expression "(undefined4 *)*param_2" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_2" (* "*") (identifier "param_2")))) (; ";")) (expression_statement "__n = param_2[1];" (assignment_expression "__n = param_2[1]" (identifier "__n") (= "=") (subscript_expression "param_2[1]" (identifier "param_2") ([ "[") (number_literal "1") (] "]"))) (; ";")) (if_statement "if (__src == param_2 + 4) {\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }\n  else {\n    *param_1 = __src;\n  }" (if "if") (parenthesized_expression "(__src == param_2 + 4)" (( "(") (binary_expression "__src == param_2 + 4" (identifier "__src") (== "==") (binary_expression "param_2 + 4" (identifier "param_2") (+ "+") (number_literal "4"))) () ")")) (compound_statement "{\n    memcpy(param_1 + 4,__src,__n);\n    *param_1 = param_1 + 4;\n    __n = param_2[1];\n  }" ({ "{") (expression_statement "memcpy(param_1 + 4,__src,__n);" (call_expression "memcpy(param_1 + 4,__src,__n)" (identifier "memcpy") (argument_list "(param_1 + 4,__src,__n)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) (, ",") (identifier "__src") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "*param_1 = param_1 + 4;" (assignment_expression "*param_1 = param_1 + 4" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4"))) (; ";")) (expression_statement "__n = param_2[1];" (assignment_expression "__n = param_2[1]" (identifier "__n") (= "=") (subscript_expression "param_2[1]" (identifier "param_2") ([ "[") (number_literal "1") (] "]"))) (; ";")) (} "}")) (else_clause "else {\n    *param_1 = __src;\n  }" (else "else") (compound_statement "{\n    *param_1 = __src;\n  }" ({ "{") (expression_statement "*param_1 = __src;" (assignment_expression "*param_1 = __src" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "__src")) (; ";")) (} "}")))) (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 "param_1[1] = __n;" (assignment_expression "param_1[1] = __n" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "__n")) (; ";")) (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    param_1[3] = param_2[3];\n  }" (if "if") (parenthesized_expression "(cVar1 != '\0')" (( "(") (binary_expression "cVar1 != '\0'" (identifier "cVar1") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    param_1[3] = param_2[3];\n  }" ({ "{") (expression_statement "param_1[3] = param_2[3];" (assignment_expression "param_1[3] = param_2[3]" (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (= "=") (subscript_expression "param_2[3]" (identifier "param_2") ([ "[") (number_literal "3") (] "]"))) (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

void function_1(type_1 *new_mbc,type_1 *old_mbc)

{
  type_2 var_3;
  char *var_1;
  size_t __n;
  
  var_1 = old_mbc->ptr;
  __n = old_mbc->bytes;
  if (var_1 == old_mbc->buf) {
    var_2(new_mbc->buf,var_1,__n);
    new_mbc->ptr = new_mbc->buf;
    __n = old_mbc->bytes;
  }
  else {
    new_mbc->ptr = var_1;
  }
  var_3 = old_mbc->wc_valid;
  new_mbc->bytes = __n;
  new_mbc->wc_valid = var_3;
  if (var_3 != 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)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (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)) (identifier) (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier)))))) (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: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (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: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal)))))) (return_statement))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void MASKED(undefined4 *param_1,undefined4 *param_2)

{
  char cVar1;
  undefined4 *__src;
  size_t __n;
  
  __src = (undefined4 *)*param_2;
  __n = param_2[1];
  if (__src == param_2 + 4) {
    memcpy(param_1 + 4,__src,__n);
    *param_1 = param_1 + 4;
    __n = param_2[1];
  }
  else {
    *param_1 = __src;
  }
  cVar1 = *(char *)(param_2 + 2);
  param_1[1] = __n;
  *(char *)(param_1 + 2) = cVar1;
  if (cVar1 != '\0') {
    param_1[3] = param_2[3];
  }
  return;
}

