#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_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct TYPE_4__ {
  int fd;
};
struct epoll_event {
  int events;
  TYPE_2__ data;
};
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ local;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int BUFSIZ;
scalar_t__ EAGAIN;
scalar_t__ ECONNABORTED;
scalar_t__ EINTR;
int EPOLLET;
int EPOLLIN;
int EPOLLOUT;
int /*<<< orphan*/ EPOLL_CTL_ADD;
int /*<<< orphan*/ EPOLL_CTL_MOD;
scalar_t__ EPROTO;
int EXIT_FAILURE;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(struct sockaddr_in *, int);
int /*<<< orphan*/ close(int);
int epoll_create(int);
int 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);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ perror(char *);
int read(int, char *, int);
int /*<<< orphan*/ setnonblocking(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int strlen(char *);
int write(int, char *, int);
int main() {
  struct epoll_event ev, events[10];
  int addrlen, listenfd, conn_sock, nfds, epfd, fd, i, nread, n;
  struct sockaddr_in local, remote;
  char buf[BUFSIZ];
  if ((listenfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    perror("sockfd\n");
    exit(1);
  }
  setnonblocking(listenfd);
  bzero(&local, sizeof(local));
  local.sin_family = AF_INET;
  local.sin_addr.s_addr = htonl(INADDR_ANY);
  local.sin_port = htons(8084);
  if (bind(listenfd, (struct sockaddr *)&local, sizeof(local)) < 0) {
    perror("bind\n");
    exit(1);
  }
  listen(listenfd, 20);
  epfd = epoll_create(10);
  if (epfd == -1) {
    perror("epoll_create");
    exit(EXIT_FAILURE);
  }
  ev.events = EPOLLIN;
  ev.data.fd = listenfd;
  if (epoll_ctl(epfd, EPOLL_CTL_ADD, listenfd, &ev) == -1) {
    perror("epoll_ctl: listen_sock");
    exit(EXIT_FAILURE);
  }
  for (;;) {
    nfds = epoll_wait(epfd, events, 10, -1);
    if (nfds == -1) {
      perror("epoll_pwait");
      exit(EXIT_FAILURE);
    }
    for (i = 0; i < nfds; ++i) {
      fd = events[i].data.fd;
      if (fd == listenfd) {
        while ((conn_sock = accept(listenfd, (struct sockaddr *)&remote,
                                   (socklen_t *)&addrlen)) > 0) {
          setnonblocking(conn_sock);
          ev.events = EPOLLIN | EPOLLET;
          ev.data.fd = conn_sock;
          if (epoll_ctl(epfd, EPOLL_CTL_ADD, conn_sock, &ev) == -1) {
            perror("epoll_ctl: add");
            exit(EXIT_FAILURE);
          }
        }
        if (conn_sock == -1) {
          if (errno != EAGAIN && errno != ECONNABORTED && errno != EPROTO &&
              errno != EINTR)
            perror("accept");
        }
        continue;
      }
      if (events[i].events & EPOLLIN) {
        n = 0;
        while ((nread = read(fd, buf + n, BUFSIZ - 1)) > 0) {
          n += nread;
        }
        if (nread == -1 && errno != EAGAIN) {
          perror("read error");
        }
        ev.data.fd = fd;
        ev.events = events[i].events | EPOLLOUT;
        if (epoll_ctl(epfd, EPOLL_CTL_MOD, fd, &ev) == -1) {
          perror("epoll_ctl: mod");
        }
      }
      if (events[i].events & EPOLLOUT) {
        sprintf(buf, "HTTP/1.1 200 OK\r\nContent-Length: %d\r\n\r\nHello World",
                11);
        int nwrite, data_size = strlen(buf);
        n = data_size;
        while (n > 0) {
          nwrite = write(fd, buf + data_size - n, n);
          if (nwrite < n) {
            if (nwrite == -1 && errno != EAGAIN) {
              perror("write error");
            }
            break;
          }
          n -= nwrite;
        }
        close(fd);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2d67(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0xa8(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xc0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xb0(%rbp)
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
mov    0x2d39(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1140 <socket@plt>
mov    %eax,-0x68(%rbp)
cmp    $0x0,%eax
jge    12a2 <main+0x82>
lea    0xd6d(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
mov    -0x68(%rbp),%edi
call   10d0 <setnonblocking@plt>
lea    -0x90(%rbp),%rdi
mov    $0xc,%esi
call   10f0 <bzero@plt>
mov    0x2d26(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x88(%rbp)
mov    0x2cff(%rip),%rax
mov    (%rax),%edi
call   1060 <htonl@plt>
mov    %eax,-0x8c(%rbp)
mov    $0x1f94,%edi
call   1050 <htons@plt>
mov    %eax,-0x90(%rbp)
mov    -0x68(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0xc,%edx
call   10c0 <bind@plt>
cmp    $0x0,%rax
jge    1322 <main+0x102>
lea    0xcf5(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
mov    -0x68(%rbp),%edi
mov    $0x14,%esi
call   10a0 <listen@plt>
mov    $0xa,%edi
call   1110 <epoll_create@plt>
mov    %eax,-0x74(%rbp)
cmpl   $0xffffffff,-0x74(%rbp)
jne    1360 <main+0x140>
lea    0xcc1(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2c37(%rip),%rax
mov    (%rax),%edi
call   1130 <exit@plt>
mov    0x2c79(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x74(%rbp),%edi
mov    0x2c5c(%rip),%rax
mov    (%rax),%esi
mov    -0x68(%rbp),%edx
lea    -0x10(%rbp),%rcx
call   1080 <epoll_ctl@plt>
cmp    $0xffffffff,%eax
jne    13ad <main+0x18d>
lea    0xc81(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2bea(%rip),%rax
mov    (%rax),%edi
call   1130 <exit@plt>
jmp    13b2 <main+0x192>
mov    -0x74(%rbp),%edi
lea    -0x60(%rbp),%rsi
mov    $0xa,%edx
mov    $0xffffffff,%ecx
call   10b0 <epoll_wait@plt>
mov    %eax,-0x70(%rbp)
cmpl   $0xffffffff,-0x70(%rbp)
jne    13ef <main+0x1cf>
lea    0xc56(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2ba8(%rip),%rax
mov    (%rax),%edi
call   1130 <exit@plt>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x70(%rbp),%eax
jge    171c <main+0x4fc>
movslq -0x7c(%rbp),%rax
mov    -0x5c(%rbp,%rax,8),%eax
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%eax
cmp    -0x68(%rbp),%eax
jne    1528 <main+0x308>
jmp    141e <main+0x1fe>
mov    -0x68(%rbp),%edi
lea    -0xa0(%rbp),%rsi
lea    -0x64(%rbp),%rdx
call   1100 <accept@plt>
mov    %eax,-0x6c(%rbp)
cmp    $0x0,%eax
jle    14a0 <main+0x280>
mov    -0x6c(%rbp),%edi
call   10d0 <setnonblocking@plt>
mov    0x2b94(%rip),%rax
mov    (%rax),%eax
mov    0x2b2b(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x74(%rbp),%edi
mov    0x2b6e(%rip),%rax
mov    (%rax),%esi
mov    -0x6c(%rbp),%edx
lea    -0x10(%rbp),%rcx
call   1080 <epoll_ctl@plt>
cmp    $0xffffffff,%eax
jne    149b <main+0x27b>
lea    0xbb6(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2afc(%rip),%rax
mov    (%rax),%edi
call   1130 <exit@plt>
jmp    141e <main+0x1fe>
cmpl   $0xffffffff,-0x6c(%rbp)
jne    1523 <main+0x303>
mov    0x2ae7(%rip),%rax
mov    (%rax),%rax
mov    0x2aad(%rip),%rcx
cmp    (%rcx),%rax
je     151e <main+0x2fe>
mov    0x2acd(%rip),%rax
mov    (%rax),%rax
mov    0x2aa3(%rip),%rcx
cmp    (%rcx),%rax
je     151e <main+0x2fe>
mov    0x2ab3(%rip),%rax
mov    (%rax),%rax
mov    0x2ac9(%rip),%rcx
cmp    (%rcx),%rax
je     151e <main+0x2fe>
mov    0x2a99(%rip),%rax
mov    (%rax),%rax
mov    0x2a7f(%rip),%rcx
cmp    (%rcx),%rax
je     151e <main+0x2fe>
lea    0xb34(%rip),%rdi
call   10e0 <perror@plt>
jmp    1523 <main+0x303>
jmp    170e <main+0x4ee>
movslq -0x7c(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%eax
mov    0x2aa9(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     160d <main+0x3ed>
movl   $0x0,-0x84(%rbp)
mov    -0xc0(%rbp),%rsi
mov    -0x78(%rbp),%edi
movslq -0x84(%rbp),%rax
add    %rax,%rsi
mov    0x2a39(%rip),%rax
mov    (%rax),%edx
sub    $0x1,%edx
call   1090 <read@plt>
mov    %eax,-0x80(%rbp)
cmp    $0x0,%eax
jle    1591 <main+0x371>
mov    -0x80(%rbp),%eax
add    -0x84(%rbp),%eax
mov    %eax,-0x84(%rbp)
jmp    154c <main+0x32c>
cmpl   $0xffffffff,-0x80(%rbp)
jne    15c1 <main+0x3a1>
mov    0x29f6(%rip),%rax
mov    (%rax),%rax
mov    0x29bc(%rip),%rcx
cmp    (%rcx),%rax
je     15c1 <main+0x3a1>
lea    0xa98(%rip),%rdi
call   10e0 <perror@plt>
mov    -0x78(%rbp),%eax
mov    %eax,-0xc(%rbp)
movslq -0x7c(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%eax
mov    0x29d2(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    -0x74(%rbp),%edi
mov    0x29db(%rip),%rax
mov    (%rax),%esi
mov    -0x78(%rbp),%edx
lea    -0x10(%rbp),%rcx
call   1080 <epoll_ctl@plt>
cmp    $0xffffffff,%eax
jne    1608 <main+0x3e8>
lea    0xa5c(%rip),%rdi
call   10e0 <perror@plt>
jmp    160d <main+0x3ed>
movslq -0x7c(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%eax
mov    0x298c(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1709 <main+0x4e9>
mov    -0xc0(%rbp),%rdi
lea    0xa39(%rip),%rsi
mov    $0xb,%edx
call   1120 <sprintf@plt>
mov    -0xc0(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xb8(%rbp)
mov    -0xb8(%rbp),%eax
mov    %eax,-0x84(%rbp)
cmpl   $0x0,-0x84(%rbp)
jle    1701 <main+0x4e1>
mov    -0xc0(%rbp),%rsi
mov    -0x78(%rbp),%edi
movslq -0xb8(%rbp),%rax
add    %rax,%rsi
movslq -0x84(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rsi
mov    -0x84(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
cmp    -0x84(%rbp),%eax
jge    16e8 <main+0x4c8>
cmpl   $0xffffffff,-0xb4(%rbp)
jne    16e3 <main+0x4c3>
mov    0x28d4(%rip),%rax
mov    (%rax),%rax
mov    0x289a(%rip),%rcx
cmp    (%rcx),%rax
je     16e3 <main+0x4c3>
lea    0x9c3(%rip),%rdi
call   10e0 <perror@plt>
jmp    1701 <main+0x4e1>
mov    -0xb4(%rbp),%ecx
mov    -0x84(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x84(%rbp)
jmp    165d <main+0x43d>
mov    -0x78(%rbp),%edi
call   1070 <close@plt>
jmp    170e <main+0x4ee>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    13f6 <main+0x1d6>
jmp    13b2 <main+0x192>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    0x2d65(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x2d93(%rip),%r13
mov    0x0(%r13),%edi
mov    0x2d50(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1140 <socket@plt>
test   %eax,%eax
jns    1276 <main+0x56>
lea    0xd8c(%rip),%rdi
jmp    12d2 <main+0xb2>
mov    %eax,%r15d
mov    %eax,%edi
call   10d0 <setnonblocking@plt>
lea    -0x50(%rbp),%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   10f0 <bzero@plt>
mov    0x0(%r13),%eax
mov    %eax,-0x48(%rbp)
mov    0x2d31(%rip),%rax
mov    (%rax),%edi
call   1060 <htonl@plt>
mov    %eax,-0x4c(%rbp)
mov    $0x1f94,%edi
call   1050 <htons@plt>
mov    %eax,-0x50(%rbp)
mov    %r15d,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   10c0 <bind@plt>
test   %rax,%rax
jns    12e1 <main+0xc1>
lea    0xd36(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1130 <exit@plt>
mov    %rbx,-0x38(%rbp)
mov    %r15d,%edi
mov    $0x14,%esi
call   10a0 <listen@plt>
mov    $0xa,%edi
call   1110 <epoll_create@plt>
cmp    $0xffffffff,%eax
jne    130d <main+0xed>
lea    0xd06(%rip),%rdi
jmp    162c <main+0x40c>
mov    %eax,%r13d
mov    0x2cc9(%rip),%r12
mov    (%r12),%eax
mov    %eax,-0x30(%rbp)
mov    %r15d,-0x2c(%rbp)
mov    0x2caf(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rcx
mov    %r13d,%edi
mov    %r15d,%edx
call   1080 <epoll_ctl@plt>
cmp    $0xffffffff,%eax
jne    134b <main+0x12b>
lea    0xcd5(%rip),%rdi
jmp    162c <main+0x40c>
lea    -0xc0(%rbp),%rsi
mov    %r13d,%edi
mov    $0xa,%edx
mov    $0xffffffff,%ecx
call   10b0 <epoll_wait@plt>
cmp    $0xffffffff,%eax
jne    1375 <main+0x155>
lea    0xcc2(%rip),%rdi
jmp    162c <main+0x40c>
mov    %r15d,-0x44(%rbp)
jmp    139e <main+0x17e>
nopl   0x0(%rax,%rax,1)
mov    %r13d,%edi
lea    -0xc0(%rbp),%rsi
mov    $0xa,%edx
mov    $0xffffffff,%ecx
call   10b0 <epoll_wait@plt>
cmp    $0xffffffff,%eax
je     1369 <main+0x149>
test   %eax,%eax
jle    1380 <main+0x160>
mov    %eax,%eax
mov    %rax,-0x58(%rbp)
xor    %ebx,%ebx
jmp    13dd <main+0x1bd>
cmp    $0xffffffff,%eax
je     15d8 <main+0x3b8>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14d,%edi
call   1070 <close@plt>
mov    0x2c11(%rip),%r12
mov    -0x40(%rbp),%rbx
add    $0x1,%rbx
cmp    -0x58(%rbp),%rbx
je     1380 <main+0x160>
mov    -0xbc(%rbp,%rbx,8),%r14d
ff
cmp    %r15d,%r14d
mov    %rbx,-0x40(%rbp)
jne    1450 <main+0x230>
mov    0x2be3(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15d,%edi
lea    -0x68(%rbp),%rsi
lea    -0x5c(%rbp),%rdx
call   1100 <accept@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    1570 <main+0x350>
mov    %ebx,%edi
call   10d0 <setnonblocking@plt>
mov    0x2b58(%rip),%rax
mov    (%rax),%eax
or     (%r12),%eax
mov    %eax,-0x30(%rbp)
mov    %ebx,-0x2c(%rbp)
mov    (%r14),%esi
mov    %r13d,%edi
mov    %ebx,%edx
lea    -0x30(%rbp),%rcx
call   1080 <epoll_ctl@plt>
cmp    $0xffffffff,%eax
jne    1400 <main+0x1e0>
jmp    1625 <main+0x405>
nop
mov    (%r12),%eax
test   %eax,-0xc0(%rbp,%rbx,8)
je     14f1 <main+0x2d1>
xor    %ebx,%ebx
mov    -0x38(%rbp),%r12
mov    0x2b32(%rip),%r15
xchg   %ax,%ax
movslq %ebx,%rbx
lea    (%r12,%rbx,1),%rsi
mov    (%r15),%edx
add    $0xffffffff,%edx
mov    %r14d,%edi
call   1090 <read@plt>
add    %eax,%ebx
test   %eax,%eax
jg     1470 <main+0x250>
cmp    $0xffffffff,%eax
jne    14aa <main+0x28a>
mov    0x2b01(%rip),%rax
mov    (%rax),%rax
mov    0x2ac7(%rip),%rcx
cmp    (%rcx),%rax
jne    1614 <main+0x3f4>
mov    %r14d,-0x2c(%rbp)
mov    0x2af3(%rip),%rax
mov    (%rax),%eax
mov    -0x40(%rbp),%rbx
or     -0xc0(%rbp,%rbx,8),%eax
mov    %eax,-0x30(%rbp)
mov    0x2af4(%rip),%rax
mov    (%rax),%esi
mov    %r13d,%edi
mov    %r14d,%edx
lea    -0x30(%rbp),%rcx
call   1080 <epoll_ctl@plt>
cmp    $0xffffffff,%eax
mov    -0x44(%rbp),%r15d
mov    0x2af5(%rip),%r12
je     1603 <main+0x3e3>
mov    0x2ab0(%rip),%rax
mov    (%rax),%eax
test   %eax,-0xc0(%rbp,%rbx,8)
je     13d3 <main+0x1b3>
mov    -0x38(%rbp),%rbx
mov    %rbx,%rdi
lea    0xb59(%rip),%rsi
mov    $0xb,%edx
call   1120 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    13c0 <main+0x1a0>
mov    %eax,%r12d
mov    %eax,%ebx
add    -0x38(%rbp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r12d,%eax
mov    %rbx,%rsi
sub    %rax,%rsi
mov    %r14d,%edi
mov    %r12d,%edx
call   1030 <write@plt>
sub    %eax,%r12d
jg     13ac <main+0x18c>
test   %r12d,%r12d
jg     1540 <main+0x320>
jmp    13c0 <main+0x1a0>
nopw   0x0(%rax,%rax,1)
cmp    $0xffffffff,%ebx
mov    -0x40(%rbp),%rbx
jne    13d3 <main+0x1b3>
mov    0x2a14(%rip),%rax
mov    (%rax),%rax
mov    0x29da(%rip),%rcx
cmp    (%rcx),%rax
je     13d3 <main+0x1b3>
mov    0x29da(%rip),%rcx
cmp    (%rcx),%rax
je     13d3 <main+0x1b3>
mov    0x2a0a(%rip),%rcx
cmp    (%rcx),%rax
je     13d3 <main+0x1b3>
mov    0x29ca(%rip),%rcx
cmp    (%rcx),%rax
je     13d3 <main+0x1b3>
lea    0xa7f(%rip),%rdi
call   10e0 <perror@plt>
jmp    13d3 <main+0x1b3>
mov    0x29b9(%rip),%rax
mov    (%rax),%rax
mov    0x297f(%rip),%rcx
cmp    (%rcx),%rax
je     13c0 <main+0x1a0>
lea    0xaa8(%rip),%rdi
call   10e0 <perror@plt>
jmp    13c0 <main+0x1a0>
lea    0xa55(%rip),%rdi
call   10e0 <perror@plt>
jmp    14f1 <main+0x2d1>
lea    0xa39(%rip),%rdi
call   10e0 <perror@plt>
jmp    14aa <main+0x28a>
lea    0xa12(%rip),%rdi
call   10e0 <perror@plt>
mov    0x2958(%rip),%rax
mov    (%rax),%edi
call   1130 <exit@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32, %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
%struct.sockaddr_in = type { i32, %struct.TYPE_3__, i32 }
%struct.TYPE_3__ = type { i32 }
%struct.sockaddr = type { i32 }
@BUFSIZ = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [8 x i8] c"sockfd\0A\00"
@INADDR_ANY = global i32 0
@.str.1 = [6 x i8] c"bind\0A\00"
@.str.2 = [13 x i8] c"epoll_create\00"
@EXIT_FAILURE = global i32 0
@EPOLLIN = global i32 0
@EPOLL_CTL_ADD = global i32 0
@.str.3 = [23 x i8] c"epoll_ctl: listen_sock\00"
@.str.4 = [12 x i8] c"epoll_pwait\00"
@EPOLLET = global i32 0
@.str.5 = [15 x i8] c"epoll_ctl: add\00"
@errno = global i64 0
@EAGAIN = global i64 0
@ECONNABORTED = global i64 0
@EPROTO = global i64 0
@EINTR = global i64 0
@.str.6 = [7 x i8] c"accept\00"
@.str.7 = [11 x i8] c"read error\00"
@EPOLLOUT = global i32 0
@EPOLL_CTL_MOD = global i32 0
@.str.8 = [15 x i8] c"epoll_ctl: mod\00"
@.str.9 = [51 x i8] c"HTTP/1.1 200 OK\0D\0AContent-Length: %d\0D\0A\0D\0AHello World\00"
@.str.10 = [12 x i8] c"write error\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.epoll_event
%3 = alloca [10 x %struct.epoll_event]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca %struct.sockaddr_in
%14 = alloca %struct.sockaddr_in
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %1
%19 = load i32, i32* @BUFSIZ
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %15
%22 = alloca i8, i64 %20
store i64 %20, i64* %16
%23 = load i32, i32* @AF_INET
%24 = load i32, i32* @SOCK_STREAM
%25 = call i32 @socket(i32 %23, i32 %24, i32 0)
store i32 %25, i32* %5
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %0
%28 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %0
%31 = load i32, i32* %5
%32 = call i32 @setnonblocking(i32 %31)
%33 = call i32 @bzero(%struct.sockaddr_in* %13, i32 12)
%34 = load i32, i32* @AF_INET
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 2
store i32 %34, i32* %35
%36 = load i32, i32* @INADDR_ANY
%37 = call i32 @htonl(i32 %36)
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 1
%39 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %38, i32 0, i32 0
store i32 %37, i32* %39
%40 = call i32 @htons(i32 8084)
%41 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 0
store i32 %40, i32* %41
%42 = load i32, i32* %5
%43 = bitcast %struct.sockaddr_in* %13 to %struct.sockaddr*
%44 = call i64 @bind(i32 %42, %struct.sockaddr* %43, i32 12)
%45 = icmp slt i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %30
%47 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %30
%50 = load i32, i32* %5
%51 = call i32 @listen(i32 %50, i32 20)
%52 = call i32 @epoll_create(i32 10)
store i32 %52, i32* %8
%53 = load i32, i32* %8
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %59
55: ; preds = %49
%56 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%57 = load i32, i32* @EXIT_FAILURE
%58 = call i32 @exit(i32 %57)
unreachable
59: ; preds = %49
%60 = load i32, i32* @EPOLLIN
%61 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %2, i32 0, i32 0
store i32 %60, i32* %61
%62 = load i32, i32* %5
%63 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %2, i32 0, i32 1
%64 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %63, i32 0, i32 0
store i32 %62, i32* %64
%65 = load i32, i32* %8
%66 = load i32, i32* @EPOLL_CTL_ADD
%67 = load i32, i32* %5
%68 = call i32 @epoll_ctl(i32 %65, i32 %66, i32 %67, %struct.epoll_event* %2)
%69 = icmp eq i32 %68, -1
br i1 %69, label %70, label %74
70: ; preds = %59
%71 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%72 = load i32, i32* @EXIT_FAILURE
%73 = call i32 @exit(i32 %72)
unreachable
74: ; preds = %59
br label %75
75: ; preds = %252, %74
%76 = load i32, i32* %8
%77 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %3, i64 0, i64 0
%78 = call i32 @epoll_wait(i32 %76, %struct.epoll_event* %77, i32 10, i32 -1)
store i32 %78, i32* %7
%79 = load i32, i32* %7
%80 = icmp eq i32 %79, -1
br i1 %80, label %81, label %85
81: ; preds = %75
%82 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%83 = load i32, i32* @EXIT_FAILURE
%84 = call i32 @exit(i32 %83)
unreachable
85: ; preds = %75
store i32 0, i32* %10
br label %86
86: ; preds = %249, %85
%87 = load i32, i32* %10
%88 = load i32, i32* %7
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %252
90: ; preds = %86
%91 = load i32, i32* %10
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %3, i64 0, i64 %92
%94 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %93, i32 0, i32 1
%95 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %94, i32 0, i32 0
%96 = load i32, i32* %95
store i32 %96, i32* %9
%97 = load i32, i32* %9
%98 = load i32, i32* %5
%99 = icmp eq i32 %97, %98
br i1 %99, label %100, label %149
100: ; preds = %90
br label %101
101: ; preds = %125, %100
%102 = load i32, i32* %5
%103 = bitcast %struct.sockaddr_in* %14 to %struct.sockaddr*
%104 = call i32 @accept(i32 %102, %struct.sockaddr* %103, i32* %4)
store i32 %104, i32* %6
%105 = icmp sgt i32 %104, 0
br i1 %105, label %106, label %126
106: ; preds = %101
%107 = load i32, i32* %6
%108 = call i32 @setnonblocking(i32 %107)
%109 = load i32, i32* @EPOLLIN
%110 = load i32, i32* @EPOLLET
%111 = or i32 %109, %110
%112 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %2, i32 0, i32 0
store i32 %111, i32* %112
%113 = load i32, i32* %6
%114 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %2, i32 0, i32 1
%115 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %114, i32 0, i32 0
store i32 %113, i32* %115
%116 = load i32, i32* %8
%117 = load i32, i32* @EPOLL_CTL_ADD
%118 = load i32, i32* %6
%119 = call i32 @epoll_ctl(i32 %116, i32 %117, i32 %118, %struct.epoll_event* %2)
%120 = icmp eq i32 %119, -1
br i1 %120, label %121, label %125
121: ; preds = %106
%122 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%123 = load i32, i32* @EXIT_FAILURE
%124 = call i32 @exit(i32 %123)
unreachable
125: ; preds = %106
br label %101
126: ; preds = %101
%127 = load i32, i32* %6
%128 = icmp eq i32 %127, -1
br i1 %128, label %129, label %148
129: ; preds = %126
%130 = load i64, i64* @errno
%131 = load i64, i64* @EAGAIN
%132 = icmp ne i64 %130, %131
br i1 %132, label %133, label %147
133: ; preds = %129
%134 = load i64, i64* @errno
%135 = load i64, i64* @ECONNABORTED
%136 = icmp ne i64 %134, %135
br i1 %136, label %137, label %147
137: ; preds = %133
%138 = load i64, i64* @errno
%139 = load i64, i64* @EPROTO
%140 = icmp ne i64 %138, %139
br i1 %140, label %141, label %147
141: ; preds = %137
%142 = load i64, i64* @errno
%143 = load i64, i64* @EINTR
%144 = icmp ne i64 %142, %143
br i1 %144, label %145, label %147
145: ; preds = %141
%146 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %147
147: ; preds = %145, %141, %137, %133, %129
br label %148
148: ; preds = %147, %126
br label %249
149: ; preds = %90
%150 = load i32, i32* %10
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %3, i64 0, i64 %151
%153 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %152, i32 0, i32 0
%154 = load i32, i32* %153
%155 = load i32, i32* @EPOLLIN
%156 = and i32 %154, %155
%157 = icmp ne i32 %156, 0
br i1 %157, label %158, label %201
158: ; preds = %149
store i32 0, i32* %12
br label %159
159: ; preds = %168, %158
%160 = load i32, i32* %9
%161 = load i32, i32* %12
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds i8, i8* %22, i64 %162
%164 = load i32, i32* @BUFSIZ
%165 = sub nsw i32 %164, 1
%166 = call i32 @read(i32 %160, i8* %163, i32 %165)
store i32 %166, i32* %11
%167 = icmp sgt i32 %166, 0
br i1 %167, label %168, label %172
168: ; preds = %159
%169 = load i32, i32* %11
%170 = load i32, i32* %12
%171 = add nsw i32 %170, %169
store i32 %171, i32* %12
br label %159
172: ; preds = %159
%173 = load i32, i32* %11
%174 = icmp eq i32 %173, -1
br i1 %174, label %175, label %181
175: ; preds = %172
%176 = load i64, i64* @errno
%177 = load i64, i64* @EAGAIN
%178 = icmp ne i64 %176, %177
br i1 %178, label %179, label %181
179: ; preds = %175
%180 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %181
181: ; preds = %179, %175, %172
%182 = load i32, i32* %9
%183 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %2, i32 0, i32 1
%184 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %183, i32 0, i32 0
store i32 %182, i32* %184
%185 = load i32, i32* %10
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %3, i64 0, i64 %186
%188 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %187, i32 0, i32 0
%189 = load i32, i32* %188
%190 = load i32, i32* @EPOLLOUT
%191 = or i32 %189, %190
%192 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %2, i32 0, i32 0
store i32 %191, i32* %192
%193 = load i32, i32* %8
%194 = load i32, i32* @EPOLL_CTL_MOD
%195 = load i32, i32* %9
%196 = call i32 @epoll_ctl(i32 %193, i32 %194, i32 %195, %struct.epoll_event* %2)
%197 = icmp eq i32 %196, -1
br i1 %197, label %198, label %200
198: ; preds = %181
%199 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %200
200: ; preds = %198, %181
br label %201
201: ; preds = %200, %149
%202 = load i32, i32* %10
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %3, i64 0, i64 %203
%205 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %204, i32 0, i32 0
%206 = load i32, i32* %205
%207 = load i32, i32* @EPOLLOUT
%208 = and i32 %206, %207
%209 = icmp ne i32 %208, 0
br i1 %209, label %210, label %248
210: ; preds = %201
%211 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i32 11)
%212 = call i32 @strlen(i8* %22)
store i32 %212, i32* %18
%213 = load i32, i32* %18
store i32 %213, i32* %12
br label %214
214: ; preds = %241, %210
%215 = load i32, i32* %12
%216 = icmp sgt i32 %215, 0
br i1 %216, label %217, label %245
217: ; preds = %214
%218 = load i32, i32* %9
%219 = load i32, i32* %18
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds i8, i8* %22, i64 %220
%222 = load i32, i32* %12
%223 = sext i32 %222 to i64
%224 = sub i64 0, %223
%225 = getelementptr inbounds i8, i8* %221, i64 %224
%226 = load i32, i32* %12
%227 = call i32 @write(i32 %218, i8* %225, i32 %226)
store i32 %227, i32* %17
%228 = load i32, i32* %17
%229 = load i32, i32* %12
%230 = icmp slt i32 %228, %229
br i1 %230, label %231, label %241
231: ; preds = %217
%232 = load i32, i32* %17
%233 = icmp eq i32 %232, -1
br i1 %233, label %234, label %240
234: ; preds = %231
%235 = load i64, i64* @errno
%236 = load i64, i64* @EAGAIN
%237 = icmp ne i64 %235, %236
br i1 %237, label %238, label %240
238: ; preds = %234
%239 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
br label %240
240: ; preds = %238, %234, %231
br label %245
241: ; preds = %217
%242 = load i32, i32* %17
%243 = load i32, i32* %12
%244 = sub nsw i32 %243, %242
store i32 %244, i32* %12
br label %214
245: ; preds = %240, %214
%246 = load i32, i32* %9
%247 = call i32 @close(i32 %246)
br label %248
248: ; preds = %245, %201
br label %249
249: ; preds = %248, %148
%250 = load i32, i32* %10
%251 = add nsw i32 %250, 1
store i32 %251, i32* %10
br label %86
252: ; preds = %86
br label %75
}

LLVM IR (-O2):
%struct.epoll_event = type { i32, %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
%struct.sockaddr_in = type { i32, %struct.TYPE_3__, i32 }
%struct.TYPE_3__ = type { i32 }
%struct.sockaddr = type { i32 }
@BUFSIZ = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [8 x i8] c"sockfd\0A\00"
@INADDR_ANY = global i32 0
@.str.1 = [6 x i8] c"bind\0A\00"
@.str.2 = [13 x i8] c"epoll_create\00"
@EXIT_FAILURE = global i32 0
@EPOLLIN = global i32 0
@EPOLL_CTL_ADD = global i32 0
@.str.3 = [23 x i8] c"epoll_ctl: listen_sock\00"
@.str.4 = [12 x i8] c"epoll_pwait\00"
@EPOLLET = global i32 0
@.str.5 = [15 x i8] c"epoll_ctl: add\00"
@errno = global i64 0
@EAGAIN = global i64 0
@ECONNABORTED = global i64 0
@EPROTO = global i64 0
@EINTR = global i64 0
@.str.6 = [7 x i8] c"accept\00"
@.str.7 = [11 x i8] c"read error\00"
@EPOLLOUT = global i32 0
@EPOLL_CTL_MOD = global i32 0
@.str.8 = [15 x i8] c"epoll_ctl: mod\00"
@.str.9 = [51 x i8] c"HTTP/1.1 200 OK\0D\0AContent-Length: %d\0D\0A\0D\0AHello World\00"
@.str.10 = [12 x i8] c"write error\00"
define i32 @main() {
%1 = alloca %struct.epoll_event
%2 = alloca [10 x %struct.epoll_event]
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca %struct.sockaddr_in
%6 = bitcast %struct.epoll_event* %1 to i8*
%7 = bitcast [10 x %struct.epoll_event]* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast %struct.sockaddr_in* %4 to i8*
%10 = bitcast %struct.sockaddr_in* %5 to i8*
%11 = load i32, i32* @BUFSIZ
%12 = zext i32 %11 to i64
%13 = alloca i8, i64 %12
%14 = load i32, i32* @AF_INET
%15 = load i32, i32* @SOCK_STREAM
%16 = tail call i32 @socket(i32 %14, i32 %15, i32 0)
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %0
%19 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %0
%22 = tail call i32 @setnonblocking(i32 %16)
%23 = call i32 @bzero(%struct.sockaddr_in* %4, i32 12)
%24 = load i32, i32* @AF_INET
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i32 %24, i32* %25
%26 = load i32, i32* @INADDR_ANY
%27 = tail call i32 @htonl(i32 %26)
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1, i32 0
store i32 %27, i32* %28
%29 = tail call i32 @htons(i32 8084)
%30 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
store i32 %29, i32* %30
%31 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%32 = call i64 @bind(i32 %16, %struct.sockaddr* %31, i32 12)
%33 = icmp slt i64 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %21
%35 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %21
%38 = call i32 @listen(i32 %16, i32 20)
%39 = call i32 @epoll_create(i32 10)
%40 = icmp eq i32 %39, -1
br i1 %40, label %41, label %45
41: ; preds = %37
%42 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%43 = load i32, i32* @EXIT_FAILURE
%44 = call i32 @exit(i32 %43)
unreachable
45: ; preds = %37
%46 = load i32, i32* @EPOLLIN
%47 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %1, i64 0, i32 0
store i32 %46, i32* %47
%48 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %1, i64 0, i32 1, i32 0
store i32 %16, i32* %48
%49 = load i32, i32* @EPOLL_CTL_ADD
%50 = call i32 @epoll_ctl(i32 %39, i32 %49, i32 %16, %struct.epoll_event* %1)
%51 = icmp eq i32 %50, -1
br i1 %51, label %58, label %52
52: ; preds = %45
%53 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %2, i64 0, i64 0
%54 = call i32 @epoll_wait(i32 %39, %struct.epoll_event* %53, i32 10, i32 -1)
%55 = icmp eq i32 %54, -1
br i1 %55, label %70, label %56
56: ; preds = %52
%57 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
br label %65
58: ; preds = %45
%59 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%60 = load i32, i32* @EXIT_FAILURE
%61 = call i32 @exit(i32 %60)
unreachable
62: ; preds = %175, %65
%63 = call i32 @epoll_wait(i32 %39, %struct.epoll_event* %53, i32 10, i32 -1)
%64 = icmp eq i32 %63, -1
br i1 %64, label %70, label %65
65: ; preds = %56, %62
%66 = phi i32 [ %54, %56 ], [ %63, %62 ]
%67 = icmp sgt i32 %66, 0
br i1 %67, label %68, label %62
68: ; preds = %65
%69 = zext i32 %66 to i64
br label %74
70: ; preds = %62, %52
%71 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%72 = load i32, i32* @EXIT_FAILURE
%73 = call i32 @exit(i32 %72)
unreachable
74: ; preds = %68, %175
%75 = phi i64 [ 0, %68 ], [ %176, %175 ]
%76 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %2, i64 0, i64 %75, i32 1, i32 0
%77 = load i32, i32* %76
%78 = icmp eq i32 %77, %16
br i1 %78, label %79, label %111
79: ; preds = %74, %82
%80 = call i32 @accept(i32 %16, %struct.sockaddr* %57, i32* %3)
%81 = icmp sgt i32 %80, 0
br i1 %81, label %82, label %94
82: ; preds = %79
%83 = call i32 @setnonblocking(i32 %80)
%84 = load i32, i32* @EPOLLIN
%85 = load i32, i32* @EPOLLET
%86 = or i32 %85, %84
store i32 %86, i32* %47
store i32 %80, i32* %48
%87 = load i32, i32* @EPOLL_CTL_ADD
%88 = call i32 @epoll_ctl(i32 %39, i32 %87, i32 %80, %struct.epoll_event* %1)
%89 = icmp eq i32 %88, -1
br i1 %89, label %90, label %79
90: ; preds = %82
%91 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%92 = load i32, i32* @EXIT_FAILURE
%93 = call i32 @exit(i32 %92)
unreachable
94: ; preds = %79
%95 = icmp eq i32 %80, -1
br i1 %95, label %96, label %175
96: ; preds = %94
%97 = load i64, i64* @errno
%98 = load i64, i64* @EAGAIN
%99 = icmp eq i64 %97, %98
%100 = load i64, i64* @ECONNABORTED
%101 = icmp eq i64 %97, %100
%102 = select i1 %99, i1 true, i1 %101
%103 = load i64, i64* @EPROTO
%104 = icmp eq i64 %97, %103
%105 = select i1 %102, i1 true, i1 %104
%106 = load i64, i64* @EINTR
%107 = icmp eq i64 %97, %106
%108 = select i1 %105, i1 true, i1 %107
br i1 %108, label %175, label %109
109: ; preds = %96
%110 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %175
111: ; preds = %74
%112 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %2, i64 0, i64 %75, i32 0
%113 = load i32, i32* %112
%114 = load i32, i32* @EPOLLIN
%115 = and i32 %114, %113
%116 = icmp eq i32 %115, 0
br i1 %116, label %143, label %117
117: ; preds = %111, %117
%118 = phi i32 [ %125, %117 ], [ 0, %111 ]
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i8, i8* %13, i64 %119
%121 = load i32, i32* @BUFSIZ
%122 = add nsw i32 %121, -1
%123 = call i32 @read(i32 %77, i8* %120, i32 %122)
%124 = icmp sgt i32 %123, 0
%125 = add nsw i32 %123, %118
br i1 %124, label %117, label %126
126: ; preds = %117
%127 = icmp eq i32 %123, -1
br i1 %127, label %128, label %134
128: ; preds = %126
%129 = load i64, i64* @errno
%130 = load i64, i64* @EAGAIN
%131 = icmp eq i64 %129, %130
br i1 %131, label %134, label %132
132: ; preds = %128
%133 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %134
134: ; preds = %132, %128, %126
store i32 %77, i32* %48
%135 = load i32, i32* %112
%136 = load i32, i32* @EPOLLOUT
%137 = or i32 %136, %135
store i32 %137, i32* %47
%138 = load i32, i32* @EPOLL_CTL_MOD
%139 = call i32 @epoll_ctl(i32 %39, i32 %138, i32 %77, %struct.epoll_event* %1)
%140 = icmp eq i32 %139, -1
br i1 %140, label %141, label %143
141: ; preds = %134
%142 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %143
143: ; preds = %134, %141, %111
%144 = load i32, i32* %112
%145 = load i32, i32* @EPOLLOUT
%146 = and i32 %145, %144
%147 = icmp eq i32 %146, 0
br i1 %147, label %175, label %148
148: ; preds = %143
%149 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i32 11)
%150 = call i32 @strlen(i8* %13)
%151 = icmp sgt i32 %150, 0
br i1 %151, label %152, label %173
152: ; preds = %148
%153 = zext i32 %150 to i64
%154 = getelementptr inbounds i8, i8* %13, i64 %153
br label %157
155: ; preds = %157
%156 = icmp sgt i32 %164, 0
br i1 %156, label %157, label %173
157: ; preds = %152, %155
%158 = phi i32 [ %150, %152 ], [ %164, %155 ]
%159 = zext i32 %158 to i64
%160 = sub nsw i64 0, %159
%161 = getelementptr inbounds i8, i8* %154, i64 %160
%162 = call i32 @write(i32 %77, i8* %161, i32 %158)
%163 = icmp sgt i32 %158, %162
%164 = sub nsw i32 %158, %162
br i1 %163, label %165, label %155
165: ; preds = %157
%166 = icmp eq i32 %162, -1
br i1 %166, label %167, label %173
167: ; preds = %165
%168 = load i64, i64* @errno
%169 = load i64, i64* @EAGAIN
%170 = icmp eq i64 %168, %169
br i1 %170, label %173, label %171
171: ; preds = %167
%172 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
br label %173
173: ; preds = %155, %148, %165, %167, %171
%174 = call i32 @close(i32 %77)
br label %175
175: ; preds = %143, %173, %94, %109, %96
%176 = add nuw nsw i64 %75, 1
%177 = icmp eq i64 %176, %69
br i1 %177, label %62, label %74
}