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

void agent_select_result(int fd,int event)

{
  agent_pending_query *conn;
  int iVar1;
  
  if (event != 1) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");
  }
  conn = (agent_pending_query *)find234(agent_pending_queries,&fd,agent_connfind);
  if (conn != (agent_pending_query *)0x0) {
    iVar1 = agent_try_read(conn);
    if (iVar1 != 0) {
      (*conn->callback)(conn->callback_ctx,conn->retbuf,conn->retlen);
      agent_cancel_query(conn);
    }
    return;
  }
  uxsel_del(fd);
  return;
}



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

void FUN_000640b0(undefined4 param_1,int param_2)

{
  int iVar1;
  int iVar2;
  
  if (param_2 != 1) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");
  }
  iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);
  if (iVar1 != 0) {
    iVar2 = FUN_00063f20();
    if (iVar2 != 0) {
      (**(code **)(iVar1 + 0x14))
                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),
                 *(undefined4 *)(iVar1 + 0x10));
      FUN_00064070(iVar1);
    }
    return;
  }
  FUN_00069b40(param_1);
  return;
}


PUSH ESI
PUSH EBX
CALL 0x00014980
ADD EBX,0x44cb9
SUB ESP,0x4
CMP dword ptr [ESP + 0x14],0x1
JNZ 0x0006412d
SUB ESP,0x4
LEA EAX,[EBX + 0xfffbb190]
PUSH EAX
LEA EAX,[ESP + 0x18]
PUSH EAX
PUSH dword ptr [EBX + 0xb6c]
CALL 0x00063df0
ADD ESP,0x10
MOV ESI,EAX
TEST EAX,EAX
JZ 0x00064118
CALL 0x00063f20
TEST EAX,EAX
JZ 0x0006410d
SUB ESP,0x4
PUSH dword ptr [ESI + 0x10]
PUSH dword ptr [ESI + 0x4]
PUSH dword ptr [ESI + 0x18]
CALL dword ptr [ESI + 0x14]
MOV dword ptr [ESP],ESI
CALL 0x00064070
ADD ESP,0x10
ADD ESP,0x4
POP EBX
POP ESI
RET
SUB ESP,0xc
PUSH dword ptr [ESP + 0x1c]
CALL 0x00069b40
ADD ESP,0x10
ADD ESP,0x4
POP EBX
POP ESI
RET
LEA EAX,[EBX + 0xfffd6048]
PUSH EAX
LEA EAX,[EBX + 0xfffd5fda]
PUSH 0x69
PUSH EAX
LEA EAX,[EBX + 0xfffd6016]
PUSH EAX
CALL 0x00014880
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_000640b0(undefined4 param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 != 1) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }\n  iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);\n  if (iVar1 != 0) {\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }\n  FUN_00069b40(param_1);\n  return;\n}\n\n" comment (function_definition "void FUN_000640b0(undefined4 param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 != 1) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }\n  iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);\n  if (iVar1 != 0) {\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }\n  FUN_00069b40(param_1);\n  return;\n}" primitive_type (function_declarator "FUN_000640b0(undefined4 param_1,int param_2)" identifier (parameter_list "(undefined4 param_1,int param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 != 1) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }\n  iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);\n  if (iVar1 != 0) {\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }\n  FUN_00069b40(param_1);\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (param_2 != 1) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }" if (parenthesized_expression "(param_2 != 1)" ( (binary_expression "param_2 != 1" identifier != number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }" { comment (expression_statement "__assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");" (call_expression "__assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result")" identifier (argument_list "("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result")" ( (string_literal ""event == SELECT_R"" " string_content ") , (string_literal ""unix/uxagentc.c"" " string_content ") , number_literal , (string_literal ""agent_select_result"" " string_content ") ))) ;) })) (expression_statement "iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);" (assignment_expression "iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00)" identifier = (call_expression "FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00)" identifier (argument_list "(DAT_000a98dc,&param_1,FUN_00063f00)" ( identifier , (pointer_expression "&param_1" & identifier) , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }" { (expression_statement "iVar2 = FUN_00063f20();" (assignment_expression "iVar2 = FUN_00063f20()" identifier = (call_expression "FUN_00063f20()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }" { (expression_statement "(**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));" (call_expression "(**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10))" (parenthesized_expression "(**(code **)(iVar1 + 0x14))" ( (pointer_expression "**(code **)(iVar1 + 0x14)" * (pointer_expression "*(code **)(iVar1 + 0x14)" * (cast_expression "(code **)(iVar1 + 0x14)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar1 + 0x14)" ( (binary_expression "iVar1 + 0x14" identifier + number_literal) ))))) )) (argument_list "(*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10))" ( (pointer_expression "*(undefined4 *)(iVar1 + 0x18)" * (cast_expression "(undefined4 *)(iVar1 + 0x18)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x18)" ( (binary_expression "iVar1 + 0x18" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(iVar1 + 4)" * (cast_expression "(undefined4 *)(iVar1 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 4)" ( (binary_expression "iVar1 + 4" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(iVar1 + 0x10)" * (cast_expression "(undefined4 *)(iVar1 + 0x10)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x10)" ( (binary_expression "iVar1 + 0x10" identifier + number_literal) )))) ))) ;) (expression_statement "FUN_00064070(iVar1);" (call_expression "FUN_00064070(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) })) (return_statement "return;" return ;) })) (expression_statement "FUN_00069b40(param_1);" (call_expression "FUN_00069b40(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid agent_select_result(int fd,int event)\n\n{\n  agent_pending_query *conn;\n  int iVar1;\n  \n  if (event != 1) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }\n  conn = (agent_pending_query *)find234(agent_pending_queries,&fd,agent_connfind);\n  if (conn != (agent_pending_query *)0x0) {\n    iVar1 = agent_try_read(conn);\n    if (iVar1 != 0) {\n      (*conn->callback)(conn->callback_ctx,conn->retbuf,conn->retlen);\n      agent_cancel_query(conn);\n    }\n    return;\n  }\n  uxsel_del(fd);\n  return;\n}\n\n" comment (function_definition "void agent_select_result(int fd,int event)\n\n{\n  agent_pending_query *conn;\n  int iVar1;\n  \n  if (event != 1) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }\n  conn = (agent_pending_query *)find234(agent_pending_queries,&fd,agent_connfind);\n  if (conn != (agent_pending_query *)0x0) {\n    iVar1 = agent_try_read(conn);\n    if (iVar1 != 0) {\n      (*conn->callback)(conn->callback_ctx,conn->retbuf,conn->retlen);\n      agent_cancel_query(conn);\n    }\n    return;\n  }\n  uxsel_del(fd);\n  return;\n}" primitive_type (function_declarator "agent_select_result(int fd,int event)" identifier (parameter_list "(int fd,int event)" ( (parameter_declaration "int fd" primitive_type identifier) , (parameter_declaration "int event" primitive_type identifier) ))) (compound_statement "{\n  agent_pending_query *conn;\n  int iVar1;\n  \n  if (event != 1) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }\n  conn = (agent_pending_query *)find234(agent_pending_queries,&fd,agent_connfind);\n  if (conn != (agent_pending_query *)0x0) {\n    iVar1 = agent_try_read(conn);\n    if (iVar1 != 0) {\n      (*conn->callback)(conn->callback_ctx,conn->retbuf,conn->retlen);\n      agent_cancel_query(conn);\n    }\n    return;\n  }\n  uxsel_del(fd);\n  return;\n}" { (declaration "agent_pending_query *conn;" type_identifier (pointer_declarator "*conn" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (event != 1) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }" if (parenthesized_expression "(event != 1)" ( (binary_expression "event != 1" identifier != number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }" { comment (expression_statement "__assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");" (call_expression "__assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result")" identifier (argument_list "("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result")" ( (string_literal ""event == SELECT_R"" " string_content ") , (string_literal ""unix/uxagentc.c"" " string_content ") , number_literal , (string_literal ""agent_select_result"" " string_content ") ))) ;) })) (expression_statement "conn = (agent_pending_query *)find234(agent_pending_queries,&fd,agent_connfind);" (assignment_expression "conn = (agent_pending_query *)find234(agent_pending_queries,&fd,agent_connfind)" identifier = (cast_expression "(agent_pending_query *)find234(agent_pending_queries,&fd,agent_connfind)" ( (type_descriptor "agent_pending_query *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "find234(agent_pending_queries,&fd,agent_connfind)" identifier (argument_list "(agent_pending_queries,&fd,agent_connfind)" ( identifier , (pointer_expression "&fd" & identifier) , identifier ))))) ;) (if_statement "if (conn != (agent_pending_query *)0x0) {\n    iVar1 = agent_try_read(conn);\n    if (iVar1 != 0) {\n      (*conn->callback)(conn->callback_ctx,conn->retbuf,conn->retlen);\n      agent_cancel_query(conn);\n    }\n    return;\n  }" if (parenthesized_expression "(conn != (agent_pending_query *)0x0)" ( (binary_expression "conn != (agent_pending_query *)0x0" identifier != (cast_expression "(agent_pending_query *)0x0" ( (type_descriptor "agent_pending_query *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar1 = agent_try_read(conn);\n    if (iVar1 != 0) {\n      (*conn->callback)(conn->callback_ctx,conn->retbuf,conn->retlen);\n      agent_cancel_query(conn);\n    }\n    return;\n  }" { (expression_statement "iVar1 = agent_try_read(conn);" (assignment_expression "iVar1 = agent_try_read(conn)" identifier = (call_expression "agent_try_read(conn)" identifier (argument_list "(conn)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n      (*conn->callback)(conn->callback_ctx,conn->retbuf,conn->retlen);\n      agent_cancel_query(conn);\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      (*conn->callback)(conn->callback_ctx,conn->retbuf,conn->retlen);\n      agent_cancel_query(conn);\n    }" { (expression_statement "(*conn->callback)(conn->callback_ctx,conn->retbuf,conn->retlen);" (call_expression "(*conn->callback)(conn->callback_ctx,conn->retbuf,conn->retlen)" (parenthesized_expression "(*conn->callback)" ( (pointer_expression "*conn->callback" * (field_expression "conn->callback" identifier -> field_identifier)) )) (argument_list "(conn->callback_ctx,conn->retbuf,conn->retlen)" ( (field_expression "conn->callback_ctx" identifier -> field_identifier) , (field_expression "conn->retbuf" identifier -> field_identifier) , (field_expression "conn->retlen" identifier -> field_identifier) ))) ;) (expression_statement "agent_cancel_query(conn);" (call_expression "agent_cancel_query(conn)" identifier (argument_list "(conn)" ( identifier ))) ;) })) (return_statement "return;" return ;) })) (expression_statement "uxsel_del(fd);" (call_expression "uxsel_del(fd)" identifier (argument_list "(fd)" ( identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_000640b0(undefined4 param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 != 1) {\n                    \n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }\n  iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);\n  if (iVar1 != 0) {\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }\n  FUN_00069b40(param_1);\n  return;\n}\n\n" (function_definition "void FUN_000640b0(undefined4 param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 != 1) {\n                    \n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }\n  iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);\n  if (iVar1 != 0) {\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }\n  FUN_00069b40(param_1);\n  return;\n}" primitive_type (function_declarator "FUN_000640b0(undefined4 param_1,int param_2)" identifier (parameter_list "(undefined4 param_1,int param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 != 1) {\n                    \n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }\n  iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);\n  if (iVar1 != 0) {\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }\n  FUN_00069b40(param_1);\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (param_2 != 1) {\n                    \n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }" if (parenthesized_expression "(param_2 != 1)" ( (binary_expression "param_2 != 1" identifier != number_literal) )) (compound_statement "{\n                    \n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }" { (expression_statement "__assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");" (call_expression "__assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result")" identifier (argument_list "("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result")" ( (string_literal ""event == SELECT_R"" " string_content ") , (string_literal ""unix/uxagentc.c"" " string_content ") , number_literal , (string_literal ""agent_select_result"" " string_content ") ))) ;) })) (expression_statement "iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);" (assignment_expression "iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00)" identifier = (call_expression "FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00)" identifier (argument_list "(DAT_000a98dc,&param_1,FUN_00063f00)" ( identifier , (pointer_expression "&param_1" & identifier) , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }" { (expression_statement "iVar2 = FUN_00063f20();" (assignment_expression "iVar2 = FUN_00063f20()" identifier = (call_expression "FUN_00063f20()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }" { (expression_statement "(**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));" (call_expression "(**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10))" (parenthesized_expression "(**(code **)(iVar1 + 0x14))" ( (pointer_expression "**(code **)(iVar1 + 0x14)" * (pointer_expression "*(code **)(iVar1 + 0x14)" * (cast_expression "(code **)(iVar1 + 0x14)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar1 + 0x14)" ( (binary_expression "iVar1 + 0x14" identifier + number_literal) ))))) )) (argument_list "(*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10))" ( (pointer_expression "*(undefined4 *)(iVar1 + 0x18)" * (cast_expression "(undefined4 *)(iVar1 + 0x18)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x18)" ( (binary_expression "iVar1 + 0x18" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(iVar1 + 4)" * (cast_expression "(undefined4 *)(iVar1 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 4)" ( (binary_expression "iVar1 + 4" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(iVar1 + 0x10)" * (cast_expression "(undefined4 *)(iVar1 + 0x10)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x10)" ( (binary_expression "iVar1 + 0x10" identifier + number_literal) )))) ))) ;) (expression_statement "FUN_00064070(iVar1);" (call_expression "FUN_00064070(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) })) (return_statement "return;" return ;) })) (expression_statement "FUN_00069b40(param_1);" (call_expression "FUN_00069b40(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( (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) )))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (return_statement return ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return ;) })))
(function_definition "void FUN_000640b0(undefined4 param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 != 1) {\n                    \n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }\n  iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);\n  if (iVar1 != 0) {\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }\n  FUN_00069b40(param_1);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_000640b0(undefined4 param_1,int param_2)" (identifier "FUN_000640b0") (parameter_list "(undefined4 param_1,int param_2)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 != 1) {\n                    \n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }\n  iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);\n  if (iVar1 != 0) {\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }\n  FUN_00069b40(param_1);\n  return;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (if_statement "if (param_2 != 1) {\n                    \n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }" (if "if") (parenthesized_expression "(param_2 != 1)" (( "(") (binary_expression "param_2 != 1" (identifier "param_2") (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n                    \n    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");\n  }" ({ "{") (expression_statement "__assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");" (call_expression "__assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result")" (identifier "__assert_fail") (argument_list "("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result")" (( "(") (string_literal ""event == SELECT_R"" (" """) (string_content "event == SELECT_R") (" """)) (, ",") (string_literal ""unix/uxagentc.c"" (" """) (string_content "unix/uxagentc.c") (" """)) (, ",") (number_literal "0x69") (, ",") (string_literal ""agent_select_result"" (" """) (string_content "agent_select_result") (" """)) () ")"))) (; ";")) (} "}"))) (expression_statement "iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);" (assignment_expression "iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00)" (identifier "iVar1") (= "=") (call_expression "FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00)" (identifier "FUN_00063df0") (argument_list "(DAT_000a98dc,&param_1,FUN_00063f00)" (( "(") (identifier "DAT_000a98dc") (, ",") (pointer_expression "&param_1" (& "&") (identifier "param_1")) (, ",") (identifier "FUN_00063f00") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    iVar2 = FUN_00063f20();\n    if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }\n    return;\n  }" ({ "{") (expression_statement "iVar2 = FUN_00063f20();" (assignment_expression "iVar2 = FUN_00063f20()" (identifier "iVar2") (= "=") (call_expression "FUN_00063f20()" (identifier "FUN_00063f20") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar2 != 0) {\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      (**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));\n      FUN_00064070(iVar1);\n    }" ({ "{") (expression_statement "(**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10));" (call_expression "(**(code **)(iVar1 + 0x14))\n                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10))" (parenthesized_expression "(**(code **)(iVar1 + 0x14))" (( "(") (pointer_expression "**(code **)(iVar1 + 0x14)" (* "*") (pointer_expression "*(code **)(iVar1 + 0x14)" (* "*") (cast_expression "(code **)(iVar1 + 0x14)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(iVar1 + 0x14)" (( "(") (binary_expression "iVar1 + 0x14" (identifier "iVar1") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (argument_list "(*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),\n                 *(undefined4 *)(iVar1 + 0x10))" (( "(") (pointer_expression "*(undefined4 *)(iVar1 + 0x18)" (* "*") (cast_expression "(undefined4 *)(iVar1 + 0x18)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x18)" (( "(") (binary_expression "iVar1 + 0x18" (identifier "iVar1") (+ "+") (number_literal "0x18")) () ")")))) (, ",") (pointer_expression "*(undefined4 *)(iVar1 + 4)" (* "*") (cast_expression "(undefined4 *)(iVar1 + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 4)" (( "(") (binary_expression "iVar1 + 4" (identifier "iVar1") (+ "+") (number_literal "4")) () ")")))) (, ",") (pointer_expression "*(undefined4 *)(iVar1 + 0x10)" (* "*") (cast_expression "(undefined4 *)(iVar1 + 0x10)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x10)" (( "(") (binary_expression "iVar1 + 0x10" (identifier "iVar1") (+ "+") (number_literal "0x10")) () ")")))) () ")"))) (; ";")) (expression_statement "FUN_00064070(iVar1);" (call_expression "FUN_00064070(iVar1)" (identifier "FUN_00064070") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "FUN_00069b40(param_1);" (call_expression "FUN_00069b40(param_1)" (identifier "FUN_00069b40") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

void function_1(int fd,int var_1)

{
  type_1 *var_4;
  int var_6;
  
  if (var_1 != 1) {
                    /* WARNING: Subroutine does not return */
    var_2("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");
  }
  var_4 = (type_1 *)var_3(agent_pending_queries,&fd,agent_connfind);
  if (var_4 != (type_1 *)0x0) {
    var_6 = var_5(var_4);
    if (var_6 != 0) {
      (*var_4->callback)(var_4->callback_ctx,var_4->retbuf,var_4->retlen);
      var_7(var_4);
    }
    return;
  }
  var_8(fd);
  return;
}


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

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

void MASKED(undefined4 param_1,int param_2)

{
  int iVar1;
  int iVar2;
  
  if (param_2 != 1) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("event == SELECT_R","unix/uxagentc.c",0x69,"agent_select_result");
  }
  iVar1 = FUN_00063df0(DAT_000a98dc,&param_1,FUN_00063f00);
  if (iVar1 != 0) {
    iVar2 = FUN_00063f20();
    if (iVar2 != 0) {
      (**(code **)(iVar1 + 0x14))
                (*(undefined4 *)(iVar1 + 0x18),*(undefined4 *)(iVar1 + 4),
                 *(undefined4 *)(iVar1 + 0x10));
      FUN_00064070(iVar1);
    }
    return;
  }
  FUN_00069b40(param_1);
  return;
}

