#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ NOFILE;
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dosHandleIO(int);
int /*<<< orphan*/ dosInitDrives();
int /*<<< orphan*/ dosMountDisk(char *, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ geteuid();
int initJoystick();
int /*<<< orphan*/ joystickHandleIO(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ updatePaddles();
int main(int argc, char *argv[]) {
  int dosfd, joyfd;
  fd_set rd, ex;
  int count;
  struct timeval timeout;
  dosInitDrives();
  for (count = 1; count < argc && count < 5; count++)
    dosMountDisk(argv[count], count - 1);
  if (!geteuid())
    joyfd = initJoystick();
  else {
    fprintf(stderr, "Must be root to do GPIO for joystick\n");
    joyfd = -1;
  }
  dosfd = open("/dev/iec8", O_RDWR);
  if (dosfd < 0)
    fprintf(stderr, "Unable to open IEC device\n");
  for (; dosfd >= 0 || joyfd >= 0;) {
    FD_ZERO(&rd);
    if (joyfd >= 0)
      FD_SET(joyfd, &rd);
    if (dosfd >= 0)
      FD_SET(dosfd, &rd);
    ex = rd;
    timeout.tv_sec = 0;
    timeout.tv_usec = 5000;
    select(NOFILE, &rd, NULL, &ex, &timeout);
    if (FD_ISSET(joyfd, &rd))
      joystickHandleIO(joyfd);
    if (FD_ISSET(dosfd, &rd))
      dosHandleIO(dosfd);
    updatePaddles();
    if (FD_ISSET(joyfd, &ex)) {
      fprintf(stderr, "Error with joystick\n");
      close(joyfd);
      joyfd = -1;
    }
    if (FD_ISSET(dosfd, &ex)) {
      fprintf(stderr, "Error with IEC\n");
      close(dosfd);
      dosfd = -1;
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <dosInitDrives@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x39(%rbp)
jge    122f <main+0x3f>
cmpl   $0x5,-0x24(%rbp)
setl   %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    123f <main+0x4f>
jmp    1264 <main+0x74>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x24(%rbp),%esi
sub    $0x1,%esi
call   1100 <dosMountDisk@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1214 <main+0x24>
mov    $0x0,%al
call   1060 <geteuid@plt>
cmp    $0x0,%eax
jne    1283 <main+0x93>
mov    $0x0,%al
call   10d0 <initJoystick@plt>
mov    %eax,-0x18(%rbp)
jmp    129f <main+0xaf>
mov    0x2d4e(%rip),%rax
mov    (%rax),%edi
lea    0xd6d(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x18(%rbp)
mov    0x2d42(%rip),%rax
mov    (%rax),%esi
lea    0xd77(%rip),%rdi
call   10e0 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    12d6 <main+0xe6>
mov    0x2d10(%rip),%rax
mov    (%rax),%edi
lea    0xd5f(%rip),%rsi
call   1090 <fprintf@plt>
jmp    12db <main+0xeb>
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x3a(%rbp)
jge    12f4 <main+0x104>
cmpl   $0x0,-0x18(%rbp)
setge  %al
mov    %al,-0x3a(%rbp)
mov    -0x3a(%rbp),%al
test   $0x1,%al
jne    1304 <main+0x114>
jmp    1428 <main+0x238>
lea    -0x1c(%rbp),%rdi
call   10a0 <FD_ZERO@plt>
cmpl   $0x0,-0x18(%rbp)
jl     1323 <main+0x133>
mov    -0x18(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1110 <FD_SET@plt>
cmpl   $0x0,-0x14(%rbp)
jl     1339 <main+0x149>
mov    -0x14(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1110 <FD_SET@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0x1388,-0x38(%rbp)
mov    0x2c73(%rip),%rax
mov    (%rax),%edi
lea    -0x1c(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
lea    -0x20(%rbp),%rcx
lea    -0x38(%rbp),%r8
call   10b0 <select@plt>
mov    -0x18(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     138a <main+0x19a>
mov    -0x18(%rbp),%edi
call   1050 <joystickHandleIO@plt>
mov    -0x14(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     13a8 <main+0x1b8>
mov    -0x14(%rbp),%edi
call   1030 <dosHandleIO@plt>
mov    $0x0,%al
call   10c0 <updatePaddles@plt>
mov    -0x18(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     13e9 <main+0x1f9>
mov    0x2c0c(%rip),%rax
mov    (%rax),%edi
lea    0xc76(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%edi
call   1080 <close@plt>
movl   $0xffffffff,-0x18(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1423 <main+0x233>
mov    0x2bd2(%rip),%rax
mov    (%rax),%edi
lea    0xc51(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
movl   $0xffffffff,-0x14(%rbp)
jmp    12db <main+0xeb>
xor    %edi,%edi
call   10f0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
xor    %eax,%eax
call   1070 <dosInitDrives@plt>
cmp    $0x2,%ebp
jl     1245 <main+0x55>
add    $0xfffffffe,%ebp
cmp    $0x3,%ebp
mov    $0x3,%ebx
cmovb  %ebp,%ebx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x8(%r14,%rbp,8),%rdi
mov    %ebp,%esi
call   1100 <dosMountDisk@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1230 <main+0x40>
xor    %eax,%eax
call   1060 <geteuid@plt>
test   %eax,%eax
jne    125b <main+0x6b>
xor    %eax,%eax
call   10d0 <initJoystick@plt>
mov    %eax,%ebx
jmp    1275 <main+0x85>
mov    0x2d76(%rip),%rax
mov    (%rax),%edi
lea    0xd95(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    0x2d6c(%rip),%rax
mov    (%rax),%esi
lea    0xda1(%rip),%rdi
call   10e0 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    12b2 <main+0xc2>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
lea    0xd90(%rip),%rsi
call   1090 <fprintf@plt>
test   %ebx,%ebx
setns  %r12b
jns    12b8 <main+0xc8>
jmp    13d8 <main+0x1e8>
test   %ebx,%ebx
setns  %r12b
test   %ebp,%ebp
setns  %r13b
lea    0x4(%rsp),%r14
mov    %rsp,%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   10a0 <FD_ZERO@plt>
test   $0x1,%r12b
je     12e8 <main+0xf8>
mov    %ebx,%edi
mov    %r14,%rsi
call   1110 <FD_SET@plt>
test   $0x1,%r13b
je     12f8 <main+0x108>
mov    %ebp,%edi
mov    %r14,%rsi
call   1110 <FD_SET@plt>
mov    0x4(%rsp),%eax
mov    %eax,(%rsp)
movq   $0x0,0x10(%rsp)
movl   $0x1388,0x8(%rsp)
mov    0x2cb1(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
xor    %edx,%edx
mov    %r15,%rcx
lea    0x8(%rsp),%r8
call   10b0 <select@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1040 <FD_ISSET@plt>
test   %rax,%rax
je     1341 <main+0x151>
mov    %ebx,%edi
call   1050 <joystickHandleIO@plt>
mov    %ebp,%edi
mov    %r14,%rsi
call   1040 <FD_ISSET@plt>
test   %rax,%rax
je     1357 <main+0x167>
mov    %ebp,%edi
call   1030 <dosHandleIO@plt>
xor    %eax,%eax
call   10c0 <updatePaddles@plt>
mov    %ebx,%edi
mov    %r15,%rsi
call   1040 <FD_ISSET@plt>
test   %rax,%rax
je     138e <main+0x19e>
mov    0x2c64(%rip),%rax
mov    (%rax),%edi
lea    0xcce(%rip),%rsi
call   1090 <fprintf@plt>
mov    %ebx,%edi
call   1080 <close@plt>
mov    $0xffffffff,%ebx
mov    %ebp,%edi
mov    %r15,%rsi
call   1040 <FD_ISSET@plt>
test   %rax,%rax
je     13be <main+0x1ce>
mov    0x2c34(%rip),%rax
mov    (%rax),%edi
lea    0xcb3(%rip),%rsi
call   1090 <fprintf@plt>
mov    %ebp,%edi
call   1080 <close@plt>
mov    $0xffffffff,%ebp
test   %ebx,%ebx
setns  %r12b
test   %ebp,%ebp
setns  %r13b
jns    12d0 <main+0xe0>
test   %ebx,%ebx
jns    12d0 <main+0xe0>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
@stderr = global i32 0
@.str = [38 x i8] c"Must be root to do GPIO for joystick\0A\00"
@.str.1 = [10 x i8] c"/dev/iec8\00"
@O_RDWR = global i32 0
@.str.2 = [27 x i8] c"Unable to open IEC device\0A\00"
@NOFILE = global i32 0
@.str.3 = [21 x i8] c"Error with joystick\0A\00"
@.str.4 = [16 x i8] c"Error with IEC\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.timeval
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 (...) @dosInitDrives()
store i32 1, i32* %10
br label %13
13: ; preds = %31, %2
%14 = load i32, i32* %10
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %10
%19 = icmp slt i32 %18, 5
br label %20
20: ; preds = %17, %13
%21 = phi i1 [ false, %13 ], [ %19, %17 ]
br i1 %21, label %22, label %34
22: ; preds = %20
%23 = load i8**, i8*** %5
%24 = load i32, i32* %10
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = load i32, i32* %10
%29 = sub nsw i32 %28, 1
%30 = call i32 @dosMountDisk(i8* %27, i32 %29)
br label %31
31: ; preds = %22
%32 = load i32, i32* %10
%33 = add nsw i32 %32, 1
store i32 %33, i32* %10
br label %13
34: ; preds = %20
%35 = call i32 (...) @geteuid()
%36 = icmp ne i32 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %34
%38 = call i32 (...) @initJoystick()
store i32 %38, i32* %7
br label %42
39: ; preds = %34
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %7
br label %42
42: ; preds = %39, %37
%43 = load i32, i32* @O_RDWR
%44 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %43)
store i32 %44, i32* %6
%45 = load i32, i32* %6
%46 = icmp slt i32 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %42
%48 = load i32, i32* @stderr
%49 = call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %50
50: ; preds = %47, %42
br label %51
51: ; preds = %110, %50
%52 = load i32, i32* %6
%53 = icmp sge i32 %52, 0
br i1 %53, label %57, label %54
54: ; preds = %51
%55 = load i32, i32* %7
%56 = icmp sge i32 %55, 0
br label %57
57: ; preds = %54, %51
%58 = phi i1 [ true, %51 ], [ %56, %54 ]
br i1 %58, label %59, label %111
59: ; preds = %57
%60 = call i32 @FD_ZERO(i32* %8)
%61 = load i32, i32* %7
%62 = icmp sge i32 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %59
%64 = load i32, i32* %7
%65 = call i32 @FD_SET(i32 %64, i32* %8)
br label %66
66: ; preds = %63, %59
%67 = load i32, i32* %6
%68 = icmp sge i32 %67, 0
br i1 %68, label %69, label %72
69: ; preds = %66
%70 = load i32, i32* %6
%71 = call i32 @FD_SET(i32 %70, i32* %8)
br label %72
72: ; preds = %69, %66
%73 = load i32, i32* %8
store i32 %73, i32* %9
%74 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 1
store i64 0, i64* %74
%75 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 0
store i32 5000, i32* %75
%76 = load i32, i32* @NOFILE
%77 = call i32 @select(i32 %76, i32* %8, i32* null, i32* %9, %struct.timeval* %11)
%78 = load i32, i32* %7
%79 = call i64 @FD_ISSET(i32 %78, i32* %8)
%80 = icmp ne i64 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %72
%82 = load i32, i32* %7
%83 = call i32 @joystickHandleIO(i32 %82)
br label %84
84: ; preds = %81, %72
%85 = load i32, i32* %6
%86 = call i64 @FD_ISSET(i32 %85, i32* %8)
%87 = icmp ne i64 %86, 0
br i1 %87, label %88, label %91
88: ; preds = %84
%89 = load i32, i32* %6
%90 = call i32 @dosHandleIO(i32 %89)
br label %91
91: ; preds = %88, %84
%92 = call i32 (...) @updatePaddles()
%93 = load i32, i32* %7
%94 = call i64 @FD_ISSET(i32 %93, i32* %9)
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %101
96: ; preds = %91
%97 = load i32, i32* @stderr
%98 = call i32 @fprintf(i32 %97, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%99 = load i32, i32* %7
%100 = call i32 @close(i32 %99)
store i32 -1, i32* %7
br label %101
101: ; preds = %96, %91
%102 = load i32, i32* %6
%103 = call i64 @FD_ISSET(i32 %102, i32* %9)
%104 = icmp ne i64 %103, 0
br i1 %104, label %105, label %110
105: ; preds = %101
%106 = load i32, i32* @stderr
%107 = call i32 @fprintf(i32 %106, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%108 = load i32, i32* %6
%109 = call i32 @close(i32 %108)
store i32 -1, i32* %6
br label %110
110: ; preds = %105, %101
br label %51
111: ; preds = %57
%112 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
@stderr = global i32 0
@.str = [38 x i8] c"Must be root to do GPIO for joystick\0A\00"
@.str.1 = [10 x i8] c"/dev/iec8\00"
@O_RDWR = global i32 0
@.str.2 = [27 x i8] c"Unable to open IEC device\0A\00"
@NOFILE = global i32 0
@.str.3 = [21 x i8] c"Error with joystick\0A\00"
@.str.4 = [16 x i8] c"Error with IEC\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timeval
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast %struct.timeval* %5 to i8*
%9 = tail call i32 (...) @dosInitDrives()
%10 = icmp sgt i32 %0, 1
br i1 %10, label %11, label %25
11: ; preds = %2
%12 = add nsw i32 %0, -2
%13 = call i32 @llvm.umin.i32(i32 %12, i32 3)
%14 = add nuw nsw i32 %13, 2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %11, %16
%17 = phi i64 [ 1, %11 ], [ %23, %16 ]
%18 = getelementptr inbounds i8*, i8** %1, i64 %17
%19 = load i8*, i8** %18
%20 = trunc i64 %17 to i32
%21 = add i32 %20, -1
%22 = tail call i32 @dosMountDisk(i8* %19, i32 %21)
%23 = add nuw nsw i64 %17, 1
%24 = icmp eq i64 %23, %15
br i1 %24, label %25, label %16
25: ; preds = %16, %2
%26 = tail call i32 (...) @geteuid()
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = tail call i32 (...) @initJoystick()
br label %33
30: ; preds = %25
%31 = load i32, i32* @stderr
%32 = tail call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %33
33: ; preds = %30, %28
%34 = phi i32 [ -1, %30 ], [ %29, %28 ]
%35 = load i32, i32* @O_RDWR
%36 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %35)
%37 = icmp slt i32 %36, 0
br i1 %37, label %40, label %38
38: ; preds = %33
%39 = icmp sgt i32 %34, -1
br label %44
40: ; preds = %33
%41 = load i32, i32* @stderr
%42 = tail call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%43 = icmp sgt i32 %34, -1
br i1 %43, label %44, label %94
44: ; preds = %38, %40
%45 = phi i1 [ %39, %38 ], [ %43, %40 ]
%46 = xor i1 %37, true
%47 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
%48 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
br label %49
49: ; preds = %44, %89
%50 = phi i1 [ %45, %44 ], [ %92, %89 ]
%51 = phi i1 [ %46, %44 ], [ %91, %89 ]
%52 = phi i32 [ %34, %44 ], [ %82, %89 ]
%53 = phi i32 [ %36, %44 ], [ %90, %89 ]
%54 = call i32 @FD_ZERO(i32* %3)
br i1 %50, label %55, label %57
55: ; preds = %49
%56 = call i32 @FD_SET(i32 %52, i32* %3)
br label %57
57: ; preds = %55, %49
br i1 %51, label %58, label %60
58: ; preds = %57
%59 = call i32 @FD_SET(i32 %53, i32* %3)
br label %60
60: ; preds = %58, %57
%61 = load i32, i32* %3
store i32 %61, i32* %4
store i64 0, i64* %47
store i32 5000, i32* %48
%62 = load i32, i32* @NOFILE
%63 = call i32 @select(i32 %62, i32* %3, i32* null, i32* %4, %struct.timeval* %5)
%64 = call i64 @FD_ISSET(i32 %52, i32* %3)
%65 = icmp eq i64 %64, 0
br i1 %65, label %68, label %66
66: ; preds = %60
%67 = call i32 @joystickHandleIO(i32 %52)
br label %68
68: ; preds = %66, %60
%69 = call i64 @FD_ISSET(i32 %53, i32* %3)
%70 = icmp eq i64 %69, 0
br i1 %70, label %73, label %71
71: ; preds = %68
%72 = call i32 @dosHandleIO(i32 %53)
br label %73
73: ; preds = %71, %68
%74 = call i32 (...) @updatePaddles()
%75 = call i64 @FD_ISSET(i32 %52, i32* %4)
%76 = icmp eq i64 %75, 0
br i1 %76, label %81, label %77
77: ; preds = %73
%78 = load i32, i32* @stderr
%79 = call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%80 = call i32 @close(i32 %52)
br label %81
81: ; preds = %77, %73
%82 = phi i32 [ -1, %77 ], [ %52, %73 ]
%83 = call i64 @FD_ISSET(i32 %53, i32* %4)
%84 = icmp eq i64 %83, 0
br i1 %84, label %89, label %85
85: ; preds = %81
%86 = load i32, i32* @stderr
%87 = call i32 @fprintf(i32 %86, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%88 = call i32 @close(i32 %53)
br label %89
89: ; preds = %85, %81
%90 = phi i32 [ -1, %85 ], [ %53, %81 ]
%91 = icmp sgt i32 %90, -1
%92 = icmp sgt i32 %82, -1
%93 = select i1 %91, i1 true, i1 %92
br i1 %93, label %49, label %94
94: ; preds = %89, %40
%95 = call i32 @exit(i32 0)
unreachable
}