#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 sockaddr_in {
  int sin_port;
  int /*<<< orphan*/ sin_addr;
};
struct sockaddr {
  int dummy;
};
struct pollfd {
  int fd;
  int events;
  int revents;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ cliaddr;

/* Variables and functions */
scalar_t__ EINTR;
int POLLIN;
int accept(int, struct sockaddr *, int *);
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ handle_connection(struct pollfd *, int);
char *inet_ntoa(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int poll(struct pollfd *, int, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void do_poll(int listenfd) {
  int connfd, sockfd;
  struct sockaddr_in cliaddr;
  socklen_t cliaddrlen;
  struct pollfd clientfds[1000];
  int maxi;
  int i;
  int nready;
  clientfds[0].fd = listenfd;
  clientfds[0].events = POLLIN;
  for (i = 1; i < 1000; i++)
    clientfds[i].fd = -1;
  maxi = 0;
  for (;;) {
    nready = poll(clientfds, maxi + 1, -1);
    if (nready == -1) {
      perror("poll error:");
      exit(1);
    }
    if (clientfds[0].revents & POLLIN) {
      cliaddrlen = sizeof(cliaddr);
      if ((connfd = accept(listenfd, (struct sockaddr *)&cliaddr,
                           &cliaddrlen)) == -1) {
        if (errno == EINTR)
          continue;
        else {
          perror("accept error:");
          exit(1);
        }
      }
      fprintf(stdout, "accept a new client: %s:%d\n",
              inet_ntoa(cliaddr.sin_addr), cliaddr.sin_port);
      for (i = 1; i < 1000; i++) {
        if (clientfds[i].fd < 0) {
          clientfds[i].fd = connfd;
          break;
        }
      }
      if (i == 1000) {
        fprintf(stderr, "too many clients.\n");
        exit(1);
      }
      clientfds[i].events = POLLIN;
      maxi = (i > maxi ? i : maxi);
      if (--nready <= 0)
        continue;
    }
    handle_connection(clientfds, maxi);
  }
}


x86 assembly (clang, -O0):
<do_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2f20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x2f00(%rbp)
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2efc(%rbp)
movl   $0x1,-0x2f08(%rbp)
cmpl   $0x3e8,-0x2f08(%rbp)
jge    11df <do_poll+0x6f>
movslq -0x2f08(%rbp),%rcx
lea    -0x2f00(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movl   $0xffffffff,(%rax)
mov    -0x2f08(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2f08(%rbp)
jmp    11a0 <do_poll+0x30>
movl   $0x0,-0x2f04(%rbp)
lea    -0x2f00(%rbp),%rdi
mov    -0x2f04(%rbp),%esi
add    $0x1,%esi
mov    $0xffffffff,%edx
call   1060 <poll@plt>
mov    %eax,-0x2f0c(%rbp)
cmpl   $0xffffffff,-0x2f0c(%rbp)
jne    122c <do_poll+0xbc>
lea    0xde3(%rip),%rdi
call   1070 <perror@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x2ef8(%rbp),%eax
mov    0x2daf(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     13ec <do_poll+0x27c>
movl   $0x8,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1080 <accept@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    129c <do_poll+0x12c>
mov    0x2d62(%rip),%rax
mov    (%rax),%rax
mov    0x2d50(%rip),%rcx
cmp    (%rcx),%rax
jne    1286 <do_poll+0x116>
jmp    11e9 <do_poll+0x79>
lea    0xd7f(%rip),%rdi
call   1070 <perror@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2d1d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2f10(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    -0x2f10(%rbp),%edi
mov    %rax,%rdx
mov    -0x18(%rbp),%ecx
lea    0xd54(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x2f08(%rbp)
cmpl   $0x3e8,-0x2f08(%rbp)
jge    133d <do_poll+0x1cd>
movslq -0x2f08(%rbp),%rcx
lea    -0x2f00(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
cmpl   $0x0,(%rax)
jge    1324 <do_poll+0x1b4>
mov    -0x8(%rbp),%ecx
movslq -0x2f08(%rbp),%rdx
lea    -0x2f00(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
jmp    133d <do_poll+0x1cd>
jmp    1329 <do_poll+0x1b9>
mov    -0x2f08(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2f08(%rbp)
jmp    12d7 <do_poll+0x167>
cmpl   $0x3e8,-0x2f08(%rbp)
jne    136e <do_poll+0x1fe>
mov    0x2c84(%rip),%rax
mov    (%rax),%edi
lea    0xcd9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2c73(%rip),%rax
mov    (%rax),%ecx
movslq -0x2f08(%rbp),%rdx
lea    -0x2f00(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
mov    -0x2f08(%rbp),%eax
cmp    -0x2f04(%rbp),%eax
jle    13b2 <do_poll+0x242>
mov    -0x2f08(%rbp),%eax
mov    %eax,-0x2f14(%rbp)
jmp    13be <do_poll+0x24e>
mov    -0x2f04(%rbp),%eax
mov    %eax,-0x2f14(%rbp)
mov    -0x2f14(%rbp),%eax
mov    %eax,-0x2f04(%rbp)
mov    -0x2f0c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2f0c(%rbp)
cmp    $0x0,%eax
jg     13e7 <do_poll+0x277>
jmp    11e9 <do_poll+0x79>
jmp    13ec <do_poll+0x27c>
lea    -0x2f00(%rbp),%rdi
mov    -0x2f04(%rbp),%esi
call   1050 <handle_connection@plt>
jmp    11e9 <do_poll+0x79>

x86 assembly (clang, -O2):
<do_poll>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2f08,%rsp
mov    %edi,%ebx
mov    %edi,0x20(%rsp)
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x24(%rsp)
mov    $0x24,%eax
nopl   0x0(%rax)
movl   $0xffffffff,0x8(%rsp,%rax,1)
ff
movl   $0xffffffff,0x14(%rsp,%rax,1)
ff
movl   $0xffffffff,0x20(%rsp,%rax,1)
ff
add    $0x24,%rax
cmp    $0x2ef8,%rax
jne    11a0 <do_poll+0x30>
lea    0x20(%rsp),%r14
lea    0xc(%rsp),%r12
xor    %r15d,%r15d
jmp    11f0 <do_poll+0x80>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x10(%rsp),%r15
mov    %r14,%rdi
mov    %r15d,%esi
call   1050 <handle_connection@plt>
mov    %r15,0x10(%rsp)
add    $0x1,%r15d
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15d,%esi
mov    $0xffffffff,%edx
call   1060 <poll@plt>
cmp    $0xffffffff,%eax
je     1327 <do_poll+0x1b7>
mov    %eax,%r13d
mov    0x2dc5(%rip),%rax
mov    (%rax),%eax
test   %eax,0x28(%rsp)
je     11e0 <do_poll+0x70>
movl   $0x8,0xc(%rsp)
mov    %ebx,%edi
lea    0x18(%rsp),%rsi
mov    %r12,%rdx
call   1080 <accept@plt>
cmp    $0xffffffff,%eax
jne    1270 <do_poll+0x100>
mov    0x2d82(%rip),%rax
mov    (%rax),%rax
mov    0x2d70(%rip),%rcx
cmp    (%rcx),%rax
je     1200 <do_poll+0x90>
jmp    1330 <do_poll+0x1c0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ebp
mov    0x2d47(%rip),%rax
mov    (%rax),%r15d
mov    0x1c(%rsp),%edi
call   1030 <inet_ntoa@plt>
mov    0x18(%rsp),%ecx
mov    %r15d,%edi
lea    0xd87(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%eax
mov    $0x3,%edx
xor    %ecx,%ecx
mov    0x10(%rsp),%r15
xchg   %ax,%ax
cmpl   $0x0,0x2c(%rsp,%rcx,1)
js     12dc <do_poll+0x16c>
cmpl   $0x0,0x38(%rsp,%rcx,1)
js     12e5 <do_poll+0x175>
cmpl   $0x0,0x44(%rsp,%rcx,1)
js     12f2 <do_poll+0x182>
add    $0x3,%rax
add    $0x24,%rcx
add    $0x3,%rdx
cmp    $0x2ed4,%rcx
jne    12b0 <do_poll+0x140>
jmp    1346 <do_poll+0x1d6>
add    %rsp,%rcx
add    $0x2c,%rcx
jmp    12fc <do_poll+0x18c>
add    $0x1,%rax
add    %rsp,%rcx
add    $0x38,%rcx
jmp    12fc <do_poll+0x18c>
add    %rsp,%rcx
add    $0x44,%rcx
mov    %rdx,%rax
mov    %ebp,(%rcx)
mov    0x2ce3(%rip),%rcx
mov    (%rcx),%ecx
mov    %eax,%edx
lea    (%rdx,%rdx,2),%rdx
mov    %ecx,0x24(%rsp,%rdx,4)
cmp    %eax,%r15d
cmovl  %eax,%r15d
cmp    $0x1,%r13d
jle    11f0 <do_poll+0x80>
jmp    11e5 <do_poll+0x75>
lea    0xcd2(%rip),%rdi
jmp    1337 <do_poll+0x1c7>
lea    0xcd5(%rip),%rdi
call   1070 <perror@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2c8b(%rip),%rax
mov    (%rax),%edi
lea    0xce0(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32 }
%struct.pollfd = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@POLLIN = global i32 0
@.str = [12 x i8] c"poll error:\00"
@errno = global i64 0
@EINTR = global i64 0
@.str.1 = [14 x i8] c"accept error:\00"
@stdout = global i32 0
@.str.2 = [28 x i8] c"accept a new client: %s:%d\0A\00"
@stderr = global i32 0
@.str.3 = [19 x i8] c"too many clients.\0A\00"
define void @do_poll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sockaddr_in
%6 = alloca i32
%7 = alloca [1000 x %struct.pollfd]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %2
%11 = load i32, i32* %2
%12 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %7, i64 0, i64 0
%13 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %12, i32 0, i32 0
store i32 %11, i32* %13
%14 = load i32, i32* @POLLIN
%15 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %7, i64 0, i64 0
%16 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %15, i32 0, i32 1
store i32 %14, i32* %16
store i32 1, i32* %9
br label %17
17: ; preds = %25, %1
%18 = load i32, i32* %9
%19 = icmp slt i32 %18, 1000
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %7, i64 0, i64 %22
%24 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %23, i32 0, i32 0
store i32 -1, i32* %24
br label %25
25: ; preds = %20
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
store i32 %27, i32* %9
br label %17
28: ; preds = %17
store i32 0, i32* %8
br label %29
29: ; preds = %114, %112, %55, %28
%30 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %7, i64 0, i64 0
%31 = load i32, i32* %8
%32 = add nsw i32 %31, 1
%33 = call i32 @poll(%struct.pollfd* %30, i32 %32, i32 -1)
store i32 %33, i32* %10
%34 = load i32, i32* %10
%35 = icmp eq i32 %34, -1
br i1 %35, label %36, label %39
36: ; preds = %29
%37 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %29
%40 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %7, i64 0, i64 0
%41 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %40, i32 0, i32 2
%42 = load i32, i32* %41
%43 = load i32, i32* @POLLIN
%44 = and i32 %42, %43
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %114
46: ; preds = %39
store i32 8, i32* %6
%47 = load i32, i32* %2
%48 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%49 = call i32 @accept(i32 %47, %struct.sockaddr* %48, i32* %6)
store i32 %49, i32* %3
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %59
51: ; preds = %46
%52 = load i64, i64* @errno
%53 = load i64, i64* @EINTR
%54 = icmp eq i64 %52, %53
br i1 %54, label %55, label %56
55: ; preds = %51
br label %29
56: ; preds = %51
%57 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %46
%60 = load i32, i32* @stdout
%61 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 1
%62 = load i32, i32* %61
%63 = call i8* @inet_ntoa(i32 %62)
%64 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 0
%65 = load i32, i32* %64
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %63, i32 %65)
store i32 1, i32* %9
br label %67
67: ; preds = %84, %59
%68 = load i32, i32* %9
%69 = icmp slt i32 %68, 1000
br i1 %69, label %70, label %87
70: ; preds = %67
%71 = load i32, i32* %9
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %7, i64 0, i64 %72
%74 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %73, i32 0, i32 0
%75 = load i32, i32* %74
%76 = icmp slt i32 %75, 0
br i1 %76, label %77, label %83
77: ; preds = %70
%78 = load i32, i32* %3
%79 = load i32, i32* %9
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %7, i64 0, i64 %80
%82 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %81, i32 0, i32 0
store i32 %78, i32* %82
br label %87
83: ; preds = %70
br label %84
84: ; preds = %83
%85 = load i32, i32* %9
%86 = add nsw i32 %85, 1
store i32 %86, i32* %9
br label %67
87: ; preds = %77, %67
%88 = load i32, i32* %9
%89 = icmp eq i32 %88, 1000
br i1 %89, label %90, label %94
90: ; preds = %87
%91 = load i32, i32* @stderr
%92 = call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%93 = call i32 @exit(i32 1)
unreachable
94: ; preds = %87
%95 = load i32, i32* @POLLIN
%96 = load i32, i32* %9
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %7, i64 0, i64 %97
%99 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %98, i32 0, i32 1
store i32 %95, i32* %99
%100 = load i32, i32* %9
%101 = load i32, i32* %8
%102 = icmp sgt i32 %100, %101
br i1 %102, label %103, label %105
103: ; preds = %94
%104 = load i32, i32* %9
br label %107
105: ; preds = %94
%106 = load i32, i32* %8
br label %107
107: ; preds = %105, %103
%108 = phi i32 [ %104, %103 ], [ %106, %105 ]
store i32 %108, i32* %8
%109 = load i32, i32* %10
%110 = add nsw i32 %109, -1
store i32 %110, i32* %10
%111 = icmp sle i32 %110, 0
br i1 %111, label %112, label %113
112: ; preds = %107
br label %29
113: ; preds = %107
br label %114
114: ; preds = %113, %39
%115 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %7, i64 0, i64 0
%116 = load i32, i32* %8
%117 = call i32 @handle_connection(%struct.pollfd* %115, i32 %116)
br label %29
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32 }
%struct.pollfd = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@POLLIN = global i32 0
@.str = [12 x i8] c"poll error:\00"
@errno = global i64 0
@EINTR = global i64 0
@.str.1 = [14 x i8] c"accept error:\00"
@stdout = global i32 0
@.str.2 = [28 x i8] c"accept a new client: %s:%d\0A\00"
@stderr = global i32 0
@.str.3 = [19 x i8] c"too many clients.\0A\00"
define void @do_poll(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = alloca [1000 x %struct.pollfd]
%5 = bitcast %struct.sockaddr_in* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast [1000 x %struct.pollfd]* %4 to i8*
%8 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %4, i64 0, i64 0, i32 0
store i32 %0, i32* %8
%9 = load i32, i32* @POLLIN
%10 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %4, i64 0, i64 0, i32 1
store i32 %9, i32* %10
br label %17
11: ; preds = %17
%12 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %4, i64 0, i64 0
%13 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %4, i64 0, i64 0, i32 2
%14 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%15 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 1
%16 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
br label %87
17: ; preds = %17, %1
%18 = phi i64 [ 1, %1 ], [ %24, %17 ]
%19 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %4, i64 0, i64 %18, i32 0
store i32 -1, i32* %19
%20 = add nuw nsw i64 %18, 1
%21 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %4, i64 0, i64 %20, i32 0
store i32 -1, i32* %21
%22 = add nuw nsw i64 %18, 2
%23 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %4, i64 0, i64 %22, i32 0
store i32 -1, i32* %23
%24 = add nuw nsw i64 %18, 3
%25 = icmp eq i64 %24, 1000
br i1 %25, label %11, label %17
26: ; preds = %87, %40
%27 = call i32 @poll(%struct.pollfd* %12, i32 %89, i32 -1)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %26
%33 = load i32, i32* %13
%34 = load i32, i32* @POLLIN
%35 = and i32 %34, %33
%36 = icmp eq i32 %35, 0
br i1 %36, label %90, label %37
37: ; preds = %32
store i32 8, i32* %3
%38 = call i32 @accept(i32 %0, %struct.sockaddr* %14, i32* %3)
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %47
40: ; preds = %37
%41 = load i64, i64* @errno
%42 = load i64, i64* @EINTR
%43 = icmp eq i64 %41, %42
br i1 %43, label %26, label %44
44: ; preds = %40
%45 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %37
%48 = load i32, i32* @stdout
%49 = load i32, i32* %15
%50 = call i8* @inet_ntoa(i32 %49)
%51 = load i32, i32* %16
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %50, i32 %51)
br label %53
53: ; preds = %68, %47
%54 = phi i64 [ 1, %47 ], [ %69, %68 ]
%55 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %4, i64 0, i64 %54, i32 0
%56 = load i32, i32* %55
%57 = icmp slt i32 %56, 0
br i1 %57, label %75, label %58
58: ; preds = %53
%59 = add nuw nsw i64 %54, 1
%60 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %4, i64 0, i64 %59, i32 0
%61 = load i32, i32* %60
%62 = icmp slt i32 %61, 0
br i1 %62, label %75, label %63
63: ; preds = %58
%64 = add nuw nsw i64 %54, 2
%65 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %4, i64 0, i64 %64, i32 0
%66 = load i32, i32* %65
%67 = icmp slt i32 %66, 0
br i1 %67, label %75, label %68
68: ; preds = %63
%69 = add nuw nsw i64 %54, 3
%70 = icmp eq i64 %69, 1000
br i1 %70, label %71, label %53
71: ; preds = %68
%72 = load i32, i32* @stderr
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%74 = call i32 @exit(i32 1)
unreachable
75: ; preds = %63, %58, %53
%76 = phi i64 [ %54, %53 ], [ %59, %58 ], [ %64, %63 ]
%77 = phi i32* [ %55, %53 ], [ %60, %58 ], [ %65, %63 ]
%78 = trunc i64 %76 to i32
store i32 %38, i32* %77
%79 = load i32, i32* @POLLIN
%80 = and i64 %76, 4294967295
%81 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %4, i64 0, i64 %80, i32 1
store i32 %79, i32* %81
%82 = icmp slt i32 %88, %78
%83 = select i1 %82, i32 %78, i32 %88
%84 = icmp slt i32 %27, 2
br i1 %84, label %85, label %90
85: ; preds = %75, %90
%86 = phi i32 [ %91, %90 ], [ %83, %75 ]
br label %87
87: ; preds = %85, %11
%88 = phi i32 [ 0, %11 ], [ %86, %85 ]
%89 = add nsw i32 %88, 1
br label %26
90: ; preds = %32, %75
%91 = phi i32 [ %83, %75 ], [ %88, %32 ]
%92 = call i32 @handle_connection(%struct.pollfd* %12, i32 %91)
br label %85
}