#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_4__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_2__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct TYPE_3__ {
  int fd;
};
struct epoll_event {
  int events;
  TYPE_1__ data;
};
typedef scalar_t__ ssize_t;
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ serveraddr;
typedef int /*<<< orphan*/ clientaddr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ ECONNRESET;
int EPOLLET;
int EPOLLIN;
int EPOLLOUT;
int /*<<< orphan*/ EPOLL_CTL_ADD;
int /*<<< orphan*/ EPOLL_CTL_MOD;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ 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*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ inet_aton(char *, TYPE_2__ *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *,
                    int *);
int /*<<< orphan*/ sendto(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          struct sockaddr *, int);
int /*<<< orphan*/ setnonblocking(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char, char, char, char);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, scalar_t__);
int main() {
  int i, maxi, listenfd, connfd, sockfd, epfd, nfds;
  int ret;
  ssize_t n;
  char line[10];
  socklen_t clilen;
  char szAddr[256] = "\0";
  struct epoll_event ev, events[10000];
  epfd = epoll_create(256);
  printf("epoll_create(256) return %d\n", epfd);
  struct sockaddr_in clientaddr;
  struct sockaddr_in serveraddr;
  listenfd = socket(AF_INET, SOCK_DGRAM, 0);
  int addrlen = sizeof(clientaddr);
  setnonblocking(listenfd);
  ev.data.fd = listenfd;
  ev.events = EPOLLIN | EPOLLET;
  ret = epoll_ctl(epfd, EPOLL_CTL_ADD, listenfd, &ev);
  printf("epoll_ctl return %d, listenfd %d\n", ret, listenfd);
  bzero(&serveraddr, sizeof(serveraddr));
  serveraddr.sin_family = AF_INET;
  char *local_addr = "127.0.0.1";
  inet_aton(local_addr, &(serveraddr.sin_addr));
  serveraddr.sin_addr.s_addr = inet_addr(local_addr);
  serveraddr.sin_port = htons(5555);
  bind(listenfd, (struct sockaddr *)&serveraddr, sizeof(serveraddr));
  memset(line, 0, 10);
  for (;;) {
    nfds = epoll_wait(epfd, events, 10000, -1);
    printf("wait nfds %d\n", nfds);
    for (i = 0; i < nfds; ++i) {
      if (events[i].events & EPOLLIN) {
        if ((sockfd = events[i].data.fd) < 0)
          continue;
        if ((n = recvfrom(sockfd, line, 10, 0, (struct sockaddr *)&clientaddr,
                          &addrlen)) < 0) {
          if (errno == ECONNRESET) {
            close(sockfd);
            events[i].data.fd = -1;
          } else
            printf("readline error\n");
        } else if (n == 0) {
          perror("connfd=0\n");
          close(sockfd);
          events[i].data.fd = -1;
        }
        char *p = (char *)&clientaddr.sin_addr;
        sprintf(szAddr, "%d.%d.%d.%d", *p, *(p + 1), *(p + 2), *(p + 3));
        printf("readline %s sockfd %d from ip:%s:%d\n", line, sockfd, szAddr,
               ntohs(clientaddr.sin_port));
        ev.data.fd = sockfd;
        ev.events = EPOLLOUT;
        epoll_ctl(epfd, EPOLL_CTL_MOD, sockfd, &ev);
      } else if (events[i].events & EPOLLOUT) {
        if (events[i].data.fd == -1)
          continue;
        sockfd = events[i].data.fd;
        write(sockfd, line, n);
        printf("writeline %s sockfd %d to ip:%s:%d\n", line, sockfd, szAddr,
               ntohs(clientaddr.sin_port));
        ev.data.fd = sockfd;
        ev.events = EPOLLIN;
        char buf[256] = "test";
        sendto(sockfd, buf, strlen(buf), 0, (struct sockaddr *)&clientaddr,
               addrlen);
        epoll_ctl(epfd, EPOLL_CTL_MOD, sockfd, &ev);
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x13b50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x140(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1070 <memset@plt>
mov    $0x100,%edi
call   1140 <epoll_create@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2d5e(%rip),%rax
mov    (%rax),%edi
mov    0x2d3d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1160 <socket@plt>
mov    %eax,-0x10(%rbp)
movl   $0xc,-0x139f4(%rbp)
mov    -0x10(%rbp),%edi
call   1110 <setnonblocking@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x144(%rbp)
mov    0x2d1f(%rip),%rax
mov    (%rax),%eax
mov    0x2cd6(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x148(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2cfc(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%edx
lea    -0x148(%rbp),%rcx
call   10a0 <epoll_ctl@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xd20(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x139f0(%rbp),%rdi
mov    $0xc,%esi
call   1130 <bzero@plt>
mov    0x2ccc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x139e8(%rbp)
lea    0xd14(%rip),%rax
mov    %rax,-0x13a00(%rbp)
mov    -0x13a00(%rbp),%rdi
lea    -0x139f0(%rbp),%rsi
add    $0x4,%rsi
call   10c0 <inet_aton@plt>
mov    -0x13a00(%rbp),%rdi
call   10b0 <inet_addr@plt>
mov    %eax,-0x139ec(%rbp)
mov    $0x15b3,%edi
call   1050 <htons@plt>
mov    %eax,-0x139f0(%rbp)
mov    -0x10(%rbp),%edi
lea    -0x139f0(%rbp),%rsi
mov    $0xc,%edx
call   1100 <bind@plt>
lea    -0x3a(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <memset@plt>
mov    -0x1c(%rbp),%edi
lea    -0x139d0(%rbp),%rsi
mov    $0x2710,%edx
mov    $0xffffffff,%ecx
call   10f0 <epoll_wait@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xc94(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    16fb <main+0x4bb>
movslq -0x8(%rbp),%rax
mov    -0x139d0(%rbp,%rax,8),%eax
mov    0x2bff(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1596 <main+0x356>
movslq -0x8(%rbp),%rax
mov    -0x139cc(%rbp,%rax,8),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1408 <main+0x1c8>
jmp    16ed <main+0x4ad>
mov    -0x18(%rbp),%edi
lea    -0x3a(%rbp),%rsi
lea    -0x139e0(%rbp),%r8
mov    $0xa,%edx
xor    %ecx,%ecx
lea    -0x139f4(%rbp),%r9
call   10d0 <recvfrom@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jge    1480 <main+0x240>
mov    0x2b6a(%rip),%rax
mov    (%rax),%rax
mov    0x2b78(%rip),%rcx
cmp    (%rcx),%rax
jne    146d <main+0x22d>
mov    -0x18(%rbp),%edi
call   1090 <close@plt>
movslq -0x8(%rbp),%rax
movl   $0xffffffff,-0x139cc(%rbp,%rax,8)
ff ff ff ff
jmp    147b <main+0x23b>
lea    0xbe3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    14b3 <main+0x273>
cmpq   $0x0,-0x30(%rbp)
jne    14ae <main+0x26e>
lea    0xbd5(%rip),%rdi
call   1120 <perror@plt>
mov    -0x18(%rbp),%edi
call   1090 <close@plt>
movslq -0x8(%rbp),%rax
movl   $0xffffffff,-0x139cc(%rbp,%rax,8)
ff ff ff ff
jmp    14b3 <main+0x273>
lea    -0x139e0(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x13a08(%rbp)
lea    -0x140(%rbp),%rdi
mov    -0x13a08(%rbp),%rax
mov    (%rax),%dl
mov    -0x13a08(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x13a08(%rbp),%rax
mov    0x2(%rax),%r8b
mov    -0x13a08(%rbp),%rax
lea    0xb79(%rip),%rsi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl 0x3(%rax),%r9d
call   1150 <sprintf@plt>
lea    -0x3a(%rbp),%rax
mov    %rax,-0x13b28(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x13b1c(%rbp)
lea    -0x140(%rbp),%rax
mov    %rax,-0x13b18(%rbp)
mov    -0x139e0(%rbp),%edi
call   10e0 <ntohs@plt>
mov    -0x13b28(%rbp),%rsi
mov    -0x13b1c(%rbp),%edx
mov    -0x13b18(%rbp),%rcx
mov    %eax,%r8d
lea    0xb26(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x144(%rbp)
mov    0x2a42(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x148(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2a38(%rip),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%edx
lea    -0x148(%rbp),%rcx
call   10a0 <epoll_ctl@plt>
jmp    16e8 <main+0x4a8>
movslq -0x8(%rbp),%rax
mov    -0x139d0(%rbp,%rax,8),%eax
mov    0x2a08(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     16e3 <main+0x4a3>
movslq -0x8(%rbp),%rax
cmpl   $0xffffffff,-0x139cc(%rbp,%rax,8)
ff
jne    15ca <main+0x38a>
jmp    16ed <main+0x4ad>
movslq -0x8(%rbp),%rax
mov    -0x139cc(%rbp,%rax,8),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x3a(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <write@plt>
lea    -0x3a(%rbp),%rax
mov    %rax,-0x13b50(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x13b44(%rbp)
lea    -0x140(%rbp),%rax
mov    %rax,-0x13b40(%rbp)
mov    -0x139e0(%rbp),%edi
call   10e0 <ntohs@plt>
mov    -0x13b50(%rbp),%rsi
mov    -0x13b44(%rbp),%edx
mov    -0x13b40(%rbp),%rcx
mov    %eax,%r8d
lea    0xa6f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x144(%rbp)
mov    0x2996(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x148(%rbp)
lea    -0x13b10(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1070 <memset@plt>
movb   $0x74,-0x13b10(%rbp)
movb   $0x65,-0x13b0f(%rbp)
movb   $0x73,-0x13b0e(%rbp)
movb   $0x74,-0x13b0d(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x13b34(%rbp)
lea    -0x13b10(%rbp),%rax
mov    %rax,-0x13b30(%rbp)
lea    -0x13b10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x13b34(%rbp),%edi
mov    -0x13b30(%rbp),%rsi
mov    %eax,%edx
lea    -0x139e0(%rbp),%r8
mov    -0x139f4(%rbp),%r9d
xor    %ecx,%ecx
call   1080 <sendto@plt>
mov    -0x1c(%rbp),%edi
mov    0x28e6(%rip),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%edx
lea    -0x148(%rbp),%rcx
call   10a0 <epoll_ctl@plt>
jmp    16e8 <main+0x4a8>
jmp    16ed <main+0x4ad>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    13c3 <main+0x183>
jmp    138f <main+0x14f>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x13ac8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x230(%rsp)
movaps %xmm0,0x220(%rsp)
movaps %xmm0,0x210(%rsp)
movaps %xmm0,0x200(%rsp)
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
mov    $0x100,%edi
call   1150 <epoll_create@plt>
mov    %eax,%r14d
lea    0xd08(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2ce0(%rip),%r15
mov    (%r15),%edi
mov    0x2cbe(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1170 <socket@plt>
mov    %eax,%ebp
movl   $0xc,0xc(%rsp)
mov    %eax,%edi
call   1120 <setnonblocking@plt>
mov    0x2cad(%rip),%rbx
mov    0x2c66(%rip),%rax
mov    (%rax),%eax
or     (%rbx),%eax
mov    %ebp,0x4(%rsp)
mov    %eax,(%rsp)
mov    0x2c8c(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rcx
mov    %r14d,%edi
mov    %ebp,%edx
call   10b0 <epoll_ctl@plt>
lea    0xcbb(%rip),%rdi
mov    %eax,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x20(%rsp),%r12
mov    %r12,%rdi
mov    $0xc,%esi
call   1140 <bzero@plt>
mov    (%r15),%eax
mov    %eax,0x28(%rsp)
lea    0x24(%rsp),%rsi
lea    0xcad(%rip),%r15
mov    %r15,%rdi
call   10d0 <inet_aton@plt>
mov    %r15,%rdi
call   10c0 <inet_addr@plt>
mov    %eax,0x24(%rsp)
mov    $0x15b3,%edi
call   1060 <htons@plt>
mov    %eax,0x20(%rsp)
mov    %ebp,%edi
mov    %r12,%rsi
mov    $0xc,%edx
call   1110 <bind@plt>
lea    0x2e(%rsp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <memset@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x240(%rsp),%r15
lea    0xc5a(%rip),%r12
nop
mov    %r14d,%edi
mov    %r15,%rsi
mov    $0x2710,%edx
mov    $0xffffffff,%ecx
call   1100 <epoll_wait@plt>
mov    %eax,%ebp
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebp,%ebp
jle    13f0 <main+0x1a0>
mov    %ebp,%r12d
xor    %r13d,%r13d
jmp    14ba <main+0x26a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
je     165e <main+0x40e>
movsbl 0x14(%rsp),%edx
movsbl 0x15(%rsp),%ecx
movsbl 0x16(%rsp),%r8d
movsbl 0x17(%rsp),%r9d
lea    0x140(%rsp),%r15
mov    %r15,%rdi
lea    0xc03(%rip),%rsi
call   1160 <sprintf@plt>
mov    0x10(%rsp),%edi
call   10f0 <ntohs@plt>
lea    0xbfa(%rip),%rdi
lea    0x2e(%rsp),%rsi
mov    %ebp,%edx
mov    %r15,%rcx
mov    %eax,%r8d
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebp,0x4(%rsp)
mov    0x2b1e(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    0x2b1a(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edi
mov    %ebp,%edx
mov    %rsp,%rcx
call   10b0 <epoll_ctl@plt>
add    $0x1,%r13
cmp    %r13,%r12
je     13e0 <main+0x190>
mov    0x240(%rsp,%r13,8),%eax
test   %eax,(%rbx)
je     1540 <main+0x2f0>
mov    0x244(%rsp,%r13,8),%ebp
test   %ebp,%ebp
js     14ad <main+0x25d>
mov    %r13,%r15
add    %r13,%r15
mov    %ebp,%edi
lea    0x2e(%rsp),%rsi
mov    $0xa,%edx
xor    %ecx,%ecx
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
call   10e0 <recvfrom@plt>
mov    %rax,0x38(%rsp)
test   %rax,%rax
jns    1430 <main+0x1e0>
mov    0x2a9e(%rip),%rax
mov    (%rax),%rax
mov    0x2aac(%rip),%rcx
cmp    (%rcx),%rax
jne    164d <main+0x3fd>
mov    %ebp,%edi
call   10a0 <close@plt>
movl   $0xffffffff,0x244(%rsp,%r15,4)
jmp    1436 <main+0x1e6>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x2a69(%rip),%rcx
test   %eax,(%rcx)
je     14ad <main+0x25d>
mov    0x244(%rsp,%r13,8),%ebp
cmp    $0xffffffff,%ebp
je     14ad <main+0x25d>
mov    %ebp,%edi
lea    0x2e(%rsp),%r15
mov    %r15,%rsi
mov    0x38(%rsp),%rdx
call   1040 <write@plt>
mov    0x10(%rsp),%edi
call   10f0 <ntohs@plt>
lea    0xb0e(%rip),%rdi
mov    %r15,%rsi
mov    %ebp,%edx
lea    0x140(%rsp),%rcx
mov    %eax,%r8d
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebp,0x4(%rsp)
mov    (%rbx),%eax
mov    %eax,(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movl   $0x74736574,0x40(%rsp)
74
lea    0x40(%rsp),%r15
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    0xc(%rsp),%r9d
mov    %ebp,%edi
mov    %r15,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
lea    0x10(%rsp),%r8
call   1090 <sendto@plt>
jmp    1497 <main+0x247>
lea    0xa62(%rip),%rdi
call   1030 <puts@plt>
jmp    1436 <main+0x1e6>
lea    0x9f2(%rip),%rdi
call   1130 <perror@plt>
jmp    151d <main+0x2cd>

LLVM IR (-O0):
%struct.epoll_event = type { i32, %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
%struct.sockaddr_in = type { i32, %struct.TYPE_4__, i32 }
%struct.TYPE_4__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [29 x i8] c"epoll_create(256) return %d\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@EPOLLIN = global i32 0
@EPOLLET = global i32 0
@EPOLL_CTL_ADD = global i32 0
@.str.1 = [34 x i8] c"epoll_ctl return %d, listenfd %d\0A\00"
@.str.2 = [10 x i8] c"127.0.0.1\00"
@.str.3 = [14 x i8] c"wait nfds %d\0A\00"
@errno = global i64 0
@ECONNRESET = global i64 0
@.str.4 = [16 x i8] c"readline error\0A\00"
@.str.5 = [10 x i8] c"connfd=0\0A\00"
@.str.6 = [12 x i8] c"%d.%d.%d.%d\00"
@.str.7 = [37 x i8] c"readline %s sockfd %d from ip:%s:%d\0A\00"
@EPOLLOUT = global i32 0
@EPOLL_CTL_MOD = global i32 0
@.str.8 = [36 x i8] c"writeline %s sockfd %d to ip:%s:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca [10 x i8]
%12 = alloca i32
%13 = alloca [256 x i8]
%14 = alloca %struct.epoll_event
%15 = alloca [10000 x %struct.epoll_event]
%16 = alloca %struct.sockaddr_in
%17 = alloca %struct.sockaddr_in
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca [256 x i8]
store i32 0, i32* %1
%22 = bitcast [256 x i8]* %13 to i8*
%23 = call i32 @epoll_create(i32 256)
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = load i32, i32* @AF_INET
%27 = load i32, i32* @SOCK_DGRAM
%28 = call i32 @socket(i32 %26, i32 %27, i32 0)
store i32 %28, i32* %4
store i32 12, i32* %18
%29 = load i32, i32* %4
%30 = call i32 @setnonblocking(i32 %29)
%31 = load i32, i32* %4
%32 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %14, i32 0, i32 1
%33 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %32, i32 0, i32 0
store i32 %31, i32* %33
%34 = load i32, i32* @EPOLLIN
%35 = load i32, i32* @EPOLLET
%36 = or i32 %34, %35
%37 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %14, i32 0, i32 0
store i32 %36, i32* %37
%38 = load i32, i32* %7
%39 = load i32, i32* @EPOLL_CTL_ADD
%40 = load i32, i32* %4
%41 = call i32 @epoll_ctl(i32 %38, i32 %39, i32 %40, %struct.epoll_event* %14)
store i32 %41, i32* %9
%42 = load i32, i32* %9
%43 = load i32, i32* %4
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %42, i32 %43)
%45 = call i32 @bzero(%struct.sockaddr_in* %17, i32 12)
%46 = load i32, i32* @AF_INET
%47 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %17, i32 0, i32 2
store i32 %46, i32* %47
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %19
%48 = load i8*, i8** %19
%49 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %17, i32 0, i32 1
%50 = call i32 @inet_aton(i8* %48, %struct.TYPE_4__* %49)
%51 = load i8*, i8** %19
%52 = call i32 @inet_addr(i8* %51)
%53 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %17, i32 0, i32 1
%54 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %53, i32 0, i32 0
store i32 %52, i32* %54
%55 = call i32 @htons(i32 5555)
%56 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %17, i32 0, i32 0
store i32 %55, i32* %56
%57 = load i32, i32* %4
%58 = bitcast %struct.sockaddr_in* %17 to %struct.sockaddr*
%59 = call i32 @bind(i32 %57, %struct.sockaddr* %58, i32 12)
%60 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%61 = call i32 @memset(i8* %60, i32 0, i32 10)
br label %62
62: ; preds = %219, %0
%63 = load i32, i32* %7
%64 = getelementptr inbounds [10000 x %struct.epoll_event], [10000 x %struct.epoll_event]* %15, i64 0, i64 0
%65 = call i32 @epoll_wait(i32 %63, %struct.epoll_event* %64, i32 10000, i32 -1)
store i32 %65, i32* %8
%66 = load i32, i32* %8
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %66)
store i32 0, i32* %2
br label %68
68: ; preds = %216, %62
%69 = load i32, i32* %2
%70 = load i32, i32* %8
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %219
72: ; preds = %68
%73 = load i32, i32* %2
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [10000 x %struct.epoll_event], [10000 x %struct.epoll_event]* %15, i64 0, i64 %74
%76 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %75, i32 0, i32 0
%77 = load i32, i32* %76
%78 = load i32, i32* @EPOLLIN
%79 = and i32 %77, %78
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %156
81: ; preds = %72
%82 = load i32, i32* %2
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [10000 x %struct.epoll_event], [10000 x %struct.epoll_event]* %15, i64 0, i64 %83
%85 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %84, i32 0, i32 1
%86 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %85, i32 0, i32 0
%87 = load i32, i32* %86
store i32 %87, i32* %6
%88 = icmp slt i32 %87, 0
br i1 %88, label %89, label %90
89: ; preds = %81
br label %216
90: ; preds = %81
%91 = load i32, i32* %6
%92 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%93 = bitcast %struct.sockaddr_in* %16 to %struct.sockaddr*
%94 = call i64 @recvfrom(i32 %91, i8* %92, i32 10, i32 0, %struct.sockaddr* %93, i32* %18)
store i64 %94, i64* %10
%95 = icmp slt i64 %94, 0
br i1 %95, label %96, label %111
96: ; preds = %90
%97 = load i64, i64* @errno
%98 = load i64, i64* @ECONNRESET
%99 = icmp eq i64 %97, %98
br i1 %99, label %100, label %108
100: ; preds = %96
%101 = load i32, i32* %6
%102 = call i32 @close(i32 %101)
%103 = load i32, i32* %2
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [10000 x %struct.epoll_event], [10000 x %struct.epoll_event]* %15, i64 0, i64 %104
%106 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %105, i32 0, i32 1
%107 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %106, i32 0, i32 0
store i32 -1, i32* %107
br label %110
108: ; preds = %96
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %110
110: ; preds = %108, %100
br label %124
111: ; preds = %90
%112 = load i64, i64* %10
%113 = icmp eq i64 %112, 0
br i1 %113, label %114, label %123
114: ; preds = %111
%115 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%116 = load i32, i32* %6
%117 = call i32 @close(i32 %116)
%118 = load i32, i32* %2
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [10000 x %struct.epoll_event], [10000 x %struct.epoll_event]* %15, i64 0, i64 %119
%121 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %120, i32 0, i32 1
%122 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %121, i32 0, i32 0
store i32 -1, i32* %122
br label %123
123: ; preds = %114, %111
br label %124
124: ; preds = %123, %110
%125 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %16, i32 0, i32 1
%126 = bitcast %struct.TYPE_4__* %125 to i8*
store i8* %126, i8** %20
%127 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%128 = load i8*, i8** %20
%129 = load i8, i8* %128
%130 = load i8*, i8** %20
%131 = getelementptr inbounds i8, i8* %130, i64 1
%132 = load i8, i8* %131
%133 = load i8*, i8** %20
%134 = getelementptr inbounds i8, i8* %133, i64 2
%135 = load i8, i8* %134
%136 = load i8*, i8** %20
%137 = getelementptr inbounds i8, i8* %136, i64 3
%138 = load i8, i8* %137
%139 = call i32 @sprintf(i8* %127, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8 signext %129, i8 signext %132, i8 signext %135, i8 signext %138)
%140 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%141 = load i32, i32* %6
%142 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%143 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %16, i32 0, i32 0
%144 = load i32, i32* %143
%145 = call i32 @ntohs(i32 %144)
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* %140, i32 %141, i8* %142, i32 %145)
%147 = load i32, i32* %6
%148 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %14, i32 0, i32 1
%149 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %148, i32 0, i32 0
store i32 %147, i32* %149
%150 = load i32, i32* @EPOLLOUT
%151 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %14, i32 0, i32 0
store i32 %150, i32* %151
%152 = load i32, i32* %7
%153 = load i32, i32* @EPOLL_CTL_MOD
%154 = load i32, i32* %6
%155 = call i32 @epoll_ctl(i32 %152, i32 %153, i32 %154, %struct.epoll_event* %14)
br label %215
156: ; preds = %72
%157 = load i32, i32* %2
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [10000 x %struct.epoll_event], [10000 x %struct.epoll_event]* %15, i64 0, i64 %158
%160 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %159, i32 0, i32 0
%161 = load i32, i32* %160
%162 = load i32, i32* @EPOLLOUT
%163 = and i32 %161, %162
%164 = icmp ne i32 %163, 0
br i1 %164, label %165, label %214
165: ; preds = %156
%166 = load i32, i32* %2
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds [10000 x %struct.epoll_event], [10000 x %struct.epoll_event]* %15, i64 0, i64 %167
%169 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %168, i32 0, i32 1
%170 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %169, i32 0, i32 0
%171 = load i32, i32* %170
%172 = icmp eq i32 %171, -1
br i1 %172, label %173, label %174
173: ; preds = %165
br label %216
174: ; preds = %165
%175 = load i32, i32* %2
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds [10000 x %struct.epoll_event], [10000 x %struct.epoll_event]* %15, i64 0, i64 %176
%178 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %177, i32 0, i32 1
%179 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %178, i32 0, i32 0
%180 = load i32, i32* %179
store i32 %180, i32* %6
%181 = load i32, i32* %6
%182 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%183 = load i64, i64* %10
%184 = call i32 @write(i32 %181, i8* %182, i64 %183)
%185 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%186 = load i32, i32* %6
%187 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%188 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %16, i32 0, i32 0
%189 = load i32, i32* %188
%190 = call i32 @ntohs(i32 %189)
%191 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i8* %185, i32 %186, i8* %187, i32 %190)
%192 = load i32, i32* %6
%193 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %14, i32 0, i32 1
%194 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %193, i32 0, i32 0
store i32 %192, i32* %194
%195 = load i32, i32* @EPOLLIN
%196 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %14, i32 0, i32 0
store i32 %195, i32* %196
%197 = bitcast [256 x i8]* %21 to i8*
%198 = bitcast i8* %197 to [256 x i8]*
%199 = getelementptr inbounds [256 x i8], [256 x i8]* %198, i32 0, i32 0
store i8 116, i8* %199
%200 = getelementptr inbounds [256 x i8], [256 x i8]* %198, i32 0, i32 1
store i8 101, i8* %200
%201 = getelementptr inbounds [256 x i8], [256 x i8]* %198, i32 0, i32 2
store i8 115, i8* %201
%202 = getelementptr inbounds [256 x i8], [256 x i8]* %198, i32 0, i32 3
store i8 116, i8* %202
%203 = load i32, i32* %6
%204 = getelementptr inbounds [256 x i8], [256 x i8]* %21, i64 0, i64 0
%205 = getelementptr inbounds [256 x i8], [256 x i8]* %21, i64 0, i64 0
%206 = call i32 @strlen(i8* %205)
%207 = bitcast %struct.sockaddr_in* %16 to %struct.sockaddr*
%208 = load i32, i32* %18
%209 = call i32 @sendto(i32 %203, i8* %204, i32 %206, i32 0, %struct.sockaddr* %207, i32 %208)
%210 = load i32, i32* %7
%211 = load i32, i32* @EPOLL_CTL_MOD
%212 = load i32, i32* %6
%213 = call i32 @epoll_ctl(i32 %210, i32 %211, i32 %212, %struct.epoll_event* %14)
br label %214
214: ; preds = %174, %156
br label %215
215: ; preds = %214, %124
br label %216
216: ; preds = %215, %173, %89
%217 = load i32, i32* %2
%218 = add nsw i32 %217, 1
store i32 %218, i32* %2
br label %68
219: ; preds = %68
br label %62
}

LLVM IR (-O2):
%struct.epoll_event = type { i32, %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
%struct.sockaddr_in = type { i32, %struct.TYPE_4__, i32 }
%struct.TYPE_4__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [29 x i8] c"epoll_create(256) return %d\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@EPOLLIN = global i32 0
@EPOLLET = global i32 0
@EPOLL_CTL_ADD = global i32 0
@.str.1 = [34 x i8] c"epoll_ctl return %d, listenfd %d\0A\00"
@.str.2 = [10 x i8] c"127.0.0.1\00"
@.str.3 = [14 x i8] c"wait nfds %d\0A\00"
@errno = global i64 0
@ECONNRESET = global i64 0
@.str.5 = [10 x i8] c"connfd=0\0A\00"
@.str.6 = [12 x i8] c"%d.%d.%d.%d\00"
@.str.7 = [37 x i8] c"readline %s sockfd %d from ip:%s:%d\0A\00"
@EPOLLOUT = global i32 0
@EPOLL_CTL_MOD = global i32 0
@.str.8 = [36 x i8] c"writeline %s sockfd %d to ip:%s:%d\0A\00"
@str = [15 x i8] c"readline error\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [256 x i8]
%3 = alloca %struct.epoll_event
%4 = alloca [10000 x %struct.epoll_event]
%5 = alloca %struct.sockaddr_in
%6 = alloca %struct.sockaddr_in
%7 = alloca i32
%8 = alloca [256 x i8]
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%11 = bitcast %struct.epoll_event* %3 to i8*
%12 = bitcast [10000 x %struct.epoll_event]* %4 to i8*
%13 = tail call i32 @epoll_create(i32 256)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = bitcast %struct.sockaddr_in* %5 to i8*
%16 = bitcast %struct.sockaddr_in* %6 to i8*
%17 = load i32, i32* @AF_INET
%18 = load i32, i32* @SOCK_DGRAM
%19 = tail call i32 @socket(i32 %17, i32 %18, i32 0)
%20 = bitcast i32* %7 to i8*
store i32 12, i32* %7
%21 = tail call i32 @setnonblocking(i32 %19)
%22 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %3, i64 0, i32 1, i32 0
store i32 %19, i32* %22
%23 = load i32, i32* @EPOLLIN
%24 = load i32, i32* @EPOLLET
%25 = or i32 %24, %23
%26 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %3, i64 0, i32 0
store i32 %25, i32* %26
%27 = load i32, i32* @EPOLL_CTL_ADD
%28 = call i32 @epoll_ctl(i32 %13, i32 %27, i32 %19, %struct.epoll_event* %3)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %28, i32 %19)
%30 = call i32 @bzero(%struct.sockaddr_in* %6, i32 12)
%31 = load i32, i32* @AF_INET
%32 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 2
store i32 %31, i32* %32
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 1
%34 = call i32 @inet_aton(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.TYPE_4__* %33)
%35 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%36 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %33, i64 0, i32 0
store i32 %35, i32* %36
%37 = call i32 @htons(i32 5555)
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 0
store i32 %37, i32* %38
%39 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%40 = call i32 @bind(i32 %19, %struct.sockaddr* %39, i32 12)
%41 = call i32 @memset(i8* %9, i32 0, i32 10)
%42 = getelementptr inbounds [10000 x %struct.epoll_event], [10000 x %struct.epoll_event]* %4, i64 0, i64 0
%43 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1
%45 = bitcast %struct.TYPE_4__* %44 to i8*
%46 = getelementptr inbounds i8, i8* %45, i64 1
%47 = getelementptr inbounds i8, i8* %45, i64 2
%48 = getelementptr inbounds i8, i8* %45, i64 3
%49 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 1
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 2
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 3
br label %54
54: ; preds = %121, %0
%55 = phi i64 [ undef, %0 ], [ %122, %121 ]
br label %56
56: ; preds = %54, %56
%57 = call i32 @epoll_wait(i32 %13, %struct.epoll_event* %42, i32 10000, i32 -1)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %57)
%59 = icmp sgt i32 %57, 0
br i1 %59, label %60, label %56
60: ; preds = %56
%61 = zext i32 %57 to i64
br label %62
62: ; preds = %60, %121
%63 = phi i64 [ 0, %60 ], [ %123, %121 ]
%64 = phi i64 [ %55, %60 ], [ %122, %121 ]
%65 = getelementptr inbounds [10000 x %struct.epoll_event], [10000 x %struct.epoll_event]* %4, i64 0, i64 %63, i32 0
%66 = load i32, i32* %65
%67 = load i32, i32* @EPOLLIN
%68 = and i32 %67, %66
%69 = icmp eq i32 %68, 0
br i1 %69, label %102, label %70
70: ; preds = %62
%71 = getelementptr inbounds [10000 x %struct.epoll_event], [10000 x %struct.epoll_event]* %4, i64 0, i64 %63, i32 1, i32 0
%72 = load i32, i32* %71
%73 = icmp slt i32 %72, 0
br i1 %73, label %121, label %74
74: ; preds = %70
%75 = call i64 @recvfrom(i32 %72, i8* %9, i32 10, i32 0, %struct.sockaddr* %43, i32* %7)
%76 = icmp slt i64 %75, 0
br i1 %76, label %77, label %85
77: ; preds = %74
%78 = load i64, i64* @errno
%79 = load i64, i64* @ECONNRESET
%80 = icmp eq i64 %78, %79
br i1 %80, label %81, label %83
81: ; preds = %77
%82 = call i32 @close(i32 %72)
store i32 -1, i32* %71
br label %90
83: ; preds = %77
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %90
85: ; preds = %74
%86 = icmp eq i64 %75, 0
br i1 %86, label %87, label %90
87: ; preds = %85
%88 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%89 = call i32 @close(i32 %72)
store i32 -1, i32* %71
br label %90
90: ; preds = %85, %87, %81, %83
%91 = load i8, i8* %45
%92 = load i8, i8* %46
%93 = load i8, i8* %47
%94 = load i8, i8* %48
%95 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8 signext %91, i8 signext %92, i8 signext %93, i8 signext %94)
%96 = load i32, i32* %49
%97 = call i32 @ntohs(i32 %96)
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* %9, i32 %72, i8* %10, i32 %97)
store i32 %72, i32* %22
%99 = load i32, i32* @EPOLLOUT
store i32 %99, i32* %26
%100 = load i32, i32* @EPOLL_CTL_MOD
%101 = call i32 @epoll_ctl(i32 %13, i32 %100, i32 %72, %struct.epoll_event* %3)
br label %121
102: ; preds = %62
%103 = load i32, i32* @EPOLLOUT
%104 = and i32 %103, %66
%105 = icmp eq i32 %104, 0
br i1 %105, label %121, label %106
106: ; preds = %102
%107 = getelementptr inbounds [10000 x %struct.epoll_event], [10000 x %struct.epoll_event]* %4, i64 0, i64 %63, i32 1, i32 0
%108 = load i32, i32* %107
%109 = icmp eq i32 %108, -1
br i1 %109, label %121, label %110
110: ; preds = %106
%111 = call i32 @write(i32 %108, i8* %9, i64 %64)
%112 = load i32, i32* %49
%113 = call i32 @ntohs(i32 %112)
%114 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i8* %9, i32 %108, i8* %10, i32 %113)
store i32 %108, i32* %22
%115 = load i32, i32* @EPOLLIN
store i32 %115, i32* %26
store i8 116, i8* %50
store i8 101, i8* %51
store i8 115, i8* %52
store i8 116, i8* %53
%116 = call i32 @strlen(i8* %50)
%117 = load i32, i32* %7
%118 = call i32 @sendto(i32 %108, i8* %50, i32 %116, i32 0, %struct.sockaddr* %43, i32 %117)
%119 = load i32, i32* @EPOLL_CTL_MOD
%120 = call i32 @epoll_ctl(i32 %13, i32 %119, i32 %108, %struct.epoll_event* %3)
br label %121
121: ; preds = %90, %110, %102, %106, %70
%122 = phi i64 [ %64, %70 ], [ %75, %90 ], [ %64, %106 ], [ %64, %110 ], [ %64, %102 ]
%123 = add nuw nsw i64 %63, 1
%124 = icmp eq i64 %123, %61
br i1 %124, label %54, label %62
}