
int safe_poll(pollfd *ufds,nfds_t nfds,int timeout)

{
  int *piVar1;
  int iVar2;
  
  piVar1 = bb_errno;
  do {
    iVar2 = poll((pollfd *)ufds,nfds,timeout);
    if (-1 < iVar2) {
      return iVar2;
    }
    timeout = timeout - (uint)(0 < timeout);
  } while ((*piVar1 & 0xfffffff7U) == 4);
  bb_perror_msg("poll");
  return iVar2;
}



int FUN_001a4974(pollfd *param_1,nfds_t param_2,int param_3)

{
  uint *puVar1;
  int iVar2;
  
  puVar1 = DAT_001c65c0;
  do {
    iVar2 = poll(param_1,param_2,param_3);
    if (-1 < iVar2) {
      return iVar2;
    }
    param_3 = param_3 - (uint)(0 < param_3);
  } while ((*puVar1 & 0xfffffff7) == 4);
  FUN_0010d7b5(&DAT_001b945b);
  return iVar2;
}


PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
MOV R14,RDI
MOV R13,RSI
MOV EBX,EDX
MOV R12,qword ptr [0x001c65c0]
MOV EDX,EBX
MOV RSI,R13
MOV RDI,R14
CALL 0x0010bfa0
MOV EBP,EAX
TEST EAX,EAX
JNS 0x001a49c5
TEST EBX,EBX
SETG AL
MOVZX EAX,AL
SUB EBX,EAX
MOV EAX,dword ptr [R12]
AND EAX,0xfffffff7
CMP EAX,0x4
JZ 0x001a498b
LEA RDI,[0x1b945b]
MOV EAX,0x0
CALL 0x0010d7b5
MOV EAX,EBP
POP RBX
POP RBP
POP R12
POP R13
POP R14
RET
(translation_unit "int FUN_001a4974(pollfd *param_1,nfds_t param_2,int param_3)\n\n{\n  uint *puVar1;\n  int iVar2;\n  \n  puVar1 = DAT_001c65c0;\n  do {\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  } while ((*puVar1 & 0xfffffff7) == 4);\n  FUN_0010d7b5(&DAT_001b945b);\n  return iVar2;\n}\n\n" (function_definition "int FUN_001a4974(pollfd *param_1,nfds_t param_2,int param_3)\n\n{\n  uint *puVar1;\n  int iVar2;\n  \n  puVar1 = DAT_001c65c0;\n  do {\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  } while ((*puVar1 & 0xfffffff7) == 4);\n  FUN_0010d7b5(&DAT_001b945b);\n  return iVar2;\n}" primitive_type (function_declarator "FUN_001a4974(pollfd *param_1,nfds_t param_2,int param_3)" identifier (parameter_list "(pollfd *param_1,nfds_t param_2,int param_3)" ( (parameter_declaration "pollfd *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "nfds_t param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  uint *puVar1;\n  int iVar2;\n  \n  puVar1 = DAT_001c65c0;\n  do {\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  } while ((*puVar1 & 0xfffffff7) == 4);\n  FUN_0010d7b5(&DAT_001b945b);\n  return iVar2;\n}" { (declaration "uint *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "puVar1 = DAT_001c65c0;" (assignment_expression "puVar1 = DAT_001c65c0" identifier = identifier) ;) (do_statement "do {\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  } while ((*puVar1 & 0xfffffff7) == 4);" do (compound_statement "{\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  }" { (expression_statement "iVar2 = poll(param_1,param_2,param_3);" (assignment_expression "iVar2 = poll(param_1,param_2,param_3)" identifier = (call_expression "poll(param_1,param_2,param_3)" identifier (argument_list "(param_1,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (-1 < iVar2) {\n      return iVar2;\n    }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n      return iVar2;\n    }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "param_3 = param_3 - (uint)(0 < param_3);" (assignment_expression "param_3 = param_3 - (uint)(0 < param_3)" identifier = (binary_expression "param_3 - (uint)(0 < param_3)" identifier - (call_expression "(uint)(0 < param_3)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(0 < param_3)" ( (binary_expression "0 < param_3" number_literal < identifier) ))))) ;) }) while (parenthesized_expression "((*puVar1 & 0xfffffff7) == 4)" ( (binary_expression "(*puVar1 & 0xfffffff7) == 4" (parenthesized_expression "(*puVar1 & 0xfffffff7)" ( (binary_expression "*puVar1 & 0xfffffff7" (pointer_expression "*puVar1" * identifier) & number_literal) )) == number_literal) )) ;) (expression_statement "FUN_0010d7b5(&DAT_001b945b);" (call_expression "FUN_0010d7b5(&DAT_001b945b)" identifier (argument_list "(&DAT_001b945b)" ( (pointer_expression "&DAT_001b945b" & identifier) ))) ;) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "int safe_poll(pollfd *ufds,nfds_t nfds,int timeout)\n\n{\n  int *piVar1;\n  int iVar2;\n  \n  piVar1 = bb_errno;\n  do {\n    iVar2 = poll((pollfd *)ufds,nfds,timeout);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    timeout = timeout - (uint)(0 < timeout);\n  } while ((*piVar1 & 0xfffffff7U) == 4);\n  bb_perror_msg("poll");\n  return iVar2;\n}\n\n" (function_definition "int safe_poll(pollfd *ufds,nfds_t nfds,int timeout)\n\n{\n  int *piVar1;\n  int iVar2;\n  \n  piVar1 = bb_errno;\n  do {\n    iVar2 = poll((pollfd *)ufds,nfds,timeout);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    timeout = timeout - (uint)(0 < timeout);\n  } while ((*piVar1 & 0xfffffff7U) == 4);\n  bb_perror_msg("poll");\n  return iVar2;\n}" primitive_type (function_declarator "safe_poll(pollfd *ufds,nfds_t nfds,int timeout)" identifier (parameter_list "(pollfd *ufds,nfds_t nfds,int timeout)" ( (parameter_declaration "pollfd *ufds" type_identifier (pointer_declarator "*ufds" * identifier)) , (parameter_declaration "nfds_t nfds" type_identifier identifier) , (parameter_declaration "int timeout" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  \n  piVar1 = bb_errno;\n  do {\n    iVar2 = poll((pollfd *)ufds,nfds,timeout);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    timeout = timeout - (uint)(0 < timeout);\n  } while ((*piVar1 & 0xfffffff7U) == 4);\n  bb_perror_msg("poll");\n  return iVar2;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "piVar1 = bb_errno;" (assignment_expression "piVar1 = bb_errno" identifier = identifier) ;) (do_statement "do {\n    iVar2 = poll((pollfd *)ufds,nfds,timeout);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    timeout = timeout - (uint)(0 < timeout);\n  } while ((*piVar1 & 0xfffffff7U) == 4);" do (compound_statement "{\n    iVar2 = poll((pollfd *)ufds,nfds,timeout);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    timeout = timeout - (uint)(0 < timeout);\n  }" { (expression_statement "iVar2 = poll((pollfd *)ufds,nfds,timeout);" (assignment_expression "iVar2 = poll((pollfd *)ufds,nfds,timeout)" identifier = (call_expression "poll((pollfd *)ufds,nfds,timeout)" identifier (argument_list "((pollfd *)ufds,nfds,timeout)" ( (cast_expression "(pollfd *)ufds" ( (type_descriptor "pollfd *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , identifier , identifier )))) ;) (if_statement "if (-1 < iVar2) {\n      return iVar2;\n    }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n      return iVar2;\n    }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "timeout = timeout - (uint)(0 < timeout);" (assignment_expression "timeout = timeout - (uint)(0 < timeout)" identifier = (binary_expression "timeout - (uint)(0 < timeout)" identifier - (call_expression "(uint)(0 < timeout)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(0 < timeout)" ( (binary_expression "0 < timeout" number_literal < identifier) ))))) ;) }) while (parenthesized_expression "((*piVar1 & 0xfffffff7U) == 4)" ( (binary_expression "(*piVar1 & 0xfffffff7U) == 4" (parenthesized_expression "(*piVar1 & 0xfffffff7U)" ( (binary_expression "*piVar1 & 0xfffffff7U" (pointer_expression "*piVar1" * identifier) & number_literal) )) == number_literal) )) ;) (expression_statement "bb_perror_msg("poll");" (call_expression "bb_perror_msg("poll")" identifier (argument_list "("poll")" ( (string_literal ""poll"" " string_content ") ))) ;) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "int FUN_001a4974(pollfd *param_1,nfds_t param_2,int param_3)\n\n{\n  uint *puVar1;\n  int iVar2;\n  \n  puVar1 = DAT_001c65c0;\n  do {\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  } while ((*puVar1 & 0xfffffff7) == 4);\n  FUN_0010d7b5(&DAT_001b945b);\n  return iVar2;\n}\n\n" (function_definition "int FUN_001a4974(pollfd *param_1,nfds_t param_2,int param_3)\n\n{\n  uint *puVar1;\n  int iVar2;\n  \n  puVar1 = DAT_001c65c0;\n  do {\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  } while ((*puVar1 & 0xfffffff7) == 4);\n  FUN_0010d7b5(&DAT_001b945b);\n  return iVar2;\n}" primitive_type (function_declarator "FUN_001a4974(pollfd *param_1,nfds_t param_2,int param_3)" identifier (parameter_list "(pollfd *param_1,nfds_t param_2,int param_3)" ( (parameter_declaration "pollfd *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "nfds_t param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  uint *puVar1;\n  int iVar2;\n  \n  puVar1 = DAT_001c65c0;\n  do {\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  } while ((*puVar1 & 0xfffffff7) == 4);\n  FUN_0010d7b5(&DAT_001b945b);\n  return iVar2;\n}" { (declaration "uint *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "puVar1 = DAT_001c65c0;" (assignment_expression "puVar1 = DAT_001c65c0" identifier = identifier) ;) (do_statement "do {\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  } while ((*puVar1 & 0xfffffff7) == 4);" do (compound_statement "{\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  }" { (expression_statement "iVar2 = poll(param_1,param_2,param_3);" (assignment_expression "iVar2 = poll(param_1,param_2,param_3)" identifier = (call_expression "poll(param_1,param_2,param_3)" identifier (argument_list "(param_1,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (-1 < iVar2) {\n      return iVar2;\n    }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n      return iVar2;\n    }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "param_3 = param_3 - (uint)(0 < param_3);" (assignment_expression "param_3 = param_3 - (uint)(0 < param_3)" identifier = (binary_expression "param_3 - (uint)(0 < param_3)" identifier - (call_expression "(uint)(0 < param_3)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(0 < param_3)" ( (binary_expression "0 < param_3" number_literal < identifier) ))))) ;) }) while (parenthesized_expression "((*puVar1 & 0xfffffff7) == 4)" ( (binary_expression "(*puVar1 & 0xfffffff7) == 4" (parenthesized_expression "(*puVar1 & 0xfffffff7)" ( (binary_expression "*puVar1 & 0xfffffff7" (pointer_expression "*puVar1" * identifier) & number_literal) )) == number_literal) )) ;) (expression_statement "FUN_0010d7b5(&DAT_001b945b);" (call_expression "FUN_0010d7b5(&DAT_001b945b)" identifier (argument_list "(&DAT_001b945b)" ( (pointer_expression "&DAT_001b945b" & identifier) ))) ;) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression LIT < IDENT) ))))) ;) }) while (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) & LIT) )) == LIT) )) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression & IDENT) ))) ;) (return_statement return IDENT ;) })))
(function_definition "int FUN_001a4974(pollfd *param_1,nfds_t param_2,int param_3)\n\n{\n  uint *puVar1;\n  int iVar2;\n  \n  puVar1 = DAT_001c65c0;\n  do {\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  } while ((*puVar1 & 0xfffffff7) == 4);\n  FUN_0010d7b5(&DAT_001b945b);\n  return iVar2;\n}" (primitive_type "int") (function_declarator "FUN_001a4974(pollfd *param_1,nfds_t param_2,int param_3)" (identifier "FUN_001a4974") (parameter_list "(pollfd *param_1,nfds_t param_2,int param_3)" (( "(") (parameter_declaration "pollfd *param_1" (type_identifier "pollfd") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "nfds_t param_2" (type_identifier "nfds_t") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  uint *puVar1;\n  int iVar2;\n  \n  puVar1 = DAT_001c65c0;\n  do {\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  } while ((*puVar1 & 0xfffffff7) == 4);\n  FUN_0010d7b5(&DAT_001b945b);\n  return iVar2;\n}" ({ "{") (declaration "uint *puVar1;" (type_identifier "uint") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (expression_statement "puVar1 = DAT_001c65c0;" (assignment_expression "puVar1 = DAT_001c65c0" (identifier "puVar1") (= "=") (identifier "DAT_001c65c0")) (; ";")) (do_statement "do {\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  } while ((*puVar1 & 0xfffffff7) == 4);" (do "do") (compound_statement "{\n    iVar2 = poll(param_1,param_2,param_3);\n    if (-1 < iVar2) {\n      return iVar2;\n    }\n    param_3 = param_3 - (uint)(0 < param_3);\n  }" ({ "{") (expression_statement "iVar2 = poll(param_1,param_2,param_3);" (assignment_expression "iVar2 = poll(param_1,param_2,param_3)" (identifier "iVar2") (= "=") (call_expression "poll(param_1,param_2,param_3)" (identifier "poll") (argument_list "(param_1,param_2,param_3)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (-1 < iVar2) {\n      return iVar2;\n    }" (if "if") (parenthesized_expression "(-1 < iVar2)" (( "(") (binary_expression "-1 < iVar2" (number_literal "-1") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n      return iVar2;\n    }" ({ "{") (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (expression_statement "param_3 = param_3 - (uint)(0 < param_3);" (assignment_expression "param_3 = param_3 - (uint)(0 < param_3)" (identifier "param_3") (= "=") (binary_expression "param_3 - (uint)(0 < param_3)" (identifier "param_3") (- "-") (call_expression "(uint)(0 < param_3)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(0 < param_3)" (( "(") (binary_expression "0 < param_3" (number_literal "0") (< "<") (identifier "param_3")) () ")"))))) (; ";")) (} "}")) (while "while") (parenthesized_expression "((*puVar1 & 0xfffffff7) == 4)" (( "(") (binary_expression "(*puVar1 & 0xfffffff7) == 4" (parenthesized_expression "(*puVar1 & 0xfffffff7)" (( "(") (binary_expression "*puVar1 & 0xfffffff7" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (& "&") (number_literal "0xfffffff7")) () ")")) (== "==") (number_literal "4")) () ")")) (; ";")) (expression_statement "FUN_0010d7b5(&DAT_001b945b);" (call_expression "FUN_0010d7b5(&DAT_001b945b)" (identifier "FUN_0010d7b5") (argument_list "(&DAT_001b945b)" (( "(") (pointer_expression "&DAT_001b945b" (& "&") (identifier "DAT_001b945b")) () ")"))) (; ";")) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))

int function_1(type_1 *ufds,type_2 nfds,int var_3)

{
  int *piVar1;
  int var_2;
  
  piVar1 = bb_errno;
  do {
    var_2 = var_1((type_1 *)ufds,nfds,var_3);
    if (-1 < var_2) {
      return var_2;
    }
    var_3 = var_3 - (uint)(0 < var_3);
  } while ((*piVar1 & 0xfffffff7U) == 4);
  var_4("poll");
  return var_2;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (number_literal) right: (identifier)))))))) condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) right: (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier))))) (return_statement (identifier)))))

int MASKED(pollfd *param_1,nfds_t param_2,int param_3)

{
  uint *puVar1;
  int iVar2;
  
  puVar1 = DAT_001c65c0;
  do {
    iVar2 = poll(param_1,param_2,param_3);
    if (-1 < iVar2) {
      return iVar2;
    }
    param_3 = param_3 - (uint)(0 < param_3);
  } while ((*puVar1 & 0xfffffff7) == 4);
  FUN_0010d7b5(&DAT_001b945b);
  return iVar2;
}

