#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;
  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,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%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    -0xc(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    -0x2f10(%rbp),%edi
mov    %rax,%rdx
mov    -0x10(%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 %struct.sockaddr_in
%5 = alloca i32
%6 = alloca [1000 x %struct.pollfd]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %2
%10 = load i32, i32* %2
%11 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %6, i64 0, i64 0
%12 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %11, i32 0, i32 0
store i32 %10, i32* %12
%13 = load i32, i32* @POLLIN
%14 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %6, i64 0, i64 0
%15 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %14, i32 0, i32 1
store i32 %13, i32* %15
store i32 1, i32* %8
br label %16
16: ; preds = %24, %1
%17 = load i32, i32* %8
%18 = icmp slt i32 %17, 1000
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %6, i64 0, i64 %21
%23 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %22, i32 0, i32 0
store i32 -1, i32* %23
br label %24
24: ; preds = %19
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %16
27: ; preds = %16
store i32 0, i32* %7
br label %28
28: ; preds = %113, %111, %54, %27
%29 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %6, i64 0, i64 0
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
%32 = call i32 @poll(%struct.pollfd* %29, i32 %31, i32 -1)
store i32 %32, i32* %9
%33 = load i32, i32* %9
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %38
35: ; preds = %28
%36 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%37 = call i32 @exit(i32 1)
unreachable
38: ; preds = %28
%39 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %6, i64 0, i64 0
%40 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %39, i32 0, i32 2
%41 = load i32, i32* %40
%42 = load i32, i32* @POLLIN
%43 = and i32 %41, %42
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %113
45: ; preds = %38
store i32 8, i32* %5
%46 = load i32, i32* %2
%47 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%48 = call i32 @accept(i32 %46, %struct.sockaddr* %47, i32* %5)
store i32 %48, i32* %3
%49 = icmp eq i32 %48, -1
br i1 %49, label %50, label %58
50: ; preds = %45
%51 = load i64, i64* @errno
%52 = load i64, i64* @EINTR
%53 = icmp eq i64 %51, %52
br i1 %53, label %54, label %55
54: ; preds = %50
br label %28
55: ; preds = %50
%56 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %45
%59 = load i32, i32* @stdout
%60 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 1
%61 = load i32, i32* %60
%62 = call i8* @inet_ntoa(i32 %61)
%63 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%64 = load i32, i32* %63
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %62, i32 %64)
store i32 1, i32* %8
br label %66
66: ; preds = %83, %58
%67 = load i32, i32* %8
%68 = icmp slt i32 %67, 1000
br i1 %68, label %69, label %86
69: ; preds = %66
%70 = load i32, i32* %8
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %6, i64 0, i64 %71
%73 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %72, i32 0, i32 0
%74 = load i32, i32* %73
%75 = icmp slt i32 %74, 0
br i1 %75, label %76, label %82
76: ; preds = %69
%77 = load i32, i32* %3
%78 = load i32, i32* %8
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %6, i64 0, i64 %79
%81 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %80, i32 0, i32 0
store i32 %77, i32* %81
br label %86
82: ; preds = %69
br label %83
83: ; preds = %82
%84 = load i32, i32* %8
%85 = add nsw i32 %84, 1
store i32 %85, i32* %8
br label %66
86: ; preds = %76, %66
%87 = load i32, i32* %8
%88 = icmp eq i32 %87, 1000
br i1 %88, label %89, label %93
89: ; preds = %86
%90 = load i32, i32* @stderr
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%92 = call i32 @exit(i32 1)
unreachable
93: ; preds = %86
%94 = load i32, i32* @POLLIN
%95 = load i32, i32* %8
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %6, i64 0, i64 %96
%98 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %97, i32 0, i32 1
store i32 %94, i32* %98
%99 = load i32, i32* %8
%100 = load i32, i32* %7
%101 = icmp sgt i32 %99, %100
br i1 %101, label %102, label %104
102: ; preds = %93
%103 = load i32, i32* %8
br label %106
104: ; preds = %93
%105 = load i32, i32* %7
br label %106
106: ; preds = %104, %102
%107 = phi i32 [ %103, %102 ], [ %105, %104 ]
store i32 %107, i32* %7
%108 = load i32, i32* %9
%109 = add nsw i32 %108, -1
store i32 %109, i32* %9
%110 = icmp sle i32 %109, 0
br i1 %110, label %111, label %112
111: ; preds = %106
br label %28
112: ; preds = %106
br label %113
113: ; preds = %112, %38
%114 = getelementptr inbounds [1000 x %struct.pollfd], [1000 x %struct.pollfd]* %6, i64 0, i64 0
%115 = load i32, i32* %7
%116 = call i32 @handle_connection(%struct.pollfd* %114, i32 %115)
br label %28
}

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
}