#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int fd;
};
struct epoll_event {
  int events;
  TYPE_1__ data;
};

/* Variables and functions */
int EPOLLERR;
int EPOLLHUP;
int EPOLLIN;
int EPOLLRDHUP;
int /*<<< orphan*/ EPOLL_CTL_DEL;
int /*<<< orphan*/ add_user(char *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ epoll_ctl(int, int /*<<< orphan*/, int,
                             struct epoll_event *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, ...);
int /*<<< orphan*/ write(int, ...);
int /*<<< orphan*/ write_all_users();
void handle_client_fd(struct epoll_event *e, int epoll_fd) {
  if ((e->events & EPOLLERR) || (e->events & EPOLLRDHUP) ||
      (e->events & EPOLLHUP)) {
    epoll_ctl(epoll_fd, EPOLL_CTL_DEL, e->data.fd, e);
    close(epoll_fd);
  } else if (e->events & EPOLLIN) {
    char msg[1024];
    size_t msg_len = 0;
    msg_len = read(e->data.fd, &msg_len, sizeof(size_t));
    if (msg_len == -1) {
      printf("bytes reading error \n");
    }
    if (read(e->data.fd, msg, 1024) == -1) {
      printf("reading error \n");
      close(e->data.fd);
      close(epoll_fd);
    }
    write(e->data.fd, &msg_len, sizeof(size_t));
    write(e->data.fd, msg, msg_len);
    msg[msg_len] = '\0';
    switch (msg[0]) {
    case '1':
      printf("one \n");
      break;
    case '2':
      printf("Your nick is: ");
      int i = 0;
      char name[50];
      int a;
      for (a = 2; a < msg_len; a++) {
        name[i] = msg[a];
        i++;
        printf("%c", msg[a]);
      }
      printf("\n");
      add_user(name, e->data.fd);
      break;
    case '3':
      break;
    case '4':
      break;
    case '5':
      break;
    case '6':
      write_all_users();
      break;
    case '7':
      break;
    default:
      printf("Wrong first number \n");
      break;
    }
    close(e->data.fd);
    epoll_ctl(epoll_fd, EPOLL_CTL_DEL, e->data.fd, e);
  }
}


x86 assembly (clang, -O0):
<handle_client_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2e41(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    11ca <handle_client_fd+0x5a>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2e21(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    11ca <handle_client_fd+0x5a>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2e01(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11f3 <handle_client_fd+0x83>
mov    -0xc(%rbp),%edi
mov    0x2e24(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rcx
call   1060 <epoll_ctl@plt>
mov    -0xc(%rbp),%edi
call   1050 <close@plt>
jmp    1442 <handle_client_fd+0x2d2>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2de0(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     143d <handle_client_fd+0x2cd>
movq   $0x0,-0x418(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
lea    -0x418(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1070 <read@plt>
cltq
mov    %rax,-0x418(%rbp)
cmpq   $0xffffffffffffffff,-0x418(%rbp)
ff
jne    1255 <handle_client_fd+0xe5>
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
mov    $0x0,%al
call   1070 <read@plt>
cmp    $0xffffffff,%eax
jne    129a <handle_client_fd+0x12a>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1050 <close@plt>
mov    -0xc(%rbp),%edi
call   1050 <close@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
xor    %eax,%eax
mov    %al,-0x461(%rbp)
lea    -0x418(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    -0x461(%rbp),%al
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%edi
mov    -0x418(%rbp),%rdx
lea    -0x410(%rbp),%rsi
call   1030 <write@plt>
mov    -0x418(%rbp),%rax
movb   $0x0,-0x410(%rbp,%rax,1)
movsbl -0x410(%rbp),%eax
add    $0xffffffcf,%eax
mov    %eax,%ecx
mov    %rcx,-0x460(%rbp)
sub    $0x6,%eax
ja     1407 <handle_client_fd+0x297>
mov    -0x460(%rbp),%rax
lea    0xced(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd0f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1415 <handle_client_fd+0x2a5>
lea    0xd02(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x41c(%rbp)
movl   $0x2,-0x454(%rbp)
movslq -0x454(%rbp),%rax
cmp    -0x418(%rbp),%rax
jae    13c1 <handle_client_fd+0x251>
movslq -0x454(%rbp),%rax
mov    -0x410(%rbp,%rax,1),%cl
movslq -0x41c(%rbp),%rax
mov    %cl,-0x450(%rbp,%rax,1)
mov    -0x41c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x41c(%rbp)
movslq -0x454(%rbp),%rax
movsbl -0x410(%rbp,%rax,1),%esi
ff
lea    0xca1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x454(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x454(%rbp)
jmp    1351 <handle_client_fd+0x1e1>
lea    0xc6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x450(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
call   1080 <add_user@plt>
jmp    1415 <handle_client_fd+0x2a5>
jmp    1415 <handle_client_fd+0x2a5>
jmp    1415 <handle_client_fd+0x2a5>
jmp    1415 <handle_client_fd+0x2a5>
mov    $0x0,%al
call   1090 <write_all_users@plt>
jmp    1415 <handle_client_fd+0x2a5>
jmp    1415 <handle_client_fd+0x2a5>
lea    0xc3c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1050 <close@plt>
mov    -0xc(%rbp),%edi
mov    0x2bcd(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rcx
call   1060 <epoll_ctl@plt>
jmp    1442 <handle_client_fd+0x2d2>
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_client_fd>:
push   %rbp
push   %r14
push   %rbx
sub    $0x450,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
mov    (%rdi),%eax
mov    0x2e26(%rip),%rcx
test   %eax,(%rcx)
jne    11c4 <handle_client_fd+0x34>
mov    0x2e13(%rip),%rcx
test   %eax,(%rcx)
jne    11c4 <handle_client_fd+0x34>
mov    0x2e00(%rip),%rcx
test   %eax,(%rcx)
je     11ee <handle_client_fd+0x5e>
mov    0x2e2d(%rip),%rax
mov    (%rax),%esi
mov    0x4(%rbx),%edx
mov    %r14d,%edi
mov    %rbx,%rcx
call   1080 <epoll_ctl@plt>
mov    %r14d,%edi
add    $0x450,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1070 <close@plt>
mov    0x2deb(%rip),%rcx
test   %eax,(%rcx)
je     1341 <handle_client_fd+0x1b1>
movq   $0x0,0x8(%rsp)
mov    0x4(%rbx),%edi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1090 <read@plt>
cltq
mov    %rax,0x8(%rsp)
cmp    $0xffffffff,%eax
jne    1232 <handle_client_fd+0xa2>
lea    0xe17(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rbx),%edi
lea    0x50(%rsp),%rsi
mov    $0x400,%edx
xor    %eax,%eax
call   1090 <read@plt>
cmp    $0xffffffff,%eax
jne    1267 <handle_client_fd+0xd7>
lea    0xdf8(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rbx),%edi
call   1070 <close@plt>
mov    %r14d,%edi
call   1070 <close@plt>
mov    0x4(%rbx),%edi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1050 <write@plt>
mov    0x4(%rbx),%edi
mov    0x8(%rsp),%rdx
lea    0x50(%rsp),%rsi
xor    %eax,%eax
call   1050 <write@plt>
mov    0x8(%rsp),%rax
movb   $0x0,0x50(%rsp,%rax,1)
movsbl 0x50(%rsp),%eax
add    $0xffffffcf,%eax
cmp    $0x6,%eax
ja     12bf <handle_client_fd+0x12f>
lea    0xd53(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd6e(%rip),%rdi
jmp    12c6 <handle_client_fd+0x136>
lea    0xd6a(%rip),%rdi
call   1040 <puts@plt>
jmp    1322 <handle_client_fd+0x192>
lea    0xd48(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpq   $0x3,0x8(%rsp)
jb     1302 <handle_client_fd+0x172>
mov    $0x2,%ebp
movsbl 0x50(%rsp,%rbp,1),%edi
mov    %dil,0xe(%rsp,%rbp,1)
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,0x8(%rsp)
ja     12e8 <handle_client_fd+0x158>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rbx),%esi
lea    0x10(%rsp),%rdi
call   10a0 <add_user@plt>
jmp    1322 <handle_client_fd+0x192>
xor    %eax,%eax
call   10b0 <write_all_users@plt>
mov    0x4(%rbx),%edi
call   1070 <close@plt>
mov    0x2cc7(%rip),%rax
mov    (%rax),%esi
mov    0x4(%rbx),%edx
mov    %r14d,%edi
mov    %rbx,%rcx
call   1080 <epoll_ctl@plt>
add    $0x450,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.epoll_event = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@EPOLLERR = global i32 0
@EPOLLRDHUP = global i32 0
@EPOLLHUP = global i32 0
@EPOLL_CTL_DEL = global i32 0
@EPOLLIN = global i32 0
@.str = [22 x i8] c"bytes reading error \0A\00"
@.str.1 = [16 x i8] c"reading error \0A\00"
@.str.2 = [6 x i8] c"one \0A\00"
@.str.3 = [15 x i8] c"Your nick is: \00"
@.str.4 = [3 x i8] c"%c\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [21 x i8] c"Wrong first number \0A\00"
define void @handle_client_fd(%struct.epoll_event* %0, i32 %1) {
%3 = alloca %struct.epoll_event*
%4 = alloca i32
%5 = alloca [1024 x i8]
%6 = alloca i64
%7 = alloca i32
%8 = alloca [50 x i8]
%9 = alloca i32
store %struct.epoll_event* %0, %struct.epoll_event** %3
store i32 %1, i32* %4
%10 = load %struct.epoll_event*, %struct.epoll_event** %3
%11 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load i32, i32* @EPOLLERR
%14 = and i32 %12, %13
%15 = icmp ne i32 %14, 0
br i1 %15, label %30, label %16
16: ; preds = %2
%17 = load %struct.epoll_event*, %struct.epoll_event** %3
%18 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %17, i32 0, i32 0
%19 = load i32, i32* %18
%20 = load i32, i32* @EPOLLRDHUP
%21 = and i32 %19, %20
%22 = icmp ne i32 %21, 0
br i1 %22, label %30, label %23
23: ; preds = %16
%24 = load %struct.epoll_event*, %struct.epoll_event** %3
%25 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %24, i32 0, i32 0
%26 = load i32, i32* %25
%27 = load i32, i32* @EPOLLHUP
%28 = and i32 %26, %27
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %41
30: ; preds = %23, %16, %2
%31 = load i32, i32* %4
%32 = load i32, i32* @EPOLL_CTL_DEL
%33 = load %struct.epoll_event*, %struct.epoll_event** %3
%34 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %33, i32 0, i32 1
%35 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %34, i32 0, i32 0
%36 = load i32, i32* %35
%37 = load %struct.epoll_event*, %struct.epoll_event** %3
%38 = call i32 @epoll_ctl(i32 %31, i32 %32, i32 %36, %struct.epoll_event* %37)
%39 = load i32, i32* %4
%40 = call i32 @close(i32 %39)
br label %153
41: ; preds = %23
%42 = load %struct.epoll_event*, %struct.epoll_event** %3
%43 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %42, i32 0, i32 0
%44 = load i32, i32* %43
%45 = load i32, i32* @EPOLLIN
%46 = and i32 %44, %45
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %152
48: ; preds = %41
store i64 0, i64* %6
%49 = load %struct.epoll_event*, %struct.epoll_event** %3
%50 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %49, i32 0, i32 1
%51 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %50, i32 0, i32 0
%52 = load i32, i32* %51
%53 = call i32 (i32, ...) @read(i32 %52, i64* %6, i64 8)
%54 = sext i32 %53 to i64
store i64 %54, i64* %6
%55 = load i64, i64* %6
%56 = icmp eq i64 %55, -1
br i1 %56, label %57, label %59
57: ; preds = %48
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %59
59: ; preds = %57, %48
%60 = load %struct.epoll_event*, %struct.epoll_event** %3
%61 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %60, i32 0, i32 1
%62 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %61, i32 0, i32 0
%63 = load i32, i32* %62
%64 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%65 = call i32 (i32, ...) @read(i32 %63, i8* %64, i32 1024)
%66 = icmp eq i32 %65, -1
br i1 %66, label %67, label %76
67: ; preds = %59
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%69 = load %struct.epoll_event*, %struct.epoll_event** %3
%70 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %69, i32 0, i32 1
%71 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %70, i32 0, i32 0
%72 = load i32, i32* %71
%73 = call i32 @close(i32 %72)
%74 = load i32, i32* %4
%75 = call i32 @close(i32 %74)
br label %76
76: ; preds = %67, %59
%77 = load %struct.epoll_event*, %struct.epoll_event** %3
%78 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %77, i32 0, i32 1
%79 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %78, i32 0, i32 0
%80 = load i32, i32* %79
%81 = call i32 (i32, ...) @write(i32 %80, i64* %6, i64 8)
%82 = load %struct.epoll_event*, %struct.epoll_event** %3
%83 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %82, i32 0, i32 1
%84 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %83, i32 0, i32 0
%85 = load i32, i32* %84
%86 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%87 = load i64, i64* %6
%88 = call i32 (i32, ...) @write(i32 %85, i8* %86, i64 %87)
%89 = load i64, i64* %6
%90 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 %89
store i8 0, i8* %90
%91 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%92 = load i8, i8* %91
%93 = sext i8 %92 to i32
switch i32 %93, label %136 [
i32 49, label %94
i32 50, label %96
i32 51, label %130
i32 52, label %131
i32 53, label %132
i32 54, label %133
i32 55, label %135
]
94: ; preds = %76
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %138
96: ; preds = %76
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %7
store i32 2, i32* %9
br label %98
98: ; preds = %119, %96
%99 = load i32, i32* %9
%100 = sext i32 %99 to i64
%101 = load i64, i64* %6
%102 = icmp ult i64 %100, %101
br i1 %102, label %103, label %122
103: ; preds = %98
%104 = load i32, i32* %9
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 %105
%107 = load i8, i8* %106
%108 = load i32, i32* %7
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 %109
store i8 %107, i8* %110
%111 = load i32, i32* %7
%112 = add nsw i32 %111, 1
store i32 %112, i32* %7
%113 = load i32, i32* %9
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 %114
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %117)
br label %119
119: ; preds = %103
%120 = load i32, i32* %9
%121 = add nsw i32 %120, 1
store i32 %121, i32* %9
br label %98
122: ; preds = %98
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%124 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%125 = load %struct.epoll_event*, %struct.epoll_event** %3
%126 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %125, i32 0, i32 1
%127 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %126, i32 0, i32 0
%128 = load i32, i32* %127
%129 = call i32 @add_user(i8* %124, i32 %128)
br label %138
130: ; preds = %76
br label %138
131: ; preds = %76
br label %138
132: ; preds = %76
br label %138
133: ; preds = %76
%134 = call i32 (...) @write_all_users()
br label %138
135: ; preds = %76
br label %138
136: ; preds = %76
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %138
138: ; preds = %136, %135, %133, %132, %131, %130, %122, %94
%139 = load %struct.epoll_event*, %struct.epoll_event** %3
%140 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %139, i32 0, i32 1
%141 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %140, i32 0, i32 0
%142 = load i32, i32* %141
%143 = call i32 @close(i32 %142)
%144 = load i32, i32* %4
%145 = load i32, i32* @EPOLL_CTL_DEL
%146 = load %struct.epoll_event*, %struct.epoll_event** %3
%147 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %146, i32 0, i32 1
%148 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %147, i32 0, i32 0
%149 = load i32, i32* %148
%150 = load %struct.epoll_event*, %struct.epoll_event** %3
%151 = call i32 @epoll_ctl(i32 %144, i32 %145, i32 %149, %struct.epoll_event* %150)
br label %152
152: ; preds = %138, %41
br label %153
153: ; preds = %152, %30
ret void
}

LLVM IR (-O2):
%struct.epoll_event = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@EPOLLERR = global i32 0
@EPOLLRDHUP = global i32 0
@EPOLLHUP = global i32 0
@EPOLL_CTL_DEL = global i32 0
@EPOLLIN = global i32 0
@.str.3 = [15 x i8] c"Your nick is: \00"
@str = [5 x i8] c"one \00"
@str.7 = [20 x i8] c"Wrong first number \00"
@str.8 = [15 x i8] c"reading error \00"
@str.9 = [21 x i8] c"bytes reading error \00"
define void @handle_client_fd(%struct.epoll_event* %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = alloca i64
%5 = alloca [50 x i8]
%6 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %0, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @EPOLLERR
%9 = and i32 %8, %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i32, i32* @EPOLLRDHUP
%13 = and i32 %12, %7
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i32, i32* @EPOLLHUP
%17 = and i32 %16, %7
%18 = icmp eq i32 %17, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %11, %2
%20 = load i32, i32* @EPOLL_CTL_DEL
%21 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %0, i64 0, i32 1, i32 0
%22 = load i32, i32* %21
%23 = tail call i32 @epoll_ctl(i32 %1, i32 %20, i32 %22, %struct.epoll_event* %0)
%24 = tail call i32 @close(i32 %1)
br label %91
25: ; preds = %15
%26 = load i32, i32* @EPOLLIN
%27 = and i32 %26, %7
%28 = icmp eq i32 %27, 0
br i1 %28, label %91, label %29
29: ; preds = %25
%30 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%31 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%32 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %0, i64 0, i32 1, i32 0
%33 = load i32, i32* %32
%34 = call i32 (i32, ...) @read(i32 %33, i64* %4, i64 8)
%35 = sext i32 %34 to i64
store i64 %35, i64* %4
%36 = icmp eq i32 %34, -1
br i1 %36, label %37, label %39
37: ; preds = %29
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.9, i64 0, i64 0))
br label %39
39: ; preds = %37, %29
%40 = load i32, i32* %32
%41 = call i32 (i32, ...) @read(i32 %40, i8* %30, i32 1024)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %48
43: ; preds = %39
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.8, i64 0, i64 0))
%45 = load i32, i32* %32
%46 = call i32 @close(i32 %45)
%47 = call i32 @close(i32 %1)
br label %48
48: ; preds = %43, %39
%49 = load i32, i32* %32
%50 = call i32 (i32, ...) @write(i32 %49, i64* %4, i64 8)
%51 = load i32, i32* %32
%52 = load i64, i64* %4
%53 = call i32 (i32, ...) @write(i32 %51, i8* %30, i64 %52)
%54 = load i64, i64* %4
%55 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %54
store i8 0, i8* %55
%56 = load i8, i8* %30
%57 = sext i8 %56 to i32
switch i32 %57, label %83 [
i32 49, label %58
i32 50, label %60
i32 51, label %85
i32 52, label %85
i32 53, label %85
i32 54, label %81
i32 55, label %85
]
58: ; preds = %48
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %85
60: ; preds = %48
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%62 = load i64, i64* %4
%63 = icmp ugt i64 %62, 2
br i1 %63, label %64, label %76
64: ; preds = %60, %64
%65 = phi i64 [ %70, %64 ], [ 0, %60 ]
%66 = phi i64 [ %73, %64 ], [ 2, %60 ]
%67 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 %65
store i8 %68, i8* %69
%70 = add nuw i64 %65, 1
%71 = sext i8 %68 to i32
%72 = call i32 @putchar(i32 %71)
%73 = add nuw i64 %66, 1
%74 = load i64, i64* %4
%75 = icmp ugt i64 %74, %73
br i1 %75, label %64, label %76
76: ; preds = %64, %60
%77 = call i32 @putchar(i32 10)
%78 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%79 = load i32, i32* %32
%80 = call i32 @add_user(i8* %78, i32 %79)
br label %85
81: ; preds = %48
%82 = call i32 (...) @write_all_users()
br label %85
83: ; preds = %48
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0))
br label %85
85: ; preds = %83, %48, %81, %48, %48, %48, %76, %58
%86 = load i32, i32* %32
%87 = call i32 @close(i32 %86)
%88 = load i32, i32* @EPOLL_CTL_DEL
%89 = load i32, i32* %32
%90 = call i32 @epoll_ctl(i32 %1, i32 %88, i32 %89, %struct.epoll_event* %0)
br label %91
91: ; preds = %25, %85, %19
ret void
}