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

curl_mimepart * curl_mime_addpart(curl_mime *mime)

{
  curl_mimepart *pcVar1;
  curl_mimepart *part;
  
  if (mime != (curl_mime *)0x0) {
    part = (curl_mimepart *)(*Curl_cmalloc)(0x164);
    if (part != (curl_mimepart *)0x0) {
      Curl_mime_initpart(part,mime->easy);
      pcVar1 = mime->lastpart;
      part->parent = mime;
      if (pcVar1 == (curl_mimepart *)0x0) {
        mime->firstpart = part;
      }
      else {
        pcVar1->nextpart = part;
      }
      mime->lastpart = part;
      return part;
    }
  }
  return (curl_mimepart *)0x0;
}



int __regparm2 curl_mime_addpart(undefined4 param_1,undefined4 param_2,undefined4 *param_3)

{
  int iVar1;
  int iVar2;
  int unaff_EBX;
  
  entry(param_2,0x6dabc);
  if (param_3 != (undefined4 *)0x0) {
    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);
    if (iVar2 != 0) {
      FUN_0006d820(iVar2,*param_3);
      iVar1 = param_3[3];
      *(undefined4 **)(iVar2 + 4) = param_3;
      if (iVar1 == 0) {
        param_3[2] = iVar2;
      }
      else {
        *(int *)(iVar1 + 8) = iVar2;
      }
      param_3[3] = iVar2;
      return iVar2;
    }
  }
  return 0;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV EDI,dword ptr [ESP + 0x10]
CALL 0x00019ed0
ADD EBX,0x48d24
TEST EDI,EDI
JZ 0x0006db08
SUB ESP,0xc
LEA EAX,[EBX + 0x890]
PUSH 0x164
CALL dword ptr [EAX]
MOV ESI,EAX
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0006db08
SUB ESP,0x8
PUSH dword ptr [EDI]
PUSH EAX
CALL 0x0006d820
MOV EAX,dword ptr [EDI + 0xc]
MOV dword ptr [ESI + 0x4],EDI
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0006db10
MOV dword ptr [EAX + 0x8],ESI
MOV dword ptr [EDI + 0xc],ESI
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
RET
XOR ESI,ESI
POP EBX
MOV EAX,ESI
POP ESI
POP EDI
RET
MOV dword ptr [EDI + 0x8],ESI
JMP 0x0006dafa
(translation_unit "int __regparm2 curl_mime_addpart(undefined4 param_1,undefined4 param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int unaff_EBX;\n  \n  entry(param_2,0x6dabc);\n  if (param_3 != (undefined4 *)0x0) {\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }\n  return 0;\n}\n\n" (function_definition "int __regparm2 curl_mime_addpart(undefined4 param_1,undefined4 param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int unaff_EBX;\n  \n  entry(param_2,0x6dabc);\n  if (param_3 != (undefined4 *)0x0) {\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }\n  return 0;\n}" primitive_type (ERROR "__regparm2" identifier) (function_declarator "curl_mime_addpart(undefined4 param_1,undefined4 param_2,undefined4 *param_3)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 *param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int unaff_EBX;\n  \n  entry(param_2,0x6dabc);\n  if (param_3 != (undefined4 *)0x0) {\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int unaff_EBX;" primitive_type identifier ;) (expression_statement "entry(param_2,0x6dabc);" (call_expression "entry(param_2,0x6dabc)" identifier (argument_list "(param_2,0x6dabc)" ( identifier , number_literal ))) ;) (if_statement "if (param_3 != (undefined4 *)0x0) {\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }" if (parenthesized_expression "(param_3 != (undefined4 *)0x0)" ( (binary_expression "param_3 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }" { (expression_statement "iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);" (assignment_expression "iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164)" identifier = (call_expression "(**(code **)(&UNK_000495b4 + unaff_EBX))(0x164)" (parenthesized_expression "(**(code **)(&UNK_000495b4 + unaff_EBX))" ( (pointer_expression "**(code **)(&UNK_000495b4 + unaff_EBX)" * (pointer_expression "*(code **)(&UNK_000495b4 + unaff_EBX)" * (cast_expression "(code **)(&UNK_000495b4 + unaff_EBX)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(&UNK_000495b4 + unaff_EBX)" ( (binary_expression "&UNK_000495b4 + unaff_EBX" (pointer_expression "&UNK_000495b4" & identifier) + identifier) ))))) )) (argument_list "(0x164)" ( number_literal )))) ;) (if_statement "if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }" { (expression_statement "FUN_0006d820(iVar2,*param_3);" (call_expression "FUN_0006d820(iVar2,*param_3)" identifier (argument_list "(iVar2,*param_3)" ( identifier , (pointer_expression "*param_3" * identifier) ))) ;) (expression_statement "iVar1 = param_3[3];" (assignment_expression "iVar1 = param_3[3]" identifier = (subscript_expression "param_3[3]" identifier [ number_literal ])) ;) (expression_statement "*(undefined4 **)(iVar2 + 4) = param_3;" (assignment_expression "*(undefined4 **)(iVar2 + 4) = param_3" (pointer_expression "*(undefined4 **)(iVar2 + 4)" * (cast_expression "(undefined4 **)(iVar2 + 4)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar2 + 4)" ( (binary_expression "iVar2 + 4" identifier + number_literal) )))) = identifier) ;) (if_statement "if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        param_3[2] = iVar2;\n      }" { (expression_statement "param_3[2] = iVar2;" (assignment_expression "param_3[2] = iVar2" (subscript_expression "param_3[2]" identifier [ number_literal ]) = identifier) ;) }) (else_clause "else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }" else (compound_statement "{\n        *(int *)(iVar1 + 8) = iVar2;\n      }" { (expression_statement "*(int *)(iVar1 + 8) = iVar2;" (assignment_expression "*(int *)(iVar1 + 8) = iVar2" (pointer_expression "*(int *)(iVar1 + 8)" * (cast_expression "(int *)(iVar1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 8)" ( (binary_expression "iVar1 + 8" identifier + number_literal) )))) = identifier) ;) }))) (expression_statement "param_3[3] = iVar2;" (assignment_expression "param_3[3] = iVar2" (subscript_expression "param_3[3]" identifier [ number_literal ]) = identifier) ;) (return_statement "return iVar2;" return identifier ;) })) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\ncurl_mimepart * curl_mime_addpart(curl_mime *mime)\n\n{\n  curl_mimepart *pcVar1;\n  curl_mimepart *part;\n  \n  if (mime != (curl_mime *)0x0) {\n    part = (curl_mimepart *)(*Curl_cmalloc)(0x164);\n    if (part != (curl_mimepart *)0x0) {\n      Curl_mime_initpart(part,mime->easy);\n      pcVar1 = mime->lastpart;\n      part->parent = mime;\n      if (pcVar1 == (curl_mimepart *)0x0) {\n        mime->firstpart = part;\n      }\n      else {\n        pcVar1->nextpart = part;\n      }\n      mime->lastpart = part;\n      return part;\n    }\n  }\n  return (curl_mimepart *)0x0;\n}\n\n" comment comment comment (function_definition "curl_mimepart * curl_mime_addpart(curl_mime *mime)\n\n{\n  curl_mimepart *pcVar1;\n  curl_mimepart *part;\n  \n  if (mime != (curl_mime *)0x0) {\n    part = (curl_mimepart *)(*Curl_cmalloc)(0x164);\n    if (part != (curl_mimepart *)0x0) {\n      Curl_mime_initpart(part,mime->easy);\n      pcVar1 = mime->lastpart;\n      part->parent = mime;\n      if (pcVar1 == (curl_mimepart *)0x0) {\n        mime->firstpart = part;\n      }\n      else {\n        pcVar1->nextpart = part;\n      }\n      mime->lastpart = part;\n      return part;\n    }\n  }\n  return (curl_mimepart *)0x0;\n}" type_identifier (pointer_declarator "* curl_mime_addpart(curl_mime *mime)" * (function_declarator "curl_mime_addpart(curl_mime *mime)" identifier (parameter_list "(curl_mime *mime)" ( (parameter_declaration "curl_mime *mime" type_identifier (pointer_declarator "*mime" * identifier)) )))) (compound_statement "{\n  curl_mimepart *pcVar1;\n  curl_mimepart *part;\n  \n  if (mime != (curl_mime *)0x0) {\n    part = (curl_mimepart *)(*Curl_cmalloc)(0x164);\n    if (part != (curl_mimepart *)0x0) {\n      Curl_mime_initpart(part,mime->easy);\n      pcVar1 = mime->lastpart;\n      part->parent = mime;\n      if (pcVar1 == (curl_mimepart *)0x0) {\n        mime->firstpart = part;\n      }\n      else {\n        pcVar1->nextpart = part;\n      }\n      mime->lastpart = part;\n      return part;\n    }\n  }\n  return (curl_mimepart *)0x0;\n}" { (declaration "curl_mimepart *pcVar1;" type_identifier (pointer_declarator "*pcVar1" * identifier) ;) (declaration "curl_mimepart *part;" type_identifier (pointer_declarator "*part" * identifier) ;) (if_statement "if (mime != (curl_mime *)0x0) {\n    part = (curl_mimepart *)(*Curl_cmalloc)(0x164);\n    if (part != (curl_mimepart *)0x0) {\n      Curl_mime_initpart(part,mime->easy);\n      pcVar1 = mime->lastpart;\n      part->parent = mime;\n      if (pcVar1 == (curl_mimepart *)0x0) {\n        mime->firstpart = part;\n      }\n      else {\n        pcVar1->nextpart = part;\n      }\n      mime->lastpart = part;\n      return part;\n    }\n  }" if (parenthesized_expression "(mime != (curl_mime *)0x0)" ( (binary_expression "mime != (curl_mime *)0x0" identifier != (cast_expression "(curl_mime *)0x0" ( (type_descriptor "curl_mime *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    part = (curl_mimepart *)(*Curl_cmalloc)(0x164);\n    if (part != (curl_mimepart *)0x0) {\n      Curl_mime_initpart(part,mime->easy);\n      pcVar1 = mime->lastpart;\n      part->parent = mime;\n      if (pcVar1 == (curl_mimepart *)0x0) {\n        mime->firstpart = part;\n      }\n      else {\n        pcVar1->nextpart = part;\n      }\n      mime->lastpart = part;\n      return part;\n    }\n  }" { (expression_statement "part = (curl_mimepart *)(*Curl_cmalloc)(0x164);" (assignment_expression "part = (curl_mimepart *)(*Curl_cmalloc)(0x164)" identifier = (cast_expression "(curl_mimepart *)(*Curl_cmalloc)(0x164)" ( (type_descriptor "curl_mimepart *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*Curl_cmalloc)(0x164)" (parenthesized_expression "(*Curl_cmalloc)" ( (pointer_expression "*Curl_cmalloc" * identifier) )) (argument_list "(0x164)" ( number_literal ))))) ;) (if_statement "if (part != (curl_mimepart *)0x0) {\n      Curl_mime_initpart(part,mime->easy);\n      pcVar1 = mime->lastpart;\n      part->parent = mime;\n      if (pcVar1 == (curl_mimepart *)0x0) {\n        mime->firstpart = part;\n      }\n      else {\n        pcVar1->nextpart = part;\n      }\n      mime->lastpart = part;\n      return part;\n    }" if (parenthesized_expression "(part != (curl_mimepart *)0x0)" ( (binary_expression "part != (curl_mimepart *)0x0" identifier != (cast_expression "(curl_mimepart *)0x0" ( (type_descriptor "curl_mimepart *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      Curl_mime_initpart(part,mime->easy);\n      pcVar1 = mime->lastpart;\n      part->parent = mime;\n      if (pcVar1 == (curl_mimepart *)0x0) {\n        mime->firstpart = part;\n      }\n      else {\n        pcVar1->nextpart = part;\n      }\n      mime->lastpart = part;\n      return part;\n    }" { (expression_statement "Curl_mime_initpart(part,mime->easy);" (call_expression "Curl_mime_initpart(part,mime->easy)" identifier (argument_list "(part,mime->easy)" ( identifier , (field_expression "mime->easy" identifier -> field_identifier) ))) ;) (expression_statement "pcVar1 = mime->lastpart;" (assignment_expression "pcVar1 = mime->lastpart" identifier = (field_expression "mime->lastpart" identifier -> field_identifier)) ;) (expression_statement "part->parent = mime;" (assignment_expression "part->parent = mime" (field_expression "part->parent" identifier -> field_identifier) = identifier) ;) (if_statement "if (pcVar1 == (curl_mimepart *)0x0) {\n        mime->firstpart = part;\n      }\n      else {\n        pcVar1->nextpart = part;\n      }" if (parenthesized_expression "(pcVar1 == (curl_mimepart *)0x0)" ( (binary_expression "pcVar1 == (curl_mimepart *)0x0" identifier == (cast_expression "(curl_mimepart *)0x0" ( (type_descriptor "curl_mimepart *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        mime->firstpart = part;\n      }" { (expression_statement "mime->firstpart = part;" (assignment_expression "mime->firstpart = part" (field_expression "mime->firstpart" identifier -> field_identifier) = identifier) ;) }) (else_clause "else {\n        pcVar1->nextpart = part;\n      }" else (compound_statement "{\n        pcVar1->nextpart = part;\n      }" { (expression_statement "pcVar1->nextpart = part;" (assignment_expression "pcVar1->nextpart = part" (field_expression "pcVar1->nextpart" identifier -> field_identifier) = identifier) ;) }))) (expression_statement "mime->lastpart = part;" (assignment_expression "mime->lastpart = part" (field_expression "mime->lastpart" identifier -> field_identifier) = identifier) ;) (return_statement "return part;" return identifier ;) })) })) (return_statement "return (curl_mimepart *)0x0;" return (cast_expression "(curl_mimepart *)0x0" ( (type_descriptor "curl_mimepart *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "int __regparm2 curl_mime_addpart(undefined4 param_1,undefined4 param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int unaff_EBX;\n  \n  entry(param_2,0x6dabc);\n  if (param_3 != (undefined4 *)0x0) {\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }\n  return 0;\n}\n\n" (function_definition "int __regparm2 curl_mime_addpart(undefined4 param_1,undefined4 param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int unaff_EBX;\n  \n  entry(param_2,0x6dabc);\n  if (param_3 != (undefined4 *)0x0) {\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }\n  return 0;\n}" primitive_type (ERROR "__regparm2" identifier) (function_declarator "curl_mime_addpart(undefined4 param_1,undefined4 param_2,undefined4 *param_3)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 *param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int unaff_EBX;\n  \n  entry(param_2,0x6dabc);\n  if (param_3 != (undefined4 *)0x0) {\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int unaff_EBX;" primitive_type identifier ;) (expression_statement "entry(param_2,0x6dabc);" (call_expression "entry(param_2,0x6dabc)" identifier (argument_list "(param_2,0x6dabc)" ( identifier , number_literal ))) ;) (if_statement "if (param_3 != (undefined4 *)0x0) {\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }" if (parenthesized_expression "(param_3 != (undefined4 *)0x0)" ( (binary_expression "param_3 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }" { (expression_statement "iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);" (assignment_expression "iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164)" identifier = (call_expression "(**(code **)(&UNK_000495b4 + unaff_EBX))(0x164)" (parenthesized_expression "(**(code **)(&UNK_000495b4 + unaff_EBX))" ( (pointer_expression "**(code **)(&UNK_000495b4 + unaff_EBX)" * (pointer_expression "*(code **)(&UNK_000495b4 + unaff_EBX)" * (cast_expression "(code **)(&UNK_000495b4 + unaff_EBX)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(&UNK_000495b4 + unaff_EBX)" ( (binary_expression "&UNK_000495b4 + unaff_EBX" (pointer_expression "&UNK_000495b4" & identifier) + identifier) ))))) )) (argument_list "(0x164)" ( number_literal )))) ;) (if_statement "if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }" { (expression_statement "FUN_0006d820(iVar2,*param_3);" (call_expression "FUN_0006d820(iVar2,*param_3)" identifier (argument_list "(iVar2,*param_3)" ( identifier , (pointer_expression "*param_3" * identifier) ))) ;) (expression_statement "iVar1 = param_3[3];" (assignment_expression "iVar1 = param_3[3]" identifier = (subscript_expression "param_3[3]" identifier [ number_literal ])) ;) (expression_statement "*(undefined4 **)(iVar2 + 4) = param_3;" (assignment_expression "*(undefined4 **)(iVar2 + 4) = param_3" (pointer_expression "*(undefined4 **)(iVar2 + 4)" * (cast_expression "(undefined4 **)(iVar2 + 4)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar2 + 4)" ( (binary_expression "iVar2 + 4" identifier + number_literal) )))) = identifier) ;) (if_statement "if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        param_3[2] = iVar2;\n      }" { (expression_statement "param_3[2] = iVar2;" (assignment_expression "param_3[2] = iVar2" (subscript_expression "param_3[2]" identifier [ number_literal ]) = identifier) ;) }) (else_clause "else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }" else (compound_statement "{\n        *(int *)(iVar1 + 8) = iVar2;\n      }" { (expression_statement "*(int *)(iVar1 + 8) = iVar2;" (assignment_expression "*(int *)(iVar1 + 8) = iVar2" (pointer_expression "*(int *)(iVar1 + 8)" * (cast_expression "(int *)(iVar1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 8)" ( (binary_expression "iVar1 + 8" identifier + number_literal) )))) = identifier) ;) }))) (expression_statement "param_3[3] = iVar2;" (assignment_expression "param_3[3] = iVar2" (subscript_expression "param_3[3]" identifier [ number_literal ]) = identifier) ;) (return_statement "return iVar2;" return identifier ;) })) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression & IDENT) + IDENT) ))))) )) (argument_list ( LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (pointer_expression * IDENT) ))) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) }))) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (return_statement return IDENT ;) })) })) (return_statement return LIT ;) })))
(function_definition "int __regparm2 curl_mime_addpart(undefined4 param_1,undefined4 param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  int unaff_EBX;\n  \n  entry(param_2,0x6dabc);\n  if (param_3 != (undefined4 *)0x0) {\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }\n  return 0;\n}" (primitive_type "int") (ERROR "__regparm2" (identifier "__regparm2")) (function_declarator "curl_mime_addpart(undefined4 param_1,undefined4 param_2,undefined4 *param_3)" (identifier "curl_mime_addpart") (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 *param_3)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 *param_3" (type_identifier "undefined4") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int unaff_EBX;\n  \n  entry(param_2,0x6dabc);\n  if (param_3 != (undefined4 *)0x0) {\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }\n  return 0;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int unaff_EBX;" (primitive_type "int") (identifier "unaff_EBX") (; ";")) (expression_statement "entry(param_2,0x6dabc);" (call_expression "entry(param_2,0x6dabc)" (identifier "entry") (argument_list "(param_2,0x6dabc)" (( "(") (identifier "param_2") (, ",") (number_literal "0x6dabc") () ")"))) (; ";")) (if_statement "if (param_3 != (undefined4 *)0x0) {\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }" (if "if") (parenthesized_expression "(param_3 != (undefined4 *)0x0)" (( "(") (binary_expression "param_3 != (undefined4 *)0x0" (identifier "param_3") (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);\n    if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }\n  }" ({ "{") (expression_statement "iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);" (assignment_expression "iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164)" (identifier "iVar2") (= "=") (call_expression "(**(code **)(&UNK_000495b4 + unaff_EBX))(0x164)" (parenthesized_expression "(**(code **)(&UNK_000495b4 + unaff_EBX))" (( "(") (pointer_expression "**(code **)(&UNK_000495b4 + unaff_EBX)" (* "*") (pointer_expression "*(code **)(&UNK_000495b4 + unaff_EBX)" (* "*") (cast_expression "(code **)(&UNK_000495b4 + unaff_EBX)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(&UNK_000495b4 + unaff_EBX)" (( "(") (binary_expression "&UNK_000495b4 + unaff_EBX" (pointer_expression "&UNK_000495b4" (& "&") (identifier "UNK_000495b4")) (+ "+") (identifier "unaff_EBX")) () ")"))))) () ")")) (argument_list "(0x164)" (( "(") (number_literal "0x164") () ")")))) (; ";")) (if_statement "if (iVar2 != 0) {\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_0006d820(iVar2,*param_3);\n      iVar1 = param_3[3];\n      *(undefined4 **)(iVar2 + 4) = param_3;\n      if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }\n      param_3[3] = iVar2;\n      return iVar2;\n    }" ({ "{") (expression_statement "FUN_0006d820(iVar2,*param_3);" (call_expression "FUN_0006d820(iVar2,*param_3)" (identifier "FUN_0006d820") (argument_list "(iVar2,*param_3)" (( "(") (identifier "iVar2") (, ",") (pointer_expression "*param_3" (* "*") (identifier "param_3")) () ")"))) (; ";")) (expression_statement "iVar1 = param_3[3];" (assignment_expression "iVar1 = param_3[3]" (identifier "iVar1") (= "=") (subscript_expression "param_3[3]" (identifier "param_3") ([ "[") (number_literal "3") (] "]"))) (; ";")) (expression_statement "*(undefined4 **)(iVar2 + 4) = param_3;" (assignment_expression "*(undefined4 **)(iVar2 + 4) = param_3" (pointer_expression "*(undefined4 **)(iVar2 + 4)" (* "*") (cast_expression "(undefined4 **)(iVar2 + 4)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(iVar2 + 4)" (( "(") (binary_expression "iVar2 + 4" (identifier "iVar2") (+ "+") (number_literal "4")) () ")")))) (= "=") (identifier "param_3")) (; ";")) (if_statement "if (iVar1 == 0) {\n        param_3[2] = iVar2;\n      }\n      else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        param_3[2] = iVar2;\n      }" ({ "{") (expression_statement "param_3[2] = iVar2;" (assignment_expression "param_3[2] = iVar2" (subscript_expression "param_3[2]" (identifier "param_3") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "iVar2")) (; ";")) (} "}")) (else_clause "else {\n        *(int *)(iVar1 + 8) = iVar2;\n      }" (else "else") (compound_statement "{\n        *(int *)(iVar1 + 8) = iVar2;\n      }" ({ "{") (expression_statement "*(int *)(iVar1 + 8) = iVar2;" (assignment_expression "*(int *)(iVar1 + 8) = iVar2" (pointer_expression "*(int *)(iVar1 + 8)" (* "*") (cast_expression "(int *)(iVar1 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 8)" (( "(") (binary_expression "iVar1 + 8" (identifier "iVar1") (+ "+") (number_literal "8")) () ")")))) (= "=") (identifier "iVar2")) (; ";")) (} "}")))) (expression_statement "param_3[3] = iVar2;" (assignment_expression "param_3[3] = iVar2" (subscript_expression "param_3[3]" (identifier "param_3") ([ "[") (number_literal "3") (] "]")) (= "=") (identifier "iVar2")) (; ";")) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

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

type_1 * function_1(type_2 *var_1)

{
  type_1 *var_4;
  type_1 *var_2;
  
  if (var_1 != (type_2 *)0x0) {
    var_2 = (type_1 *)(*Curl_cmalloc)(0x164);
    if (var_2 != (type_1 *)0x0) {
      var_3(var_2,var_1->easy);
      var_4 = var_1->lastpart;
      var_2->parent = var_1;
      if (var_4 == (type_1 *)0x0) {
        var_1->firstpart = var_2;
      }
      else {
        var_4->nextpart = var_2;
      }
      var_1->lastpart = var_2;
      return var_2;
    }
  }
  return (type_1 *)0x0;
}


(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: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (identifier))))))) arguments: (argument_list (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator 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: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier)))) alternative: (else_clause (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: (identifier)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (return_statement (identifier)))))) (return_statement (number_literal)))))

int __regparm2 MASKED(undefined4 param_1,undefined4 param_2,undefined4 *param_3)

{
  int iVar1;
  int iVar2;
  int unaff_EBX;
  
  entry(param_2,0x6dabc);
  if (param_3 != (undefined4 *)0x0) {
    iVar2 = (**(code **)(&UNK_000495b4 + unaff_EBX))(0x164);
    if (iVar2 != 0) {
      FUN_0006d820(iVar2,*param_3);
      iVar1 = param_3[3];
      *(undefined4 **)(iVar2 + 4) = param_3;
      if (iVar1 == 0) {
        param_3[2] = iVar2;
      }
      else {
        *(int *)(iVar1 + 8) = iVar2;
      }
      param_3[3] = iVar2;
      return iVar2;
    }
  }
  return 0;
}

