#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 pollfd {
  int fd;
  int events;
  scalar_t__ revents;
};

/* Variables and functions */
int /*<<< orphan*/ MSG_DONTWAIT;
int /*<<< orphan*/ MSG_PEEK;
int POLLIN;
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ close(int);
int listen_to(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ memcpy(struct pollfd *, struct pollfd *, int);
int poll(struct pollfd *, size_t, int);
int /*<<< orphan*/ printf(char *, int);
int recv(int, char *, int, int /*<<< orphan*/);
int main() {
  int server = listen_to(NULL, "4242");
  printf("Server: %i\n", server);
  struct pollfd fds[1024];
  size_t n_fds = 0;
  fds[n_fds].fd = server;
  fds[n_fds].events = POLLIN;
  n_fds++;
  while (1) {
    int ret = poll(fds, n_fds, 10);
    if (ret < 0)
      break;
    if (ret == 0)
      continue;
    for (size_t i = 0; i < n_fds; i++) {
      if (!fds[i].revents & POLLIN)
        continue;
      fds[i].revents = 0;
      if (i == 0) {
        int client = accept(server, NULL, NULL);
        if (n_fds >= 1024) {
          close(client);
        } else {
          printf("+ %i\n", client);
          fds[n_fds].fd = client;
          fds[n_fds].events = POLLIN;
          n_fds++;
        }
      } else {
        char buf;
        int ret = recv(fds[i].fd, &buf, 1, MSG_PEEK);
        if (ret == 0) {
          printf("- %i\n", fds[i].fd);
          if (i != n_fds - 1)
            memcpy(&fds[i], &fds[n_fds - 1], sizeof(struct pollfd));
          n_fds--;
        } else {
          while (recv(fds[i].fd, &buf, 1, MSG_DONTWAIT) > 0)
            ;
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4040,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe73(%rip),%rsi
call   1090 <listen_to@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
movq   $0x0,-0x4018(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4018(%rbp),%rdx
lea    -0x4010(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
mov    0x2e10(%rip),%rax
mov    (%rax),%ecx
mov    -0x4018(%rbp),%rdx
lea    -0x4010(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
mov    -0x4018(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x4018(%rbp)
lea    -0x4010(%rbp),%rdi
mov    -0x4018(%rbp),%rsi
mov    $0xa,%edx
call   1070 <poll@plt>
mov    %eax,-0x401c(%rbp)
cmpl   $0x0,-0x401c(%rbp)
jge    122c <main+0xbc>
jmp    14a0 <main+0x330>
cmpl   $0x0,-0x401c(%rbp)
jne    123e <main+0xce>
jmp    11fc <main+0x8c>
movq   $0x0,-0x4028(%rbp)
mov    -0x4028(%rbp),%rax
cmp    -0x4018(%rbp),%rax
jae    149b <main+0x32b>
mov    -0x4028(%rbp),%rcx
lea    -0x4010(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
cmpq   $0x0,0x8(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    0x2d58(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1298 <main+0x128>
jmp    1484 <main+0x314>
mov    -0x4028(%rbp),%rcx
lea    -0x4010(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movq   $0x0,0x8(%rax)
cmpq   $0x0,-0x4028(%rbp)
jne    1360 <main+0x1f0>
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1080 <accept@plt>
mov    %eax,-0x402c(%rbp)
cmpq   $0x400,-0x4018(%rbp)
jb     12f9 <main+0x189>
mov    -0x402c(%rbp),%edi
call   1050 <close@plt>
jmp    135b <main+0x1eb>
mov    -0x402c(%rbp),%esi
lea    0xd0b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x402c(%rbp),%ecx
mov    -0x4018(%rbp),%rdx
lea    -0x4010(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
mov    0x2cb1(%rip),%rax
mov    (%rax),%ecx
mov    -0x4018(%rbp),%rdx
lea    -0x4010(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
mov    -0x4018(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x4018(%rbp)
jmp    147f <main+0x30f>
mov    -0x4028(%rbp),%rcx
lea    -0x4010(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%edi
mov    0x2c6a(%rip),%rax
mov    (%rax),%ecx
lea    -0x402d(%rbp),%rsi
mov    $0x1,%edx
call   1030 <recv@plt>
mov    %eax,-0x4034(%rbp)
cmpl   $0x0,-0x4034(%rbp)
jne    1431 <main+0x2c1>
mov    -0x4028(%rbp),%rcx
lea    -0x4010(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%esi
lea    0xc55(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4028(%rbp),%rax
mov    -0x4018(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
je     141a <main+0x2aa>
mov    -0x4028(%rbp),%rax
lea    -0x4010(%rbp),%rdi
shl    $0x4,%rax
add    %rax,%rdi
mov    -0x4018(%rbp),%rax
sub    $0x1,%rax
lea    -0x4010(%rbp),%rsi
shl    $0x4,%rax
add    %rax,%rsi
mov    $0x10,%edx
call   1060 <memcpy@plt>
mov    -0x4018(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x4018(%rbp)
jmp    147a <main+0x30a>
jmp    1436 <main+0x2c6>
mov    -0x4028(%rbp),%rcx
lea    -0x4010(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%edi
mov    0x2b7c(%rip),%rax
mov    (%rax),%ecx
lea    -0x402d(%rbp),%rsi
mov    $0x1,%edx
call   1030 <recv@plt>
cmp    $0x0,%eax
jle    1475 <main+0x305>
jmp    1436 <main+0x2c6>
jmp    147a <main+0x30a>
jmp    147f <main+0x30f>
jmp    1484 <main+0x314>
mov    -0x4028(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x4028(%rbp)
jmp    1249 <main+0xd9>
jmp    11fc <main+0x8c>
mov    -0x4(%rbp),%eax
add    $0x4040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4018,%rsp
lea    0xe78(%rip),%rsi
xor    %edi,%edi
call   1090 <listen_to@plt>
mov    %eax,%ebx
lea    0xe6d(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,0xc(%rsp)
mov    %ebx,0x10(%rsp)
mov    0x2e32(%rip),%r14
mov    (%r14),%eax
mov    %eax,0x14(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x1,%ebx
mov    $0x1,%esi
mov    $0xa,%edx
call   1070 <poll@plt>
test   %eax,%eax
js     1328 <main+0x1b8>
lea    0xb(%rsp),%rbp
mov    0x2dee(%rip),%r12
jmp    120a <main+0x9a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1070 <poll@plt>
test   %eax,%eax
js     1328 <main+0x1b8>
test   %eax,%eax
je     11f0 <main+0x80>
test   %rbx,%rbx
je     11f0 <main+0x80>
xor    %r15d,%r15d
jmp    1249 <main+0xd9>
lea    0xdf2(%rip),%rdi
mov    %r13d,%esi
call   1040 <printf@plt>
mov    %rbx,%rax
shl    $0x4,%rax
mov    %r13d,0x10(%rsp,%rax,1)
mov    (%r14),%ecx
mov    %ecx,0x14(%rsp,%rax,1)
add    $0x1,%rbx
xchg   %ax,%ax
add    $0x1,%r15
cmp    %rbx,%r15
jae    11f0 <main+0x80>
mov    %r15,%rax
shl    $0x4,%rax
cmpq   $0x0,0x18(%rsp,%rax,1)
sete   %cl
test   %cl,(%r14)
jne    1240 <main+0xd0>
lea    (%rsp,%rax,1),%rcx
add    $0x18,%rcx
movq   $0x0,(%rcx)
test   %r15,%r15
je     12bb <main+0x14b>
lea    (%rsp,%rax,1),%r13
add    $0x10,%r13
mov    0x0(%r13),%edi
mov    0x2d63(%rip),%rax
mov    (%rax),%ecx
mov    %rbp,%rsi
mov    $0x1,%edx
call   1030 <recv@plt>
test   %eax,%eax
je     12e5 <main+0x175>
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13),%edi
mov    (%r12),%ecx
mov    %rbp,%rsi
mov    $0x1,%edx
call   1030 <recv@plt>
test   %eax,%eax
jg     12a0 <main+0x130>
jmp    131d <main+0x1ad>
mov    0xc(%rsp),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <accept@plt>
mov    %eax,%r13d
cmp    $0x400,%rbx
jb     1218 <main+0xa8>
mov    %r13d,%edi
call   1050 <close@plt>
jmp    1240 <main+0xd0>
mov    0x0(%r13),%esi
lea    0xd27(%rip),%rdi
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
mov    %r15,%rax
cmp    %rbx,%r15
je     1320 <main+0x1b0>
mov    %rbx,%rax
shl    $0x4,%rax
lea    (%rsp,%rax,1),%rsi
add    $0x10,%rsi
mov    %r13,%rdi
mov    $0x10,%edx
call   1060 <memcpy@plt>
mov    %rbx,%rax
mov    %rax,%rbx
jmp    1240 <main+0xd0>
xor    %eax,%eax
add    $0x4018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32, i64 }
@.str = [5 x i8] c"4242\00"
@.str.1 = [12 x i8] c"Server: %i\0A\00"
@POLLIN = global i32 0
@.str.2 = [6 x i8] c"+ %i\0A\00"
@MSG_PEEK = global i32 0
@.str.3 = [6 x i8] c"- %i\0A\00"
@MSG_DONTWAIT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1024 x %struct.pollfd]
%4 = alloca i64
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 @listen_to(i32* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %11)
store i64 0, i64* %4
%13 = load i32, i32* %2
%14 = load i64, i64* %4
%15 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %3, i64 0, i64 %14
%16 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %15, i32 0, i32 0
store i32 %13, i32* %16
%17 = load i32, i32* @POLLIN
%18 = load i64, i64* %4
%19 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %3, i64 0, i64 %18
%20 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %19, i32 0, i32 1
store i32 %17, i32* %20
%21 = load i64, i64* %4
%22 = add i64 %21, 1
store i64 %22, i64* %4
br label %23
23: ; preds = %0, %33, %124
%24 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %3, i64 0, i64 0
%25 = load i64, i64* %4
%26 = call i32 @poll(%struct.pollfd* %24, i64 %25, i32 10)
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %23
br label %125
30: ; preds = %23
%31 = load i32, i32* %5
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %30
br label %23
34: ; preds = %30
store i64 0, i64* %6
br label %35
35: ; preds = %121, %34
%36 = load i64, i64* %6
%37 = load i64, i64* %4
%38 = icmp ult i64 %36, %37
br i1 %38, label %39, label %124
39: ; preds = %35
%40 = load i64, i64* %6
%41 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %3, i64 0, i64 %40
%42 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %41, i32 0, i32 2
%43 = load i64, i64* %42
%44 = icmp ne i64 %43, 0
%45 = xor i1 %44, true
%46 = zext i1 %45 to i32
%47 = load i32, i32* @POLLIN
%48 = and i32 %46, %47
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %39
br label %121
51: ; preds = %39
%52 = load i64, i64* %6
%53 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %3, i64 0, i64 %52
%54 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %53, i32 0, i32 2
store i64 0, i64* %54
%55 = load i64, i64* %6
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %79
57: ; preds = %51
%58 = load i32, i32* %2
%59 = call i32 @accept(i32 %58, i32* null, i32* null)
store i32 %59, i32* %7
%60 = load i64, i64* %4
%61 = icmp uge i64 %60, 1024
br i1 %61, label %62, label %65
62: ; preds = %57
%63 = load i32, i32* %7
%64 = call i32 @close(i32 %63)
br label %78
65: ; preds = %57
%66 = load i32, i32* %7
%67 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %66)
%68 = load i32, i32* %7
%69 = load i64, i64* %4
%70 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %3, i64 0, i64 %69
%71 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %70, i32 0, i32 0
store i32 %68, i32* %71
%72 = load i32, i32* @POLLIN
%73 = load i64, i64* %4
%74 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %3, i64 0, i64 %73
%75 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %74, i32 0, i32 1
store i32 %72, i32* %75
%76 = load i64, i64* %4
%77 = add i64 %76, 1
store i64 %77, i64* %4
br label %78
78: ; preds = %65, %62
br label %120
79: ; preds = %51
%80 = load i64, i64* %6
%81 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %3, i64 0, i64 %80
%82 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %81, i32 0, i32 0
%83 = load i32, i32* %82
%84 = load i32, i32* @MSG_PEEK
%85 = call i32 @recv(i32 %83, i8* %8, i32 1, i32 %84)
store i32 %85, i32* %9
%86 = load i32, i32* %9
%87 = icmp eq i32 %86, 0
br i1 %87, label %88, label %108
88: ; preds = %79
%89 = load i64, i64* %6
%90 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %3, i64 0, i64 %89
%91 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %90, i32 0, i32 0
%92 = load i32, i32* %91
%93 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %92)
%94 = load i64, i64* %6
%95 = load i64, i64* %4
%96 = sub i64 %95, 1
%97 = icmp ne i64 %94, %96
br i1 %97, label %98, label %105
98: ; preds = %88
%99 = load i64, i64* %6
%100 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %3, i64 0, i64 %99
%101 = load i64, i64* %4
%102 = sub i64 %101, 1
%103 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %3, i64 0, i64 %102
%104 = call i32 @memcpy(%struct.pollfd* %100, %struct.pollfd* %103, i32 16)
br label %105
105: ; preds = %98, %88
%106 = load i64, i64* %4
%107 = add i64 %106, -1
store i64 %107, i64* %4
br label %119
108: ; preds = %79
br label %109
109: ; preds = %117, %108
%110 = load i64, i64* %6
%111 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %3, i64 0, i64 %110
%112 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %111, i32 0, i32 0
%113 = load i32, i32* %112
%114 = load i32, i32* @MSG_DONTWAIT
%115 = call i32 @recv(i32 %113, i8* %8, i32 1, i32 %114)
%116 = icmp sgt i32 %115, 0
br i1 %116, label %117, label %118
117: ; preds = %109
br label %109
118: ; preds = %109
br label %119
119: ; preds = %118, %105
br label %120
120: ; preds = %119, %78
br label %121
121: ; preds = %120, %50
%122 = load i64, i64* %6
%123 = add i64 %122, 1
store i64 %123, i64* %6
br label %35
124: ; preds = %35
br label %23
125: ; preds = %29
%126 = load i32, i32* %1
ret i32 %126
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32, i64 }
@.str = [5 x i8] c"4242\00"
@.str.1 = [12 x i8] c"Server: %i\0A\00"
@POLLIN = global i32 0
@.str.2 = [6 x i8] c"+ %i\0A\00"
@MSG_PEEK = global i32 0
@.str.3 = [6 x i8] c"- %i\0A\00"
@MSG_DONTWAIT = global i32 0
define i32 @main() {
%1 = alloca [1024 x %struct.pollfd]
%2 = alloca i8
%3 = tail call i32 @listen_to(i32* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = bitcast [1024 x %struct.pollfd]* %1 to i8*
%6 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %1, i64 0, i64 0
%7 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %1, i64 0, i64 0, i32 0
store i32 %3, i32* %7
%8 = load i32, i32* @POLLIN
%9 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %1, i64 0, i64 0, i32 1
store i32 %8, i32* %9
%10 = call i32 @poll(%struct.pollfd* %6, i64 1, i32 10)
%11 = icmp slt i32 %10, 0
br i1 %11, label %71, label %12
12: ; preds = %0, %67
%13 = phi i32 [ %69, %67 ], [ %10, %0 ]
%14 = phi i64 [ %68, %67 ], [ 1, %0 ]
%15 = icmp ne i32 %13, 0
%16 = icmp ne i64 %14, 0
%17 = and i1 %15, %16
br i1 %17, label %18, label %67
18: ; preds = %12, %63
%19 = phi i64 [ %64, %63 ], [ %14, %12 ]
%20 = phi i64 [ %65, %63 ], [ 0, %12 ]
%21 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %1, i64 0, i64 %20
%22 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %1, i64 0, i64 %20, i32 2
%23 = load i64, i64* %22
%24 = icmp eq i64 %23, 0
%25 = zext i1 %24 to i32
%26 = load i32, i32* @POLLIN
%27 = and i32 %26, %25
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %63
29: ; preds = %18
store i64 0, i64* %22
%30 = icmp eq i64 %20, 0
br i1 %30, label %31, label %42
31: ; preds = %29
%32 = call i32 @accept(i32 %3, i32* null, i32* null)
%33 = icmp ugt i64 %19, 1023
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 @close(i32 %32)
br label %63
36: ; preds = %31
%37 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%38 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %1, i64 0, i64 %19, i32 0
store i32 %32, i32* %38
%39 = load i32, i32* @POLLIN
%40 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %1, i64 0, i64 %19, i32 1
store i32 %39, i32* %40
%41 = add nuw nsw i64 %19, 1
br label %63
42: ; preds = %29
%43 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %21, i64 0, i32 0
%44 = load i32, i32* %43
%45 = load i32, i32* @MSG_PEEK
%46 = call i32 @recv(i32 %44, i8* %2, i32 1, i32 %45)
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %56
48: ; preds = %42
%49 = load i32, i32* %43
%50 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %49)
%51 = add i64 %19, -1
%52 = icmp eq i64 %20, %51
br i1 %52, label %61, label %53
53: ; preds = %48
%54 = getelementptr inbounds [1024 x %struct.pollfd], [1024 x %struct.pollfd]* %1, i64 0, i64 %51
%55 = call i32 @memcpy(%struct.pollfd* %21, %struct.pollfd* %54, i32 16)
br label %61
56: ; preds = %42, %56
%57 = load i32, i32* %43
%58 = load i32, i32* @MSG_DONTWAIT
%59 = call i32 @recv(i32 %57, i8* %2, i32 1, i32 %58)
%60 = icmp sgt i32 %59, 0
br i1 %60, label %56, label %61
61: ; preds = %56, %48, %53
%62 = phi i64 [ %51, %53 ], [ %20, %48 ], [ %19, %56 ]
br label %63
63: ; preds = %34, %36, %61, %18
%64 = phi i64 [ %19, %18 ], [ %62, %61 ], [ %19, %34 ], [ %41, %36 ]
%65 = add nuw i64 %20, 1
%66 = icmp ult i64 %65, %64
br i1 %66, label %18, label %67
67: ; preds = %63, %12
%68 = phi i64 [ %14, %12 ], [ %64, %63 ]
%69 = call i32 @poll(%struct.pollfd* %6, i64 %68, i32 10)
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %12
71: ; preds = %67, %0
ret i32 0
}