#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int fd;
};
struct epoll_event {
  int events;
  TYPE_1__ data;
};
typedef size_t ssize_t;
typedef int /*<<< orphan*/ got_buff;

/* Variables and functions */
int EPOLLET;
int EPOLLIN;
int /*<<< orphan*/ EPOLL_CTL_ADD;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ SOMAXCONN;
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ close(int);
int create_in_listener_nb(int);
int epoll_create1(int /*<<< orphan*/);
int epoll_ctl(int, int /*<<< orphan*/, int, struct epoll_event *);
int epoll_wait(int, struct epoll_event *, int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ listen(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
size_t recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ setnonblock(int);
int /*<<< orphan*/ stderr;
int main(void) {
  int listener_fd, epoll_fd;
  int clients_fds[1000];
  size_t n_clients;
  struct epoll_event ev;
  struct epoll_event events[10];
  int got_events;
  n_clients = 0;
  listener_fd = create_in_listener_nb(8081);
  if (listener_fd == -1) {
    fputs("Can't create listener", stderr);
    exit(EXIT_FAILURE);
  }
  epoll_fd = epoll_create1(0);
  ev.events = EPOLLIN | EPOLLET;
  ev.data.fd = listener_fd;
  if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, listener_fd, &ev) == -1) {
    fputs("Can't add listener to epoll", stderr);
    goto EXIT;
  };
  listen(listener_fd, SOMAXCONN);
  while (1) {
    int i;
    got_events = epoll_wait(epoll_fd, events, 10, -1);
    for (i = 0; i < got_events; i++) {
      if (events[i].data.fd == listener_fd && events[i].events & EPOLLIN) {
        int accepted_fd;
        accepted_fd = accept(listener_fd, NULL, NULL);
        printf("Connected %d\n", accepted_fd);
        setnonblock(accepted_fd);
        ev.events = EPOLLIN | EPOLLET;
        ev.data.fd = accepted_fd;
        epoll_ctl(epoll_fd, EPOLL_CTL_ADD, accepted_fd, &ev);
      } else if (events[i].events & EPOLLIN) {
        ssize_t got_len;
        char got_buff[1000];
        printf("Got something from %d\n", events[i].data.fd);
        got_len = recv(events[i].data.fd, got_buff,
                       (sizeof(got_buff) / sizeof((got_buff)[0])) - 1, 0);
        got_buff[got_len] = '\0';
        puts(got_buff);
      }
    }
  }
EXIT:
  close(listener_fd);
  close(epoll_fd);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1410,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0xfb8(%rbp)
mov    $0x1f91,%edi
call   1080 <create_in_listener_nb@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1227 <main+0x57>
mov    0x2dc5(%rip),%rax
mov    (%rax),%esi
lea    0xdec(%rip),%rdi
call   1060 <fputs@plt>
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
xor    %edi,%edi
call   10f0 <epoll_create1@plt>
mov    %eax,-0xc(%rbp)
mov    0x2db0(%rip),%rax
mov    (%rax),%eax
mov    0x2d77(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0xfc0(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xfbc(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2d84(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
lea    -0xfc0(%rbp),%rcx
call   1090 <epoll_ctl@plt>
cmp    $0xffffffff,%eax
jne    1290 <main+0xc0>
mov    0x2d53(%rip),%rax
mov    (%rax),%esi
lea    0xd90(%rip),%rdi
call   1060 <fputs@plt>
jmp    142c <main+0x25c>
mov    -0x8(%rbp),%edi
mov    0x2d2e(%rip),%rax
mov    (%rax),%esi
call   10b0 <listen@plt>
mov    -0xc(%rbp),%edi
lea    -0x1010(%rbp),%rsi
mov    $0xa,%edx
mov    $0xffffffff,%ecx
call   10c0 <epoll_wait@plt>
mov    %eax,-0x1014(%rbp)
movl   $0x0,-0x1018(%rbp)
mov    -0x1018(%rbp),%eax
cmp    -0x1014(%rbp),%eax
jge    1427 <main+0x257>
movslq -0x1018(%rbp),%rax
mov    -0x100c(%rbp,%rax,8),%eax
cmp    -0x8(%rbp),%eax
jne    138c <main+0x1bc>
movslq -0x1018(%rbp),%rax
mov    -0x1010(%rbp,%rax,8),%eax
mov    0x2ce0(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     138c <main+0x1bc>
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   10d0 <accept@plt>
mov    %eax,-0x101c(%rbp)
mov    -0x101c(%rbp),%esi
lea    0xcfd(%rip),%rdi
call   1050 <printf@plt>
mov    -0x101c(%rbp),%edi
call   10a0 <setnonblock@plt>
mov    0x2c9c(%rip),%rax
mov    (%rax),%eax
mov    0x2c63(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0xfc0(%rbp)
mov    -0x101c(%rbp),%eax
mov    %eax,-0xfbc(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2c6d(%rip),%rax
mov    (%rax),%esi
mov    -0x101c(%rbp),%edx
lea    -0xfc0(%rbp),%rcx
call   1090 <epoll_ctl@plt>
jmp    140e <main+0x23e>
movslq -0x1018(%rbp),%rax
mov    -0x1010(%rbp,%rax,8),%eax
mov    0x2c47(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1409 <main+0x239>
movslq -0x1018(%rbp),%rax
mov    -0x100c(%rbp,%rax,8),%esi
lea    0xc7f(%rip),%rdi
call   1050 <printf@plt>
movslq -0x1018(%rbp),%rax
mov    -0x100c(%rbp,%rax,8),%edi
lea    -0x1410(%rbp),%rsi
mov    $0x3e7,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %rax,-0x1028(%rbp)
mov    -0x1028(%rbp),%rax
movb   $0x0,-0x1410(%rbp,%rax,1)
lea    -0x1410(%rbp),%rdi
call   1040 <puts@plt>
jmp    140e <main+0x23e>
jmp    1413 <main+0x243>
mov    -0x1018(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1018(%rbp)
jmp    12ca <main+0xfa>
jmp    12a1 <main+0xd1>
mov    -0x8(%rbp),%edi
call   1070 <close@plt>
mov    -0xc(%rbp),%edi
call   1070 <close@plt>
mov    0x2b7d(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x448,%rsp
mov    $0x1f91,%edi
call   1080 <create_in_listener_nb@plt>
cmp    $0xffffffff,%eax
je     1354 <main+0x184>
mov    %eax,%r14d
xor    %edi,%edi
call   10f0 <epoll_create1@plt>
mov    %eax,%edi
mov    0x2de1(%rip),%r12
mov    0x2daa(%rip),%rax
mov    (%rax),%eax
or     (%r12),%eax
mov    %eax,0x8(%rsp)
mov    %r14d,0xc(%rsp)
mov    0x2dbc(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rcx
mov    %edi,0x4(%rsp)
mov    %r14d,%edx
call   1090 <epoll_ctl@plt>
cmp    $0xffffffff,%eax
je     136b <main+0x19b>
mov    0x2d81(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edi
call   10b0 <listen@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%edi
lea    0x10(%rsp),%rsi
mov    $0xa,%edx
mov    $0xffffffff,%ecx
call   10c0 <epoll_wait@plt>
test   %eax,%eax
jle    1260 <main+0x90>
mov    %eax,%r13d
xor    %ebp,%ebp
jmp    1299 <main+0xc9>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbp
cmp    %rbp,%r13
je     1260 <main+0x90>
mov    0x14(%rsp,%rbp,8),%esi
mov    (%r12),%eax
and    0x10(%rsp,%rbp,8),%eax
cmp    %r14d,%esi
jne    1310 <main+0x140>
test   %eax,%eax
je     1290 <main+0xc0>
mov    %r14d,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10d0 <accept@plt>
mov    %eax,%r15d
lea    0xd6e(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %r15d,%edi
call   10a0 <setnonblock@plt>
mov    0x2cde(%rip),%rax
mov    (%rax),%eax
or     (%r12),%eax
mov    %eax,0x8(%rsp)
mov    %r15d,0xc(%rsp)
mov    0x2cf0(%rip),%rax
mov    (%rax),%esi
mov    0x4(%rsp),%edi
mov    %r15d,%edx
lea    0x8(%rsp),%rcx
call   1090 <epoll_ctl@plt>
jmp    1290 <main+0xc0>
cs nopw 0x0(%rax,%rax,1)
nop
test   %eax,%eax
je     1290 <main+0xc0>
mov    %rbp,%rbx
add    %rbp,%rbx
lea    0xd1b(%rip),%rdi
call   1050 <printf@plt>
mov    0x14(%rsp,%rbx,4),%edi
lea    0x60(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x3e7,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
movb   $0x0,0x60(%rsp,%rax,1)
mov    %rbx,%rdi
call   1040 <puts@plt>
jmp    1290 <main+0xc0>
mov    0x2c75(%rip),%rax
mov    (%rax),%esi
lea    0xc9c(%rip),%rdi
call   1060 <fputs@plt>
jmp    1391 <main+0x1c1>
mov    0x2c5e(%rip),%rax
mov    (%rax),%esi
lea    0xc9b(%rip),%rdi
call   1060 <fputs@plt>
mov    %r14d,%edi
call   1070 <close@plt>
mov    0x4(%rsp),%edi
call   1070 <close@plt>
mov    0x2c28(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@.str = [22 x i8] c"Can't create listener\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
@EPOLLIN = global i32 0
@EPOLLET = global i32 0
@EPOLL_CTL_ADD = global i32 0
@.str.1 = [28 x i8] c"Can't add listener to epoll\00"
@SOMAXCONN = global i32 0
@.str.2 = [14 x i8] c"Connected %d\0A\00"
@.str.3 = [23 x i8] c"Got something from %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1000 x i32]
%5 = alloca i64
%6 = alloca %struct.epoll_event
%7 = alloca [10 x %struct.epoll_event]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
%12 = alloca [1000 x i8]
store i32 0, i32* %1
store i64 0, i64* %5
%13 = call i32 @create_in_listener_nb(i32 8081)
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %21
16: ; preds = %0
%17 = load i32, i32* @stderr
%18 = call i32 @fputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* @EXIT_FAILURE
%20 = call i32 @exit(i32 %19)
unreachable
21: ; preds = %0
%22 = call i32 @epoll_create1(i32 0)
store i32 %22, i32* %3
%23 = load i32, i32* @EPOLLIN
%24 = load i32, i32* @EPOLLET
%25 = or i32 %23, %24
%26 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %6, i32 0, i32 0
store i32 %25, i32* %26
%27 = load i32, i32* %2
%28 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %6, i32 0, i32 1
%29 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %28, i32 0, i32 0
store i32 %27, i32* %29
%30 = load i32, i32* %3
%31 = load i32, i32* @EPOLL_CTL_ADD
%32 = load i32, i32* %2
%33 = call i32 @epoll_ctl(i32 %30, i32 %31, i32 %32, %struct.epoll_event* %6)
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %38
35: ; preds = %21
%36 = load i32, i32* @stderr
%37 = call i32 @fputs(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %36)
br label %121
38: ; preds = %21
%39 = load i32, i32* %2
%40 = load i32, i32* @SOMAXCONN
%41 = call i32 @listen(i32 %39, i32 %40)
br label %42
42: ; preds = %38, %120
%43 = load i32, i32* %3
%44 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %7, i64 0, i64 0
%45 = call i32 @epoll_wait(i32 %43, %struct.epoll_event* %44, i32 10, i32 -1)
store i32 %45, i32* %8
store i32 0, i32* %9
br label %46
46: ; preds = %117, %42
%47 = load i32, i32* %9
%48 = load i32, i32* %8
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %120
50: ; preds = %46
%51 = load i32, i32* %9
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %7, i64 0, i64 %52
%54 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %53, i32 0, i32 1
%55 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %54, i32 0, i32 0
%56 = load i32, i32* %55
%57 = load i32, i32* %2
%58 = icmp eq i32 %56, %57
br i1 %58, label %59, label %86
59: ; preds = %50
%60 = load i32, i32* %9
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %7, i64 0, i64 %61
%63 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %62, i32 0, i32 0
%64 = load i32, i32* %63
%65 = load i32, i32* @EPOLLIN
%66 = and i32 %64, %65
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %86
68: ; preds = %59
%69 = load i32, i32* %2
%70 = call i32 @accept(i32 %69, i32* null, i32* null)
store i32 %70, i32* %10
%71 = load i32, i32* %10
%72 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %71)
%73 = load i32, i32* %10
%74 = call i32 @setnonblock(i32 %73)
%75 = load i32, i32* @EPOLLIN
%76 = load i32, i32* @EPOLLET
%77 = or i32 %75, %76
%78 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %6, i32 0, i32 0
store i32 %77, i32* %78
%79 = load i32, i32* %10
%80 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %6, i32 0, i32 1
%81 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %80, i32 0, i32 0
store i32 %79, i32* %81
%82 = load i32, i32* %3
%83 = load i32, i32* @EPOLL_CTL_ADD
%84 = load i32, i32* %10
%85 = call i32 @epoll_ctl(i32 %82, i32 %83, i32 %84, %struct.epoll_event* %6)
br label %116
86: ; preds = %59, %50
%87 = load i32, i32* %9
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %7, i64 0, i64 %88
%90 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %89, i32 0, i32 0
%91 = load i32, i32* %90
%92 = load i32, i32* @EPOLLIN
%93 = and i32 %91, %92
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %115
95: ; preds = %86
%96 = load i32, i32* %9
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %7, i64 0, i64 %97
%99 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %98, i32 0, i32 1
%100 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %99, i32 0, i32 0
%101 = load i32, i32* %100
%102 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %101)
%103 = load i32, i32* %9
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %7, i64 0, i64 %104
%106 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %105, i32 0, i32 1
%107 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %106, i32 0, i32 0
%108 = load i32, i32* %107
%109 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%110 = call i64 @recv(i32 %108, i8* %109, i32 999, i32 0)
store i64 %110, i64* %11
%111 = load i64, i64* %11
%112 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 %111
store i8 0, i8* %112
%113 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%114 = call i32 @puts(i8* %113)
br label %115
115: ; preds = %95, %86
br label %116
116: ; preds = %115, %68
br label %117
117: ; preds = %116
%118 = load i32, i32* %9
%119 = add nsw i32 %118, 1
store i32 %119, i32* %9
br label %46
120: ; preds = %46
br label %42
121: ; preds = %35
%122 = load i32, i32* %2
%123 = call i32 @close(i32 %122)
%124 = load i32, i32* %3
%125 = call i32 @close(i32 %124)
%126 = load i32, i32* @EXIT_FAILURE
%127 = call i32 @exit(i32 %126)
unreachable
}

LLVM IR (-O2):
%struct.epoll_event = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@.str = [22 x i8] c"Can't create listener\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
@EPOLLIN = global i32 0
@EPOLLET = global i32 0
@EPOLL_CTL_ADD = global i32 0
@.str.1 = [28 x i8] c"Can't add listener to epoll\00"
@SOMAXCONN = global i32 0
@.str.2 = [14 x i8] c"Connected %d\0A\00"
@.str.3 = [23 x i8] c"Got something from %d\0A\00"
define i32 @main() {
%1 = alloca %struct.epoll_event
%2 = alloca [10 x %struct.epoll_event]
%3 = alloca [1000 x i8]
%4 = bitcast %struct.epoll_event* %1 to i8*
%5 = bitcast [10 x %struct.epoll_event]* %2 to i8*
%6 = tail call i32 @create_in_listener_nb(i32 8081)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = tail call i32 @fputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = tail call i32 @exit(i32 %11)
unreachable
13: ; preds = %0
%14 = tail call i32 @epoll_create1(i32 0)
%15 = load i32, i32* @EPOLLIN
%16 = load i32, i32* @EPOLLET
%17 = or i32 %16, %15
%18 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %1, i64 0, i32 0
store i32 %17, i32* %18
%19 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %1, i64 0, i32 1, i32 0
store i32 %6, i32* %19
%20 = load i32, i32* @EPOLL_CTL_ADD
%21 = call i32 @epoll_ctl(i32 %14, i32 %20, i32 %6, %struct.epoll_event* %1)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %30
23: ; preds = %13
%24 = load i32, i32* @stderr
%25 = call i32 @fputs(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = call i32 @close(i32 %6)
%27 = call i32 @close(i32 %14)
%28 = load i32, i32* @EXIT_FAILURE
%29 = call i32 @exit(i32 %28)
unreachable
30: ; preds = %13
%31 = load i32, i32* @SOMAXCONN
%32 = call i32 @listen(i32 %6, i32 %31)
%33 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %2, i64 0, i64 0
%34 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
br label %35
35: ; preds = %38, %30
%36 = call i32 @epoll_wait(i32 %14, %struct.epoll_event* %33, i32 10, i32 -1)
%37 = icmp sgt i32 %36, 0
br i1 %37, label %39, label %38
38: ; preds = %68, %35
br label %35
39: ; preds = %35
%40 = zext i32 %36 to i64
br label %41
41: ; preds = %39, %68
%42 = phi i64 [ 0, %39 ], [ %69, %68 ]
%43 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %2, i64 0, i64 %42, i32 1, i32 0
%44 = load i32, i32* %43
%45 = icmp eq i32 %44, %6
%46 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %2, i64 0, i64 %42, i32 0
%47 = load i32, i32* %46
%48 = load i32, i32* @EPOLLIN
%49 = and i32 %48, %47
%50 = icmp eq i32 %49, 0
br i1 %45, label %51, label %61
51: ; preds = %41
br i1 %50, label %68, label %52
52: ; preds = %51
%53 = call i32 @accept(i32 %6, i32* null, i32* null)
%54 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %53)
%55 = call i32 @setnonblock(i32 %53)
%56 = load i32, i32* @EPOLLIN
%57 = load i32, i32* @EPOLLET
%58 = or i32 %57, %56
store i32 %58, i32* %18
store i32 %53, i32* %19
%59 = load i32, i32* @EPOLL_CTL_ADD
%60 = call i32 @epoll_ctl(i32 %14, i32 %59, i32 %53, %struct.epoll_event* %1)
br label %68
61: ; preds = %41
br i1 %50, label %68, label %62
62: ; preds = %61
%63 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %44)
%64 = load i32, i32* %43
%65 = call i64 @recv(i32 %64, i8* %34, i32 999, i32 0)
%66 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %65
store i8 0, i8* %66
%67 = call i32 @puts(i8* %34)
br label %68
68: ; preds = %51, %52, %62, %61
%69 = add nuw nsw i64 %42, 1
%70 = icmp eq i64 %69, %40
br i1 %70, label %38, label %41
}