#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 {
  TYPE_1__ data;
  void *events;
};

/* Variables and functions */
scalar_t__ EINTR;
void *EPOLLIN;
int /*<<< orphan*/ EPOLL_CTL_ADD;
int /*<<< orphan*/ EPOLL_CTL_DEL;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ close(int);
int epoll_create(int);
scalar_t__ epoll_ctl(int, int /*<<< orphan*/, int, struct epoll_event *);
int epoll_wait(int, struct epoll_event *, int, int);
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct epoll_event *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
scalar_t__ tcp_main(int);
int tcp_server_socket(int);
int main(int argc, char *argv[]) {
  int listen_fd, client_fd, epoll_fd;
  int i, nready;
  struct epoll_event ev, events[10];
  listen_fd = tcp_server_socket(1234);
  if ((epoll_fd = epoll_create(10)) < 0) {
    perror("epoll_create");
    exit(EXIT_FAILURE);
  }
  memset(&ev, 0, sizeof(struct epoll_event));
  ev.events = EPOLLIN;
  ev.data.fd = listen_fd;
  if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, listen_fd, &ev) < 0) {
    perror("epoll_ctl_add-listen_fd error");
    exit(EXIT_FAILURE);
  }
  for (;;) {
    if ((nready = epoll_wait(epoll_fd, events, 10, -1)) < 0) {
      if (errno == EINTR)
        continue;
      perror("epoll_wait error");
      exit(EXIT_FAILURE);
    }
    for (i = 0; i < nready; i++) {
      if (events[i].data.fd == listen_fd) {
        if ((client_fd = accept(listen_fd, NULL, NULL)) < 0) {
          perror("accept error");
          exit(EXIT_FAILURE);
        }
        ev.events = EPOLLIN;
        ev.data.fd = client_fd;
        if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, client_fd, &ev) < 0) {
          perror("epoll_ctl_add-client_fd error");
          exit(EXIT_FAILURE);
        }
      } else {
        if (tcp_main(events[i].data.fd) == 0) {
          if (epoll_ctl(epoll_fd, EPOLL_CTL_DEL, events[i].data.fd, NULL) < 0) {
            perror("epoll_ctl_del error");
            exit(EXIT_FAILURE);
          }
          close(events[i].data.fd);
        }
      }
    }
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4d2,%edi
call   1030 <tcp_server_socket@plt>
mov    %eax,-0x14(%rbp)
mov    $0xa,%edi
call   10b0 <epoll_create@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    11f6 <main+0x56>
lea    0xe1d(%rip),%rdi
call   1090 <perror@plt>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
mov    0x2dd3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2db4(%rip),%rax
mov    (%rax),%esi
mov    -0x14(%rbp),%edx
lea    -0x38(%rbp),%rcx
call   1070 <epoll_ctl@plt>
cmp    $0x0,%rax
jge    1256 <main+0xb6>
lea    0xdca(%rip),%rdi
call   1090 <perror@plt>
mov    0x2d71(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
jmp    125b <main+0xbb>
mov    -0x1c(%rbp),%edi
lea    -0xe0(%rbp),%rsi
mov    $0xa,%edx
mov    $0xffffffff,%ecx
call   1080 <epoll_wait@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jge    12b9 <main+0x119>
mov    0x2d41(%rip),%rax
mov    (%rax),%rax
mov    0x2d27(%rip),%rcx
cmp    (%rcx),%rax
jne    129f <main+0xff>
jmp    125b <main+0xbb>
lea    0xd85(%rip),%rdi
call   1090 <perror@plt>
mov    0x2d0e(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1414 <main+0x274>
movslq -0x20(%rbp),%rcx
lea    -0xe0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1373 <main+0x1d3>
mov    -0x14(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   10a0 <accept@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    131e <main+0x17e>
lea    0xd31(%rip),%rdi
call   1090 <perror@plt>
mov    0x2ca9(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    0x2cbb(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2c9c(%rip),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%edx
lea    -0x38(%rbp),%rcx
call   1070 <epoll_ctl@plt>
cmp    $0x0,%rax
jge    136e <main+0x1ce>
lea    0xcee(%rip),%rdi
call   1090 <perror@plt>
mov    0x2c59(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
jmp    1401 <main+0x261>
movslq -0x20(%rbp),%rcx
lea    -0xe0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%edi
call   1040 <tcp_main@plt>
cmp    $0x0,%rax
jne    13fc <main+0x25c>
mov    -0x1c(%rbp),%edi
mov    0x2c58(%rip),%rax
mov    (%rax),%esi
movslq -0x20(%rbp),%rcx
lea    -0xe0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1070 <epoll_ctl@plt>
cmp    $0x0,%rax
jge    13e3 <main+0x243>
lea    0xc97(%rip),%rdi
call   1090 <perror@plt>
mov    0x2be4(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
movslq -0x20(%rbp),%rcx
lea    -0xe0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%edi
call   1060 <close@plt>
jmp    1401 <main+0x261>
jmp    1406 <main+0x266>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12c0 <main+0x120>
jmp    125b <main+0xbb>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    $0x4d2,%edi
call   1030 <tcp_server_socket@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   10b0 <epoll_create@plt>
test   %eax,%eax
jns    11d7 <main+0x37>
lea    0xe2e(%rip),%rdi
jmp    1314 <main+0x174>
mov    %eax,%ebp
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
mov    0x2dee(%rip),%r13
mov    0x0(%r13),%rax
mov    %rax,0x8(%rsp)
mov    %ebx,(%rsp)
mov    0x2dd3(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %r14,%rcx
call   1070 <epoll_ctl@plt>
test   %rax,%rax
jns    1224 <main+0x84>
lea    0xdee(%rip),%rdi
jmp    1314 <main+0x174>
mov    %rsp,%r15
jmp    124a <main+0xaa>
nopl   0x0(%rax)
mov    0x2d91(%rip),%rax
mov    (%rax),%rax
mov    0x2d77(%rip),%rcx
cmp    (%rcx),%rax
jne    1327 <main+0x187>
mov    %ebp,%edi
lea    0x10(%rsp),%rsi
mov    $0xa,%edx
mov    $0xffffffff,%ecx
call   1080 <epoll_wait@plt>
test   %eax,%eax
js     1230 <main+0x90>
je     124a <main+0xaa>
mov    %eax,%r14d
shl    $0x4,%r14
xor    %r12d,%r12d
jmp    1293 <main+0xf3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
call   1040 <tcp_main@plt>
test   %rax,%rax
je     12d3 <main+0x133>
add    $0x10,%r12
cmp    %r12,%r14
je     124a <main+0xaa>
mov    0x10(%rsp,%r12,1),%edi
cmp    %ebx,%edi
jne    1280 <main+0xe0>
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10a0 <accept@plt>
test   %eax,%eax
js     12fb <main+0x15b>
mov    0x0(%r13),%rcx
mov    %rcx,0x8(%rsp)
mov    %eax,(%rsp)
mov    0x2d1a(%rip),%rcx
mov    (%rcx),%esi
mov    %ebp,%edi
mov    %eax,%edx
mov    %r15,%rcx
call   1070 <epoll_ctl@plt>
test   %rax,%rax
jns    128a <main+0xea>
jmp    1304 <main+0x164>
mov    0x2d1e(%rip),%rax
mov    (%rax),%esi
mov    0x10(%rsp,%r12,1),%edx
mov    %ebp,%edi
xor    %ecx,%ecx
call   1070 <epoll_ctl@plt>
test   %rax,%rax
js     130d <main+0x16d>
mov    0x10(%rsp,%r12,1),%edi
call   1060 <close@plt>
jmp    128a <main+0xea>
lea    0xd3a(%rip),%rdi
jmp    1314 <main+0x174>
lea    0xd3e(%rip),%rdi
jmp    1314 <main+0x174>
lea    0xd53(%rip),%rdi
call   1090 <perror@plt>
mov    0x2ca0(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
lea    0xcfd(%rip),%rdi
jmp    1314 <main+0x174>

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

LLVM IR (-O2):
%struct.epoll_event = type { %struct.TYPE_2__, i8* }
%struct.TYPE_2__ = type { i32 }
@.str = [13 x i8] c"epoll_create\00"
@EXIT_FAILURE = global i32 0
@EPOLLIN = global i8* null
@EPOLL_CTL_ADD = global i32 0
@.str.1 = [30 x i8] c"epoll_ctl_add-listen_fd error\00"
@errno = global i64 0
@EINTR = global i64 0
@.str.2 = [17 x i8] c"epoll_wait error\00"
@.str.3 = [13 x i8] c"accept error\00"
@.str.4 = [30 x i8] c"epoll_ctl_add-client_fd error\00"
@EPOLL_CTL_DEL = global i32 0
@.str.5 = [20 x i8] c"epoll_ctl_del error\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.epoll_event
%4 = alloca [10 x %struct.epoll_event]
%5 = bitcast %struct.epoll_event* %3 to i8*
%6 = bitcast [10 x %struct.epoll_event]* %4 to i8*
%7 = tail call i32 @tcp_server_socket(i32 1234)
%8 = tail call i32 @epoll_create(i32 10)
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = call i32 @memset(%struct.epoll_event* %3, i32 0, i32 16)
%16 = load i8*, i8** @EPOLLIN
%17 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %3, i64 0, i32 1
store i8* %16, i8** %17
%18 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %3, i64 0, i32 0, i32 0
store i32 %7, i32* %18
%19 = load i32, i32* @EPOLL_CTL_ADD
%20 = call i64 @epoll_ctl(i32 %8, i32 %19, i32 %7, %struct.epoll_event* %3)
%21 = icmp slt i64 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %14
%23 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %4, i64 0, i64 0
br label %28
24: ; preds = %14
%25 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%26 = load i32, i32* @EXIT_FAILURE
%27 = call i32 @exit(i32 %26)
unreachable
28: ; preds = %33, %22
%29 = call i32 @epoll_wait(i32 %8, %struct.epoll_event* %23, i32 10, i32 -1)
%30 = icmp slt i32 %29, 0
br i1 %30, label %36, label %31
31: ; preds = %28
%32 = icmp eq i32 %29, 0
br i1 %32, label %33, label %34
33: ; preds = %80, %31, %36
br label %28
34: ; preds = %31
%35 = zext i32 %29 to i64
br label %44
36: ; preds = %28
%37 = load i64, i64* @errno
%38 = load i64, i64* @EINTR
%39 = icmp eq i64 %37, %38
br i1 %39, label %33, label %40
40: ; preds = %36
%41 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%42 = load i32, i32* @EXIT_FAILURE
%43 = call i32 @exit(i32 %42)
unreachable
44: ; preds = %34, %80
%45 = phi i64 [ 0, %34 ], [ %81, %80 ]
%46 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %4, i64 0, i64 %45, i32 0, i32 0
%47 = load i32, i32* %46
%48 = icmp eq i32 %47, %7
br i1 %48, label %49, label %65
49: ; preds = %44
%50 = call i32 @accept(i32 %7, i32* null, i32* null)
%51 = icmp slt i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%54 = load i32, i32* @EXIT_FAILURE
%55 = call i32 @exit(i32 %54)
unreachable
56: ; preds = %49
%57 = load i8*, i8** @EPOLLIN
store i8* %57, i8** %17
store i32 %50, i32* %18
%58 = load i32, i32* @EPOLL_CTL_ADD
%59 = call i64 @epoll_ctl(i32 %8, i32 %58, i32 %50, %struct.epoll_event* %3)
%60 = icmp slt i64 %59, 0
br i1 %60, label %61, label %80
61: ; preds = %56
%62 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%63 = load i32, i32* @EXIT_FAILURE
%64 = call i32 @exit(i32 %63)
unreachable
65: ; preds = %44
%66 = call i64 @tcp_main(i32 %47)
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %80
68: ; preds = %65
%69 = load i32, i32* @EPOLL_CTL_DEL
%70 = load i32, i32* %46
%71 = call i64 @epoll_ctl(i32 %8, i32 %69, i32 %70, %struct.epoll_event* null)
%72 = icmp slt i64 %71, 0
br i1 %72, label %73, label %77
73: ; preds = %68
%74 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%75 = load i32, i32* @EXIT_FAILURE
%76 = call i32 @exit(i32 %75)
unreachable
77: ; preds = %68
%78 = load i32, i32* %46
%79 = call i32 @close(i32 %78)
br label %80
80: ; preds = %56, %77, %65
%81 = add nuw nsw i64 %45, 1
%82 = icmp eq i64 %81, %35
br i1 %82, label %33, label %44
}