#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*/ 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 *, size_t *);
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(823);
  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,
                                   (size_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);
      }
    }
  }
  close(epfd);
  close(listenfd);
  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    $0x337,%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    $0x337,%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 823)
%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 = %253, %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 = %250, %85
%87 = load i32, i32* %10
%88 = load i32, i32* %7
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %253
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 %150
100: ; preds = %90
br label %101
101: ; preds = %126, %100
%102 = load i32, i32* %5
%103 = bitcast %struct.sockaddr_in* %14 to %struct.sockaddr*
%104 = bitcast i32* %4 to i64*
%105 = call i32 @accept(i32 %102, %struct.sockaddr* %103, i64* %104)
store i32 %105, i32* %6
%106 = icmp sgt i32 %105, 0
br i1 %106, label %107, label %127
107: ; preds = %101
%108 = load i32, i32* %6
%109 = call i32 @setnonblocking(i32 %108)
%110 = load i32, i32* @EPOLLIN
%111 = load i32, i32* @EPOLLET
%112 = or i32 %110, %111
%113 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %2, i32 0, i32 0
store i32 %112, i32* %113
%114 = load i32, i32* %6
%115 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %2, i32 0, i32 1
%116 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %115, i32 0, i32 0
store i32 %114, i32* %116
%117 = load i32, i32* %8
%118 = load i32, i32* @EPOLL_CTL_ADD
%119 = load i32, i32* %6
%120 = call i32 @epoll_ctl(i32 %117, i32 %118, i32 %119, %struct.epoll_event* %2)
%121 = icmp eq i32 %120, -1
br i1 %121, label %122, label %126
122: ; preds = %107
%123 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%124 = load i32, i32* @EXIT_FAILURE
%125 = call i32 @exit(i32 %124)
unreachable
126: ; preds = %107
br label %101
127: ; preds = %101
%128 = load i32, i32* %6
%129 = icmp eq i32 %128, -1
br i1 %129, label %130, label %149
130: ; preds = %127
%131 = load i64, i64* @errno
%132 = load i64, i64* @EAGAIN
%133 = icmp ne i64 %131, %132
br i1 %133, label %134, label %148
134: ; preds = %130
%135 = load i64, i64* @errno
%136 = load i64, i64* @ECONNABORTED
%137 = icmp ne i64 %135, %136
br i1 %137, label %138, label %148
138: ; preds = %134
%139 = load i64, i64* @errno
%140 = load i64, i64* @EPROTO
%141 = icmp ne i64 %139, %140
br i1 %141, label %142, label %148
142: ; preds = %138
%143 = load i64, i64* @errno
%144 = load i64, i64* @EINTR
%145 = icmp ne i64 %143, %144
br i1 %145, label %146, label %148
146: ; preds = %142
%147 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %148
148: ; preds = %146, %142, %138, %134, %130
br label %149
149: ; preds = %148, %127
br label %250
150: ; preds = %90
%151 = load i32, i32* %10
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %3, i64 0, i64 %152
%154 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %153, i32 0, i32 0
%155 = load i32, i32* %154
%156 = load i32, i32* @EPOLLIN
%157 = and i32 %155, %156
%158 = icmp ne i32 %157, 0
br i1 %158, label %159, label %202
159: ; preds = %150
store i32 0, i32* %12
br label %160
160: ; preds = %169, %159
%161 = load i32, i32* %9
%162 = load i32, i32* %12
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds i8, i8* %22, i64 %163
%165 = load i32, i32* @BUFSIZ
%166 = sub nsw i32 %165, 1
%167 = call i32 @read(i32 %161, i8* %164, i32 %166)
store i32 %167, i32* %11
%168 = icmp sgt i32 %167, 0
br i1 %168, label %169, label %173
169: ; preds = %160
%170 = load i32, i32* %11
%171 = load i32, i32* %12
%172 = add nsw i32 %171, %170
store i32 %172, i32* %12
br label %160
173: ; preds = %160
%174 = load i32, i32* %11
%175 = icmp eq i32 %174, -1
br i1 %175, label %176, label %182
176: ; preds = %173
%177 = load i64, i64* @errno
%178 = load i64, i64* @EAGAIN
%179 = icmp ne i64 %177, %178
br i1 %179, label %180, label %182
180: ; preds = %176
%181 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %182
182: ; preds = %180, %176, %173
%183 = load i32, i32* %9
%184 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %2, i32 0, i32 1
%185 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %184, i32 0, i32 0
store i32 %183, i32* %185
%186 = load i32, i32* %10
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %3, i64 0, i64 %187
%189 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %188, i32 0, i32 0
%190 = load i32, i32* %189
%191 = load i32, i32* @EPOLLOUT
%192 = or i32 %190, %191
%193 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %2, i32 0, i32 0
store i32 %192, i32* %193
%194 = load i32, i32* %8
%195 = load i32, i32* @EPOLL_CTL_MOD
%196 = load i32, i32* %9
%197 = call i32 @epoll_ctl(i32 %194, i32 %195, i32 %196, %struct.epoll_event* %2)
%198 = icmp eq i32 %197, -1
br i1 %198, label %199, label %201
199: ; preds = %182
%200 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %201
201: ; preds = %199, %182
br label %202
202: ; preds = %201, %150
%203 = load i32, i32* %10
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %3, i64 0, i64 %204
%206 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %205, i32 0, i32 0
%207 = load i32, i32* %206
%208 = load i32, i32* @EPOLLOUT
%209 = and i32 %207, %208
%210 = icmp ne i32 %209, 0
br i1 %210, label %211, label %249
211: ; preds = %202
%212 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i32 11)
%213 = call i32 @strlen(i8* %22)
store i32 %213, i32* %18
%214 = load i32, i32* %18
store i32 %214, i32* %12
br label %215
215: ; preds = %242, %211
%216 = load i32, i32* %12
%217 = icmp sgt i32 %216, 0
br i1 %217, label %218, label %246
218: ; preds = %215
%219 = load i32, i32* %9
%220 = load i32, i32* %18
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds i8, i8* %22, i64 %221
%223 = load i32, i32* %12
%224 = sext i32 %223 to i64
%225 = sub i64 0, %224
%226 = getelementptr inbounds i8, i8* %222, i64 %225
%227 = load i32, i32* %12
%228 = call i32 @write(i32 %219, i8* %226, i32 %227)
store i32 %228, i32* %17
%229 = load i32, i32* %17
%230 = load i32, i32* %12
%231 = icmp slt i32 %229, %230
br i1 %231, label %232, label %242
232: ; preds = %218
%233 = load i32, i32* %17
%234 = icmp eq i32 %233, -1
br i1 %234, label %235, label %241
235: ; preds = %232
%236 = load i64, i64* @errno
%237 = load i64, i64* @EAGAIN
%238 = icmp ne i64 %236, %237
br i1 %238, label %239, label %241
239: ; preds = %235
%240 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
br label %241
241: ; preds = %239, %235, %232
br label %246
242: ; preds = %218
%243 = load i32, i32* %17
%244 = load i32, i32* %12
%245 = sub nsw i32 %244, %243
store i32 %245, i32* %12
br label %215
246: ; preds = %241, %215
%247 = load i32, i32* %9
%248 = call i32 @close(i32 %247)
br label %249
249: ; preds = %246, %202
br label %250
250: ; preds = %249, %149
%251 = load i32, i32* %10
%252 = add nsw i32 %251, 1
store i32 %252, i32* %10
br label %86
253: ; 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 823)
%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 %59, 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 %71, label %56
56: ; preds = %52
%57 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%58 = bitcast i32* %3 to i64*
br label %66
59: ; preds = %45
%60 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%61 = load i32, i32* @EXIT_FAILURE
%62 = call i32 @exit(i32 %61)
unreachable
63: ; preds = %176, %66
%64 = call i32 @epoll_wait(i32 %39, %struct.epoll_event* %53, i32 10, i32 -1)
%65 = icmp eq i32 %64, -1
br i1 %65, label %71, label %66
66: ; preds = %56, %63
%67 = phi i32 [ %54, %56 ], [ %64, %63 ]
%68 = icmp sgt i32 %67, 0
br i1 %68, label %69, label %63
69: ; preds = %66
%70 = zext i32 %67 to i64
br label %75
71: ; preds = %63, %52
%72 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%73 = load i32, i32* @EXIT_FAILURE
%74 = call i32 @exit(i32 %73)
unreachable
75: ; preds = %69, %176
%76 = phi i64 [ 0, %69 ], [ %177, %176 ]
%77 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %2, i64 0, i64 %76, i32 1, i32 0
%78 = load i32, i32* %77
%79 = icmp eq i32 %78, %16
br i1 %79, label %80, label %112
80: ; preds = %75, %83
%81 = call i32 @accept(i32 %16, %struct.sockaddr* %57, i64* %58)
%82 = icmp sgt i32 %81, 0
br i1 %82, label %83, label %95
83: ; preds = %80
%84 = call i32 @setnonblocking(i32 %81)
%85 = load i32, i32* @EPOLLIN
%86 = load i32, i32* @EPOLLET
%87 = or i32 %86, %85
store i32 %87, i32* %47
store i32 %81, i32* %48
%88 = load i32, i32* @EPOLL_CTL_ADD
%89 = call i32 @epoll_ctl(i32 %39, i32 %88, i32 %81, %struct.epoll_event* %1)
%90 = icmp eq i32 %89, -1
br i1 %90, label %91, label %80
91: ; preds = %83
%92 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%93 = load i32, i32* @EXIT_FAILURE
%94 = call i32 @exit(i32 %93)
unreachable
95: ; preds = %80
%96 = icmp eq i32 %81, -1
br i1 %96, label %97, label %176
97: ; preds = %95
%98 = load i64, i64* @errno
%99 = load i64, i64* @EAGAIN
%100 = icmp eq i64 %98, %99
%101 = load i64, i64* @ECONNABORTED
%102 = icmp eq i64 %98, %101
%103 = select i1 %100, i1 true, i1 %102
%104 = load i64, i64* @EPROTO
%105 = icmp eq i64 %98, %104
%106 = select i1 %103, i1 true, i1 %105
%107 = load i64, i64* @EINTR
%108 = icmp eq i64 %98, %107
%109 = select i1 %106, i1 true, i1 %108
br i1 %109, label %176, label %110
110: ; preds = %97
%111 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %176
112: ; preds = %75
%113 = getelementptr inbounds [10 x %struct.epoll_event], [10 x %struct.epoll_event]* %2, i64 0, i64 %76, i32 0
%114 = load i32, i32* %113
%115 = load i32, i32* @EPOLLIN
%116 = and i32 %115, %114
%117 = icmp eq i32 %116, 0
br i1 %117, label %144, label %118
118: ; preds = %112, %118
%119 = phi i32 [ %126, %118 ], [ 0, %112 ]
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds i8, i8* %13, i64 %120
%122 = load i32, i32* @BUFSIZ
%123 = add nsw i32 %122, -1
%124 = call i32 @read(i32 %78, i8* %121, i32 %123)
%125 = icmp sgt i32 %124, 0
%126 = add nsw i32 %124, %119
br i1 %125, label %118, label %127
127: ; preds = %118
%128 = icmp eq i32 %124, -1
br i1 %128, label %129, label %135
129: ; preds = %127
%130 = load i64, i64* @errno
%131 = load i64, i64* @EAGAIN
%132 = icmp eq i64 %130, %131
br i1 %132, label %135, label %133
133: ; preds = %129
%134 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %135
135: ; preds = %133, %129, %127
store i32 %78, i32* %48
%136 = load i32, i32* %113
%137 = load i32, i32* @EPOLLOUT
%138 = or i32 %137, %136
store i32 %138, i32* %47
%139 = load i32, i32* @EPOLL_CTL_MOD
%140 = call i32 @epoll_ctl(i32 %39, i32 %139, i32 %78, %struct.epoll_event* %1)
%141 = icmp eq i32 %140, -1
br i1 %141, label %142, label %144
142: ; preds = %135
%143 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %144
144: ; preds = %135, %142, %112
%145 = load i32, i32* %113
%146 = load i32, i32* @EPOLLOUT
%147 = and i32 %146, %145
%148 = icmp eq i32 %147, 0
br i1 %148, label %176, label %149
149: ; preds = %144
%150 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i32 11)
%151 = call i32 @strlen(i8* %13)
%152 = icmp sgt i32 %151, 0
br i1 %152, label %153, label %174
153: ; preds = %149
%154 = zext i32 %151 to i64
%155 = getelementptr inbounds i8, i8* %13, i64 %154
br label %158
156: ; preds = %158
%157 = icmp sgt i32 %165, 0
br i1 %157, label %158, label %174
158: ; preds = %153, %156
%159 = phi i32 [ %151, %153 ], [ %165, %156 ]
%160 = zext i32 %159 to i64
%161 = sub nsw i64 0, %160
%162 = getelementptr inbounds i8, i8* %155, i64 %161
%163 = call i32 @write(i32 %78, i8* %162, i32 %159)
%164 = icmp sgt i32 %159, %163
%165 = sub nsw i32 %159, %163
br i1 %164, label %166, label %156
166: ; preds = %158
%167 = icmp eq i32 %163, -1
br i1 %167, label %168, label %174
168: ; preds = %166
%169 = load i64, i64* @errno
%170 = load i64, i64* @EAGAIN
%171 = icmp eq i64 %169, %170
br i1 %171, label %174, label %172
172: ; preds = %168
%173 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
br label %174
174: ; preds = %156, %149, %166, %168, %172
%175 = call i32 @close(i32 %78)
br label %176
176: ; preds = %144, %174, %95, %110, %97
%177 = add nuw nsw i64 %76, 1
%178 = icmp eq i64 %177, %70
br i1 %178, label %63, label %75
}