// File: /workspace/github_c_makefile_star2_O0/niuyuling[P]CProxy/main.c
// Function: tcp_loop
void *tcp_loop(void *p)
{
    conf *configure = (conf *) p;
    int n;

    ev.events = EPOLLIN;
    ev.data.fd = server_sock;
    if (-1 == epoll_ctl(epollfd, EPOLL_CTL_ADD, server_sock, &ev)) {
        exit(1);
    }

    ev.events = EPOLLIN;
    ev.data.fd = server_sock6;
    if (-1 == epoll_ctl(epollfd, EPOLL_CTL_ADD, server_sock6, &ev)) {
        exit(1);
    }

    while (1) {
        n = epoll_wait(epollfd, events, MAX_CONNECTION, -1);
        while (n-- > 0) {
            if (events[n].data.fd == server_sock6) {
                accept_client6();
            } else if (events[n].data.fd == server_sock) {
                accept_client();
            } else {
                if (events[n].events & EPOLLIN) {
                    tcp_in((conn_t *) events[n].data.ptr, configure);
                }
                if (events[n].events & EPOLLOUT) {
                    tcp_out((conn_t *) events[n].data.ptr);
                }
            }
        }
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x1, 0x1688e(%rip)     # 0x193dc
movl 0x1687c(%rip), %eax     # 0x193d0
movl %eax, 0x16886(%rip)     # 0x193e0
movl 0x16874(%rip), %edi     # 0x193d4
movl 0x1686a(%rip), %edx     # 0x193d0
movl $0x1, %esi
leaq 0x1686a(%rip), %rcx     # 0x193dc
callq 0x2240
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x2b8c
movl $0x1, %edi
callq 0x24e0
movl $0x1, 0x16846(%rip)     # 0x193dc
movl 0x1683c(%rip), %eax     # 0x193d8
movl %eax, 0x1683e(%rip)     # 0x193e0
movl 0x1682c(%rip), %edi     # 0x193d4
movl 0x1682a(%rip), %edx     # 0x193d8
movl $0x1, %esi
leaq 0x16822(%rip), %rcx     # 0x193dc
callq 0x2240
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x2bd4
movl $0x1, %edi
callq 0x24e0
jmp 0x2bd6
movl 0x167f8(%rip), %edi     # 0x193d4
leaq 0x1680d(%rip), %rsi     # 0x193f0
movl $0x3fc, %edx            # imm = 0x3FC
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x2410
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x14(%rbp)
cmpl $0x0, %eax
jle 0x2ccf
movslq -0x14(%rbp), %rcx
leaq 0x167dc(%rip), %rax     # 0x193f0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpl 0x167b4(%rip), %eax     # 0x193d8
jne 0x2c30
callq 0x2a20
jmp 0x2cca
movslq -0x14(%rbp), %rcx
leaq 0x167b5(%rip), %rax     # 0x193f0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpl 0x16785(%rip), %eax     # 0x193d0
jne 0x2c54
callq 0x2910
jmp 0x2cc8
movslq -0x14(%rbp), %rcx
leaq 0x16791(%rip), %rax     # 0x193f0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2c8f
movslq -0x14(%rbp), %rcx
leaq 0x16775(%rip), %rax     # 0x193f0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq 0x4(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x42b0
movslq -0x14(%rbp), %rcx
leaq 0x16756(%rip), %rax     # 0x193f0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x2cc6
movslq -0x14(%rbp), %rcx
leaq 0x1673a(%rip), %rax     # 0x193f0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq 0x4(%rax), %rdi
callq 0x4a40
jmp 0x2cc8
jmp 0x2cca
jmp 0x2bf5
jmp 0x2bd6
nopw %cs:(%rax,%rax)