#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__ EINTR;
scalar_t__ errno;
int sys_select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
               int /*<<< orphan*/ *, struct timeval *);
int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds,
                    fd_set *errorfds, struct timeval *tval) {
  int ret;
  fd_set *readfds2, readfds_buf, *writefds2, writefds_buf, *errorfds2,
      errorfds_buf;
  struct timeval tval2, *ptval, end_time, now_time;
  extern void GetTimeOfDay(struct timeval * tval);
  readfds2 = (readfds ? &readfds_buf : NULL);
  writefds2 = (writefds ? &writefds_buf : NULL);
  errorfds2 = (errorfds ? &errorfds_buf : NULL);
  if (tval) {
    GetTimeOfDay(&end_time);
    end_time.tv_sec += tval->tv_sec;
    end_time.tv_usec += tval->tv_usec;
    end_time.tv_sec += end_time.tv_usec / 1000000;
    end_time.tv_usec %= 1000000;
    ptval = &tval2;
  } else {
    ptval = NULL;
  }
  do {
    if (readfds)
      readfds_buf = *readfds;
    if (writefds)
      writefds_buf = *writefds;
    if (errorfds)
      errorfds_buf = *errorfds;
    if (tval) {
      GetTimeOfDay(&now_time);
      tval2.tv_sec = end_time.tv_sec - now_time.tv_sec;
      tval2.tv_usec = end_time.tv_usec - now_time.tv_usec;
      if ((signed long)tval2.tv_usec < 0) {
        tval2.tv_usec += 1000000;
        tval2.tv_sec--;
      }
      if ((signed long)tval2.tv_sec < 0) {
        ret = 0;
        break;
      }
    }
    ret = sys_select(maxfd, readfds2, writefds2, errorfds2, ptval);
  } while (ret == -1 && errno == EINTR);
  if (readfds)
    *readfds = readfds_buf;
  if (writefds)
    *writefds = writefds_buf;
  if (errorfds)
    *errorfds = errorfds_buf;
  return ret;
}


x86 assembly (clang, -O0):
<sys_select_intr>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1159 <sys_select_intr+0x39>
lea    -0x3c(%rbp),%rax
mov    %rax,-0xa0(%rbp)
jmp    1167 <sys_select_intr+0x47>
xor    %eax,%eax
mov    %rax,-0xa0(%rbp)
jmp    1167 <sys_select_intr+0x47>
mov    -0xa0(%rbp),%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118d <sys_select_intr+0x6d>
lea    -0x4c(%rbp),%rax
mov    %rax,-0xa8(%rbp)
jmp    119b <sys_select_intr+0x7b>
xor    %eax,%eax
mov    %rax,-0xa8(%rbp)
jmp    119b <sys_select_intr+0x7b>
mov    -0xa8(%rbp),%rax
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11c1 <sys_select_intr+0xa1>
lea    -0x5c(%rbp),%rax
mov    %rax,-0xb0(%rbp)
jmp    11cf <sys_select_intr+0xaf>
xor    %eax,%eax
mov    %rax,-0xb0(%rbp)
jmp    11cf <sys_select_intr+0xaf>
mov    -0xb0(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     124c <sys_select_intr+0x12c>
lea    -0x88(%rbp),%rdi
call   1040 <GetTimeOfDay@plt>
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
add    -0x80(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
add    -0x88(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
cltq
add    -0x80(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x88(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %edx,-0x88(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
jmp    1254 <sys_select_intr+0x134>
movq   $0x0,-0x78(%rbp)
jmp    1259 <sys_select_intr+0x139>
cmpq   $0x0,-0x10(%rbp)
je     126d <sys_select_intr+0x14d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1281 <sys_select_intr+0x161>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1295 <sys_select_intr+0x175>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     130b <sys_select_intr+0x1eb>
lea    -0x98(%rbp),%rdi
call   1040 <GetTimeOfDay@plt>
mov    -0x80(%rbp),%rax
sub    -0x90(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x88(%rbp),%eax
sub    -0x98(%rbp),%eax
mov    %eax,-0x70(%rbp)
movslq -0x70(%rbp),%rax
cmp    $0x0,%rax
jge    12ef <sys_select_intr+0x1cf>
mov    -0x70(%rbp),%eax
add    $0xf4240,%eax
mov    %eax,-0x70(%rbp)
mov    -0x68(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jge    1306 <sys_select_intr+0x1e6>
movl   $0x0,-0x2c(%rbp)
jmp    1363 <sys_select_intr+0x243>
jmp    130b <sys_select_intr+0x1eb>
mov    -0x4(%rbp),%edi
mov    -0x38(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x78(%rbp),%r8
call   1030 <sys_select@plt>
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x2c(%rbp)
mov    %al,-0xb1(%rbp)
jne    1355 <sys_select_intr+0x235>
mov    0x2ca1(%rip),%rax
mov    (%rax),%rax
mov    0x2c8f(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xb1(%rbp)
mov    -0xb1(%rbp),%al
test   $0x1,%al
jne    1259 <sys_select_intr+0x139>
cmpq   $0x0,-0x10(%rbp)
je     1377 <sys_select_intr+0x257>
mov    -0x3c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     138b <sys_select_intr+0x26b>
mov    -0x4c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     139f <sys_select_intr+0x27f>
mov    -0x5c(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_select_intr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r8,%rbp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,0x14(%rsp)
test   %rsi,%rsi
lea    0x10(%rsp),%rax
cmove  %rsi,%rax
mov    %rax,0x40(%rsp)
test   %rdx,%rdx
lea    0xc(%rsp),%rax
cmove  %rdx,%rax
mov    %rax,0x38(%rsp)
test   %rcx,%rcx
lea    0x8(%rsp),%r12
cmove  %rcx,%r12
test   %r8,%r8
je     11c3 <sys_select_intr+0xa3>
lea    0x18(%rsp),%rdi
call   1040 <GetTimeOfDay@plt>
mov    0x20(%rsp),%rax
add    0x8(%rbp),%rax
mov    0x18(%rsp),%ecx
mov    %rbp,%r13
add    0x0(%rbp),%ecx
movslq %ecx,%rcx
imul   $0x431bde83,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x32,%rdx
add    %esi,%edx
movslq %edx,%rdx
add    %rdx,%rax
mov    %rax,0x20(%rsp)
imul   $0xf4240,%edx,%eax
sub    %eax,%ecx
mov    %ecx,0x18(%rsp)
lea    0x28(%rsp),%rbp
jmp    11d0 <sys_select_intr+0xb0>
mov    %rbp,%r13
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
test   %rbx,%rbx
je     11db <sys_select_intr+0xbb>
mov    (%rbx),%eax
mov    %eax,0x10(%rsp)
test   %r15,%r15
je     11e7 <sys_select_intr+0xc7>
mov    (%r15),%eax
mov    %eax,0xc(%rsp)
test   %r14,%r14
je     11f3 <sys_select_intr+0xd3>
mov    (%r14),%eax
mov    %eax,0x8(%rsp)
test   %r13,%r13
je     1237 <sys_select_intr+0x117>
lea    0x48(%rsp),%rdi
call   1040 <GetTimeOfDay@plt>
mov    0x20(%rsp),%rax
sub    0x50(%rsp),%rax
mov    %rax,0x30(%rsp)
mov    0x18(%rsp),%ecx
sub    0x48(%rsp),%ecx
mov    %ecx,0x28(%rsp)
jns    1232 <sys_select_intr+0x112>
add    $0xf4240,%ecx
mov    %ecx,0x28(%rsp)
add    $0xffffffffffffffff,%rax
mov    %rax,0x30(%rsp)
test   %rax,%rax
js     12a1 <sys_select_intr+0x181>
mov    0x14(%rsp),%edi
mov    0x40(%rsp),%rsi
mov    0x38(%rsp),%rdx
mov    %r12,%rcx
mov    %rbp,%r8
call   1030 <sys_select@plt>
cmp    $0xffffffff,%eax
jne    126f <sys_select_intr+0x14f>
mov    0x2d7c(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2d7a(%rip),%rdx
cmp    %rcx,(%rdx)
je     11d0 <sys_select_intr+0xb0>
test   %rbx,%rbx
je     127a <sys_select_intr+0x15a>
mov    0x10(%rsp),%ecx
mov    %ecx,(%rbx)
test   %r15,%r15
je     1286 <sys_select_intr+0x166>
mov    0xc(%rsp),%ecx
mov    %ecx,(%r15)
test   %r14,%r14
je     1292 <sys_select_intr+0x172>
mov    0x8(%rsp),%ecx
mov    %ecx,(%r14)
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
test   %rbx,%rbx
jne    1274 <sys_select_intr+0x154>
jmp    127a <sys_select_intr+0x15a>

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
@errno = global i64 0
@EINTR = global i64 0
define i32 @sys_select_intr(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca %struct.timeval*
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32
%16 = alloca i32*
%17 = alloca i32
%18 = alloca %struct.timeval
%19 = alloca %struct.timeval*
%20 = alloca %struct.timeval
%21 = alloca %struct.timeval
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store %struct.timeval* %4, %struct.timeval** %10
%22 = load i32*, i32** %7
%23 = icmp ne i32* %22, null
br i1 %23, label %24, label %25
24: ; preds = %5
br label %26
25: ; preds = %5
br label %26
26: ; preds = %25, %24
%27 = phi i32* [ %13, %24 ], [ null, %25 ]
store i32* %27, i32** %12
%28 = load i32*, i32** %8
%29 = icmp ne i32* %28, null
br i1 %29, label %30, label %31
30: ; preds = %26
br label %32
31: ; preds = %26
br label %32
32: ; preds = %31, %30
%33 = phi i32* [ %15, %30 ], [ null, %31 ]
store i32* %33, i32** %14
%34 = load i32*, i32** %9
%35 = icmp ne i32* %34, null
br i1 %35, label %36, label %37
36: ; preds = %32
br label %38
37: ; preds = %32
br label %38
38: ; preds = %37, %36
%39 = phi i32* [ %17, %36 ], [ null, %37 ]
store i32* %39, i32** %16
%40 = load %struct.timeval*, %struct.timeval** %10
%41 = icmp ne %struct.timeval* %40, null
br i1 %41, label %42, label %65
42: ; preds = %38
%43 = load %struct.timeval*, %struct.timeval** %10
%44 = getelementptr inbounds %struct.timeval, %struct.timeval* %43, i32 0, i32 1
%45 = load i64, i64* %44
%46 = getelementptr inbounds %struct.timeval, %struct.timeval* %20, i32 0, i32 1
%47 = load i64, i64* %46
%48 = add nsw i64 %47, %45
store i64 %48, i64* %46
%49 = load %struct.timeval*, %struct.timeval** %10
%50 = getelementptr inbounds %struct.timeval, %struct.timeval* %49, i32 0, i32 0
%51 = load i32, i32* %50
%52 = getelementptr inbounds %struct.timeval, %struct.timeval* %20, i32 0, i32 0
%53 = load i32, i32* %52
%54 = add nsw i32 %53, %51
store i32 %54, i32* %52
%55 = getelementptr inbounds %struct.timeval, %struct.timeval* %20, i32 0, i32 0
%56 = load i32, i32* %55
%57 = sdiv i32 %56, 1000000
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds %struct.timeval, %struct.timeval* %20, i32 0, i32 1
%60 = load i64, i64* %59
%61 = add nsw i64 %60, %58
store i64 %61, i64* %59
%62 = getelementptr inbounds %struct.timeval, %struct.timeval* %20, i32 0, i32 0
%63 = load i32, i32* %62
%64 = srem i32 %63, 1000000
store i32 %64, i32* %62
store %struct.timeval* %18, %struct.timeval** %19
br label %66
65: ; preds = %38
store %struct.timeval* null, %struct.timeval** %19
br label %66
66: ; preds = %65, %42
br label %67
67: ; preds = %132, %66
%68 = load i32*, i32** %7
%69 = icmp ne i32* %68, null
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = load i32*, i32** %7
%72 = load i32, i32* %71
store i32 %72, i32* %13
br label %73
73: ; preds = %70, %67
%74 = load i32*, i32** %8
%75 = icmp ne i32* %74, null
br i1 %75, label %76, label %79
76: ; preds = %73
%77 = load i32*, i32** %8
%78 = load i32, i32* %77
store i32 %78, i32* %15
br label %79
79: ; preds = %76, %73
%80 = load i32*, i32** %9
%81 = icmp ne i32* %80, null
br i1 %81, label %82, label %85
82: ; preds = %79
%83 = load i32*, i32** %9
%84 = load i32, i32* %83
store i32 %84, i32* %17
br label %85
85: ; preds = %82, %79
%86 = load %struct.timeval*, %struct.timeval** %10
%87 = icmp ne %struct.timeval* %86, null
br i1 %87, label %88, label %118
88: ; preds = %85
%89 = getelementptr inbounds %struct.timeval, %struct.timeval* %20, i32 0, i32 1
%90 = load i64, i64* %89
%91 = getelementptr inbounds %struct.timeval, %struct.timeval* %21, i32 0, i32 1
%92 = load i64, i64* %91
%93 = sub nsw i64 %90, %92
%94 = getelementptr inbounds %struct.timeval, %struct.timeval* %18, i32 0, i32 1
store i64 %93, i64* %94
%95 = getelementptr inbounds %struct.timeval, %struct.timeval* %20, i32 0, i32 0
%96 = load i32, i32* %95
%97 = getelementptr inbounds %struct.timeval, %struct.timeval* %21, i32 0, i32 0
%98 = load i32, i32* %97
%99 = sub nsw i32 %96, %98
%100 = getelementptr inbounds %struct.timeval, %struct.timeval* %18, i32 0, i32 0
store i32 %99, i32* %100
%101 = getelementptr inbounds %struct.timeval, %struct.timeval* %18, i32 0, i32 0
%102 = load i32, i32* %101
%103 = sext i32 %102 to i64
%104 = icmp slt i64 %103, 0
br i1 %104, label %105, label %112
105: ; preds = %88
%106 = getelementptr inbounds %struct.timeval, %struct.timeval* %18, i32 0, i32 0
%107 = load i32, i32* %106
%108 = add nsw i32 %107, 1000000
store i32 %108, i32* %106
%109 = getelementptr inbounds %struct.timeval, %struct.timeval* %18, i32 0, i32 1
%110 = load i64, i64* %109
%111 = add nsw i64 %110, -1
store i64 %111, i64* %109
br label %112
112: ; preds = %105, %88
%113 = getelementptr inbounds %struct.timeval, %struct.timeval* %18, i32 0, i32 1
%114 = load i64, i64* %113
%115 = icmp slt i64 %114, 0
br i1 %115, label %116, label %117
116: ; preds = %112
store i32 0, i32* %11
br label %134
117: ; preds = %112
br label %118
118: ; preds = %117, %85
%119 = load i32, i32* %6
%120 = load i32*, i32** %12
%121 = load i32*, i32** %14
%122 = load i32*, i32** %16
%123 = load %struct.timeval*, %struct.timeval** %19
%124 = call i32 @sys_select(i32 %119, i32* %120, i32* %121, i32* %122, %struct.timeval* %123)
store i32 %124, i32* %11
br label %125
125: ; preds = %118
%126 = load i32, i32* %11
%127 = icmp eq i32 %126, -1
br i1 %127, label %128, label %132
128: ; preds = %125
%129 = load i64, i64* @errno
%130 = load i64, i64* @EINTR
%131 = icmp eq i64 %129, %130
br label %132
132: ; preds = %128, %125
%133 = phi i1 [ false, %125 ], [ %131, %128 ]
br i1 %133, label %67, label %134
134: ; preds = %132, %116
%135 = load i32*, i32** %7
%136 = icmp ne i32* %135, null
br i1 %136, label %137, label %140
137: ; preds = %134
%138 = load i32, i32* %13
%139 = load i32*, i32** %7
store i32 %138, i32* %139
br label %140
140: ; preds = %137, %134
%141 = load i32*, i32** %8
%142 = icmp ne i32* %141, null
br i1 %142, label %143, label %146
143: ; preds = %140
%144 = load i32, i32* %15
%145 = load i32*, i32** %8
store i32 %144, i32* %145
br label %146
146: ; preds = %143, %140
%147 = load i32*, i32** %9
%148 = icmp ne i32* %147, null
br i1 %148, label %149, label %152
149: ; preds = %146
%150 = load i32, i32* %17
%151 = load i32*, i32** %9
store i32 %150, i32* %151
br label %152
152: ; preds = %149, %146
%153 = load i32, i32* %11
ret i32 %153
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
@errno = global i64 0
@EINTR = global i64 0
define i32 @sys_select_intr(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.timeval
%10 = alloca %struct.timeval
%11 = alloca %struct.timeval
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = bitcast i32* %8 to i8*
%15 = bitcast %struct.timeval* %9 to i8*
%16 = bitcast %struct.timeval* %10 to i8*
%17 = bitcast %struct.timeval* %11 to i8*
%18 = icmp eq i32* %1, null
%19 = select i1 %18, i32* null, i32* %6
%20 = icmp eq i32* %2, null
%21 = select i1 %20, i32* null, i32* %7
%22 = icmp eq i32* %3, null
%23 = select i1 %22, i32* null, i32* %8
%24 = icmp eq %struct.timeval* %4, null
br i1 %24, label %40, label %25
25: ; preds = %5
%26 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
%27 = load i64, i64* %26
%28 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i64 0, i32 1
%29 = load i64, i64* %28
%30 = add nsw i64 %29, %27
%31 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
%32 = load i32, i32* %31
%33 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i64 0, i32 0
%34 = load i32, i32* %33
%35 = add nsw i32 %34, %32
%36 = sdiv i32 %35, 1000000
%37 = sext i32 %36 to i64
%38 = add nsw i64 %30, %37
store i64 %38, i64* %28
%39 = srem i32 %35, 1000000
store i32 %39, i32* %33
br label %40
40: ; preds = %5, %25
%41 = phi %struct.timeval* [ %9, %25 ], [ null, %5 ]
%42 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i64 0, i32 1
%43 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i64 0, i32 1
%44 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i64 0, i32 1
%45 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i64 0, i32 0
%46 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i64 0, i32 0
%47 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i64 0, i32 0
br label %48
48: ; preds = %72, %40
br i1 %18, label %51, label %49
49: ; preds = %48
%50 = load i32, i32* %1
store i32 %50, i32* %6
br label %51
51: ; preds = %49, %48
br i1 %20, label %54, label %52
52: ; preds = %51
%53 = load i32, i32* %2
store i32 %53, i32* %7
br label %54
54: ; preds = %52, %51
br i1 %22, label %57, label %55
55: ; preds = %54
%56 = load i32, i32* %3
store i32 %56, i32* %8
br label %57
57: ; preds = %55, %54
br i1 %24, label %72, label %58
58: ; preds = %57
%59 = load i64, i64* %42
%60 = load i64, i64* %43
%61 = sub nsw i64 %59, %60
store i64 %61, i64* %44
%62 = load i32, i32* %45
%63 = load i32, i32* %46
%64 = sub nsw i32 %62, %63
store i32 %64, i32* %47
%65 = icmp slt i32 %64, 0
br i1 %65, label %66, label %69
66: ; preds = %58
%67 = add nsw i32 %64, 1000000
store i32 %67, i32* %47
%68 = add nsw i64 %61, -1
store i64 %68, i64* %44
br label %69
69: ; preds = %58, %66
%70 = phi i64 [ %68, %66 ], [ %61, %58 ]
%71 = icmp slt i64 %70, 0
br i1 %71, label %79, label %72
72: ; preds = %69, %57
%73 = call i32 @sys_select(i32 %0, i32* %19, i32* %21, i32* %23, %struct.timeval* %41)
%74 = icmp eq i32 %73, -1
%75 = load i64, i64* @errno
%76 = load i64, i64* @EINTR
%77 = icmp eq i64 %75, %76
%78 = select i1 %74, i1 %77, i1 false
br i1 %78, label %48, label %79
79: ; preds = %69, %72
%80 = phi i32 [ %73, %72 ], [ 0, %69 ]
br i1 %18, label %83, label %81
81: ; preds = %79
%82 = load i32, i32* %6
store i32 %82, i32* %1
br label %83
83: ; preds = %81, %79
br i1 %20, label %86, label %84
84: ; preds = %83
%85 = load i32, i32* %7
store i32 %85, i32* %2
br label %86
86: ; preds = %84, %83
br i1 %22, label %89, label %87
87: ; preds = %86
%88 = load i32, i32* %8
store i32 %88, i32* %3
br label %89
89: ; preds = %87, %86
ret i32 %80
}