
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

size_t encoder_nop_read(char *buffer,size_t size,_Bool ateof,curl_mimepart *part)

{
  size_t sVar1;
  uint __n;
  
  sVar1 = (part->encstate).bufbeg;
  __n = (part->encstate).bufend - sVar1;
  if (size < __n) {
    __n = size;
  }
  if (__n == 0) {
    (part->encstate).bufbeg = sVar1;
    return 0;
  }
  memcpy(buffer,(part->encstate).buf,__n);
  (part->encstate).bufbeg = (part->encstate).bufbeg + __n;
  return __n;
}



size_t __regparm2
FUN_00066b30(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,
            undefined4 param_5,int param_6)

{
  uint __n;
  void *unaff_retaddr;
  
  entry(param_2,0x66b3c);
  __n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);
  if (param_3 < __n) {
    __n = param_3;
  }
  if (__n == 0) {
    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);
    return 0;
  }
  memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);
  *(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;
  return __n;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV EDI,dword ptr [ESP + 0x1c]
CALL 0x00019ed0
ADD EBX,0x49ca4
MOV EDX,dword ptr [ESP + 0x14]
MOV EAX,dword ptr [EDI + 0x5c]
MOV ESI,dword ptr [EDI + 0x60]
SUB ESI,EAX
CMP ESI,EDX
CMOVA ESI,EDX
TEST ESI,ESI
JNZ 0x00066b68
ADD EAX,ESI
MOV dword ptr [EDI + 0x5c],EAX
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
RET
SUB ESP,0x4
LEA EAX,[EDI + 0x64]
PUSH ESI
PUSH EAX
PUSH dword ptr [ESP + 0x1c]
CALL 0x00018750
MOV EAX,dword ptr [EDI + 0x5c]
ADD ESP,0x10
ADD EAX,ESI
MOV dword ptr [EDI + 0x5c],EAX
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
RET
(translation_unit "size_t __regparm2\nFUN_00066b30(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,\n            undefined4 param_5,int param_6)\n\n{\n  uint __n;\n  void *unaff_retaddr;\n  \n  entry(param_2,0x66b3c);\n  __n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);\n  if (param_3 < __n) {\n    __n = param_3;\n  }\n  if (__n == 0) {\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }\n  memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);\n  *(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;\n  return __n;\n}\n\n" (function_definition "size_t __regparm2\nFUN_00066b30(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,\n            undefined4 param_5,int param_6)\n\n{\n  uint __n;\n  void *unaff_retaddr;\n  \n  entry(param_2,0x66b3c);\n  __n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);\n  if (param_3 < __n) {\n    __n = param_3;\n  }\n  if (__n == 0) {\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }\n  memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);\n  *(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;\n  return __n;\n}" primitive_type (ERROR "__regparm2" identifier) (function_declarator "FUN_00066b30(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,\n            undefined4 param_5,int param_6)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,\n            undefined4 param_5,int param_6)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "undefined4 param_5" type_identifier identifier) , (parameter_declaration "int param_6" primitive_type identifier) ))) (compound_statement "{\n  uint __n;\n  void *unaff_retaddr;\n  \n  entry(param_2,0x66b3c);\n  __n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);\n  if (param_3 < __n) {\n    __n = param_3;\n  }\n  if (__n == 0) {\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }\n  memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);\n  *(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;\n  return __n;\n}" { (declaration "uint __n;" type_identifier identifier ;) (declaration "void *unaff_retaddr;" primitive_type (pointer_declarator "*unaff_retaddr" * identifier) ;) (expression_statement "entry(param_2,0x66b3c);" (call_expression "entry(param_2,0x66b3c)" identifier (argument_list "(param_2,0x66b3c)" ( identifier , number_literal ))) ;) (expression_statement "__n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);" (assignment_expression "__n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c)" identifier = (binary_expression "*(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c)" (pointer_expression "*(int *)(param_6 + 0x60)" * (cast_expression "(int *)(param_6 + 0x60)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 0x60)" ( (binary_expression "param_6 + 0x60" identifier + number_literal) )))) - (pointer_expression "*(int *)(param_6 + 0x5c)" * (cast_expression "(int *)(param_6 + 0x5c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 0x5c)" ( (binary_expression "param_6 + 0x5c" identifier + number_literal) )))))) ;) (if_statement "if (param_3 < __n) {\n    __n = param_3;\n  }" if (parenthesized_expression "(param_3 < __n)" ( (binary_expression "param_3 < __n" identifier < identifier) )) (compound_statement "{\n    __n = param_3;\n  }" { (expression_statement "__n = param_3;" (assignment_expression "__n = param_3" identifier = identifier) ;) })) (if_statement "if (__n == 0) {\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }" if (parenthesized_expression "(__n == 0)" ( (binary_expression "__n == 0" identifier == number_literal) )) (compound_statement "{\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }" { (expression_statement "*(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);" (assignment_expression "*(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c)" (pointer_expression "*(int *)(param_6 + 0x5c)" * (cast_expression "(int *)(param_6 + 0x5c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 0x5c)" ( (binary_expression "param_6 + 0x5c" identifier + number_literal) )))) = (pointer_expression "*(int *)(param_6 + 0x5c)" * (cast_expression "(int *)(param_6 + 0x5c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 0x5c)" ( (binary_expression "param_6 + 0x5c" identifier + number_literal) ))))) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);" (call_expression "memcpy(unaff_retaddr,(void *)(param_6 + 100),__n)" identifier (argument_list "(unaff_retaddr,(void *)(param_6 + 100),__n)" ( identifier , (cast_expression "(void *)(param_6 + 100)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 100)" ( (binary_expression "param_6 + 100" identifier + number_literal) ))) , identifier ))) ;) (expression_statement "*(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;" (assignment_expression "*(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n" (pointer_expression "*(uint *)(param_6 + 0x5c)" * (cast_expression "(uint *)(param_6 + 0x5c)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 0x5c)" ( (binary_expression "param_6 + 0x5c" identifier + number_literal) )))) = (binary_expression "*(int *)(param_6 + 0x5c) + __n" (pointer_expression "*(int *)(param_6 + 0x5c)" * (cast_expression "(int *)(param_6 + 0x5c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 0x5c)" ( (binary_expression "param_6 + 0x5c" identifier + number_literal) )))) + identifier)) ;) (return_statement "return __n;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nsize_t encoder_nop_read(char *buffer,size_t size,_Bool ateof,curl_mimepart *part)\n\n{\n  size_t sVar1;\n  uint __n;\n  \n  sVar1 = (part->encstate).bufbeg;\n  __n = (part->encstate).bufend - sVar1;\n  if (size < __n) {\n    __n = size;\n  }\n  if (__n == 0) {\n    (part->encstate).bufbeg = sVar1;\n    return 0;\n  }\n  memcpy(buffer,(part->encstate).buf,__n);\n  (part->encstate).bufbeg = (part->encstate).bufbeg + __n;\n  return __n;\n}\n\n" comment comment (function_definition "size_t encoder_nop_read(char *buffer,size_t size,_Bool ateof,curl_mimepart *part)\n\n{\n  size_t sVar1;\n  uint __n;\n  \n  sVar1 = (part->encstate).bufbeg;\n  __n = (part->encstate).bufend - sVar1;\n  if (size < __n) {\n    __n = size;\n  }\n  if (__n == 0) {\n    (part->encstate).bufbeg = sVar1;\n    return 0;\n  }\n  memcpy(buffer,(part->encstate).buf,__n);\n  (part->encstate).bufbeg = (part->encstate).bufbeg + __n;\n  return __n;\n}" primitive_type (function_declarator "encoder_nop_read(char *buffer,size_t size,_Bool ateof,curl_mimepart *part)" identifier (parameter_list "(char *buffer,size_t size,_Bool ateof,curl_mimepart *part)" ( (parameter_declaration "char *buffer" primitive_type (pointer_declarator "*buffer" * identifier)) , (parameter_declaration "size_t size" primitive_type identifier) , (parameter_declaration "_Bool ateof" type_identifier identifier) , (parameter_declaration "curl_mimepart *part" type_identifier (pointer_declarator "*part" * identifier)) ))) (compound_statement "{\n  size_t sVar1;\n  uint __n;\n  \n  sVar1 = (part->encstate).bufbeg;\n  __n = (part->encstate).bufend - sVar1;\n  if (size < __n) {\n    __n = size;\n  }\n  if (__n == 0) {\n    (part->encstate).bufbeg = sVar1;\n    return 0;\n  }\n  memcpy(buffer,(part->encstate).buf,__n);\n  (part->encstate).bufbeg = (part->encstate).bufbeg + __n;\n  return __n;\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "uint __n;" type_identifier identifier ;) (expression_statement "sVar1 = (part->encstate).bufbeg;" (assignment_expression "sVar1 = (part->encstate).bufbeg" identifier = (field_expression "(part->encstate).bufbeg" (parenthesized_expression "(part->encstate)" ( (field_expression "part->encstate" identifier -> field_identifier) )) . field_identifier)) ;) (expression_statement "__n = (part->encstate).bufend - sVar1;" (assignment_expression "__n = (part->encstate).bufend - sVar1" identifier = (binary_expression "(part->encstate).bufend - sVar1" (field_expression "(part->encstate).bufend" (parenthesized_expression "(part->encstate)" ( (field_expression "part->encstate" identifier -> field_identifier) )) . field_identifier) - identifier)) ;) (if_statement "if (size < __n) {\n    __n = size;\n  }" if (parenthesized_expression "(size < __n)" ( (binary_expression "size < __n" identifier < identifier) )) (compound_statement "{\n    __n = size;\n  }" { (expression_statement "__n = size;" (assignment_expression "__n = size" identifier = identifier) ;) })) (if_statement "if (__n == 0) {\n    (part->encstate).bufbeg = sVar1;\n    return 0;\n  }" if (parenthesized_expression "(__n == 0)" ( (binary_expression "__n == 0" identifier == number_literal) )) (compound_statement "{\n    (part->encstate).bufbeg = sVar1;\n    return 0;\n  }" { (expression_statement "(part->encstate).bufbeg = sVar1;" (assignment_expression "(part->encstate).bufbeg = sVar1" (field_expression "(part->encstate).bufbeg" (parenthesized_expression "(part->encstate)" ( (field_expression "part->encstate" identifier -> field_identifier) )) . field_identifier) = identifier) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "memcpy(buffer,(part->encstate).buf,__n);" (call_expression "memcpy(buffer,(part->encstate).buf,__n)" identifier (argument_list "(buffer,(part->encstate).buf,__n)" ( identifier , (field_expression "(part->encstate).buf" (parenthesized_expression "(part->encstate)" ( (field_expression "part->encstate" identifier -> field_identifier) )) . field_identifier) , identifier ))) ;) (expression_statement "(part->encstate).bufbeg = (part->encstate).bufbeg + __n;" (assignment_expression "(part->encstate).bufbeg = (part->encstate).bufbeg + __n" (field_expression "(part->encstate).bufbeg" (parenthesized_expression "(part->encstate)" ( (field_expression "part->encstate" identifier -> field_identifier) )) . field_identifier) = (binary_expression "(part->encstate).bufbeg + __n" (field_expression "(part->encstate).bufbeg" (parenthesized_expression "(part->encstate)" ( (field_expression "part->encstate" identifier -> field_identifier) )) . field_identifier) + identifier)) ;) (return_statement "return __n;" return identifier ;) })))
(translation_unit "size_t __regparm2\nFUN_00066b30(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,\n            undefined4 param_5,int param_6)\n\n{\n  uint __n;\n  void *unaff_retaddr;\n  \n  entry(param_2,0x66b3c);\n  __n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);\n  if (param_3 < __n) {\n    __n = param_3;\n  }\n  if (__n == 0) {\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }\n  memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);\n  *(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;\n  return __n;\n}\n\n" (function_definition "size_t __regparm2\nFUN_00066b30(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,\n            undefined4 param_5,int param_6)\n\n{\n  uint __n;\n  void *unaff_retaddr;\n  \n  entry(param_2,0x66b3c);\n  __n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);\n  if (param_3 < __n) {\n    __n = param_3;\n  }\n  if (__n == 0) {\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }\n  memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);\n  *(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;\n  return __n;\n}" primitive_type (ERROR "__regparm2" identifier) (function_declarator "FUN_00066b30(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,\n            undefined4 param_5,int param_6)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,\n            undefined4 param_5,int param_6)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "undefined4 param_5" type_identifier identifier) , (parameter_declaration "int param_6" primitive_type identifier) ))) (compound_statement "{\n  uint __n;\n  void *unaff_retaddr;\n  \n  entry(param_2,0x66b3c);\n  __n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);\n  if (param_3 < __n) {\n    __n = param_3;\n  }\n  if (__n == 0) {\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }\n  memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);\n  *(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;\n  return __n;\n}" { (declaration "uint __n;" type_identifier identifier ;) (declaration "void *unaff_retaddr;" primitive_type (pointer_declarator "*unaff_retaddr" * identifier) ;) (expression_statement "entry(param_2,0x66b3c);" (call_expression "entry(param_2,0x66b3c)" identifier (argument_list "(param_2,0x66b3c)" ( identifier , number_literal ))) ;) (expression_statement "__n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);" (assignment_expression "__n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c)" identifier = (binary_expression "*(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c)" (pointer_expression "*(int *)(param_6 + 0x60)" * (cast_expression "(int *)(param_6 + 0x60)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 0x60)" ( (binary_expression "param_6 + 0x60" identifier + number_literal) )))) - (pointer_expression "*(int *)(param_6 + 0x5c)" * (cast_expression "(int *)(param_6 + 0x5c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 0x5c)" ( (binary_expression "param_6 + 0x5c" identifier + number_literal) )))))) ;) (if_statement "if (param_3 < __n) {\n    __n = param_3;\n  }" if (parenthesized_expression "(param_3 < __n)" ( (binary_expression "param_3 < __n" identifier < identifier) )) (compound_statement "{\n    __n = param_3;\n  }" { (expression_statement "__n = param_3;" (assignment_expression "__n = param_3" identifier = identifier) ;) })) (if_statement "if (__n == 0) {\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }" if (parenthesized_expression "(__n == 0)" ( (binary_expression "__n == 0" identifier == number_literal) )) (compound_statement "{\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }" { (expression_statement "*(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);" (assignment_expression "*(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c)" (pointer_expression "*(int *)(param_6 + 0x5c)" * (cast_expression "(int *)(param_6 + 0x5c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 0x5c)" ( (binary_expression "param_6 + 0x5c" identifier + number_literal) )))) = (pointer_expression "*(int *)(param_6 + 0x5c)" * (cast_expression "(int *)(param_6 + 0x5c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 0x5c)" ( (binary_expression "param_6 + 0x5c" identifier + number_literal) ))))) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);" (call_expression "memcpy(unaff_retaddr,(void *)(param_6 + 100),__n)" identifier (argument_list "(unaff_retaddr,(void *)(param_6 + 100),__n)" ( identifier , (cast_expression "(void *)(param_6 + 100)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 100)" ( (binary_expression "param_6 + 100" identifier + number_literal) ))) , identifier ))) ;) (expression_statement "*(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;" (assignment_expression "*(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n" (pointer_expression "*(uint *)(param_6 + 0x5c)" * (cast_expression "(uint *)(param_6 + 0x5c)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 0x5c)" ( (binary_expression "param_6 + 0x5c" identifier + number_literal) )))) = (binary_expression "*(int *)(param_6 + 0x5c) + __n" (pointer_expression "*(int *)(param_6 + 0x5c)" * (cast_expression "(int *)(param_6 + 0x5c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_6 + 0x5c)" ( (binary_expression "param_6 + 0x5c" identifier + number_literal) )))) + identifier)) ;) (return_statement "return __n;" return identifier ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT ))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (return_statement return LIT ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))) , IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + IDENT)) ;) (return_statement return IDENT ;) })))
(function_definition "size_t __regparm2\nFUN_00066b30(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,\n            undefined4 param_5,int param_6)\n\n{\n  uint __n;\n  void *unaff_retaddr;\n  \n  entry(param_2,0x66b3c);\n  __n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);\n  if (param_3 < __n) {\n    __n = param_3;\n  }\n  if (__n == 0) {\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }\n  memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);\n  *(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;\n  return __n;\n}" (primitive_type "size_t") (ERROR "__regparm2" (identifier "__regparm2")) (function_declarator "FUN_00066b30(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,\n            undefined4 param_5,int param_6)" (identifier "FUN_00066b30") (parameter_list "(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,\n            undefined4 param_5,int param_6)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) (, ",") (parameter_declaration "undefined4 param_5" (type_identifier "undefined4") (identifier "param_5")) (, ",") (parameter_declaration "int param_6" (primitive_type "int") (identifier "param_6")) () ")"))) (compound_statement "{\n  uint __n;\n  void *unaff_retaddr;\n  \n  entry(param_2,0x66b3c);\n  __n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);\n  if (param_3 < __n) {\n    __n = param_3;\n  }\n  if (__n == 0) {\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }\n  memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);\n  *(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;\n  return __n;\n}" ({ "{") (declaration "uint __n;" (type_identifier "uint") (identifier "__n") (; ";")) (declaration "void *unaff_retaddr;" (primitive_type "void") (pointer_declarator "*unaff_retaddr" (* "*") (identifier "unaff_retaddr")) (; ";")) (expression_statement "entry(param_2,0x66b3c);" (call_expression "entry(param_2,0x66b3c)" (identifier "entry") (argument_list "(param_2,0x66b3c)" (( "(") (identifier "param_2") (, ",") (number_literal "0x66b3c") () ")"))) (; ";")) (expression_statement "__n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);" (assignment_expression "__n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c)" (identifier "__n") (= "=") (binary_expression "*(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c)" (pointer_expression "*(int *)(param_6 + 0x60)" (* "*") (cast_expression "(int *)(param_6 + 0x60)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_6 + 0x60)" (( "(") (binary_expression "param_6 + 0x60" (identifier "param_6") (+ "+") (number_literal "0x60")) () ")")))) (- "-") (pointer_expression "*(int *)(param_6 + 0x5c)" (* "*") (cast_expression "(int *)(param_6 + 0x5c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_6 + 0x5c)" (( "(") (binary_expression "param_6 + 0x5c" (identifier "param_6") (+ "+") (number_literal "0x5c")) () ")")))))) (; ";")) (if_statement "if (param_3 < __n) {\n    __n = param_3;\n  }" (if "if") (parenthesized_expression "(param_3 < __n)" (( "(") (binary_expression "param_3 < __n" (identifier "param_3") (< "<") (identifier "__n")) () ")")) (compound_statement "{\n    __n = param_3;\n  }" ({ "{") (expression_statement "__n = param_3;" (assignment_expression "__n = param_3" (identifier "__n") (= "=") (identifier "param_3")) (; ";")) (} "}"))) (if_statement "if (__n == 0) {\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }" (if "if") (parenthesized_expression "(__n == 0)" (( "(") (binary_expression "__n == 0" (identifier "__n") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);\n    return 0;\n  }" ({ "{") (expression_statement "*(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);" (assignment_expression "*(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c)" (pointer_expression "*(int *)(param_6 + 0x5c)" (* "*") (cast_expression "(int *)(param_6 + 0x5c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_6 + 0x5c)" (( "(") (binary_expression "param_6 + 0x5c" (identifier "param_6") (+ "+") (number_literal "0x5c")) () ")")))) (= "=") (pointer_expression "*(int *)(param_6 + 0x5c)" (* "*") (cast_expression "(int *)(param_6 + 0x5c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_6 + 0x5c)" (( "(") (binary_expression "param_6 + 0x5c" (identifier "param_6") (+ "+") (number_literal "0x5c")) () ")"))))) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);" (call_expression "memcpy(unaff_retaddr,(void *)(param_6 + 100),__n)" (identifier "memcpy") (argument_list "(unaff_retaddr,(void *)(param_6 + 100),__n)" (( "(") (identifier "unaff_retaddr") (, ",") (cast_expression "(void *)(param_6 + 100)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_6 + 100)" (( "(") (binary_expression "param_6 + 100" (identifier "param_6") (+ "+") (number_literal "100")) () ")"))) (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "*(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;" (assignment_expression "*(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n" (pointer_expression "*(uint *)(param_6 + 0x5c)" (* "*") (cast_expression "(uint *)(param_6 + 0x5c)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_6 + 0x5c)" (( "(") (binary_expression "param_6 + 0x5c" (identifier "param_6") (+ "+") (number_literal "0x5c")) () ")")))) (= "=") (binary_expression "*(int *)(param_6 + 0x5c) + __n" (pointer_expression "*(int *)(param_6 + 0x5c)" (* "*") (cast_expression "(int *)(param_6 + 0x5c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_6 + 0x5c)" (( "(") (binary_expression "param_6 + 0x5c" (identifier "param_6") (+ "+") (number_literal "0x5c")) () ")")))) (+ "+") (identifier "__n"))) (; ";")) (return_statement "return __n;" (return "return") (identifier "__n") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

size_t function_1(char *buffer,size_t var_2,type_1 ateof,type_2 *part)

{
  size_t var_1;
  type_3 var_3;
  
  var_1 = (part->encstate).bufbeg;
  var_3 = (part->encstate).bufend - var_1;
  if (var_2 < var_3) {
    var_3 = var_2;
  }
  if (var_3 == 0) {
    (part->encstate).bufbeg = var_1;
    return 0;
  }
  var_4(buffer,(part->encstate).buf,var_3);
  (part->encstate).bufbeg = (part->encstate).bufbeg + var_3;
  return var_3;
}


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

size_t __regparm2
MASKED(undefined4 param_1,undefined4 param_2,uint param_3,undefined4 param_4,
            undefined4 param_5,int param_6)

{
  uint __n;
  void *unaff_retaddr;
  
  entry(param_2,0x66b3c);
  __n = *(int *)(param_6 + 0x60) - *(int *)(param_6 + 0x5c);
  if (param_3 < __n) {
    __n = param_3;
  }
  if (__n == 0) {
    *(int *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c);
    return 0;
  }
  memcpy(unaff_retaddr,(void *)(param_6 + 100),__n);
  *(uint *)(param_6 + 0x5c) = *(int *)(param_6 + 0x5c) + __n;
  return __n;
}

