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

int MHD_upgrade_action(MHD_UpgradeResponseHandle *urh,MHD_UpgradeAction action,...)

{
  MHD_Connection *connection;
  
  if ((((urh != (MHD_UpgradeResponseHandle *)0x0) &&
       (connection = urh->connection, connection != (MHD_Connection *)0x0)) &&
      (connection->daemon != (MHD_Daemon *)0x0)) &&
     ((action == MHD_UPGRADE_ACTION_CLOSE && (urh->was_closed == false)))) {
    if ((connection->daemon->options & MHD_USE_SSL) != MHD_NO_FLAG) {
      shutdown((urh->app).socket,2);
    }
    urh->was_closed = true;
    MHD_resume_connection(connection);
    return 1;
  }
  return 0;
}



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

undefined4 MHD_upgrade_action(int *param_1,int param_2)

{
  int iVar1;
  
  if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))
     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {
    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {
      shutdown(param_1[0xd],2);
    }
    *(undefined1 *)(param_1 + 0x14) = 1;
    MHD_resume_connection(iVar1);
    return 1;
  }
  return 0;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV ESI,dword ptr [ESP + 0x10]
CALL 0x00013810
ADD EBX,0x11c54
TEST ESI,ESI
JZ 0x000231e0
MOV EDI,dword ptr [ESI]
TEST EDI,EDI
JZ 0x000231e0
MOV EDX,dword ptr [EDI + 0x18]
TEST EDX,EDX
JZ 0x000231e0
MOV EAX,dword ptr [ESP + 0x14]
TEST EAX,EAX
JNZ 0x000231e0
MOVZX ECX,byte ptr [ESI + 0x50]
XOR EAX,EAX
TEST CL,CL
JNZ 0x000231e2
TEST byte ptr [EDX + 0xf8],0x2
JNZ 0x000231f0
SUB ESP,0xc
MOV byte ptr [ESI + 0x50],0x1
PUSH EDI
CALL 0x000133e0
ADD ESP,0x10
MOV EAX,0x1
POP EBX
POP ESI
POP EDI
RET
XOR EAX,EAX
POP EBX
POP ESI
POP EDI
RET
SUB ESP,0x8
PUSH 0x2
PUSH dword ptr [ESI + 0x34]
CALL 0x00013720
ADD ESP,0x10
JMP 0x000231be
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 MHD_upgrade_action(int *param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }\n  return 0;\n}\n\n" comment (function_definition "undefined4 MHD_upgrade_action(int *param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }\n  return 0;\n}" type_identifier (function_declarator "MHD_upgrade_action(int *param_1,int param_2)" identifier (parameter_list "(int *param_1,int param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }" if (parenthesized_expression "((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0'))))" ( (binary_expression "(((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))" (parenthesized_expression "(((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))" ( (binary_expression "((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0)" (parenthesized_expression "((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0))" ( (binary_expression "(param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)" (parenthesized_expression "(param_1 != (int *)0x0)" ( (binary_expression "param_1 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(iVar1 = *param_1, iVar1 != 0)" ( (comma_expression "iVar1 = *param_1, iVar1 != 0" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) , (binary_expression "iVar1 != 0" identifier != number_literal)) ))) )) && (parenthesized_expression "(*(int *)(iVar1 + 0x18) != 0)" ( (binary_expression "*(int *)(iVar1 + 0x18) != 0" (pointer_expression "*(int *)(iVar1 + 0x18)" * (cast_expression "(int *)(iVar1 + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x18)" ( (binary_expression "iVar1 + 0x18" identifier + number_literal) )))) != number_literal) ))) )) && (parenthesized_expression "((param_2 == 0 && ((char)param_1[0x14] == '\0')))" ( (parenthesized_expression "(param_2 == 0 && ((char)param_1[0x14] == '\0'))" ( (binary_expression "param_2 == 0 && ((char)param_1[0x14] == '\0')" (binary_expression "param_2 == 0" identifier == number_literal) && (parenthesized_expression "((char)param_1[0x14] == '\0')" ( (binary_expression "(char)param_1[0x14] == '\0'" (cast_expression "(char)param_1[0x14]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[0x14]" identifier [ number_literal ])) == (char_literal "'\0'" ' escape_sequence ')) ))) )) ))) )) (compound_statement "{\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }" { (if_statement "if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }" if (parenthesized_expression "((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0)" ( (binary_expression "(*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0" (parenthesized_expression "(*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2)" ( (binary_expression "*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2" (pointer_expression "*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8)" * (cast_expression "(byte *)(*(int *)(iVar1 + 0x18) + 0xf8)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(iVar1 + 0x18) + 0xf8)" ( (binary_expression "*(int *)(iVar1 + 0x18) + 0xf8" (pointer_expression "*(int *)(iVar1 + 0x18)" * (cast_expression "(int *)(iVar1 + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x18)" ( (binary_expression "iVar1 + 0x18" identifier + number_literal) )))) + number_literal) )))) & number_literal) )) != number_literal) )) (compound_statement "{\n      shutdown(param_1[0xd],2);\n    }" { (expression_statement "shutdown(param_1[0xd],2);" (call_expression "shutdown(param_1[0xd],2)" identifier (argument_list "(param_1[0xd],2)" ( (subscript_expression "param_1[0xd]" identifier [ number_literal ]) , number_literal ))) ;) })) (expression_statement "*(undefined1 *)(param_1 + 0x14) = 1;" (assignment_expression "*(undefined1 *)(param_1 + 0x14) = 1" (pointer_expression "*(undefined1 *)(param_1 + 0x14)" * (cast_expression "(undefined1 *)(param_1 + 0x14)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) = number_literal) ;) (expression_statement "MHD_resume_connection(iVar1);" (call_expression "MHD_resume_connection(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) (return_statement "return 1;" return number_literal ;) })) (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: Enum "MHD_FLAG": Some values do not have unique names */\n/* WARNING: Enum "gnutls_pk_algorithm_t": Some values do not have unique names */\n/* WARNING: Enum "gnutls_certificate_type_t": Some values do not have unique names */\n\nint MHD_upgrade_action(MHD_UpgradeResponseHandle *urh,MHD_UpgradeAction action,...)\n\n{\n  MHD_Connection *connection;\n  \n  if ((((urh != (MHD_UpgradeResponseHandle *)0x0) &&\n       (connection = urh->connection, connection != (MHD_Connection *)0x0)) &&\n      (connection->daemon != (MHD_Daemon *)0x0)) &&\n     ((action == MHD_UPGRADE_ACTION_CLOSE && (urh->was_closed == false)))) {\n    if ((connection->daemon->options & MHD_USE_SSL) != MHD_NO_FLAG) {\n      shutdown((urh->app).socket,2);\n    }\n    urh->was_closed = true;\n    MHD_resume_connection(connection);\n    return 1;\n  }\n  return 0;\n}\n\n" comment comment comment comment (function_definition "int MHD_upgrade_action(MHD_UpgradeResponseHandle *urh,MHD_UpgradeAction action,...)\n\n{\n  MHD_Connection *connection;\n  \n  if ((((urh != (MHD_UpgradeResponseHandle *)0x0) &&\n       (connection = urh->connection, connection != (MHD_Connection *)0x0)) &&\n      (connection->daemon != (MHD_Daemon *)0x0)) &&\n     ((action == MHD_UPGRADE_ACTION_CLOSE && (urh->was_closed == false)))) {\n    if ((connection->daemon->options & MHD_USE_SSL) != MHD_NO_FLAG) {\n      shutdown((urh->app).socket,2);\n    }\n    urh->was_closed = true;\n    MHD_resume_connection(connection);\n    return 1;\n  }\n  return 0;\n}" primitive_type (function_declarator "MHD_upgrade_action(MHD_UpgradeResponseHandle *urh,MHD_UpgradeAction action,...)" identifier (parameter_list "(MHD_UpgradeResponseHandle *urh,MHD_UpgradeAction action,...)" ( (parameter_declaration "MHD_UpgradeResponseHandle *urh" type_identifier (pointer_declarator "*urh" * identifier)) , (parameter_declaration "MHD_UpgradeAction action" type_identifier identifier) , (variadic_parameter "..." ...) ))) (compound_statement "{\n  MHD_Connection *connection;\n  \n  if ((((urh != (MHD_UpgradeResponseHandle *)0x0) &&\n       (connection = urh->connection, connection != (MHD_Connection *)0x0)) &&\n      (connection->daemon != (MHD_Daemon *)0x0)) &&\n     ((action == MHD_UPGRADE_ACTION_CLOSE && (urh->was_closed == false)))) {\n    if ((connection->daemon->options & MHD_USE_SSL) != MHD_NO_FLAG) {\n      shutdown((urh->app).socket,2);\n    }\n    urh->was_closed = true;\n    MHD_resume_connection(connection);\n    return 1;\n  }\n  return 0;\n}" { (declaration "MHD_Connection *connection;" type_identifier (pointer_declarator "*connection" * identifier) ;) (if_statement "if ((((urh != (MHD_UpgradeResponseHandle *)0x0) &&\n       (connection = urh->connection, connection != (MHD_Connection *)0x0)) &&\n      (connection->daemon != (MHD_Daemon *)0x0)) &&\n     ((action == MHD_UPGRADE_ACTION_CLOSE && (urh->was_closed == false)))) {\n    if ((connection->daemon->options & MHD_USE_SSL) != MHD_NO_FLAG) {\n      shutdown((urh->app).socket,2);\n    }\n    urh->was_closed = true;\n    MHD_resume_connection(connection);\n    return 1;\n  }" if (parenthesized_expression "((((urh != (MHD_UpgradeResponseHandle *)0x0) &&\n       (connection = urh->connection, connection != (MHD_Connection *)0x0)) &&\n      (connection->daemon != (MHD_Daemon *)0x0)) &&\n     ((action == MHD_UPGRADE_ACTION_CLOSE && (urh->was_closed == false))))" ( (binary_expression "(((urh != (MHD_UpgradeResponseHandle *)0x0) &&\n       (connection = urh->connection, connection != (MHD_Connection *)0x0)) &&\n      (connection->daemon != (MHD_Daemon *)0x0)) &&\n     ((action == MHD_UPGRADE_ACTION_CLOSE && (urh->was_closed == false)))" (parenthesized_expression "(((urh != (MHD_UpgradeResponseHandle *)0x0) &&\n       (connection = urh->connection, connection != (MHD_Connection *)0x0)) &&\n      (connection->daemon != (MHD_Daemon *)0x0))" ( (binary_expression "((urh != (MHD_UpgradeResponseHandle *)0x0) &&\n       (connection = urh->connection, connection != (MHD_Connection *)0x0)) &&\n      (connection->daemon != (MHD_Daemon *)0x0)" (parenthesized_expression "((urh != (MHD_UpgradeResponseHandle *)0x0) &&\n       (connection = urh->connection, connection != (MHD_Connection *)0x0))" ( (binary_expression "(urh != (MHD_UpgradeResponseHandle *)0x0) &&\n       (connection = urh->connection, connection != (MHD_Connection *)0x0)" (parenthesized_expression "(urh != (MHD_UpgradeResponseHandle *)0x0)" ( (binary_expression "urh != (MHD_UpgradeResponseHandle *)0x0" identifier != (cast_expression "(MHD_UpgradeResponseHandle *)0x0" ( (type_descriptor "MHD_UpgradeResponseHandle *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(connection = urh->connection, connection != (MHD_Connection *)0x0)" ( (comma_expression "connection = urh->connection, connection != (MHD_Connection *)0x0" (assignment_expression "connection = urh->connection" identifier = (field_expression "urh->connection" identifier -> field_identifier)) , (binary_expression "connection != (MHD_Connection *)0x0" identifier != (cast_expression "(MHD_Connection *)0x0" ( (type_descriptor "MHD_Connection *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) && (parenthesized_expression "(connection->daemon != (MHD_Daemon *)0x0)" ( (binary_expression "connection->daemon != (MHD_Daemon *)0x0" (field_expression "connection->daemon" identifier -> field_identifier) != (cast_expression "(MHD_Daemon *)0x0" ( (type_descriptor "MHD_Daemon *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) && (parenthesized_expression "((action == MHD_UPGRADE_ACTION_CLOSE && (urh->was_closed == false)))" ( (parenthesized_expression "(action == MHD_UPGRADE_ACTION_CLOSE && (urh->was_closed == false))" ( (binary_expression "action == MHD_UPGRADE_ACTION_CLOSE && (urh->was_closed == false)" (binary_expression "action == MHD_UPGRADE_ACTION_CLOSE" identifier == identifier) && (parenthesized_expression "(urh->was_closed == false)" ( (binary_expression "urh->was_closed == false" (field_expression "urh->was_closed" identifier -> field_identifier) == false) ))) )) ))) )) (compound_statement "{\n    if ((connection->daemon->options & MHD_USE_SSL) != MHD_NO_FLAG) {\n      shutdown((urh->app).socket,2);\n    }\n    urh->was_closed = true;\n    MHD_resume_connection(connection);\n    return 1;\n  }" { (if_statement "if ((connection->daemon->options & MHD_USE_SSL) != MHD_NO_FLAG) {\n      shutdown((urh->app).socket,2);\n    }" if (parenthesized_expression "((connection->daemon->options & MHD_USE_SSL) != MHD_NO_FLAG)" ( (binary_expression "(connection->daemon->options & MHD_USE_SSL) != MHD_NO_FLAG" (parenthesized_expression "(connection->daemon->options & MHD_USE_SSL)" ( (binary_expression "connection->daemon->options & MHD_USE_SSL" (field_expression "connection->daemon->options" (field_expression "connection->daemon" identifier -> field_identifier) -> field_identifier) & identifier) )) != identifier) )) (compound_statement "{\n      shutdown((urh->app).socket,2);\n    }" { (expression_statement "shutdown((urh->app).socket,2);" (call_expression "shutdown((urh->app).socket,2)" identifier (argument_list "((urh->app).socket,2)" ( (field_expression "(urh->app).socket" (parenthesized_expression "(urh->app)" ( (field_expression "urh->app" identifier -> field_identifier) )) . field_identifier) , number_literal ))) ;) })) (expression_statement "urh->was_closed = true;" (assignment_expression "urh->was_closed = true" (field_expression "urh->was_closed" identifier -> field_identifier) = true) ;) (expression_statement "MHD_resume_connection(connection);" (call_expression "MHD_resume_connection(connection)" identifier (argument_list "(connection)" ( identifier ))) ;) (return_statement "return 1;" return number_literal ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "undefined4 MHD_upgrade_action(int *param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }\n  return 0;\n}\n\n" (function_definition "undefined4 MHD_upgrade_action(int *param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }\n  return 0;\n}" type_identifier (function_declarator "MHD_upgrade_action(int *param_1,int param_2)" identifier (parameter_list "(int *param_1,int param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }" if (parenthesized_expression "((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0'))))" ( (binary_expression "(((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))" (parenthesized_expression "(((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))" ( (binary_expression "((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0)" (parenthesized_expression "((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0))" ( (binary_expression "(param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)" (parenthesized_expression "(param_1 != (int *)0x0)" ( (binary_expression "param_1 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(iVar1 = *param_1, iVar1 != 0)" ( (comma_expression "iVar1 = *param_1, iVar1 != 0" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) , (binary_expression "iVar1 != 0" identifier != number_literal)) ))) )) && (parenthesized_expression "(*(int *)(iVar1 + 0x18) != 0)" ( (binary_expression "*(int *)(iVar1 + 0x18) != 0" (pointer_expression "*(int *)(iVar1 + 0x18)" * (cast_expression "(int *)(iVar1 + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x18)" ( (binary_expression "iVar1 + 0x18" identifier + number_literal) )))) != number_literal) ))) )) && (parenthesized_expression "((param_2 == 0 && ((char)param_1[0x14] == '\0')))" ( (parenthesized_expression "(param_2 == 0 && ((char)param_1[0x14] == '\0'))" ( (binary_expression "param_2 == 0 && ((char)param_1[0x14] == '\0')" (binary_expression "param_2 == 0" identifier == number_literal) && (parenthesized_expression "((char)param_1[0x14] == '\0')" ( (binary_expression "(char)param_1[0x14] == '\0'" (cast_expression "(char)param_1[0x14]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[0x14]" identifier [ number_literal ])) == (char_literal "'\0'" ' escape_sequence ')) ))) )) ))) )) (compound_statement "{\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }" { (if_statement "if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }" if (parenthesized_expression "((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0)" ( (binary_expression "(*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0" (parenthesized_expression "(*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2)" ( (binary_expression "*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2" (pointer_expression "*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8)" * (cast_expression "(byte *)(*(int *)(iVar1 + 0x18) + 0xf8)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(iVar1 + 0x18) + 0xf8)" ( (binary_expression "*(int *)(iVar1 + 0x18) + 0xf8" (pointer_expression "*(int *)(iVar1 + 0x18)" * (cast_expression "(int *)(iVar1 + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x18)" ( (binary_expression "iVar1 + 0x18" identifier + number_literal) )))) + number_literal) )))) & number_literal) )) != number_literal) )) (compound_statement "{\n      shutdown(param_1[0xd],2);\n    }" { (expression_statement "shutdown(param_1[0xd],2);" (call_expression "shutdown(param_1[0xd],2)" identifier (argument_list "(param_1[0xd],2)" ( (subscript_expression "param_1[0xd]" identifier [ number_literal ]) , number_literal ))) ;) })) (expression_statement "*(undefined1 *)(param_1 + 0x14) = 1;" (assignment_expression "*(undefined1 *)(param_1 + 0x14) = 1" (pointer_expression "*(undefined1 *)(param_1 + 0x14)" * (cast_expression "(undefined1 *)(param_1 + 0x14)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) = number_literal) ;) (expression_statement "MHD_resume_connection(iVar1);" (call_expression "MHD_resume_connection(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) (return_statement "return 1;" return number_literal ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (pointer_expression * IDENT)) , (binary_expression IDENT != LIT)) ))) )) && (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) ))) )) && (parenthesized_expression ( (parenthesized_expression ( (binary_expression (binary_expression IDENT == LIT) && (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) == (char_literal ' escape_sequence ')) ))) )) ))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + LIT) )))) & LIT) )) != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) , LIT ))) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return LIT ;) })) (return_statement return LIT ;) })))
(function_definition "undefined4 MHD_upgrade_action(int *param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }\n  return 0;\n}" (type_identifier "undefined4") (function_declarator "MHD_upgrade_action(int *param_1,int param_2)" (identifier "MHD_upgrade_action") (parameter_list "(int *param_1,int param_2)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  \n  if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }\n  return 0;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (if_statement "if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }" (if "if") (parenthesized_expression "((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0'))))" (( "(") (binary_expression "(((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))\n     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))" (parenthesized_expression "(((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))" (( "(") (binary_expression "((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0)" (parenthesized_expression "((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0))" (( "(") (binary_expression "(param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)" (parenthesized_expression "(param_1 != (int *)0x0)" (( "(") (binary_expression "param_1 != (int *)0x0" (identifier "param_1") (!= "!=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (&& "&&") (parenthesized_expression "(iVar1 = *param_1, iVar1 != 0)" (( "(") (comma_expression "iVar1 = *param_1, iVar1 != 0" (assignment_expression "iVar1 = *param_1" (identifier "iVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (, ",") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0"))) () ")"))) () ")")) (&& "&&") (parenthesized_expression "(*(int *)(iVar1 + 0x18) != 0)" (( "(") (binary_expression "*(int *)(iVar1 + 0x18) != 0" (pointer_expression "*(int *)(iVar1 + 0x18)" (* "*") (cast_expression "(int *)(iVar1 + 0x18)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x18)" (( "(") (binary_expression "iVar1 + 0x18" (identifier "iVar1") (+ "+") (number_literal "0x18")) () ")")))) (!= "!=") (number_literal "0")) () ")"))) () ")")) (&& "&&") (parenthesized_expression "((param_2 == 0 && ((char)param_1[0x14] == '\0')))" (( "(") (parenthesized_expression "(param_2 == 0 && ((char)param_1[0x14] == '\0'))" (( "(") (binary_expression "param_2 == 0 && ((char)param_1[0x14] == '\0')" (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) (&& "&&") (parenthesized_expression "((char)param_1[0x14] == '\0')" (( "(") (binary_expression "(char)param_1[0x14] == '\0'" (cast_expression "(char)param_1[0x14]" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (subscript_expression "param_1[0x14]" (identifier "param_1") ([ "[") (number_literal "0x14") (] "]"))) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")"))) () ")")) () ")"))) () ")")) (compound_statement "{\n    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }\n    *(undefined1 *)(param_1 + 0x14) = 1;\n    MHD_resume_connection(iVar1);\n    return 1;\n  }" ({ "{") (if_statement "if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {\n      shutdown(param_1[0xd],2);\n    }" (if "if") (parenthesized_expression "((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0)" (( "(") (binary_expression "(*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0" (parenthesized_expression "(*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2)" (( "(") (binary_expression "*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2" (pointer_expression "*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8)" (* "*") (cast_expression "(byte *)(*(int *)(iVar1 + 0x18) + 0xf8)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)(iVar1 + 0x18) + 0xf8)" (( "(") (binary_expression "*(int *)(iVar1 + 0x18) + 0xf8" (pointer_expression "*(int *)(iVar1 + 0x18)" (* "*") (cast_expression "(int *)(iVar1 + 0x18)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x18)" (( "(") (binary_expression "iVar1 + 0x18" (identifier "iVar1") (+ "+") (number_literal "0x18")) () ")")))) (+ "+") (number_literal "0xf8")) () ")")))) (& "&") (number_literal "2")) () ")")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      shutdown(param_1[0xd],2);\n    }" ({ "{") (expression_statement "shutdown(param_1[0xd],2);" (call_expression "shutdown(param_1[0xd],2)" (identifier "shutdown") (argument_list "(param_1[0xd],2)" (( "(") (subscript_expression "param_1[0xd]" (identifier "param_1") ([ "[") (number_literal "0xd") (] "]")) (, ",") (number_literal "2") () ")"))) (; ";")) (} "}"))) (expression_statement "*(undefined1 *)(param_1 + 0x14) = 1;" (assignment_expression "*(undefined1 *)(param_1 + 0x14) = 1" (pointer_expression "*(undefined1 *)(param_1 + 0x14)" (* "*") (cast_expression "(undefined1 *)(param_1 + 0x14)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) (= "=") (number_literal "1")) (; ";")) (expression_statement "MHD_resume_connection(iVar1);" (call_expression "MHD_resume_connection(iVar1)" (identifier "MHD_resume_connection") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

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

int function_1(type_1 *var_1,type_2 var_3,...)

{
  type_3 *var_2;
  
  if ((((var_1 != (type_1 *)0x0) &&
       (var_2 = var_1->var_2, var_2 != (type_3 *)0x0)) &&
      (var_2->daemon != (type_4 *)0x0)) &&
     ((var_3 == var_4 && (var_1->was_closed == false)))) {
    if ((var_2->daemon->options & var_5) != var_6) {
      var_7((var_1->app).socket,2);
    }
    var_1->was_closed = true;
    var_8(var_2);
    return 1;
  }
  return 0;
}


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

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

undefined4 MASKED(int *param_1,int param_2)

{
  int iVar1;
  
  if ((((param_1 != (int *)0x0) && (iVar1 = *param_1, iVar1 != 0)) && (*(int *)(iVar1 + 0x18) != 0))
     && ((param_2 == 0 && ((char)param_1[0x14] == '\0')))) {
    if ((*(byte *)(*(int *)(iVar1 + 0x18) + 0xf8) & 2) != 0) {
      shutdown(param_1[0xd],2);
    }
    *(undefined1 *)(param_1 + 0x14) = 1;
    MHD_resume_connection(iVar1);
    return 1;
  }
  return 0;
}

