
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention -- yet parameter storage is locked */

void wait_procsubs(void)

{
  int iVar1;
  pid_t *ppVar2;
  int iVar3;
  
  if ((0 < nfds) && (0 < totfds)) {
    iVar3 = 0;
    ppVar2 = dev_fd_list;
    do {
      if (0 < ppVar2[iVar3]) {
        wait_for(ppVar2[iVar3]);
        ppVar2 = dev_fd_list;
        iVar1 = nfds;
        dev_fd_list[iVar3] = -1;
        if (iVar1 < 1) {
          return;
        }
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 < totfds);
  }
  return;
}



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

void wait_procsubs(void)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {
    iVar3 = 0;
    iVar2 = DAT_00179060;
    do {
      iVar1 = *(int *)(iVar2 + iVar3 * 4);
      if (0 < iVar1) {
        wait_for(iVar1);
        iVar2 = DAT_00179060;
        iVar1 = DAT_0017905c;
        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;
        if (iVar1 < 1) {
          return;
        }
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 < DAT_00179058);
  }
  return;
}


PUSH ESI
PUSH EBX
CALL 0x000312b0
ADD EBX,0xf72d9
SUB ESP,0x4
MOV ECX,dword ptr [EBX + 0x705c]
TEST ECX,ECX
JLE 0x0007ad88
MOV EDX,dword ptr [EBX + 0x7058]
TEST EDX,EDX
JLE 0x0007ad88
MOV EDX,dword ptr [EBX + 0x7060]
XOR ESI,ESI
JMP 0x0007ad5b
ADD ESI,0x1
CMP dword ptr [EBX + 0x7058],ESI
JLE 0x0007ad88
MOV EAX,dword ptr [EDX + ESI*0x4]
TEST EAX,EAX
JLE 0x0007ad50
SUB ESP,0xc
PUSH EAX
CALL 0x0006c7b0
MOV EDX,dword ptr [EBX + 0x7060]
MOV EAX,dword ptr [EBX + 0x705c]
ADD ESP,0x10
MOV dword ptr [EDX + ESI*0x4],0xffffffff
ADD ESI,0x1
TEST EAX,EAX
JG 0x0007ad53
ADD ESP,0x4
POP EBX
POP ESI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid wait_procsubs(void)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }\n  return;\n}\n\n" comment (function_definition "void wait_procsubs(void)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }\n  return;\n}" primitive_type (function_declarator "wait_procsubs(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (if_statement "if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }" if (parenthesized_expression "((0 < DAT_0017905c) && (0 < DAT_00179058))" ( (binary_expression "(0 < DAT_0017905c) && (0 < DAT_00179058)" (parenthesized_expression "(0 < DAT_0017905c)" ( (binary_expression "0 < DAT_0017905c" number_literal < identifier) )) && (parenthesized_expression "(0 < DAT_00179058)" ( (binary_expression "0 < DAT_00179058" number_literal < identifier) ))) )) (compound_statement "{\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "iVar2 = DAT_00179060;" (assignment_expression "iVar2 = DAT_00179060" identifier = identifier) ;) (do_statement "do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);" do (compound_statement "{\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    }" { (expression_statement "iVar1 = *(int *)(iVar2 + iVar3 * 4);" (assignment_expression "iVar1 = *(int *)(iVar2 + iVar3 * 4)" identifier = (pointer_expression "*(int *)(iVar2 + iVar3 * 4)" * (cast_expression "(int *)(iVar2 + iVar3 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar3 * 4)" ( (binary_expression "iVar2 + iVar3 * 4" identifier + (binary_expression "iVar3 * 4" identifier * number_literal)) ))))) ;) (if_statement "if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }" if (parenthesized_expression "(0 < iVar1)" ( (binary_expression "0 < iVar1" number_literal < identifier) )) (compound_statement "{\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }" { (expression_statement "wait_for(iVar1);" (call_expression "wait_for(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "iVar2 = DAT_00179060;" (assignment_expression "iVar2 = DAT_00179060" identifier = identifier) ;) (expression_statement "iVar1 = DAT_0017905c;" (assignment_expression "iVar1 = DAT_0017905c" identifier = identifier) ;) (expression_statement "*(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;" (assignment_expression "*(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff" (pointer_expression "*(undefined4 *)(DAT_00179060 + iVar3 * 4)" * (cast_expression "(undefined4 *)(DAT_00179060 + iVar3 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_00179060 + iVar3 * 4)" ( (binary_expression "DAT_00179060 + iVar3 * 4" identifier + (binary_expression "iVar3 * 4" identifier * number_literal)) )))) = number_literal) ;) (if_statement "if (iVar1 < 1) {\n          return;\n        }" if (parenthesized_expression "(iVar1 < 1)" ( (binary_expression "iVar1 < 1" identifier < number_literal) )) (compound_statement "{\n          return;\n        }" { (return_statement "return;" return ;) })) })) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" identifier = (binary_expression "iVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar3 < DAT_00179058)" ( (binary_expression "iVar3 < DAT_00179058" identifier < identifier) )) ;) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention -- yet parameter storage is locked */\n\nvoid wait_procsubs(void)\n\n{\n  int iVar1;\n  pid_t *ppVar2;\n  int iVar3;\n  \n  if ((0 < nfds) && (0 < totfds)) {\n    iVar3 = 0;\n    ppVar2 = dev_fd_list;\n    do {\n      if (0 < ppVar2[iVar3]) {\n        wait_for(ppVar2[iVar3]);\n        ppVar2 = dev_fd_list;\n        iVar1 = nfds;\n        dev_fd_list[iVar3] = -1;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < totfds);\n  }\n  return;\n}\n\n" comment comment (function_definition "void wait_procsubs(void)\n\n{\n  int iVar1;\n  pid_t *ppVar2;\n  int iVar3;\n  \n  if ((0 < nfds) && (0 < totfds)) {\n    iVar3 = 0;\n    ppVar2 = dev_fd_list;\n    do {\n      if (0 < ppVar2[iVar3]) {\n        wait_for(ppVar2[iVar3]);\n        ppVar2 = dev_fd_list;\n        iVar1 = nfds;\n        dev_fd_list[iVar3] = -1;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < totfds);\n  }\n  return;\n}" primitive_type (function_declarator "wait_procsubs(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int iVar1;\n  pid_t *ppVar2;\n  int iVar3;\n  \n  if ((0 < nfds) && (0 < totfds)) {\n    iVar3 = 0;\n    ppVar2 = dev_fd_list;\n    do {\n      if (0 < ppVar2[iVar3]) {\n        wait_for(ppVar2[iVar3]);\n        ppVar2 = dev_fd_list;\n        iVar1 = nfds;\n        dev_fd_list[iVar3] = -1;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < totfds);\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "pid_t *ppVar2;" type_identifier (pointer_declarator "*ppVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (if_statement "if ((0 < nfds) && (0 < totfds)) {\n    iVar3 = 0;\n    ppVar2 = dev_fd_list;\n    do {\n      if (0 < ppVar2[iVar3]) {\n        wait_for(ppVar2[iVar3]);\n        ppVar2 = dev_fd_list;\n        iVar1 = nfds;\n        dev_fd_list[iVar3] = -1;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < totfds);\n  }" if (parenthesized_expression "((0 < nfds) && (0 < totfds))" ( (binary_expression "(0 < nfds) && (0 < totfds)" (parenthesized_expression "(0 < nfds)" ( (binary_expression "0 < nfds" number_literal < identifier) )) && (parenthesized_expression "(0 < totfds)" ( (binary_expression "0 < totfds" number_literal < identifier) ))) )) (compound_statement "{\n    iVar3 = 0;\n    ppVar2 = dev_fd_list;\n    do {\n      if (0 < ppVar2[iVar3]) {\n        wait_for(ppVar2[iVar3]);\n        ppVar2 = dev_fd_list;\n        iVar1 = nfds;\n        dev_fd_list[iVar3] = -1;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < totfds);\n  }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "ppVar2 = dev_fd_list;" (assignment_expression "ppVar2 = dev_fd_list" identifier = identifier) ;) (do_statement "do {\n      if (0 < ppVar2[iVar3]) {\n        wait_for(ppVar2[iVar3]);\n        ppVar2 = dev_fd_list;\n        iVar1 = nfds;\n        dev_fd_list[iVar3] = -1;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < totfds);" do (compound_statement "{\n      if (0 < ppVar2[iVar3]) {\n        wait_for(ppVar2[iVar3]);\n        ppVar2 = dev_fd_list;\n        iVar1 = nfds;\n        dev_fd_list[iVar3] = -1;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    }" { (if_statement "if (0 < ppVar2[iVar3]) {\n        wait_for(ppVar2[iVar3]);\n        ppVar2 = dev_fd_list;\n        iVar1 = nfds;\n        dev_fd_list[iVar3] = -1;\n        if (iVar1 < 1) {\n          return;\n        }\n      }" if (parenthesized_expression "(0 < ppVar2[iVar3])" ( (binary_expression "0 < ppVar2[iVar3]" number_literal < (subscript_expression "ppVar2[iVar3]" identifier [ identifier ])) )) (compound_statement "{\n        wait_for(ppVar2[iVar3]);\n        ppVar2 = dev_fd_list;\n        iVar1 = nfds;\n        dev_fd_list[iVar3] = -1;\n        if (iVar1 < 1) {\n          return;\n        }\n      }" { (expression_statement "wait_for(ppVar2[iVar3]);" (call_expression "wait_for(ppVar2[iVar3])" identifier (argument_list "(ppVar2[iVar3])" ( (subscript_expression "ppVar2[iVar3]" identifier [ identifier ]) ))) ;) (expression_statement "ppVar2 = dev_fd_list;" (assignment_expression "ppVar2 = dev_fd_list" identifier = identifier) ;) (expression_statement "iVar1 = nfds;" (assignment_expression "iVar1 = nfds" identifier = identifier) ;) (expression_statement "dev_fd_list[iVar3] = -1;" (assignment_expression "dev_fd_list[iVar3] = -1" (subscript_expression "dev_fd_list[iVar3]" identifier [ identifier ]) = number_literal) ;) (if_statement "if (iVar1 < 1) {\n          return;\n        }" if (parenthesized_expression "(iVar1 < 1)" ( (binary_expression "iVar1 < 1" identifier < number_literal) )) (compound_statement "{\n          return;\n        }" { (return_statement "return;" return ;) })) })) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" identifier = (binary_expression "iVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar3 < totfds)" ( (binary_expression "iVar3 < totfds" identifier < identifier) )) ;) })) (return_statement "return;" return ;) })))
(translation_unit "void wait_procsubs(void)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }\n  return;\n}\n\n" (function_definition "void wait_procsubs(void)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }\n  return;\n}" primitive_type (function_declarator "wait_procsubs(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (if_statement "if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }" if (parenthesized_expression "((0 < DAT_0017905c) && (0 < DAT_00179058))" ( (binary_expression "(0 < DAT_0017905c) && (0 < DAT_00179058)" (parenthesized_expression "(0 < DAT_0017905c)" ( (binary_expression "0 < DAT_0017905c" number_literal < identifier) )) && (parenthesized_expression "(0 < DAT_00179058)" ( (binary_expression "0 < DAT_00179058" number_literal < identifier) ))) )) (compound_statement "{\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "iVar2 = DAT_00179060;" (assignment_expression "iVar2 = DAT_00179060" identifier = identifier) ;) (do_statement "do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);" do (compound_statement "{\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    }" { (expression_statement "iVar1 = *(int *)(iVar2 + iVar3 * 4);" (assignment_expression "iVar1 = *(int *)(iVar2 + iVar3 * 4)" identifier = (pointer_expression "*(int *)(iVar2 + iVar3 * 4)" * (cast_expression "(int *)(iVar2 + iVar3 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar3 * 4)" ( (binary_expression "iVar2 + iVar3 * 4" identifier + (binary_expression "iVar3 * 4" identifier * number_literal)) ))))) ;) (if_statement "if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }" if (parenthesized_expression "(0 < iVar1)" ( (binary_expression "0 < iVar1" number_literal < identifier) )) (compound_statement "{\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }" { (expression_statement "wait_for(iVar1);" (call_expression "wait_for(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) (expression_statement "iVar2 = DAT_00179060;" (assignment_expression "iVar2 = DAT_00179060" identifier = identifier) ;) (expression_statement "iVar1 = DAT_0017905c;" (assignment_expression "iVar1 = DAT_0017905c" identifier = identifier) ;) (expression_statement "*(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;" (assignment_expression "*(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff" (pointer_expression "*(undefined4 *)(DAT_00179060 + iVar3 * 4)" * (cast_expression "(undefined4 *)(DAT_00179060 + iVar3 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_00179060 + iVar3 * 4)" ( (binary_expression "DAT_00179060 + iVar3 * 4" identifier + (binary_expression "iVar3 * 4" identifier * number_literal)) )))) = number_literal) ;) (if_statement "if (iVar1 < 1) {\n          return;\n        }" if (parenthesized_expression "(iVar1 < 1)" ( (binary_expression "iVar1 < 1" identifier < number_literal) )) (compound_statement "{\n          return;\n        }" { (return_statement "return;" return ;) })) })) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" identifier = (binary_expression "iVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar3 < DAT_00179058)" ( (binary_expression "iVar3 < DAT_00179058" identifier < identifier) )) ;) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (binary_expression LIT < IDENT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return ;) })) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT < IDENT) )) ;) })) (return_statement return ;) })))
(function_definition "void wait_procsubs(void)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }\n  return;\n}" (primitive_type "void") (function_declarator "wait_procsubs(void)" (identifier "wait_procsubs") (parameter_list "(void)" (( "(") (parameter_declaration "void" (primitive_type "void")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }\n  return;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (if_statement "if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }" (if "if") (parenthesized_expression "((0 < DAT_0017905c) && (0 < DAT_00179058))" (( "(") (binary_expression "(0 < DAT_0017905c) && (0 < DAT_00179058)" (parenthesized_expression "(0 < DAT_0017905c)" (( "(") (binary_expression "0 < DAT_0017905c" (number_literal "0") (< "<") (identifier "DAT_0017905c")) () ")")) (&& "&&") (parenthesized_expression "(0 < DAT_00179058)" (( "(") (binary_expression "0 < DAT_00179058" (number_literal "0") (< "<") (identifier "DAT_00179058")) () ")"))) () ")")) (compound_statement "{\n    iVar3 = 0;\n    iVar2 = DAT_00179060;\n    do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);\n  }" ({ "{") (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar2 = DAT_00179060;" (assignment_expression "iVar2 = DAT_00179060" (identifier "iVar2") (= "=") (identifier "DAT_00179060")) (; ";")) (do_statement "do {\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    } while (iVar3 < DAT_00179058);" (do "do") (compound_statement "{\n      iVar1 = *(int *)(iVar2 + iVar3 * 4);\n      if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }\n      iVar3 = iVar3 + 1;\n    }" ({ "{") (expression_statement "iVar1 = *(int *)(iVar2 + iVar3 * 4);" (assignment_expression "iVar1 = *(int *)(iVar2 + iVar3 * 4)" (identifier "iVar1") (= "=") (pointer_expression "*(int *)(iVar2 + iVar3 * 4)" (* "*") (cast_expression "(int *)(iVar2 + iVar3 * 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + iVar3 * 4)" (( "(") (binary_expression "iVar2 + iVar3 * 4" (identifier "iVar2") (+ "+") (binary_expression "iVar3 * 4" (identifier "iVar3") (* "*") (number_literal "4"))) () ")"))))) (; ";")) (if_statement "if (0 < iVar1) {\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }" (if "if") (parenthesized_expression "(0 < iVar1)" (( "(") (binary_expression "0 < iVar1" (number_literal "0") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n        wait_for(iVar1);\n        iVar2 = DAT_00179060;\n        iVar1 = DAT_0017905c;\n        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;\n        if (iVar1 < 1) {\n          return;\n        }\n      }" ({ "{") (expression_statement "wait_for(iVar1);" (call_expression "wait_for(iVar1)" (identifier "wait_for") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (expression_statement "iVar2 = DAT_00179060;" (assignment_expression "iVar2 = DAT_00179060" (identifier "iVar2") (= "=") (identifier "DAT_00179060")) (; ";")) (expression_statement "iVar1 = DAT_0017905c;" (assignment_expression "iVar1 = DAT_0017905c" (identifier "iVar1") (= "=") (identifier "DAT_0017905c")) (; ";")) (expression_statement "*(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;" (assignment_expression "*(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff" (pointer_expression "*(undefined4 *)(DAT_00179060 + iVar3 * 4)" (* "*") (cast_expression "(undefined4 *)(DAT_00179060 + iVar3 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(DAT_00179060 + iVar3 * 4)" (( "(") (binary_expression "DAT_00179060 + iVar3 * 4" (identifier "DAT_00179060") (+ "+") (binary_expression "iVar3 * 4" (identifier "iVar3") (* "*") (number_literal "4"))) () ")")))) (= "=") (number_literal "0xffffffff")) (; ";")) (if_statement "if (iVar1 < 1) {\n          return;\n        }" (if "if") (parenthesized_expression "(iVar1 < 1)" (( "(") (binary_expression "iVar1 < 1" (identifier "iVar1") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n          return;\n        }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}"))) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" (identifier "iVar3") (= "=") (binary_expression "iVar3 + 1" (identifier "iVar3") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar3 < DAT_00179058)" (( "(") (binary_expression "iVar3 < DAT_00179058" (identifier "iVar3") (< "<") (identifier "DAT_00179058")) () ")")) (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention -- yet parameter storage is locked */

void function_1(void)

{
  int var_4;
  type_1 *ppVar2;
  int var_5;
  
  if ((0 < var_1) && (0 < var_2)) {
    var_5 = 0;
    ppVar2 = dev_fd_list;
    do {
      if (0 < ppVar2[var_5]) {
        var_3(ppVar2[var_5]);
        ppVar2 = dev_fd_list;
        var_4 = var_1;
        dev_fd_list[var_5] = -1;
        if (var_4 < 1) {
          return;
        }
      }
      var_5 = var_5 + 1;
    } while (var_5 < var_2);
  }
  return;
}


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

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

void MASKED(void)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  if ((0 < DAT_0017905c) && (0 < DAT_00179058)) {
    iVar3 = 0;
    iVar2 = DAT_00179060;
    do {
      iVar1 = *(int *)(iVar2 + iVar3 * 4);
      if (0 < iVar1) {
        wait_for(iVar1);
        iVar2 = DAT_00179060;
        iVar1 = DAT_0017905c;
        *(undefined4 *)(DAT_00179060 + iVar3 * 4) = 0xffffffff;
        if (iVar1 < 1) {
          return;
        }
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 < DAT_00179058);
  }
  return;
}

