LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, 0x13876(%rip)     # 0x1637c
leaq 0x1386f(%rip), %rcx     # 0x1637c
movl 0x1385d(%rip), %edx     # 0x16370
movl %edx, 0x13867(%rip)     # 0x16380
movl 0x13855(%rip), %edi     # 0x16374
movl $0x1, %esi
callq 0x2220
cmpl $-0x1, %eax
je 0x2bf6
movl $0x1, 0x13840(%rip)     # 0x1637c
leaq 0x13839(%rip), %rcx     # 0x1637c
movl 0x1382f(%rip), %edx     # 0x16378
movl %edx, 0x13831(%rip)     # 0x16380
movl 0x1381f(%rip), %edi     # 0x16374
movl $0x1, %esi
callq 0x2220
cmpl $-0x1, %eax
je 0x2bf6
leaq 0x13821(%rip), %r14     # 0x16390
movl 0x137ff(%rip), %edi     # 0x16374
movq %r14, %rsi
movl $0x3fc, %edx            # imm = 0x3FC
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x23e0
testl %eax, %eax
jle 0x2b6f
movl %eax, %r15d
leaq (%r15,%r15,2), %rax
incq %r15
leaq (%r14,%rax,4), %r12
addq $-0x8, %r12
movl (%r12), %eax
cmpl 0x137d1(%rip), %eax     # 0x16378
jne 0x2bb0
callq 0x2a34
jmp 0x2be4
cmpl 0x137ba(%rip), %eax     # 0x16370
jne 0x2bbf
callq 0x297a
jmp 0x2be4
testb $0x1, -0x4(%r12)
je 0x2bd3
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x3a28
testb $0x4, -0x4(%r12)
je 0x2be4
movq (%r12), %rdi
callq 0x3f2d
decq %r15
addq $-0xc, %r12
cmpq $0x1, %r15
jg 0x2b9d
jmp 0x2b6f
movl $0x1, %edi
callq 0x24a0
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/main.c
// Function: get_executable_path
int get_executable_path(char *processdir, char *processname, int len)
{
    char *filename;
    if (readlink("/proc/self/exe", processdir, len) <= 0)
        return -1;
    filename = strrchr(processdir, '/');
    if (filename == NULL)
        return -1;
    ++filename;
    strcpy(processname, filename);
    *filename = '\0';
    return (int)(filename - processdir);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movslq %edx, %rdx
leaq 0x62e9(%rip), %rdi      # 0x90c1
movq %rbx, %rsi
callq 0x20c0
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testq %rax, %rax
jle 0x2e1a
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x2190
testq %rax, %rax
je 0x2e1a
movq %rax, %r12
movq %rax, %r14
incq %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x2080
movb $0x0, 0x1(%r12)
subl %ebx, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/main.c
// Function: server_ini
void server_ini()
{
    signal(SIGPIPE, SIG_IGN);   // 忽略PIPE信号

    if (daemon(1, 1)) {
        perror("daemon");
        return;
    }

    while (process-- > 1 && fork() == 0);
}

// Assembly:
pushq %rax
movl $0x1, %esi
movl $0xd, %edi
callq 0x2290
movl $0x1, %edi
movl $0x1, %esi
callq 0x2390
testl %eax, %eax
jne 0x2e6b
movl 0x1651a(%rip), %eax     # 0x1936c
leal -0x1(%rax), %ecx
movl %ecx, 0x16511(%rip)     # 0x1936c
cmpl $0x2, %eax
jl 0x2e69
callq 0x2520
testl %eax, %eax
je 0x2e4c
popq %rax
retq
leaq 0x625e(%rip), %rdi      # 0x90d0
popq %rax
jmp 0x2450
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/main.c
// Function: udp_listen
int udp_listen(char *ip, int port)
{
    struct sockaddr_in addr;
    int fd, opt = 1;

    if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
        perror("udp socket");
        exit(1);
    }
    setsockopt(fd, SOL_IP, IP_TRANSPARENT, &opt, sizeof(opt));
    setsockopt(fd, SOL_IP, IP_RECVORIGDSTADDR, &opt, sizeof(opt));
    memset(&addr, 0, sizeof(addr));
    addr.sin_addr.s_addr = inet_addr(ip);
    addr.sin_port = htons(port);
    addr.sin_family = AF_INET;
    if (bind(fd, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
        perror("udp bind");
        exit(1);
    }

    return fd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movq %rdi, %r14
movl $0x1, 0xc(%rsp)
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x2540
testl %eax, %eax
js 0x2f20
movl %eax, %ebx
leaq 0xc(%rsp), %r15
movl %eax, %edi
xorl %esi, %esi
movl $0x13, %edx
movq %r15, %rcx
movl $0x4, %r8d
callq 0x20b0
movl %ebx, %edi
xorl %esi, %esi
movl $0x14, %edx
movq %r15, %rcx
movl $0x4, %r8d
callq 0x20b0
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, (%r15)
movq %r14, %rdi
callq 0x2270
movl %eax, 0x4(%r15)
rolw $0x8, %bp
movw %bp, 0x2(%r15)
movw $0x2, (%r15)
movl %ebx, %edi
movq %r15, %rsi
movl $0x10, %edx
callq 0x2400
testl %eax, %eax
jne 0x2f25
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x264a
callq 0x2635
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/main.c
// Function: timeout_check
void *timeout_check(void *nullPtr)
{
    while (1) {
        sleep(60);
        if (server_sock >= 0 || server_sock6 >= 0)
            tcp_timeout_check(NULL);
        if (global.dns_listen_fd >= 0)
            dns_timeout_check();
        if (global.udp_listen_fd >= 0)
            udp_timeout_check();
    }

    return NULL;
}

// Assembly:
pushq %rax
movl $0x3c, %edi
callq 0x24f0
cmpl $0x0, 0x13434(%rip)     # 0x16370
jns 0x2f47
cmpl $0x0, 0x13433(%rip)     # 0x16378
js 0x2f4e
xorl %edi, %edi
callq 0x37c7
cmpl $0x0, 0x1641f(%rip)     # 0x19374
js 0x2f5e
xorl %eax, %eax
callq 0x5ac2
cmpl $0x0, 0x16413(%rip)     # 0x19378
js 0x2f2b
xorl %eax, %eax
callq 0x6a84
jmp 0x2f2b
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/main.c
// Function: thread_loop
void thread_loop(conf * configure)
{
    pthread_t thread_id = 0;
    /*
    sigset_t signal_mask;
    sigemptyset(&signal_mask);
    sigaddset(&signal_mask, SIGPIPE); // 忽略PIPE信号
    if (pthread_sigmask(SIG_BLOCK, &signal_mask, NULL) != 0) {
        printf("block sigpipe error\n");
    }
    */
    
    if (global.timeout_m)
        pthread_create(&thread_id, NULL, &timeout_check, NULL);
    
    if (server_sock >= 0)
    {
        if (global.dns_listen_fd >= 0) {
            dns_init();
            pthread_create(&thread_id, NULL, &dns_loop, NULL);
        }
        if (global.udp_listen_fd >= 0) {
            udp_init();
            //udp_loop(NULL);
            pthread_create(&thread_id, NULL, &udp_loop, NULL);
        }
        
        if (pthread_create(&thread_id, NULL, &tcp_loop, (void *)configure) != 0)
            perror("pthread_create");
    }
    
    if (global.dns_listen_fd >= 0)
    {
        dns_init();
        if (global.udp_listen_fd >= 0)
        {
            udp_init();
            pthread_create(&thread_id, NULL, &udp_loop, NULL);
        }
        dns_loop(NULL);
    }

    udp_init();
    udp_loop(NULL);

    //pthread_join(thread_id, NULL);
    //pthread_exit(NULL);

    /*  线程分离
       pthread_attr_t attr;
       pthread_attr_init(&attr);
       pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
       pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
       pthread_create(&thread_id, &attr, &tcp_timeout_check, NULL);
       pthread_create(&thread_id, &attr, &tcp_loop, (void *)configure);
       pthread_exit(NULL);
     */
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq $0x0, 0x8(%rsp)
cmpl $0x0, 0x161ef(%rip)     # 0x19384
je 0x31ac
leaq -0x274(%rip), %rdx      # 0x2f2a
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x2410
cmpl $0x0, 0x131bd(%rip)     # 0x16370
js 0x3219
cmpl $0x0, 0x161b8(%rip)     # 0x19374
js 0x31da
xorl %eax, %eax
callq 0x5b84
leaq 0x2dae(%rip), %rdx      # 0x5f7a
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x2410
cmpl $0x0, 0x16197(%rip)     # 0x19378
js 0x31ff
xorl %eax, %eax
callq 0x6b63
leaq 0x3cb7(%rip), %rdx      # 0x6ea8
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x2410
leaq -0x715(%rip), %rdx      # 0x2af1
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movq %rbx, %rcx
callq 0x2410
testl %eax, %eax
jne 0x3269
cmpl $0x0, 0x16154(%rip)     # 0x19374
js 0x3255
xorl %eax, %eax
callq 0x5b84
cmpl $0x0, 0x16148(%rip)     # 0x19378
js 0x324e
xorl %eax, %eax
callq 0x6b63
leaq 0x3c68(%rip), %rdx      # 0x6ea8
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x2410
xorl %edi, %edi
callq 0x5f7a
xorl %eax, %eax
callq 0x6b63
xorl %edi, %edi
callq 0x6ea8
addq $0x10, %rsp
popq %rbx
retq
leaq 0x5e9c(%rip), %rdi      # 0x910c
callq 0x2450
jmp 0x3219
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_proxy.c
// Function: tcp_timeout_check
void *tcp_timeout_check(void *nullPtr)
{
    int i;

    for (i = 0; i < MAX_CONNECTION; i += 2) {
        if (cts[i].fd > -1) {
            if (cts[i].timer >= timeout_minute) {
                printf("关闭连接\n");
                close_connection(cts + i);
            } else
                cts[i].timer++;
        }
    }

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq $-0x2, %r15
leaq 0x8c36(%rip), %rbx      # 0xc410
leaq 0x5b6d(%rip), %r14      # 0x934e
cmpl $0x0, 0x10(%rbx)
js 0x3809
movl 0x20(%rbx), %eax
cmpl 0x15d40(%rip), %eax     # 0x19530
jge 0x37f9
incl %eax
movl %eax, 0x20(%rbx)
jmp 0x3809
movq %r14, %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x3822
addq $0x2, %r15
addq $0x50, %rbx
cmpq $0x3fa, %r15            # imm = 0x3FA
jb 0x37e1
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_proxy.c
// Function: close_connection
void close_connection(conn_t * conn)
{
    epoll_ctl(epollfd, EPOLL_CTL_DEL, conn->fd, NULL);
    close(conn->fd);
    if ((conn - cts) & 1) {
        char *server_data;

        server_data = conn->ready_data;
        memset(conn, 0, sizeof(conn_t));
        conn->ready_data = server_data;
        conn--->fd = -1;
    } else {
        free(conn->ready_data);
        free(conn->incomplete_data);
        memset(conn, 0, sizeof(conn_t));
        conn++->fd = -1;
    }
    if (conn->fd >= 0)
        close_connection(conn);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x12b44(%rip), %r14     # 0x16374
leal 0x8bda(%rip), %ebp      # 0xc410
movl (%r14), %edi
movl 0x10(%rbx), %edx
movl $0x2, %esi
xorl %ecx, %ecx
callq 0x2220
movl 0x10(%rbx), %edi
callq 0x21e0
movl %ebx, %eax
subl %ebp, %eax
btl $0x3, %eax
movq (%rbx), %rdi
jb 0x3884
callq 0x2030
movq 0x8(%rbx), %rdi
callq 0x2030
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movq $0x0, 0x20(%rbx)
movl $0x28, %eax
jmp 0x38a0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
movq %rdi, (%rbx)
movq $-0x28, %rax
movl $0xffffffff, 0x10(%rbx) # imm = 0xFFFFFFFF
cmpl $0x0, 0x10(%rbx,%rax)
leaq (%rbx,%rax), %rbx
jns 0x3836
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_proxy.c
// Function: clientToserver
void clientToserver(conn_t * in)
{
    int write_len;
    conn_t *remote;
    remote = in + 1;

    write_len = write(remote->fd, in->ready_data, in->ready_data_len);
    if (write_len == in->ready_data_len) {
        in->ready_data_len = 0;
        in->ready_data = NULL;
    } else {
        close_connection(remote);
    }

    return;

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x38(%rdi), %edi
movq (%rbx), %rsi
movslq 0x14(%rbx), %rdx
callq 0x20e0
cmpl %eax, 0x14(%rbx)
jne 0x38df
movl $0x0, 0x14(%rbx)
movq $0x0, (%rbx)
popq %rbx
retq
addq $0x28, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x3822
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_proxy.c
// Function: serverToClient
static void serverToClient(conn_t * server)
{
    conn_t *client;
    int write_len;

    client = server - 1;
    while ((server->ready_data_len = read(server->fd, server->ready_data, BUFFER_SIZE)) > 0) {
        dataEncode(server->ready_data, server->ready_data_len, sslEncodeCode);
        write_len = write(client->fd, server->ready_data, server->ready_data_len);
        if (write_len <= 0) {
            if (write_len == 0 || errno != EAGAIN)
                close_connection(server);
            else
                server->sent_len = 0;
            return;
        } else if (write_len < server->ready_data_len) {
            server->sent_len = write_len;
            ev.events = EPOLLIN | EPOLLOUT | EPOLLET;
            ev.data.ptr = client;
            epoll_ctl(epollfd, EPOLL_CTL_MOD, client->fd, &ev);
            return;
        }
        if (server->ready_data_len < BUFFER_SIZE)
            break;
    }
    //判断是否关闭连接
    if (server->ready_data_len == 0 || (server->ready_data_len == -1 && errno != EAGAIN))
        close_connection(server);
    else
        server->ready_data_len = server->sent_len = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq -0x28(%rdi), %r14
movl 0x10(%rbx), %edi
movq (%rbx), %rsi
movl $0x2000, %edx           # imm = 0x2000
callq 0x2240
movl %eax, 0x14(%rbx)
testl %eax, %eax
jle 0x3e08
movq (%rbx), %rcx
movb 0x15883(%rip), %dl      # 0x19654
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
incq %rax
xorb %dl, -0x2(%rcx,%rax)
decq %rax
cmpq $0x1, %rax
jg 0x3dd9
movl -0x18(%rbx), %edi
movq (%rbx), %rsi
movslq 0x14(%rbx), %rdx
callq 0x20e0
testl %eax, %eax
jle 0x3e28
movl 0x14(%rbx), %ecx
cmpl %eax, %ecx
jg 0x3e52
cmpl $0x1fff, %ecx           # imm = 0x1FFF
jg 0x3db1
movl 0x14(%rbx), %eax
testl %eax, %eax
je 0x3e43
cmpl $-0x1, %eax
jne 0x3e1e
callq 0x2050
cmpl $0xb, (%rax)
jne 0x3e43
xorl %eax, %eax
movl %eax, 0x1c(%rbx)
movl %eax, 0x14(%rbx)
jmp 0x3e3b
je 0x3e43
callq 0x2050
cmpl $0xb, (%rax)
jne 0x3e43
movl $0x0, 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3822
movl %eax, 0x1c(%rbx)
leaq 0x12520(%rip), %rcx     # 0x1637c
movl $0x80000005, (%rcx)     # imm = 0x80000005
movq %r14, 0x4(%rcx)
leaq 0x12507(%rip), %rax     # 0x16374
movl (%rax), %edi
movl -0x18(%rbx), %edx
movl $0x3, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2220
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_proxy.c
// Function: copy_data
static int8_t copy_data(conn_t * ct)
{
    dataEncode(ct->incomplete_data, ct->incomplete_data_len, sslEncodeCode);

    if (ct->ready_data) {
        char *new_data;

        new_data = (char *)realloc(ct->ready_data, ct->ready_data_len + ct->incomplete_data_len);
        if (new_data == NULL)
            return 1;
        ct->ready_data = new_data;
        memcpy(new_data + ct->ready_data_len, ct->incomplete_data, ct->incomplete_data_len);
        ct->ready_data_len += ct->incomplete_data_len;
        free(ct->incomplete_data);
    } else {
        ct->ready_data = ct->incomplete_data;
        ct->ready_data_len = ct->incomplete_data_len;
    }
    ct->incomplete_data = NULL;
    ct->incomplete_data_len = 0;

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x18(%rdi), %rax
testq %rax, %rax
jle 0x3eb1
movq 0x8(%rbx), %rcx
movb 0x157b3(%rip), %dl      # 0x19654
incq %rax
xorb %dl, -0x2(%rcx,%rax)
decq %rax
cmpq $0x1, %rax
jg 0x3ea4
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3eff
movslq 0x14(%rbx), %rax
movslq 0x18(%rbx), %rsi
addq %rax, %rsi
callq 0x23c0
testq %rax, %rax
je 0x3f1f
movq %rax, (%rbx)
movslq 0x14(%rbx), %r12
addq %r12, %rax
movq 0x8(%rbx), %r14
movslq 0x18(%rbx), %r15
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x22d0
leal (%r15,%r12), %eax
movl %eax, 0x14(%rbx)
movq %r14, %rdi
callq 0x2030
jmp 0x3f0c
movq 0x8(%rbx), %rax
movq %rax, (%rbx)
movl 0x18(%rbx), %eax
movl %eax, 0x14(%rbx)
movq $0x0, 0x8(%rbx)
movl $0x0, 0x18(%rbx)
xorl %eax, %eax
jmp 0x3f21
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_proxy.c
// Function: tcp_out
void tcp_out(conn_t * to)
{
    conn_t *from;
    int write_len;

    if (to->fd == -1)
        return;
    else if ((to - cts) & 1)
        from = to - 1;
    else
        from = to + 1;
    from->timer = to->timer = 0;

    write_len = write(to->fd, from->ready_data + from->sent_len, from->ready_data_len - from->sent_len);
    if (write_len == from->ready_data_len - from->sent_len) {
        //服务端的数据可能没全部写入到客户端
        if ((from - cts) & 1) {
            serverToClient(from);
            if (from->fd >= 0 && from->ready_data_len == 0) {
                ev.events = EPOLLIN | EPOLLET;
                ev.data.ptr = to;
                epoll_ctl(epollfd, EPOLL_CTL_MOD, to->fd, &ev);
            }
        } else {
            ev.events = EPOLLIN | EPOLLET;
            ev.data.ptr = to;
            epoll_ctl(epollfd, EPOLL_CTL_MOD, to->fd, &ev);
            free(from->ready_data);
            from->ready_data = NULL;
            from->ready_data_len = 0;
        }
    } else if (write_len > 0) {
        from->sent_len += write_len;
        ev.events = EPOLLIN | EPOLLOUT | EPOLLET;
        ev.data.ptr = to;
        epoll_ctl(epollfd, EPOLL_CTL_MOD, to->fd, &ev);
    } else if (errno != EAGAIN) {
        close_connection(to);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x10(%rdi), %edi
cmpl $-0x1, %edi
je 0x403f
leal 0x84ca(%rip), %eax      # 0xc410
movl %ebx, %ecx
subl %eax, %ecx
leaq -0x28(%rbx), %r14
leaq 0x28(%rbx), %rax
btl $0x3, %ecx
cmovaeq %rax, %r14
xorl %eax, %eax
movl %eax, 0x20(%rbx)
movl %eax, 0x20(%r14)
movslq 0x1c(%r14), %rax
movq (%r14), %rsi
addq %rax, %rsi
movslq 0x14(%r14), %rdx
subq %rax, %rdx
callq 0x20e0
movl 0x14(%r14), %edx
movl 0x1c(%r14), %ecx
subl %ecx, %edx
cmpl %eax, %edx
jne 0x3fd8
leal 0x8483(%rip), %eax      # 0xc410
movl %r14d, %ecx
subl %eax, %ecx
btl $0x3, %ecx
jb 0x4010
leaq 0x123dd(%rip), %rcx     # 0x1637c
movl $0x80000001, (%rcx)     # imm = 0x80000001
movq %rbx, 0x4(%rcx)
leaq 0x123c4(%rip), %rax     # 0x16374
movl (%rax), %edi
movl 0x10(%rbx), %edx
movl $0x3, %esi
callq 0x2220
movq (%r14), %rdi
callq 0x2030
movq $0x0, (%r14)
movl $0x0, 0x14(%r14)
jmp 0x403f
testl %eax, %eax
jle 0x4035
addl %eax, %ecx
movl %ecx, 0x1c(%r14)
leaq 0x12393(%rip), %rcx     # 0x1637c
movl $0x80000005, (%rcx)     # imm = 0x80000005
movq %rbx, 0x4(%rcx)
leaq 0x1237a(%rip), %rax     # 0x16374
movl (%rax), %edi
movl 0x10(%rbx), %edx
movl $0x3, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2220
movq %r14, %rdi
callq 0x3da6
cmpl $0x0, 0x10(%r14)
js 0x403f
cmpl $0x0, 0x14(%r14)
jne 0x403f
leaq 0x1234f(%rip), %rcx     # 0x1637c
movl $0x80000001, (%rcx)     # imm = 0x80000001
jmp 0x3fef
callq 0x2050
cmpl $0xb, (%rax)
jne 0x4047
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3822
nop
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_request.c
// Function: copy_new_mem
int8_t copy_new_mem(char *src, int src_len, char **dest)
{
    *dest = (char *)malloc(src_len + 1);
    if (*dest == NULL)
        return 1;
    memcpy(*dest, src, src_len);
    *((*dest) + src_len) = '\0';

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movl %esi, %r14d
movq %rdi, %rbx
leal 0x1(%r14), %eax
movslq %eax, %rdi
callq 0x2320
movq %rax, (%r12)
testq %rax, %rax
je 0x40c1
movq %rax, %r15
movslq %r14d, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x22d0
movb $0x0, (%r15,%r14)
xorl %eax, %eax
jmp 0x40c3
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_request.c
// Function: get_http_path
char *get_http_path(char *url, int url_len, char *path)
{
    char *_p0, *_p1;
    _p0 = _p1 = NULL;

    _p1 = strchr(url, '\0');

    if (url_len > 7) {
        if (url) {
            _p0 = strstr(url + 7, "/");
            if (_p0)
                return memcpy(path, _p0, _p1 - _p0);
            else
                return memcpy(path, "/", 1); // 如果没有资源路径就默认"/"
        }
    } else {
        return memcpy(path, "/", 1);
    }

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x2140
cmpl $0x8, %ebp
jl 0x4802
testq %r14, %r14
je 0x4807
movq %rax, %r15
leaq 0x7(%r14), %rdi
movl $0x2f, %esi
callq 0x2160
testq %rax, %rax
je 0x4802
addq %r15, %r14
subq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x22d0
movb $0x2f, (%rbx)
jmp 0x4809
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_request.c
// Function: get_http_host_port_len
void get_http_host_port_len(char *head, int *host_len, int *port_len)
{
    *host_len = 0;
    *port_len = 0;
    char *_p1 = strstr(head, "Host"); // 判断Host行
    if (_p1) {                  // 为真时
        char *_p2 = strstr(_p1, "\n");
        *host_len = (int)(_p2 - _p1);

        char host[*host_len + 1];
        memcpy(host, _p1, *host_len);
        host[*host_len] = '\0';

        char *_p3 = strrchr(host, ':');
        char *_p4 = strchr(host, '\0');
        if (_p3) {
            *port_len = _p4 - (_p3 + 1);
        } else {
            *port_len = *host_len;
        }
    } else {                    // 为假时
        char *_p1 = strstr(head, "host");
        if (_p1) {
            char *_p2 = strstr(_p1, "\n");
            *host_len = (int)(_p2 - _p1);

            char host[*host_len + 1];
            memcpy(host, _p1, *host_len);
            host[*host_len] = '\0';

            char *_p3 = strrchr(host, ':');
            char *_p4 = strchr(host, '\0');
            if (_p3) {
                *port_len = _p4 - (_p3 + 1);
            } else {
                *port_len = *host_len;
            }
        } else {                // 未找到时使用HTTP_HEAD_CACHE_SIZE大小
            *host_len = HTTP_HEAD_HOST_CACHE_SIZE;
            *port_len = HTTP_HEAD_HOST_CACHE_SIZE / 10;
        }
    }

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
xorl %eax, %eax
movl %eax, (%rsi)
movl %eax, (%rdx)
leaq 0x4b48(%rip), %rsi      # 0x9383
callq 0x2530
testq %rax, %rax
jne 0x485d
leaq 0x4b3c(%rip), %rsi      # 0x9388
movq %r12, %rdi
callq 0x2530
testq %rax, %rax
je 0x48e7
movq %rax, %r15
movq %rbx, -0x30(%rbp)
movq %rax, %rdi
movl $0xa, %esi
callq 0x2160
movq %rsp, %r13
subl %r15d, %eax
movl %eax, (%r14)
incl %eax
addq $0xf, %rax
andq $-0x10, %rax
movq %rsp, %r12
subq %rax, %r12
movq %r12, %rsp
movl (%r14), %ebx
movslq %ebx, %r14
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x22d0
movb $0x0, (%r14,%r12)
movq %r12, %rdi
movl $0x3a, %esi
callq 0x2190
testq %rax, %rax
je 0x48cf
movq %rax, %r14
movq %r12, %rdi
callq 0x2140
addl %r12d, %eax
notl %r14d
addl %eax, %r14d
movl %r14d, %ebx
movq -0x30(%rbp), %rax
movl %ebx, (%rax)
movq %r13, %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x400, (%r14)          # imm = 0x400
movl $0x66, (%rbx)
jmp 0x48d8
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_request.c
// Function: free_http_request
void free_http_request(struct http_request *http_request)
{
    if (http_request->method)
        free(http_request->method);
    if (http_request->U)
        free(http_request->U);
    if (http_request->version)
        free(http_request->version);
    if (http_request->host)
        free(http_request->host);
    if (http_request->port)
        free(http_request->port);
    if (http_request->H)
        free(http_request->H);
    if (http_request->url)
        free(http_request->url);
    if (http_request->uri)
        free(http_request->uri);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x4907
callq 0x2030
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x4915
callq 0x2030
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x4923
callq 0x2030
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x4931
callq 0x2030
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x493f
callq 0x2030
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x494d
callq 0x2030
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x495b
callq 0x2030
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x496a
popq %rbx
jmp 0x2030
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_request.c
// Function: delete_head
static char *delete_head(char *head, int *head_len, const char *needle, int string)
{
    char *temp_stack;
    char *_p1, *_p2, *_p3;
    _p1 = _p2 = _p3 = NULL;
    int temp_stack_len;

    _p1 = strstr(head, needle); // _p1指向head字符串中的"needle"字符处(needle字符串的第一个字符)
    if (_p1 == NULL) {
        //perror("_p1 HEAD NULL");
        return head;
    }
    _p2 = strchr(_p1, string);  // _p2指向head字符串中"string"字符到末尾中的'\0'
    if (_p2 == NULL) {
        //perror("_p2 HEAD NULL");
        return head;
    }
    _p3 = strchr(_p1, '\0');    // _p3指向head字符串末尾的'\0'
    if (_p3 == NULL) {
        //perror("_p3 HEAD NULL");
        return head;
    }
    temp_stack_len = (_p1 - head) + (_p3 - _p2);
    temp_stack = (char *)alloca(temp_stack_len + 1); // 分配临时栈内存，长度是去除needle到string处
    if (temp_stack == NULL) {
        perror("alloca");
        return head;
    }
    memset(temp_stack, 0, temp_stack_len + 1);
    memmove(temp_stack, head, (_p1 - head) - 1);
    strncat(temp_stack, _p2, _p3 - _p2);

    memset(head, 0, *head_len);
    *head_len = temp_stack_len;
    return memmove(head, temp_stack, temp_stack_len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x2530
testq %rax, %rax
je 0x5517
movq %rax, %r15
movq %rax, %rdi
movl $0xa, %esi
callq 0x2160
testq %rax, %rax
je 0x5517
movq %rax, %r12
movq %r15, %rdi
callq 0x2140
leaq (%rax,%r15), %r13
subq %rbx, %r15
subq %r12, %r13
leaq (%r15,%r13), %rax
movq %rax, -0x38(%rbp)
incl %eax
movslq %eax, %rdx
leaq 0xf(%rdx), %rax
andq $-0x10, %rax
movq %r14, -0x30(%rbp)
movq %rsp, %r14
subq %rax, %r14
movq %r14, %rsp
movq %r14, %rdi
xorl %esi, %esi
callq 0x21b0
decq %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x22d0
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x21d0
movq -0x30(%rbp), %r15
movslq (%r15), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x21b0
movq -0x38(%rbp), %rax
movl %eax, (%r15)
movslq %eax, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22d0
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_request.c
// Function: splice_head
static char *splice_head(char *head, int *head_len, const char *needle, char *string, int string_len)
{
    char *tail_head;
    char *_p0;
    char *_p1;

    _p1 = strstr(head, needle);
    if (_p1 == NULL) {
        return head;
    }
    _p1 = _p1 + 1;
    _p0 = strchr(_p1, '\0');

    tail_head = (char *)alloca((_p0 - _p1) + 1);
    if (tail_head == NULL) {
        perror("alloca");
        return head;
    }
    memset(tail_head, 0, (_p0 - _p1) + 1);
    memcpy(tail_head, _p1, (_p0 - _p1));

    memset(head, 0, *head_len);
    memcpy(head, string, string_len);
    strncat(head, tail_head, (_p0 - _p1));
    *head_len = string_len + (_p0 - _p1);
    return head;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r13d
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl $0xa, %esi
callq 0x2160
testq %rax, %rax
je 0x55cf
movq %rax, %r12
incq %r12
movq %r12, %rdi
callq 0x2140
movl %r13d, -0x2c(%rbp)
movq %rax, %r13
leaq 0x1(%rax), %rdx
movq %r15, -0x38(%rbp)
movq %rsp, %r15
addq $0x10, %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movq %r15, %rdi
xorl %esi, %esi
callq 0x21b0
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x22d0
movslq (%r14), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x21b0
movslq -0x2c(%rbp), %r12
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
movq %r12, %rdx
callq 0x22d0
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x21d0
addl %r13d, %r12d
movl %r12d, (%r14)
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/http_request.c
// Function: conf_handle_strrep
static char *conf_handle_strrep(char *str, int *str_len, tcp * temp)
{
    tcp *p = temp;

    while (p) {
        if (p->strrep) {
            str = replace(str, str_len, p->strrep_s, p->strrep_s_len, p->strrep_t, p->strrep_t_len);
        }

        p = p->next;
    }

    return str;
}

// Assembly:
movq %rdi, %rax
testq %rdx, %rdx
je 0x5623
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
cmpq $0x0, (%rbx)
je 0x5613
movl 0x20(%rbx), %ecx
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %r8
movl 0x24(%rbx), %r9d
movq %rax, %rdi
movq %r14, %rsi
callq 0x40cf
movq 0x50(%rbx), %rbx
testq %rbx, %rbx
jne 0x55f3
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/httpdns.c
// Function: dns_timeout_check
void dns_timeout_check()
{
    int i;

    for (i = 0; i < DNS_MAX_CONCURRENT; i++) {
        if (dns_list[i].fd > -1) {
            if (dns_list[i].timer >= global.timeout_m) {
                dnsProxyStop(dns_list + i);
            } else {
                dns_list[i].timer++;
            }
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
xorl %ebx, %ebx
leaq 0x13c10(%rip), %r14     # 0x196e0
leaq 0x13899(%rip), %r15     # 0x19370
cmpl $0x0, 0x22c(%rbx,%r14)
js 0x5b05
movl 0x230(%rbx,%r14), %eax
cmpl 0x14(%r15), %eax
jge 0x5afc
incl %eax
movl %eax, 0x230(%rbx,%r14)
jmp 0x5b05
leaq (%r14,%rbx), %rdi
callq 0x5b1b
addq $0x240, %rbx            # imm = 0x240
cmpq $0x48000, %rbx          # imm = 0x48000
jne 0x5ad7
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/httpdns.c
// Function: dnsProxyStop
static void dnsProxyStop(dns_t * dns)
{
    epoll_ctl(dns_efd, EPOLL_CTL_DEL, dns->fd, NULL);
    close(dns->fd);
    if (httpdns.tcpDNS_mode == 0)
        free(dns->out_request);
    memset(((char *)dns) + DNS_REQUEST_MAX_SIZE + sizeof(struct sockaddr_in), 0, sizeof(dns_t) - DNS_REQUEST_MAX_SIZE + -sizeof(struct sockaddr_in));
    dns->fd = -1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x5bbbb(%rip), %edi     # 0x616e0
movl 0x22c(%rbx), %edx
movl $0x2, %esi
xorl %ecx, %ecx
callq 0x2220
movl 0x22c(%rbx), %edi
callq 0x21e0
testb $0x1, 0x13b87(%rip)     # 0x196d0
jne 0x5b57
movq 0x218(%rbx), %rdi
callq 0x2030
xorps %xmm0, %xmm0
movups %xmm0, 0x222(%rbx)
movups %xmm0, 0x232(%rbx)
movups %xmm0, 0x212(%rbx)
movw $0x0, 0x242(%rbx)
movl $0xffffffff, 0x22c(%rbx) # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/httpdns.c
// Function: write_dns_cache
static void write_dns_cache(int sig)
{
    //子进程先写入缓存
    if (child_pid) {
        wait(NULL);
        cfp = fopen(httpdns.cachePath, "a");
    } else {
        cfp = fopen(httpdns.cachePath, "w");
    }
    while (cache) {
        fwrite(cache->dns_cache, *(uint16_t *) cache->dns_cache + *(uint16_t *) (cache->dns_cache + *(uint16_t *) cache->dns_cache + 2) + 4, 1, cfp);
        cache = cache->next;
    }

    exit(0);
}

// Assembly:
pushq %rax
cmpl $0x0, 0x13765(%rip)     # 0x19668
jne 0x5f0e
leaq 0x34dd(%rip), %rsi      # 0x93e9
jmp 0x5f1c
xorl %edi, %edi
callq 0x2500
leaq 0x362b(%rip), %rsi      # 0x9547
movq 0x1377d(%rip), %rdi     # 0x196a0
callq 0x2440
movq %rax, 0x13731(%rip)     # 0x19660
movq 0x137a2(%rip), %rax     # 0x196d8
testq %rax, %rax
je 0x5f73
movq (%rax), %rdi
movzwl (%rdi), %eax
movzwl 0x2(%rdi,%rax), %ecx
leaq (%rax,%rcx), %rsi
addq $0x4, %rsi
movq 0x1370b(%rip), %rcx     # 0x19660
movl $0x1, %edx
callq 0x24c0
movq 0x13772(%rip), %rax     # 0x196d8
movq 0x8(%rax), %rax
movq %rax, 0x13767(%rip)     # 0x196d8
jmp 0x5f36
xorl %edi, %edi
callq 0x24a0
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/httpdns.c
// Function: cache_record
static void cache_record(char *request, uint16_t request_len, char *response, uint16_t response_len)
{
    struct dns_cache *cache_temp;

    cache_temp = (struct dns_cache *)malloc(sizeof(struct dns_cache));
    if (cache_temp == NULL)
        return;
    cache_temp->dns_cache = (char *)malloc(request_len + response_len + 2);
    if (cache_temp->dns_cache == NULL) {
        free(cache_temp);
        return;
    }
    cache_temp->next = cache;
    cache = cache_temp;
    //不缓存dnsid
    request += 2;
    request_len -= 2;
    memcpy(cache_temp->dns_cache, &request_len, 2);
    memcpy(cache_temp->dns_cache + 2, request, request_len);
    memcpy(cache_temp->dns_cache + request_len + 2, &response_len, 2);
    memcpy(cache_temp->dns_cache + request_len + 4, response, response_len);
    if (httpdns.cacheLimit) {
        //到达缓存记录条目限制则释放前一半缓存
        if (cache_using >= httpdns.cacheLimit) {
            struct dns_cache *free_c;
            int i;
            for (i = cache_using = httpdns.cacheLimit >> 1; i--; cache_temp = cache_temp->next) ;
            for (free_c = cache_temp->next, cache_temp->next = NULL; free_c; free_c = cache_temp) {
                cache_temp = free_c->next;
                free(free_c->dns_cache);
                free(free_c);
            }
        }
        cache_using++;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r12d
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movl $0x10, %edi
callq 0x2320
testq %rax, %rax
je 0x6a5c
movq %rax, %rbx
movzwl %bp, %eax
movzwl %r12w, %r12d
leaq (%rax,%r12), %rdi
addq $0x2, %rdi
callq 0x2320
movq %rax, (%rbx)
testq %rax, %rax
je 0x6a6b
movq %rax, %r13
movq 0x12d1d(%rip), %rax     # 0x196d8
movq %rax, 0x8(%rbx)
movq %rbx, 0x12d12(%rip)     # 0x196d8
addq $0x2, %r15
addl $-0x2, %ebp
movw %bp, (%r13)
leaq 0x2(%r13), %rdi
movzwl %bp, %ebp
movq %r15, %rsi
movq %rbp, %rdx
callq 0x22d0
movw %r12w, 0x2(%r13,%rbp)
leaq 0x4(,%rbp), %rdi
addq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x22d0
movl 0x12cba(%rip), %ecx     # 0x196c0
testl %ecx, %ecx
je 0x6a5c
cmpl %ecx, 0x12c5c(%rip)     # 0x1966c
jl 0x6a56
movl %ecx, %eax
sarl %eax
movl %eax, 0x12c50(%rip)     # 0x1966c
cmpl $0x1, %ecx
je 0x6a29
movq 0x8(%rbx), %rbx
decl %eax
jne 0x6a21
movq 0x8(%rbx), %r14
movq $0x0, 0x8(%rbx)
testq %r14, %r14
je 0x6a56
movq (%r14), %rdi
movq 0x8(%r14), %rbx
callq 0x2030
movq %r14, %rdi
callq 0x2030
movq %rbx, %r14
testq %rbx, %rbx
jne 0x6a3a
incl 0x12c10(%rip)           # 0x1966c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2030
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/httpudp.c
// Function: udp_timeout_check
void udp_timeout_check()
{
    int i;

    for (i = 0; i < MAX_CLIENT_INFO; i++) {
        if (client_info_list[i].server_fd > -1) {
            if (client_info_list[i].timer >= global.timeout_m)
                proxyStop(client_info_list + i);
            else
                client_info_list[i].timer = 0;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
xorl %ebx, %ebx
leaq 0x5ce9e(%rip), %r14     # 0x63930
leaq 0x128d7(%rip), %r15     # 0x19370
cmpl $0x0, 0x1005c(%rbx,%r14)
js 0x6ac9
movl 0x10064(%rbx,%r14), %eax
cmpl 0x14(%r15), %eax
jge 0x6ac0
movl $0x0, 0x10064(%rbx,%r14)
jmp 0x6ac9
leaq (%r14,%rbx), %rdi
callq 0x6adf
addq $0x10068, %rbx          # imm = 0x10068
cmpq $0x200d000, %rbx        # imm = 0x200D000
jne 0x6a99
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/httpudp.c
// Function: proxyStop
static void proxyStop(info_t * info)
{
    epoll_ctl(udp_efd, EPOLL_CTL_DEL, info->server_fd, NULL);
    epoll_ctl(udp_efd, EPOLL_CTL_DEL, info->responseClientFd, NULL);
    close(info->server_fd);
    close(info->responseClientFd);
    free(info->rsp_data);
    info->rsp_data = NULL;
    do {
        info->server_fd = info->responseClientFd = -1;
        info->rsp_data_len = info->rsp_data_sent_len = info->client_data_sent_len = info->http_request_sent_len = 0;
    } while ((info = info->next) != NULL);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x2069e47(%rip), %edi   # 0x2070930
movl 0x1005c(%rbx), %edx
movl $0x2, %esi
xorl %ecx, %ecx
callq 0x2220
movl 0x2069e2f(%rip), %edi   # 0x2070930
movl 0x10060(%rbx), %edx
movl $0x2, %esi
xorl %ecx, %ecx
callq 0x2220
movl 0x1005c(%rbx), %edi
callq 0x21e0
movl 0x10060(%rbx), %edi
callq 0x21e0
movq 0x10040(%rbx), %rdi
callq 0x2030
movq $0x0, 0x10040(%rbx)
xorps %xmm0, %xmm0
movq $-0x1, 0x1005c(%rbx)
movups %xmm0, 0x1004c(%rbx)
movq 0x10038(%rbx), %rbx
testq %rbx, %rbx
jne 0x6b43
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/conf.c
// Function: print_tcp
void print_tcp(tcp * p)
{
    tcp *temp = p;
    while (temp) {
        if (temp->strrep)
            printf("%s %d\n", temp->strrep, temp->strrep_len);
        if (temp->strrep_s)
            printf("%s %d\n", temp->strrep_s, temp->strrep_s_len);
        if (temp->strrep_t)
            printf("%s %d\n", temp->strrep_t, temp->strrep_t_len);

        if (temp->regrep)
            printf("%s %d\n", temp->regrep, temp->regrep_len);
        if (temp->regrep_s)
            printf("%s %d\n", temp->regrep_s, temp->regrep_s_len);
        if (temp->regrep_t)
            printf("%s %d\n", temp->regrep_t, temp->regrep_t_len);

        temp = temp->next;
    }
}

// Assembly:
testq %rdi, %rdi
je 0x7886
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1c69(%rip), %r14      # 0x9458
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x7804
movl 0x8(%rbx), %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2170
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0x781a
movl 0x20(%rbx), %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2170
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0x7830
movl 0x24(%rbx), %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2170
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x7846
movl 0x30(%rbx), %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2170
movq 0x38(%rbx), %rsi
testq %rsi, %rsi
je 0x785c
movl 0x48(%rbx), %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2170
movq 0x40(%rbx), %rsi
testq %rsi, %rsi
je 0x7872
movl 0x4c(%rbx), %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2170
movq 0x50(%rbx), %rbx
testq %rbx, %rbx
jne 0x77ef
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/conf.c
// Function: free_tcp
void free_tcp(tcp ** conf_head)
{
    tcp *t;
    while (*conf_head != NULL) {
        t = *conf_head;
        *conf_head = t->next;

        if (t->strrep)
            free(t->strrep);
        if (t->strrep_s)
            free(t->strrep_s);
        if (t->strrep_t)
            free(t->strrep_t);

        if (t->regrep)
            free(t->regrep);
        if (t->regrep_s)
            free(t->regrep_s);
        if (t->regrep_t)
            free(t->regrep_t);
        if (t)
            free(t);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
testq %r14, %r14
je 0x7931
movq %rdi, %rbx
movq 0x50(%r14), %rax
movq %rax, (%rbx)
movq (%r14), %rdi
testq %rdi, %rdi
je 0x78db
callq 0x2030
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x78e9
callq 0x2030
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x78f7
callq 0x2030
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x7905
callq 0x2030
movq 0x38(%r14), %rdi
testq %rdi, %rdi
je 0x7913
callq 0x2030
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x7921
callq 0x2030
movq %r14, %rdi
callq 0x2030
movq (%rbx), %r14
testq %r14, %r14
jne 0x78c7
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/conf.c
// Function: free_conf
void free_conf(conf * p)
{
    // http module
    if (p->http_ip)
        free(p->http_ip);
    if (p->http_del)
        free(p->http_del);
    if (p->http_first)
        free(p->http_first);

    // https module
    if (p->https_ip)
        free(p->https_ip);
    if (p->https_del)
        free(p->https_del);
    if (p->https_first)
        free(p->https_first);

    // httpdns module
    if (p->httpdns_addr)
        free(p->httpdns_addr);
    if (p->httpdns_http_req)
        free(p->httpdns_http_req);

    // httpudp module
    if (p->httpudp_addr)
        free(p->httpudp_addr);
    if (p->httpudp_http_req)
        free(p->httpudp_http_req);

    return;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0x794b
callq 0x2030
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x7959
callq 0x2030
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x7967
callq 0x2030
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x7975
callq 0x2030
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x7983
callq 0x2030
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x7991
callq 0x2030
movq 0x80(%rbx), %rdi
testq %rdi, %rdi
je 0x79a2
callq 0x2030
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x79b3
callq 0x2030
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x79c4
callq 0x2030
movq 0xa8(%rbx), %rdi
testq %rdi, %rdi
je 0x79d6
popq %rbx
jmp 0x2030
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/conf.c
// Function: read_module
static char *read_module(char *buff, const char *module_name)
{
    int len;
    char *p, *p0;

    len = strlen(module_name);
    p = buff;
    while (1) {
        while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
            p++;
        if (strncasecmp(p, module_name, len) == 0) {
            p += len;
            while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
                p++;
            if (*p == '{')
                break;
        }
        if ((p = strchr(p, '\n')) == NULL)
            return NULL;
    }
    if ((p0 = strchr(++p, '}')) == NULL)
        return NULL;

    return strndup(p, p0 - p);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2140
movslq %eax, %r15
leaq 0x1(%r15), %r12
movabsq $0x100002600, %r13      # imm = 0x100002600
movzbl (%rbx), %eax
cmpq $0x20, %rax
ja 0x8627
btq %rax, %r13
jae 0x8627
incq %rbx
jmp 0x8613
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2330
testl %eax, %eax
jne 0x865c
leaq (%r12,%rbx), %rbp
addq %r15, %rbx
movzbl (%rbx), %eax
cmpq $0x20, %rax
ja 0x8657
btq %rax, %r13
jae 0x8657
incq %rbx
incq %rbp
jmp 0x8640
cmpl $0x7b, %eax
je 0x8673
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movq %rax, %rbx
testq %rax, %rax
jne 0x8613
jmp 0x86a4
incq %rbx
movq %rbx, %rdi
movl $0x7d, %esi
callq 0x2160
testq %rax, %rax
je 0x86a4
subq %rbp, %rax
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2250
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/niuyuling[P]CProxy/conf.c
// Function: string_pretreatment
static void string_pretreatment(char *str, int *len)
{
    char *lf, *p, *ori_strs[] = { "\\r", "\\n", "\\b", "\\v", "\\f", "\\t", "\\a", "\\b", "\\0" }, to_chrs[] = { '\r', '\n', '\b', '\v', '\f', '\t', '\a', '\b', '\0' };
    int i;

    while ((lf = strchr(str, '\n')) != NULL) {
        for (p = lf + 1; *p == ' ' || *p == '\t' || *p == '\n' || *p == '\r'; p++)
            *len -= 1;
        strcpy(lf, p);
        *len -= 1;
    }
    for (i = 0; i < sizeof(to_chrs); i++) {
        for (p = strstr(str, ori_strs[i]); p; p = strstr(p, ori_strs[i])) {
            //支持\\r
            *(p - 1) == '\\' ? (*p--) : (*p = to_chrs[i]);
            memmove(p + 1, p + 2, strlen(p + 2));
            (*len)--;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, (%rsp)
movl $0xa, %esi
callq 0x2160
testq %rax, %rax
je 0x8892
movabsq $0x100002600, %r14      # imm = 0x100002600
leaq 0x1(%rax), %rsi
movzbl (%rsi), %ecx
cmpq $0x20, %rcx
ja 0x8875
btq %rcx, %r14
jae 0x8875
decl (%rbx)
incq %rsi
jmp 0x885f
movq %rax, %rdi
callq 0x2080
decl (%rbx)
movq (%rsp), %rdi
movl $0xa, %esi
callq 0x2160
testq %rax, %rax
jne 0x885b
xorl %r14d, %r14d
leaq 0x34f4(%rip), %rax      # 0xbd90
movq (%rax,%r14,8), %r15
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x2530
testq %rax, %rax
je 0x8905
movq %rax, %r12
cmpb $0x5c, -0x1(%r12)
jne 0x88c1
decq %r12
jmp 0x88d0
leaq 0xc81(%rip), %rax       # 0x9549
movb (%r14,%rax), %al
movb %al, (%r12)
leaq 0x1(%r12), %r13
leaq 0x2(%r12), %rbp
movq %rbp, %rdi
callq 0x2140
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x2420
decl (%rbx)
movq %r12, %rdi
movq %r15, %rsi
callq 0x2530
movq %rax, %r12
testq %rax, %rax
jne 0x88b4
incq %r14
cmpq $0x9, %r14
jne 0x8895
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]mysh/mysh_util.c
// Function: mysh_error
void mysh_error(const char *fmt, ...)
{
	va_list va;
	va_start(va, fmt);
	fputs(SHELL_NAME ": error: ", stderr);
	vfprintf(stderr, fmt, va);
	fputc('\n', stderr);
	va_end(va);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x2443
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r14
movq %rdi, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r14)
movq 0x8b86(%rip), %r15      # 0xaff0
movq (%r15), %rsi
leaq 0x5ab0(%rip), %rdi      # 0x7f24
callq 0x2170
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x22e0
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x21f0
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]mysh/mysh_util.c
// Function: mysh_error_with_errno
void mysh_error_with_errno(const char *fmt, ...)
{
	va_list va;
	va_start(va, fmt);
	fputs(SHELL_NAME ": error: ", stderr);
	vfprintf(stderr, fmt, va);
	fprintf(stderr, ": %s", strerror(errno));
	fputc('\n', stderr);
	va_end(va);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x2502
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r14
movq %rdi, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r14)
movq 0x8ac7(%rip), %r15      # 0xaff0
movq (%r15), %rsi
leaq 0x59f1(%rip), %rdi      # 0x7f24
callq 0x2170
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x22e0
movq (%r15), %rbx
callq 0x2060
movl (%rax), %edi
callq 0x2380
leaq 0x4d33(%rip), %rsi      # 0x728f
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2240
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x21f0
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq