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

void pty_select_result(int fd,int event)

{
  int iVar1;
  Pty ppVar2;
  int in_GS_OFFSET;
  pid_t pid;
  int status;
  char c [1];
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  if (pty_signal_pipe[0] == fd) {
    read(pty_signal_pipe[0],c,1);
    do {
      pid = waitpid(-1,&status,1);
      ppVar2 = (Pty)find234(ptys_by_pid,&pid,pty_find_by_pid);
      if (ppVar2 != (Pty)0x0) {
        pty_real_select_result(ppVar2,-1,status);
      }
    } while (0 < pid);
  }
  else {
    ppVar2 = (Pty)find234(ptys_by_fd,&fd,pty_find_by_fd);
    if (ppVar2 != (Pty)0x0) {
      pty_real_select_result(ppVar2,event,0);
    }
  }
  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail_local();
  }
  return;
}



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

void FUN_00059b20(int param_1,undefined4 param_2)

{
  int iVar1;
  int in_GS_OFFSET;
  __pid_t local_2c;
  int local_28;
  undefined1 local_21;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x59b29;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (DAT_000a2014 == param_1) {
    read(DAT_000a2014,&local_21,1);
    do {
      local_2c = waitpid(-1,&local_28,1);
      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);
      if (iVar1 != 0) {
        FUN_00059850(iVar1,0xffffffff,local_28);
      }
    } while (0 < local_2c);
  }
  else {
    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);
    if (iVar1 != 0) {
      FUN_00059850(iVar1,param_2,0);
    }
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_0005c430();
  }
  return;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x0001a360
ADD EBX,0x47cbb
SUB ESP,0x1c
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0xc],EAX
XOR EAX,EAX
MOV EAX,dword ptr [EBX + 0x830]
CMP EAX,dword ptr [ESP + 0x30]
JZ 0x00059b98
SUB ESP,0x4
LEA EAX,[EBX + 0xfffb6d5c]
PUSH EAX
LEA EAX,[ESP + 0x38]
PUSH EAX
PUSH dword ptr [EBX + 0xaa8]
CALL 0x000406a0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00059b7d
SUB ESP,0x4
PUSH 0x0
PUSH dword ptr [ESP + 0x3c]
PUSH EAX
CALL 0x00059850
ADD ESP,0x10
MOV EAX,dword ptr [ESP + 0xc]
XOR EAX,dword ptr GS:[0x14]
JNZ 0x00059c06
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x4
LEA EDI,[EBX + 0xfffb6dac]
PUSH 0x1
LEA EDX,[ESP + 0x13]
PUSH EDX
PUSH EAX
CALL 0x00019b30
ADD ESP,0x10
LEA EBP,[ESP + 0x4]
MOV ESI,ESP
LEA ESI,[ESI]
NOP
SUB ESP,0x4
PUSH 0x1
PUSH EBP
PUSH -0x1
CALL 0x00018050
MOV dword ptr [ESP + 0x10],EAX
ADD ESP,0xc
PUSH EDI
PUSH ESI
PUSH dword ptr [EBX + 0xaa4]
CALL 0x000406a0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00059bfa
SUB ESP,0x4
PUSH dword ptr [ESP + 0x8]
PUSH -0x1
PUSH EAX
CALL 0x00059850
ADD ESP,0x10
MOV EAX,dword ptr [ESP]
TEST EAX,EAX
JG 0x00059bc0
JMP 0x00059b7d
CALL 0x0005c430
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_00059b20(int param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  __pid_t local_2c;\n  int local_28;\n  undefined1 local_21;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x59b29;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (DAT_000a2014 == param_1) {\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }\n  else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0005c430();\n  }\n  return;\n}\n\n" comment (function_definition "void FUN_00059b20(int param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  __pid_t local_2c;\n  int local_28;\n  undefined1 local_21;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x59b29;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (DAT_000a2014 == param_1) {\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }\n  else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0005c430();\n  }\n  return;\n}" primitive_type (function_declarator "FUN_00059b20(int param_1,undefined4 param_2)" identifier (parameter_list "(int param_1,undefined4 param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  __pid_t local_2c;\n  int local_28;\n  undefined1 local_21;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x59b29;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (DAT_000a2014 == param_1) {\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }\n  else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0005c430();\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "__pid_t local_2c;" type_identifier identifier ;) (declaration "int local_28;" primitive_type identifier ;) (declaration "undefined1 local_21;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x59b29;" (assignment_expression "uStack_14 = 0x59b29" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (DAT_000a2014 == param_1) {\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }\n  else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }" if (parenthesized_expression "(DAT_000a2014 == param_1)" ( (binary_expression "DAT_000a2014 == param_1" identifier == identifier) )) (compound_statement "{\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }" { (expression_statement "read(DAT_000a2014,&local_21,1);" (call_expression "read(DAT_000a2014,&local_21,1)" identifier (argument_list "(DAT_000a2014,&local_21,1)" ( identifier , (pointer_expression "&local_21" & identifier) , number_literal ))) ;) (do_statement "do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);" do (compound_statement "{\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    }" { (expression_statement "local_2c = waitpid(-1,&local_28,1);" (assignment_expression "local_2c = waitpid(-1,&local_28,1)" identifier = (call_expression "waitpid(-1,&local_28,1)" identifier (argument_list "(-1,&local_28,1)" ( number_literal , (pointer_expression "&local_28" & identifier) , number_literal )))) ;) (expression_statement "iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);" (assignment_expression "iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590)" identifier = (call_expression "FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590)" identifier (argument_list "(DAT_000a2288,&local_2c,FUN_00058590)" ( identifier , (pointer_expression "&local_2c" & identifier) , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }" { (expression_statement "FUN_00059850(iVar1,0xffffffff,local_28);" (call_expression "FUN_00059850(iVar1,0xffffffff,local_28)" identifier (argument_list "(iVar1,0xffffffff,local_28)" ( identifier , number_literal , identifier ))) ;) })) }) while (parenthesized_expression "(0 < local_2c)" ( (binary_expression "0 < local_2c" number_literal < identifier) )) ;) }) (else_clause "else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }" else (compound_statement "{\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }" { (expression_statement "iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);" (assignment_expression "iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540)" identifier = (call_expression "FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540)" identifier (argument_list "(DAT_000a228c,&param_1,FUN_00058540)" ( identifier , (pointer_expression "&param_1" & identifier) , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_00059850(iVar1,param_2,0);\n    }" { (expression_statement "FUN_00059850(iVar1,param_2,0);" (call_expression "FUN_00059850(iVar1,param_2,0)" identifier (argument_list "(iVar1,param_2,0)" ( identifier , identifier , number_literal ))) ;) })) }))) (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0005c430();\n  }" if (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_0005c430();\n  }" { comment (expression_statement "FUN_0005c430();" (call_expression "FUN_0005c430()" identifier (argument_list "()" ( ))) ;) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid pty_select_result(int fd,int event)\n\n{\n  int iVar1;\n  Pty ppVar2;\n  int in_GS_OFFSET;\n  pid_t pid;\n  int status;\n  char c [1];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (pty_signal_pipe[0] == fd) {\n    read(pty_signal_pipe[0],c,1);\n    do {\n      pid = waitpid(-1,&status,1);\n      ppVar2 = (Pty)find234(ptys_by_pid,&pid,pty_find_by_pid);\n      if (ppVar2 != (Pty)0x0) {\n        pty_real_select_result(ppVar2,-1,status);\n      }\n    } while (0 < pid);\n  }\n  else {\n    ppVar2 = (Pty)find234(ptys_by_fd,&fd,pty_find_by_fd);\n    if (ppVar2 != (Pty)0x0) {\n      pty_real_select_result(ppVar2,event,0);\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return;\n}\n\n" comment (function_definition "void pty_select_result(int fd,int event)\n\n{\n  int iVar1;\n  Pty ppVar2;\n  int in_GS_OFFSET;\n  pid_t pid;\n  int status;\n  char c [1];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (pty_signal_pipe[0] == fd) {\n    read(pty_signal_pipe[0],c,1);\n    do {\n      pid = waitpid(-1,&status,1);\n      ppVar2 = (Pty)find234(ptys_by_pid,&pid,pty_find_by_pid);\n      if (ppVar2 != (Pty)0x0) {\n        pty_real_select_result(ppVar2,-1,status);\n      }\n    } while (0 < pid);\n  }\n  else {\n    ppVar2 = (Pty)find234(ptys_by_fd,&fd,pty_find_by_fd);\n    if (ppVar2 != (Pty)0x0) {\n      pty_real_select_result(ppVar2,event,0);\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return;\n}" primitive_type (function_declarator "pty_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  int iVar1;\n  Pty ppVar2;\n  int in_GS_OFFSET;\n  pid_t pid;\n  int status;\n  char c [1];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (pty_signal_pipe[0] == fd) {\n    read(pty_signal_pipe[0],c,1);\n    do {\n      pid = waitpid(-1,&status,1);\n      ppVar2 = (Pty)find234(ptys_by_pid,&pid,pty_find_by_pid);\n      if (ppVar2 != (Pty)0x0) {\n        pty_real_select_result(ppVar2,-1,status);\n      }\n    } while (0 < pid);\n  }\n  else {\n    ppVar2 = (Pty)find234(ptys_by_fd,&fd,pty_find_by_fd);\n    if (ppVar2 != (Pty)0x0) {\n      pty_real_select_result(ppVar2,event,0);\n    }\n  }\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "Pty ppVar2;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "pid_t pid;" type_identifier identifier ;) (declaration "int status;" primitive_type identifier ;) (declaration "char c [1];" primitive_type (array_declarator "c [1]" identifier [ number_literal ]) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (pty_signal_pipe[0] == fd) {\n    read(pty_signal_pipe[0],c,1);\n    do {\n      pid = waitpid(-1,&status,1);\n      ppVar2 = (Pty)find234(ptys_by_pid,&pid,pty_find_by_pid);\n      if (ppVar2 != (Pty)0x0) {\n        pty_real_select_result(ppVar2,-1,status);\n      }\n    } while (0 < pid);\n  }\n  else {\n    ppVar2 = (Pty)find234(ptys_by_fd,&fd,pty_find_by_fd);\n    if (ppVar2 != (Pty)0x0) {\n      pty_real_select_result(ppVar2,event,0);\n    }\n  }" if (parenthesized_expression "(pty_signal_pipe[0] == fd)" ( (binary_expression "pty_signal_pipe[0] == fd" (subscript_expression "pty_signal_pipe[0]" identifier [ number_literal ]) == identifier) )) (compound_statement "{\n    read(pty_signal_pipe[0],c,1);\n    do {\n      pid = waitpid(-1,&status,1);\n      ppVar2 = (Pty)find234(ptys_by_pid,&pid,pty_find_by_pid);\n      if (ppVar2 != (Pty)0x0) {\n        pty_real_select_result(ppVar2,-1,status);\n      }\n    } while (0 < pid);\n  }" { (expression_statement "read(pty_signal_pipe[0],c,1);" (call_expression "read(pty_signal_pipe[0],c,1)" identifier (argument_list "(pty_signal_pipe[0],c,1)" ( (subscript_expression "pty_signal_pipe[0]" identifier [ number_literal ]) , identifier , number_literal ))) ;) (do_statement "do {\n      pid = waitpid(-1,&status,1);\n      ppVar2 = (Pty)find234(ptys_by_pid,&pid,pty_find_by_pid);\n      if (ppVar2 != (Pty)0x0) {\n        pty_real_select_result(ppVar2,-1,status);\n      }\n    } while (0 < pid);" do (compound_statement "{\n      pid = waitpid(-1,&status,1);\n      ppVar2 = (Pty)find234(ptys_by_pid,&pid,pty_find_by_pid);\n      if (ppVar2 != (Pty)0x0) {\n        pty_real_select_result(ppVar2,-1,status);\n      }\n    }" { (expression_statement "pid = waitpid(-1,&status,1);" (assignment_expression "pid = waitpid(-1,&status,1)" identifier = (call_expression "waitpid(-1,&status,1)" identifier (argument_list "(-1,&status,1)" ( number_literal , (pointer_expression "&status" & identifier) , number_literal )))) ;) (expression_statement "ppVar2 = (Pty)find234(ptys_by_pid,&pid,pty_find_by_pid);" (assignment_expression "ppVar2 = (Pty)find234(ptys_by_pid,&pid,pty_find_by_pid)" identifier = (cast_expression "(Pty)find234(ptys_by_pid,&pid,pty_find_by_pid)" ( (type_descriptor "Pty" type_identifier) ) (call_expression "find234(ptys_by_pid,&pid,pty_find_by_pid)" identifier (argument_list "(ptys_by_pid,&pid,pty_find_by_pid)" ( identifier , (pointer_expression "&pid" & identifier) , identifier ))))) ;) (if_statement "if (ppVar2 != (Pty)0x0) {\n        pty_real_select_result(ppVar2,-1,status);\n      }" if (parenthesized_expression "(ppVar2 != (Pty)0x0)" ( (binary_expression "ppVar2 != (Pty)0x0" identifier != (cast_expression "(Pty)0x0" ( (type_descriptor "Pty" type_identifier) ) number_literal)) )) (compound_statement "{\n        pty_real_select_result(ppVar2,-1,status);\n      }" { (expression_statement "pty_real_select_result(ppVar2,-1,status);" (call_expression "pty_real_select_result(ppVar2,-1,status)" identifier (argument_list "(ppVar2,-1,status)" ( identifier , number_literal , identifier ))) ;) })) }) while (parenthesized_expression "(0 < pid)" ( (binary_expression "0 < pid" number_literal < identifier) )) ;) }) (else_clause "else {\n    ppVar2 = (Pty)find234(ptys_by_fd,&fd,pty_find_by_fd);\n    if (ppVar2 != (Pty)0x0) {\n      pty_real_select_result(ppVar2,event,0);\n    }\n  }" else (compound_statement "{\n    ppVar2 = (Pty)find234(ptys_by_fd,&fd,pty_find_by_fd);\n    if (ppVar2 != (Pty)0x0) {\n      pty_real_select_result(ppVar2,event,0);\n    }\n  }" { (expression_statement "ppVar2 = (Pty)find234(ptys_by_fd,&fd,pty_find_by_fd);" (assignment_expression "ppVar2 = (Pty)find234(ptys_by_fd,&fd,pty_find_by_fd)" identifier = (cast_expression "(Pty)find234(ptys_by_fd,&fd,pty_find_by_fd)" ( (type_descriptor "Pty" type_identifier) ) (call_expression "find234(ptys_by_fd,&fd,pty_find_by_fd)" identifier (argument_list "(ptys_by_fd,&fd,pty_find_by_fd)" ( identifier , (pointer_expression "&fd" & identifier) , identifier ))))) ;) (if_statement "if (ppVar2 != (Pty)0x0) {\n      pty_real_select_result(ppVar2,event,0);\n    }" if (parenthesized_expression "(ppVar2 != (Pty)0x0)" ( (binary_expression "ppVar2 != (Pty)0x0" identifier != (cast_expression "(Pty)0x0" ( (type_descriptor "Pty" type_identifier) ) number_literal)) )) (compound_statement "{\n      pty_real_select_result(ppVar2,event,0);\n    }" { (expression_statement "pty_real_select_result(ppVar2,event,0);" (call_expression "pty_real_select_result(ppVar2,event,0)" identifier (argument_list "(ppVar2,event,0)" ( identifier , identifier , number_literal ))) ;) })) }))) (if_statement "if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" if (parenthesized_expression "(iVar1 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" { comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })) (return_statement "return;" return ;) })))
(translation_unit "void FUN_00059b20(int param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  __pid_t local_2c;\n  int local_28;\n  undefined1 local_21;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x59b29;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (DAT_000a2014 == param_1) {\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }\n  else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0005c430();\n  }\n  return;\n}\n\n" (function_definition "void FUN_00059b20(int param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  __pid_t local_2c;\n  int local_28;\n  undefined1 local_21;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x59b29;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (DAT_000a2014 == param_1) {\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }\n  else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0005c430();\n  }\n  return;\n}" primitive_type (function_declarator "FUN_00059b20(int param_1,undefined4 param_2)" identifier (parameter_list "(int param_1,undefined4 param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  __pid_t local_2c;\n  int local_28;\n  undefined1 local_21;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x59b29;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (DAT_000a2014 == param_1) {\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }\n  else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0005c430();\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "__pid_t local_2c;" type_identifier identifier ;) (declaration "int local_28;" primitive_type identifier ;) (declaration "undefined1 local_21;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x59b29;" (assignment_expression "uStack_14 = 0x59b29" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (DAT_000a2014 == param_1) {\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }\n  else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }" if (parenthesized_expression "(DAT_000a2014 == param_1)" ( (binary_expression "DAT_000a2014 == param_1" identifier == identifier) )) (compound_statement "{\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }" { (expression_statement "read(DAT_000a2014,&local_21,1);" (call_expression "read(DAT_000a2014,&local_21,1)" identifier (argument_list "(DAT_000a2014,&local_21,1)" ( identifier , (pointer_expression "&local_21" & identifier) , number_literal ))) ;) (do_statement "do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);" do (compound_statement "{\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    }" { (expression_statement "local_2c = waitpid(-1,&local_28,1);" (assignment_expression "local_2c = waitpid(-1,&local_28,1)" identifier = (call_expression "waitpid(-1,&local_28,1)" identifier (argument_list "(-1,&local_28,1)" ( number_literal , (pointer_expression "&local_28" & identifier) , number_literal )))) ;) (expression_statement "iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);" (assignment_expression "iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590)" identifier = (call_expression "FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590)" identifier (argument_list "(DAT_000a2288,&local_2c,FUN_00058590)" ( identifier , (pointer_expression "&local_2c" & identifier) , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }" { (expression_statement "FUN_00059850(iVar1,0xffffffff,local_28);" (call_expression "FUN_00059850(iVar1,0xffffffff,local_28)" identifier (argument_list "(iVar1,0xffffffff,local_28)" ( identifier , number_literal , identifier ))) ;) })) }) while (parenthesized_expression "(0 < local_2c)" ( (binary_expression "0 < local_2c" number_literal < identifier) )) ;) }) (else_clause "else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }" else (compound_statement "{\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }" { (expression_statement "iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);" (assignment_expression "iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540)" identifier = (call_expression "FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540)" identifier (argument_list "(DAT_000a228c,&param_1,FUN_00058540)" ( identifier , (pointer_expression "&param_1" & identifier) , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_00059850(iVar1,param_2,0);\n    }" { (expression_statement "FUN_00059850(iVar1,param_2,0);" (call_expression "FUN_00059850(iVar1,param_2,0)" identifier (argument_list "(iVar1,param_2,0)" ( identifier , identifier , number_literal ))) ;) })) }))) (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0005c430();\n  }" if (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    \n    FUN_0005c430();\n  }" { (expression_statement "FUN_0005c430();" (call_expression "FUN_0005c430()" identifier (argument_list "()" ( ))) ;) })) (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 ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) , LIT ))) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , (pointer_expression & IDENT) , LIT )))) ;) (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 (call_expression IDENT (argument_list ( IDENT , LIT , IDENT ))) ;) })) }) while (parenthesized_expression ( (binary_expression LIT < IDENT) )) ;) }) (else_clause else (compound_statement { (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 (call_expression IDENT (argument_list ( IDENT , IDENT , LIT ))) ;) })) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (return_statement return ;) })))
(function_definition "void FUN_00059b20(int param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  __pid_t local_2c;\n  int local_28;\n  undefined1 local_21;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x59b29;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (DAT_000a2014 == param_1) {\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }\n  else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0005c430();\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00059b20(int param_1,undefined4 param_2)" (identifier "FUN_00059b20") (parameter_list "(int param_1,undefined4 param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  __pid_t local_2c;\n  int local_28;\n  undefined1 local_21;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x59b29;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (DAT_000a2014 == param_1) {\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }\n  else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0005c430();\n  }\n  return;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "__pid_t local_2c;" (type_identifier "__pid_t") (identifier "local_2c") (; ";")) (declaration "int local_28;" (primitive_type "int") (identifier "local_28") (; ";")) (declaration "undefined1 local_21;" (type_identifier "undefined1") (identifier "local_21") (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x59b29;" (assignment_expression "uStack_14 = 0x59b29" (identifier "uStack_14") (= "=") (number_literal "0x59b29")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (if_statement "if (DAT_000a2014 == param_1) {\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }\n  else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }" (if "if") (parenthesized_expression "(DAT_000a2014 == param_1)" (( "(") (binary_expression "DAT_000a2014 == param_1" (identifier "DAT_000a2014") (== "==") (identifier "param_1")) () ")")) (compound_statement "{\n    read(DAT_000a2014,&local_21,1);\n    do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);\n  }" ({ "{") (expression_statement "read(DAT_000a2014,&local_21,1);" (call_expression "read(DAT_000a2014,&local_21,1)" (identifier "read") (argument_list "(DAT_000a2014,&local_21,1)" (( "(") (identifier "DAT_000a2014") (, ",") (pointer_expression "&local_21" (& "&") (identifier "local_21")) (, ",") (number_literal "1") () ")"))) (; ";")) (do_statement "do {\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    } while (0 < local_2c);" (do "do") (compound_statement "{\n      local_2c = waitpid(-1,&local_28,1);\n      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);\n      if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }\n    }" ({ "{") (expression_statement "local_2c = waitpid(-1,&local_28,1);" (assignment_expression "local_2c = waitpid(-1,&local_28,1)" (identifier "local_2c") (= "=") (call_expression "waitpid(-1,&local_28,1)" (identifier "waitpid") (argument_list "(-1,&local_28,1)" (( "(") (number_literal "-1") (, ",") (pointer_expression "&local_28" (& "&") (identifier "local_28")) (, ",") (number_literal "1") () ")")))) (; ";")) (expression_statement "iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);" (assignment_expression "iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590)" (identifier "iVar1") (= "=") (call_expression "FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590)" (identifier "FUN_000406a0") (argument_list "(DAT_000a2288,&local_2c,FUN_00058590)" (( "(") (identifier "DAT_000a2288") (, ",") (pointer_expression "&local_2c" (& "&") (identifier "local_2c")) (, ",") (identifier "FUN_00058590") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        FUN_00059850(iVar1,0xffffffff,local_28);\n      }" ({ "{") (expression_statement "FUN_00059850(iVar1,0xffffffff,local_28);" (call_expression "FUN_00059850(iVar1,0xffffffff,local_28)" (identifier "FUN_00059850") (argument_list "(iVar1,0xffffffff,local_28)" (( "(") (identifier "iVar1") (, ",") (number_literal "0xffffffff") (, ",") (identifier "local_28") () ")"))) (; ";")) (} "}"))) (} "}")) (while "while") (parenthesized_expression "(0 < local_2c)" (( "(") (binary_expression "0 < local_2c" (number_literal "0") (< "<") (identifier "local_2c")) () ")")) (; ";")) (} "}")) (else_clause "else {\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }" (else "else") (compound_statement "{\n    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);\n    if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }\n  }" ({ "{") (expression_statement "iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);" (assignment_expression "iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540)" (identifier "iVar1") (= "=") (call_expression "FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540)" (identifier "FUN_000406a0") (argument_list "(DAT_000a228c,&param_1,FUN_00058540)" (( "(") (identifier "DAT_000a228c") (, ",") (pointer_expression "&param_1" (& "&") (identifier "param_1")) (, ",") (identifier "FUN_00058540") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n      FUN_00059850(iVar1,param_2,0);\n    }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_00059850(iVar1,param_2,0);\n    }" ({ "{") (expression_statement "FUN_00059850(iVar1,param_2,0);" (call_expression "FUN_00059850(iVar1,param_2,0)" (identifier "FUN_00059850") (argument_list "(iVar1,param_2,0)" (( "(") (identifier "iVar1") (, ",") (identifier "param_2") (, ",") (number_literal "0") () ")"))) (; ";")) (} "}"))) (} "}")))) (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0005c430();\n  }" (if "if") (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (!= "!=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n                    \n    FUN_0005c430();\n  }" ({ "{") (expression_statement "FUN_0005c430();" (call_expression "FUN_0005c430()" (identifier "FUN_0005c430") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

void function_1(int var_2,int event)

{
  int var_9;
  type_1 var_6;
  int var_1;
  type_2 var_8;
  int status;
  char c [1];
  
  var_9 = *(int *)(var_1 + 0x14);
  if (pty_signal_pipe[0] == var_2) {
    var_3(pty_signal_pipe[0],c,1);
    do {
      var_8 = var_4(-1,&status,1);
      var_6 = (type_1)var_5(ptys_by_pid,&var_8,pty_find_by_pid);
      if (var_6 != (type_1)0x0) {
        var_7(var_6,-1,status);
      }
    } while (0 < var_8);
  }
  else {
    var_6 = (type_1)var_5(ptys_by_fd,&var_2,pty_find_by_fd);
    if (var_6 != (type_1)0x0) {
      var_7(var_6,event,0);
    }
  }
  if (var_9 != *(int *)(var_1 + 0x14)) {
                    /* WARNING: Subroutine does not return */
    var_10();
  }
  return;
}


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

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

void MASKED(int param_1,undefined4 param_2)

{
  int iVar1;
  int in_GS_OFFSET;
  __pid_t local_2c;
  int local_28;
  undefined1 local_21;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x59b29;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (DAT_000a2014 == param_1) {
    read(DAT_000a2014,&local_21,1);
    do {
      local_2c = waitpid(-1,&local_28,1);
      iVar1 = FUN_000406a0(DAT_000a2288,&local_2c,FUN_00058590);
      if (iVar1 != 0) {
        FUN_00059850(iVar1,0xffffffff,local_28);
      }
    } while (0 < local_2c);
  }
  else {
    iVar1 = FUN_000406a0(DAT_000a228c,&param_1,FUN_00058540);
    if (iVar1 != 0) {
      FUN_00059850(iVar1,param_2,0);
    }
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_0005c430();
  }
  return;
}

