LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/stv0g[P]c11-queues/mpmc_queue.c
// Function: mpmc_queue_pull_many
int mpmc_queue_pull_many(struct mpmc_queue *q, void **ptr[], size_t cnt)
{
	int ret;
	size_t i;

	for (i = 0; i < cnt; i++) {
		ret = mpmc_queue_pull(q, ptr[i]);
		if (!ret)
			break;
	}
	
	return i;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x1746
movq (%r14,%r12,8), %rsi
movq %r15, %rdi
callq 0x168c
testl %eax, %eax
je 0x1743
incq %r12
jmp 0x1729
movq %r12, %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/config.c
// Function: to_interger
static long to_interger(char* st, char* ed) {
    long result;
    char* p;

    result = 0;

    for (p = st; p <= ed; ++ p) {
        if (!isdigit(*p)) {
            return -1;
        }

        result = result * 10 + (*p - '0');

        if (result < 0) {
            return -1;
        }
    }

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
pushq $-0x1
popq %r12
cmpq %r14, %r15
ja 0x30c5
callq 0x2490
movq (%rax), %rcx
movsbq (%r15), %rax
testb $0x8, 0x1(%rcx,%rax,2)
je 0x30c2
imulq $0xa, %rbx, %rbx
addq %rax, %rbx
incq %r15
addq $-0x30, %rbx
jns 0x309a
movq %r12, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/epoll.c
// Function: epoll_create_fd
epoll_t* epoll_create_fd(int flags) {
    epoll_t* epoll = NULL;

    do {
        if ((epoll = (epoll_t*)malloc(sizeof(epoll_t))) == NULL) {
            log_error("epoll malloc failed.");
            break;
        }

        /* 创建 epoll 文件描述符 */
        if ((epoll->epollfd = epoll_create1(flags)) < 0) {
            log_error("epoll fd create failed.");
            break;
        }

        if ((epoll->events = (epoll_event*)malloc(sizeof(epoll_event) * MAX_EVENTS)) == NULL) {
            log_error("events malloc failed.");
            break;
        }

        return epoll;

    } while (0);

    if (epoll_free(epoll) != 0) {
        log_error("epoll free failed.");
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %r14d
pushq $0x10
popq %rdi
callq 0x22d0
movq %rax, %rbx
testq %rax, %rax
je 0x312b
movl %r14d, %edi
callq 0x2450
movl %eax, (%rbx)
testl %eax, %eax
js 0x3147
movl $0x3000, %edi           # imm = 0x3000
callq 0x22d0
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x3173
leaq 0x3376(%rip), %rsi      # 0x648c
leaq 0x3380(%rip), %rdx      # 0x649d
leaq 0x33b6(%rip), %r8       # 0x64da
pushq $0x4
popq %rdi
pushq $0x22
jmp 0x3161
leaq 0x335a(%rip), %rsi      # 0x648c
leaq 0x3364(%rip), %rdx      # 0x649d
leaq 0x336d(%rip), %r8       # 0x64ad
pushq $0x4
popq %rdi
pushq $0x17
jmp 0x3161
leaq 0x333e(%rip), %rsi      # 0x648c
leaq 0x3348(%rip), %rdx      # 0x649d
leaq 0x3366(%rip), %r8       # 0x64c2
pushq $0x4
popq %rdi
pushq $0x1d
popq %rcx
xorl %eax, %eax
callq 0x4c60
movq %rbx, %rdi
callq 0x317b
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/epoll.c
// Function: epoll_free
int epoll_free(epoll_t* epoll) {
    if (epoll != NULL) {
        free(epoll->events);
        epoll->events = NULL;
        free(epoll);
        epoll = NULL;
    }

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x31a0
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2030
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/epoll.c
// Function: epoll_add_fd
int epoll_add_fd(epoll_t* epoll, int fd, epoll_event* event) {

    if (epoll == NULL) {
        log_error("epoll is null.");
        return -1;
    }

    /* 添加监听事件 */
    if (epoll_ctl(epoll->epollfd, EPOLL_CTL_ADD, fd, event) != 0) {
        log_error("epoll add fd failed.");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x31db
movq %rdx, %rcx
movl %esi, %edx
movl (%rdi), %edi
pushq $0x1
popq %rsi
callq 0x21f0
testl %eax, %eax
je 0x3202
leaq 0x32c6(%rip), %rsi      # 0x648c
leaq 0x3323(%rip), %rdx      # 0x64f0
leaq 0x3338(%rip), %r8       # 0x650c
pushq $0x4
popq %rdi
pushq $0x3c
jmp 0x31f5
leaq 0x32aa(%rip), %rsi      # 0x648c
leaq 0x3307(%rip), %rdx      # 0x64f0
leaq 0x330d(%rip), %r8       # 0x64fd
pushq $0x4
popq %rdi
pushq $0x36
popq %rcx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rax
jmp 0x3204
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/epoll.c
// Function: epoll_modify_fd
int epoll_modify_fd(epoll_t* epoll, int fd, epoll_event* event) {

    if (epoll == NULL) {
        log_error("epoll is null.");
        return -1;
    }

    /* 修改监听事件 */
    if (epoll_ctl(epoll->epollfd, EPOLL_CTL_MOD, fd, event) != 0) {
        log_error("epoll mod failed.");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x323e
movq %rdx, %rcx
movl %esi, %edx
movl (%rdi), %edi
pushq $0x3
popq %rsi
callq 0x21f0
testl %eax, %eax
je 0x3265
leaq 0x3263(%rip), %rsi      # 0x648c
leaq 0x32f1(%rip), %rdx      # 0x6521
leaq 0x32fa(%rip), %r8       # 0x6531
pushq $0x4
popq %rdi
pushq $0x4f
jmp 0x3258
leaq 0x3247(%rip), %rsi      # 0x648c
leaq 0x32d5(%rip), %rdx      # 0x6521
leaq 0x32aa(%rip), %r8       # 0x64fd
pushq $0x4
popq %rdi
pushq $0x49
popq %rcx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rax
jmp 0x3267
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/epoll.c
// Function: epoll_delete_fd
int epoll_delete_fd(epoll_t* epoll, int fd, epoll_event* event) {
    
    if (epoll == NULL) {
        log_error("epoll is null.");
        return -1;
    }

    /* 删除监听事件 */
    if (epoll_ctl(epoll->epollfd, EPOLL_CTL_DEL, fd, event) != 0) {
        log_error("epoll delete failed.");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x32a1
movq %rdx, %rcx
movl %esi, %edx
movl (%rdi), %edi
pushq $0x2
popq %rsi
callq 0x21f0
testl %eax, %eax
je 0x32c8
leaq 0x3200(%rip), %rsi      # 0x648c
leaq 0x32b0(%rip), %rdx      # 0x6543
leaq 0x32b9(%rip), %r8       # 0x6553
pushq $0x4
popq %rdi
pushq $0x62
jmp 0x32bb
leaq 0x31e4(%rip), %rsi      # 0x648c
leaq 0x3294(%rip), %rdx      # 0x6543
leaq 0x3247(%rip), %r8       # 0x64fd
pushq $0x4
popq %rdi
pushq $0x5c
popq %rcx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rax
jmp 0x32ca
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/epoll.c
// Function: epoll_wait_event
int epoll_wait_event(epoll_t* epoll, int maxevents, int timeout) {
    int n;
    int events_num;

    if (epoll == NULL) {
        log_error("epoll is null.");
        return -1;
    }

    /* 最大事件数与宏 MAX_EVENTS 取较小值 */
    events_num = maxevents < MAX_EVENTS ? maxevents : MAX_EVENTS;
    /* 等待就绪事件 */
    if ((n = epoll_wait(epoll->epollfd, epoll->events, events_num, timeout)) < 0) {
        log_error("epoll wait failed.");
    }

    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x331a
movl %edx, %ecx
movl $0x400, %edx            # imm = 0x400
cmpl %edx, %esi
cmovll %esi, %edx
movl (%rdi), %eax
movq 0x8(%rdi), %rsi
movl %eax, %edi
callq 0x2330
movl %eax, %ebx
testl %eax, %eax
jns 0x333f
leaq 0x318f(%rip), %rsi      # 0x648c
leaq 0x3264(%rip), %rdx      # 0x6568
leaq 0x2e4b(%rip), %r8       # 0x6156
pushq $0x4
popq %rdi
pushq $0x79
popq %rcx
xorl %eax, %eax
callq 0x4c60
jmp 0x333f
leaq 0x316b(%rip), %rsi      # 0x648c
leaq 0x3240(%rip), %rdx      # 0x6568
leaq 0x31ce(%rip), %r8       # 0x64fd
pushq $0x4
popq %rdi
pushq $0x71
popq %rcx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http.c
// Function: http_init_connection
int http_init_connection(int connfd, epoll_t* epoll, config_t* config) {
    http_request_t* rq;
    struct epoll_event epev;

    /* 非阻塞读写 */
    set_nonblocking(connfd);

    if ((rq = http_request_init(connfd, epoll, config)) == NULL) {
        log_error("http_request_t init failed.");
        return -1;
    }

    /* 设置 epoll 监听 connfd 上的读事件，边缘触发 */
    epev.data.ptr = (void*)rq;
    epev.events = EPOLLIN | EPOLLET | EPOLLONESHOT;

    epoll_add_fd(epoll, connfd, &epev);

    /* 添加事件到定时器，设置超时回调函数 */
    add_timer((void*)rq, rq->timeout, http_close_connection);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movl %edi, %ebx
callq 0x5c34
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4581
testq %rax, %rax
je 0x33a9
movq %rax, %r15
leaq -0x24(%rbp), %rdx
movq %rax, 0x4(%rdx)
movl $0xc0000001, (%rdx)     # imm = 0xC0000001
movq %r14, %rdi
movl %ebx, %esi
callq 0x31a3
movq 0x20e8(%r15), %rsi
leaq 0x3c(%rip), %rdx        # 0x33d9
movq %r15, %rdi
callq 0x49c3
xorl %eax, %eax
jmp 0x33ce
leaq 0x31c9(%rip), %rsi      # 0x6579
leaq 0x31d2(%rip), %rdx      # 0x6589
leaq 0x31e0(%rip), %r8       # 0x659e
pushq $0x4
popq %rdi
pushq $0x4b
popq %rcx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http.c
// Function: http_close_connection
int http_close_connection(void* http_request) {
    http_request_t* rq;

    rq = (http_request_t*) http_request;
    
    close(rq->fd);

    http_request_destroy(rq);

    log_info("connection closed.");

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %edi
callq 0x21d0
movq %rbx, %rdi
callq 0x479a
leaq 0x3181(%rip), %rsi      # 0x6579
leaq 0x3270(%rip), %rdx      # 0x666f
leaq 0x327f(%rip), %r8       # 0x6685
pushq $0x2
popq %rdi
movl $0x13c, %ecx            # imm = 0x13C
xorl %eax, %eax
callq 0x4c60
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http.c
// Function: create_listenfd
int create_listenfd(unsigned short port) {
    int listenfd;
    int optval;
    struct sockaddr_in servaddr;

    /* 创建 socket 描述符 */
    if ((listenfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
        log_error("create socket failed.");
        return -1;
    }

    /* 设置 SO_REUSEADDR 关闭服务端的 TIME_WAIT */
    if (setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, (const void *)&optval , sizeof(int)) < 0) {
        log_error("set listenfd reuse adress error.");
	    return -1;
    }

    /* 设置地址与端口号 */
    bzero(&servaddr, sizeof(servaddr));
    servaddr.sin_family = AF_INET;
    servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
    servaddr.sin_port = htons((unsigned short)port);

    /* 绑定地址与端口号 */
    if (bind(listenfd, (struct sockaddr*)&servaddr, sizeof(servaddr)) < 0) {
        log_error("bind error.");
        return -1;
    }

    /* 将描述符设置为监听描述符 */
    if (listen(listenfd, BACKLOG) < 0) {
        log_error("listen error.");
        return -1;
    }

    return listenfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, %r14d
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x24a0
testl %eax, %eax
js 0x34ae
movl %eax, %ebx
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
leaq -0x14(%rbp), %rcx
pushq $0x4
popq %r8
movl %eax, %edi
callq 0x20d0
testl %eax, %eax
js 0x34ca
leaq -0x24(%rbp), %rsi
andq $0x0, 0x8(%rsi)
movw $0x2, (%rsi)
andl $0x0, 0x4(%rsi)
rolw $0x8, %r14w
movw %r14w, 0x2(%rsi)
pushq $0x10
popq %rdx
movl %ebx, %edi
callq 0x2340
testl %eax, %eax
js 0x34e6
movl %ebx, %edi
movl $0x400, %esi            # imm = 0x400
callq 0x2300
testl %eax, %eax
jns 0x350b
leaq 0x30e0(%rip), %rsi      # 0x6579
leaq 0x311a(%rip), %rdx      # 0x65ba
leaq 0x3166(%rip), %r8       # 0x660d
pushq $0x4
popq %rdi
pushq $0x7c
jmp 0x3500
leaq 0x30c4(%rip), %rsi      # 0x6579
leaq 0x30fe(%rip), %rdx      # 0x65ba
leaq 0x3107(%rip), %r8       # 0x65ca
pushq $0x4
popq %rdi
pushq $0x64
jmp 0x3500
leaq 0x30a8(%rip), %rsi      # 0x6579
leaq 0x30e2(%rip), %rdx      # 0x65ba
leaq 0x3101(%rip), %r8       # 0x65e0
pushq $0x4
popq %rdi
pushq $0x6a
jmp 0x3500
leaq 0x308c(%rip), %rsi      # 0x6579
leaq 0x30c6(%rip), %rdx      # 0x65ba
leaq 0x3106(%rip), %r8       # 0x6601
pushq $0x4
popq %rdi
pushq $0x76
popq %rcx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http.c
// Function: serve_error
static int serve_error(http_request_t* rq, unsigned status) {
    char body[MAXMSG] = { '\0' };
    int length;

    sprintf(body, "<html><head>");
    sprintf(body, "%s<title>%d %s</title></head>", body, status, get_shortmsg(status));
    sprintf(body, "%s<body bgcolor=\"LightSkyBlue\" align=\"center\">", body);
    sprintf(body, "%s<h1>%d %s</h1><hr>", body, status, get_shortmsg(status));
    sprintf(body, "%s<em>%s</em>", body, SERVER_NAME);
    sprintf(body, "%s</body></html>", body);

    length = strlen(body);

    serve_headers(rq, NULL, "text/html; charset=UTF-8", length, status);

    if (rio_writen(rq->fd, body, length) < 0) {
        log_error("write error.");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movl %esi, %r14d
movq %rdi, %rbx
leaq -0x1013(%rbp), %r15
movl $0xff3, %edx            # imm = 0xFF3
movq %r15, %rdi
xorl %esi, %esi
callq 0x21b0
movabsq $0x683c3e6c6d74683c, %rax # imm = 0x683C3E6C6D74683C
movq %rax, -0xd(%r15)
movabsq $0x3e646165683c3e, %rax # imm = 0x3E646165683C3E
movq %rax, -0x8(%r15)
movl %r14d, %edi
callq 0x3e13
movq %rax, %r12
leaq 0x2fc0(%rip), %rsi      # 0x6a14
leaq -0x1020(%rbp), %r15
movq %r15, %rdi
movq %r15, %rdx
movl %r14d, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x23e0
leaq 0x2fbd(%rip), %rsi      # 0x6a32
movq %r15, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x23e0
leaq 0x2fd8(%rip), %rsi      # 0x6a61
movq %r15, %rdi
movq %r15, %rdx
movl %r14d, %ecx
movq %r12, %r8
xorl %eax, %eax
callq 0x23e0
leaq 0x2fd3(%rip), %rsi      # 0x6a76
leaq 0x2c51(%rip), %rcx      # 0x66fb
movq %r15, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x23e0
leaq 0x2fc6(%rip), %rsi      # 0x6a84
movq %r15, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x23e0
movq %r15, %rdi
callq 0x2130
movslq %eax, %r12
leaq 0x2d9c(%rip), %rdx      # 0x6879
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rcx
movl %r14d, %r8d
callq 0x3b33
movl (%rbx), %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5540
testq %rax, %rax
jns 0x3b23
leaq 0x2a73(%rip), %rsi      # 0x6579
leaq 0x2f88(%rip), %rdx      # 0x6a95
leaq 0x2bb7(%rip), %r8       # 0x66cb
pushq $0x4
popq %rdi
movl $0x1e2, %ecx            # imm = 0x1E2
xorl %eax, %eax
callq 0x4c60
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_request.c
// Function: http_process_date
static int http_process_date(http_request_t* rq, http_headers_out_t* out, char* st, char* ed) {
    struct tm time;

    if (!strptime(st, "%a, %d %b %Y %H:%M:%S GMT", &time)) {
        log_error("date error.");
        return REQUEST_ERROR;
    }

    out->rtime = mktime(&time);

    return HTTP_OK;    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rdi
movq %rsi, %rbx
leaq 0x22cc(%rip), %rsi      # 0x6707
leaq -0x40(%rbp), %rdx
callq 0x2430
testq %rax, %rax
je 0x445d
leaq -0x40(%rbp), %rdi
callq 0x2310
movq %rax, 0x8(%rbx)
movl $0xc8, %eax
jmp 0x4484
leaq 0x26d7(%rip), %rsi      # 0x6b3b
leaq 0x275b(%rip), %rdx      # 0x6bc6
leaq 0x2766(%rip), %r8       # 0x6bd8
pushq $0x4
popq %rdi
movl $0xc2, %ecx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rax
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_request.c
// Function: http_process_if_modified_since
static int http_process_if_modified_since(http_request_t* rq, http_headers_out_t* out, char* st, char* ed) {
    struct tm time;
    time_t ims;

    if (!strptime(st, "%a, %d %b %Y %H:%M:%S GMT", &time)) {
        log_error("date error.");
        return REQUEST_ERROR;
    }

    ims = mktime(&time);

    if (ims < out->mtime) {
        out->if_modified = 1;   /* 返回 200 */
        out->status = HTTP_OK;
    } else {
        out->if_modified = 2;   /* 返回 304 */
        out->status = HTTP_NOT_MODIFIED;
    }

    return HTTP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rdi
movq %rsi, %rbx
leaq 0x2266(%rip), %rsi      # 0x6707
leaq -0x40(%rbp), %rdx
callq 0x2430
testq %rax, %rax
je 0x44db
leaq -0x40(%rbp), %rdi
callq 0x2310
movl $0xcf, %ecx
andl (%rbx), %ecx
cmpq 0x10(%rbx), %rax
movl $0xc810, %eax           # imm = 0xC810
movl $0x13020, %edx          # imm = 0x13020
cmovll %eax, %edx
orl %ecx, %edx
movl %edx, (%rbx)
movl $0xc8, %eax
jmp 0x4502
leaq 0x2659(%rip), %rsi      # 0x6b3b
leaq 0x26fb(%rip), %rdx      # 0x6be4
leaq 0x26e8(%rip), %r8       # 0x6bd8
pushq $0x4
popq %rdi
movl $0xd0, %ecx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rax
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_request.c
// Function: http_process_if_unmodified_since
static int http_process_if_unmodified_since(http_request_t* rq, http_headers_out_t* out, char* st, char* ed) {
    struct tm time;
    time_t iums;

    if (strptime(st, "%a, %d %b %Y %H:%M:%S GMT", &time)) {
        log_error("date error.");
        return REQUEST_ERROR;
    }

    iums = mktime(&time);

    if (iums > out->mtime) {
        out->if_unmodified = 1; /* 返回 412 */
        out->status = HTTP_PRECONDITION_FAILED;
    }

    return HTTP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rdi
movq %rsi, %rbx
leaq 0x21e8(%rip), %rsi      # 0x6707
leaq -0x40(%rbp), %rdx
callq 0x2430
testq %rax, %rax
je 0x4556
leaq 0x2607(%rip), %rsi      # 0x6b3b
leaq 0x26c8(%rip), %rdx      # 0x6c03
leaq 0x2696(%rip), %r8       # 0x6bd8
pushq $0x4
popq %rdi
movl $0xe6, %ecx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rax
jmp 0x457a
leaq -0x40(%rbp), %rdi
callq 0x2310
movq %rax, %rcx
movl $0xc8, %eax
cmpq 0x10(%rbx), %rcx
jle 0x457a
movl (%rbx), %ecx
andl $0x3f, %ecx
orl $0x19c40, %ecx          # imm = 0x19C40
movl %ecx, (%rbx)
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_request.c
// Function: http_request_init
http_request_t* http_request_init(int fd, epoll_t* epoll, config_t* config) {
    http_request_t* rq;

    if ((rq = (http_request_t*)malloc(sizeof(http_request_t))) == NULL) {
        log_error("http_request_t malloc failed.");
        return NULL;
    }

    rq->fd = fd;
    rq->epoll = epoll;
    rq->state = 0;
    rq->have_args = 0;
    rq->bufst = &(rq->buf[0]);
    rq->bufed = &(rq->buf[0]);
    rq->handler = http_process_request_line;    /* 初始时解析请求行 */
    rq->timer.timer_set = 0;
    rq->timer.handler = http_close_connection;  /* 定时器超时回调函数 */
    if (config) {
        rq->root = config->root;
        rq->defile = config->defile;
        rq->timeout = config->timeout;
    }
    
    init_list_head(&(rq->headers_list_head));   /* 初始化链表 */

    return rq;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %r12d
movl $0x20f8, %edi           # imm = 0x20F8
callq 0x22d0
movq %rax, %rbx
testq %rax, %rax
je 0x462c
movl %r12d, (%rbx)
movq %r15, 0x8(%rbx)
andl $0x0, 0x48(%rbx)
andl $0x0, 0x50(%rbx)
leaq 0x98(%rbx), %rax
movq %rax, 0x2098(%rbx)
movq %rax, 0x20a0(%rbx)
leaq 0x84(%rip), %rax        # 0x465a
movq %rax, 0x20f0(%rbx)
movb $0x0, 0x20e0(%rbx)
leaq -0x1212(%rip), %rax     # 0x33d9
movq %rax, 0x20d8(%rbx)
testq %r14, %r14
je 0x461e
leaq 0x8(%r14), %rax
movq %rax, 0x88(%rbx)
leaq 0x108(%r14), %rax
movq %rax, 0x90(%rbx)
movq 0x208(%r14), %rax
movq %rax, 0x20e8(%rbx)
movq %rbx, %rdi
addq $0x58, %rdi
callq 0x4bd4
jmp 0x464e
leaq 0x2508(%rip), %rsi      # 0x6b3b
leaq 0x2519(%rip), %rdx      # 0x6b53
leaq 0x2524(%rip), %r8       # 0x6b65
pushq $0x4
popq %rdi
pushq $0x29
popq %rcx
xorl %eax, %eax
callq 0x4c60
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_request.c
// Function: http_process_request_line
static int http_process_request_line(http_request_t* rq) {
    int ret;

    if (rq->timer.timeout) {
        return REQUEST_TIMEOUT;
    }

    if ((ret = http_parse_request_line(rq)) == REQUEST_OK) {
        /* 当返回 REQUEST_OK 时，请求行已解析完毕，继续解析首部字段 */
        rq->handler = http_process_request_headers;
        return http_process_request_headers(rq);
    }
    
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testb $0x2, 0x20e0(%rdi)
jne 0x4691
movq %rdi, %rbx
callq 0x3efc
testl %eax, %eax
jne 0x4694
leaq 0x138(%rip), %rax       # 0x47b4
movq %rax, 0x20f0(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x47b4
pushq $-0x3
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_request.c
// Function: http_headers_out_init
http_headers_out_t* http_headers_out_init() {
    http_headers_out_t* out;

    if ((out = (http_headers_out_t*)malloc(sizeof(http_headers_out_t))) == NULL) {
        log_error("http_headers_out_t malloc failed.");
        return NULL;
    }

    out->keep_alive = 0;
    out->if_modified = 0;
    out->if_unmodified = 0;
    out->status = 0;

    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
pushq $0x18
popq %rdi
callq 0x22d0
movq %rax, %rbx
testq %rax, %rax
je 0x46b6
andl $0x0, (%rbx)
jmp 0x46d8
leaq 0x247e(%rip), %rsi      # 0x6b3b
leaq 0x24bf(%rip), %rdx      # 0x6b83
leaq 0x24ce(%rip), %r8       # 0x6b99
pushq $0x4
popq %rdi
pushq $0x48
popq %rcx
xorl %eax, %eax
callq 0x4c60
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_request.c
// Function: http_analyze_headers
int http_analyze_headers(http_request_t* rq, http_headers_out_t* out) {
    http_header_t* pos;
    list_head_t* head;
    list_head_t* now;
    list_head_t* next;
    http_headers_in_t* in;
    int len;

    /* 获取链表头 */
    head = &(rq->headers_list_head);

    /* 遍历链表中的每一个节点 */
    list_for_each_entry(pos, head, list_node) {
        /* 对于每一个节点循环判断与每一个字段名是否匹配 */
        len = pos->header_name_end - pos->header_name_start + 1;
        for (in = http_headers_in; strlen(in->name) > 0; ++ in) {
            /* 如果匹配，则执行相应处理函数 */
            if (!strncmp(in->name, pos->header_name_start, len)) {
                if (in->handler != NULL) {
                    in->handler(rq, out, pos->header_value_start, pos->header_value_end);
                }

                break;
            }
        }
    }

    /* 销毁链表中的所有节点 */
    now = head->next;
    while (now != head) {
        next = now->next;
        pos = list_entry(now, http_header_t, list_node);

        list_del(now);
        free(pos);
        pos = NULL;

        now = next;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x40(%rbp)
leaq 0x58(%rdi), %r13
movq %rdi, -0x38(%rbp)
leaq 0x60(%rdi), %r14
movq %r14, -0x30(%rbp)
movq (%r14), %r14
cmpq %r13, %r14
je 0x4764
movl 0x18(%r14), %eax
movq 0x10(%r14), %r15
subl %r15d, %eax
incl %eax
movslq %eax, %r12
leaq 0x5b52(%rip), %rbx      # 0xa278
movq -0x8(%rbx), %rdi
cmpb $0x0, (%rdi)
je 0x475e
movq %r15, %rsi
movq %r12, %rdx
callq 0x2070
testl %eax, %eax
je 0x4744
addq $0x10, %rbx
jmp 0x4726
movq (%rbx), %rax
testq %rax, %rax
je 0x475e
movq 0x20(%r14), %rdx
movq 0x28(%r14), %rcx
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq *%rax
addq $0x8, %r14
jmp 0x4707
movq -0x30(%rbp), %rax
movq (%rax), %rbx
cmpq %r13, %rbx
je 0x4789
movq 0x8(%rbx), %r14
movq %rbx, %rdi
callq 0x4c30
movq %rbx, %rdi
callq 0x2030
movq %r14, %rbx
jmp 0x476b
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_timer.c
// Function: init_timer
int init_timer() {
    /* 初始化的主要工作就是初始化一颗红黑树 */
    if (rbtree_init(&timer_rbtree, &timer_nil, rbtree_insert_timer) != 0) {
        log_error("rbtree init error.");
        return -1;
    }

    /* 初始化互斥锁，用于多线程使用定时器的同步操作 */
    if (pthread_mutex_init(&timer_mutex, NULL) != 0) {
        log_error("timer mutex init failed.");
        return -1;
    }

    /* 初始化 current_msec ，可做可不做 */
    if (update_current_msec() != 0) {
        log_error("get current time error.");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x5afb(%rip), %rdi      # 0xa2d8
leaq 0x5b0c(%rip), %rsi      # 0xa2f0
leaq 0x777(%rip), %rdx       # 0x4f62
callq 0x4da8
testl %eax, %eax
je 0x4810
leaq 0x2429(%rip), %rsi      # 0x6c24
leaq 0x2438(%rip), %rdx      # 0x6c3a
leaq 0x243c(%rip), %r8       # 0x6c45
pushq $0x4
popq %rdi
pushq $0x1c
jmp 0x4863
leaq 0x5b09(%rip), %rdi      # 0xa320
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x2440
testl %eax, %eax
je 0x4840
leaq 0x23f9(%rip), %rsi      # 0x6c24
leaq 0x2408(%rip), %rdx      # 0x6c3a
leaq 0x241f(%rip), %r8       # 0x6c58
pushq $0x4
popq %rdi
pushq $0x22
jmp 0x4863
callq 0x4b8a
testl %eax, %eax
je 0x486e
leaq 0x23d4(%rip), %rsi      # 0x6c24
leaq 0x23e3(%rip), %rdx      # 0x6c3a
leaq 0x2413(%rip), %r8       # 0x6c71
pushq $0x4
popq %rdi
pushq $0x28
popq %rcx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_timer.c
// Function: find_timer
msec_t find_timer() {
    msec_int_t timer;
    rbtree_node_t* node;

    //DBG("find timer pid:%u ready to lock\n", pthread_self());
    pthread_mutex_lock(&timer_mutex);
    //DBG("find timer pid:%u locked\n", pthread_self());

    /* 如果定时器为空，则返回无穷 */
    if (timer_rbtree.root == &timer_nil) {
        //DBG("find timer pid:%u ready to unlock\n", pthread_self());
        pthread_mutex_unlock(&timer_mutex);
        //DBG("find timer pid:%u unlocked\n", pthread_self());
        return TIMER_INFINITE;
    }

    /* 获取红黑树中最左边的节点即键最小的节点 */
    node = rbtree_get_min(&timer_rbtree);
    //ASSERT(node != NULL, "node is NULL.");

    //DBG("find timer pid:%u ready to unlock\n", pthread_self());
    pthread_mutex_unlock(&timer_mutex);
    //DBG("find timer pid:%u unlocked\n", pthread_self());

    /* 计算与当前时间的差值并返回 */
    update_current_msec();

    timer = (msec_int_t)(node->key - current_msec);

    return (msec_t)(timer > 0 ? timer : 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x5a9c(%rip), %rdi      # 0xa320
callq 0x2480
movq 0x5a48(%rip), %rax      # 0xa2d8
leaq 0x5a59(%rip), %rcx      # 0xa2f0
cmpq %rcx, %rax
je 0x48d1
leaq 0x5a35(%rip), %rdi      # 0xa2d8
callq 0x4dea
movq %rax, %rbx
leaq 0x5a6e(%rip), %rdi      # 0xa320
callq 0x22b0
callq 0x4b8a
movq (%rbx), %rcx
subq 0x5a82(%rip), %rcx      # 0xa348
xorl %eax, %eax
testq %rcx, %rcx
cmovgq %rcx, %rax
jmp 0x48e0
leaq 0x5a48(%rip), %rdi      # 0xa320
callq 0x22b0
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_timer.c
// Function: expire_timers
int expire_timers() {
    rbtree_node_t* node;
    http_timer_t* timer;
    http_request_t* ev;

    //while (timer_rbtree.root != &timer_nil) {
    for ( ;; ) {
        //DBG("expire timer pid:%u ready to lock\n", pthread_self());
        pthread_mutex_lock(&timer_mutex);

        //DBG("expire timer pid:%u locked\n", pthread_self());
        
        /* 定时器为空，即红黑树为空 */
        if (timer_rbtree.root == &timer_nil) {
            break;
        }

        /* 获取红黑树中最左边的节点即键最小的节点 */
        if ((node = rbtree_get_min(&timer_rbtree)) == NULL) {
            log_error("get min failed.");
            pthread_mutex_unlock(&timer_mutex);
            return -1;
        }

        update_current_msec();

        /* 计算是否超时 */
        if ((msec_int_t)(node->key - current_msec) <= 0) {
            /* 如果超时 */
            /* 删除红黑树中的节点 */
            rbtree_delete(&timer_rbtree, node);

            pthread_mutex_unlock(&timer_mutex);


            /* 通过偏移量获取 timer 指针 */
            timer = (http_timer_t*) ((char*)node - offsetof(http_timer_t, timer_node));

            /* 标记红黑树中已经不监控该事件 */
            timer->timer_set = 0;

            /* 通过偏移量获取事件指针 */
            ev = (http_request_t*) ((char*)timer - offsetof(http_request_t, timer));
            
            /* 标记事件已超时 */
            timer->timeout = 1;

            /* 执行回调函数 */
            if (timer->handler) {
                timer->handler((void*)ev);
            }

            continue;
        }


        break;
    }

    pthread_mutex_unlock(&timer_mutex);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x5a24(%rip), %rbx      # 0xa320
leaq 0x59ed(%rip), %r13      # 0xa2f0
leaq 0x59ce(%rip), %r14      # 0xa2d8
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x2480
movq 0x59bc(%rip), %rax      # 0xa2d8
cmpq %r13, %rax
je 0x49a5
movq %r14, %rdi
callq 0x4dea
testq %rax, %rax
je 0x497f
movq %rax, %r15
callq 0x4b8a
movq (%r15), %rax
subq 0x5a04(%rip), %rax      # 0xa348
testq %rax, %rax
jg 0x49a5
movq %r14, %rdi
movq %r15, %rsi
callq 0x5188
movq %rbx, %rdi
callq 0x22b0
movb 0x38(%r15), %al
andb $-0x4, %al
orb $0x2, %al
movb %al, 0x38(%r15)
movq 0x30(%r15), %rax
testq %rax, %rax
je 0x490d
addq $-0x20a8, %r15          # imm = 0xDF58
movq %r15, %rdi
callq *%rax
jmp 0x490d
leaq 0x229e(%rip), %rsi      # 0x6c24
leaq 0x22fc(%rip), %rdx      # 0x6c89
leaq 0x2303(%rip), %r8       # 0x6c97
pushq $0x4
popq %rdi
pushq $0x78
popq %rcx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %r12
leaq 0x5974(%rip), %rdi      # 0xa320
callq 0x22b0
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_timer.c
// Function: add_timer
int add_timer(void* http_request, msec_t timeout, timer_handler_t* handler) {
    http_request_t* ev;
    http_timer_t* timer;

    if (http_request == NULL) {
        log_error("event ptr is NULL.");
        return -1;
    }

    if (timeout <= 0) {
        log_error("timeout is invalid.");
        return -1;
    }

    ev = (http_request_t*)http_request;
    timer = &(ev->timer);

    if (timer->timer_set) {
        /* 如果定时器已被设置，则先删除再添加 */
        //log_debug("delete timer first?");
        delete_timer(ev);
    }

    /* 设置标记位和回调函数 */
    timer->timer_set = 1;
    timer->timeout = 0;
    timer->handler = handler;

    update_current_msec();

    /* 设置超时时间 */
    timer->timer_node.key = current_msec + timeout;

    pthread_mutex_lock(&timer_mutex);

    /* 向红黑树中插入节点 */
    //log_debug("ready to insert:%d", timer->timer_node.key);
    if (rbtree_insert(&timer_rbtree, &(timer->timer_node)) != 0) {
        log_error("rbtree insert failed.");
        pthread_mutex_unlock(&timer_mutex);
        return -1;
    }

    pthread_mutex_unlock(&timer_mutex);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x4a83
movq %rsi, %rbx
testq %rsi, %rsi
je 0x4aa2
movq %rdx, %r12
movq %rdi, %r15
leaq 0x20a8(%rdi), %r14
movb 0x20e0(%rdi), %al
testb $0x1, %al
je 0x4a09
movq %r15, %rdi
callq 0x4ae2
movb 0x20e0(%r15), %al
andb $-0x4, %al
incb %al
movb %al, 0x20e0(%r15)
movq %r12, 0x20d8(%r15)
callq 0x4b8a
addq 0x5921(%rip), %rbx      # 0xa348
movq %rbx, 0x20a8(%r15)
leaq 0x58eb(%rip), %rdi      # 0xa320
callq 0x2480
leaq 0x5897(%rip), %rdi      # 0xa2d8
movq %r14, %rsi
callq 0x4f9e
testl %eax, %eax
je 0x4ad2
leaq 0x21cc(%rip), %rsi      # 0x6c24
leaq 0x2248(%rip), %rdx      # 0x6ca7
leaq 0x2272(%rip), %r8       # 0x6cd8
pushq $0x4
popq %rdi
movl $0xce, %ecx
xorl %eax, %eax
callq 0x4c60
leaq 0x58a4(%rip), %rdi      # 0xa320
callq 0x22b0
jmp 0x4ac6
leaq 0x219a(%rip), %rsi      # 0x6c24
leaq 0x2216(%rip), %rdx      # 0x6ca7
leaq 0x2219(%rip), %r8       # 0x6cb1
pushq $0x4
popq %rdi
movl $0xad, %ecx
jmp 0x4abf
leaq 0x217b(%rip), %rsi      # 0x6c24
leaq 0x21f7(%rip), %rdx      # 0x6ca7
leaq 0x220d(%rip), %r8       # 0x6cc4
pushq $0x4
popq %rdi
movl $0xb2, %ecx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5847(%rip), %rdi      # 0xa320
callq 0x22b0
xorl %eax, %eax
jmp 0x4ac9
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_timer.c
// Function: delete_timer
int delete_timer(void* http_request) {
    http_request_t* ev;

    if (http_request == NULL) {
        log_error("event ptr is NULL.");
        return -1;
    }

    ev = (http_request_t*)http_request;

    pthread_mutex_lock(&timer_mutex);

    /* 删除红黑树中的节点 */
    //log_debug("ready to delete:%d", (ev->timer).timer_node.key);
    if (rbtree_delete(&timer_rbtree, &((ev->timer).timer_node)) != 0) {
        log_error("delete rbtree node failed.");
        pthread_mutex_unlock(&timer_mutex);
        return -1;
    }

    pthread_mutex_unlock(&timer_mutex);

    /* 标记红黑树中已经不监控该事件 */
    (ev->timer).timer_set = 0;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4b45
movq %rdi, %rbx
leaq 0x5829(%rip), %rdi      # 0xa320
callq 0x2480
leaq 0x20a8(%rbx), %rsi
leaq 0x57ce(%rip), %rdi      # 0xa2d8
callq 0x5188
testl %eax, %eax
je 0x4b6e
leaq 0x210a(%rip), %rsi      # 0x6c24
leaq 0x21cd(%rip), %rdx      # 0x6cee
leaq 0x21d3(%rip), %r8       # 0x6cfb
pushq $0x4
popq %rdi
movl $0xea, %ecx
xorl %eax, %eax
callq 0x4c60
leaq 0x57e2(%rip), %rdi      # 0xa320
callq 0x22b0
jmp 0x4b69
leaq 0x20d8(%rip), %rsi      # 0x6c24
leaq 0x219b(%rip), %rdx      # 0x6cee
leaq 0x2157(%rip), %r8       # 0x6cb1
pushq $0x4
popq %rdi
movl $0xdf, %ecx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rax
jmp 0x4b83
leaq 0x57ab(%rip), %rdi      # 0xa320
callq 0x22b0
andb $-0x2, 0x20e0(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/http/http_timer.c
// Function: update_current_msec
static int update_current_msec() {
    struct timeval cur_time;
    
    if (gettimeofday(&cur_time, NULL) != 0) {
        return -1;
    }

    current_msec = cur_time.tv_sec * 1000 + cur_time.tv_usec / 1000;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
xorl %ebx, %ebx
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x21a0
testl %eax, %eax
je 0x4ba9
pushq $-0x1
popq %rbx
jmp 0x4bc9
imulq $0x3e8, -0x18(%rbp), %rcx # imm = 0x3E8
movq -0x10(%rbp), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
addq %rcx, %rax
movq %rax, 0x577f(%rip)      # 0xa348
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/log.c
// Function: log_log
void log_log(enum log_level level, const char* file, const char* function, const int line, const char* fmt, ...) {
    char log[MAX_LOG] = { '\0' };
    char date[18] = { '\0' };
    struct tm* tm;
    time_t now;
    va_list args;

    now = time(NULL);
    tm = localtime(&now);
    strftime(date, sizeof(date), "%y-%m-%d %H:%M:%S", tm);

    va_start(args, fmt);
    vsnprintf(log, sizeof(log), fmt, args);
    va_end(args);

    fprintf(stderr, "[%17s][%s(%d):%s]%s%s: \x1B[0m%s\n", 
                    date, file, line, function, level_colors[level], level_strings[level], log);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %r8, %r14
movl %ecx, -0x2c(%rbp)
movq %rdx, -0x40(%rbp)
movq %rsi, -0x38(%rbp)
movl %edi, %r13d
leaq -0x130(%rbp), %r15
movq %r9, 0x28(%r15)
testb %al, %al
je 0x4ccc
movaps %xmm0, -0x100(%rbp)
movaps %xmm1, -0xf0(%rbp)
movaps %xmm2, -0xe0(%rbp)
movaps %xmm3, -0xd0(%rbp)
movaps %xmm4, -0xc0(%rbp)
movaps %xmm5, -0xb0(%rbp)
movaps %xmm6, -0xa0(%rbp)
movaps %xmm7, -0x90(%rbp)
leaq -0x230(%rbp), %r12
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
xorl %esi, %esi
callq 0x21b0
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rbx
movaps %xmm0, (%rbx)
andw $0x0, 0x10(%rbx)
xorl %edi, %edi
callq 0x2290
leaq -0x48(%rbp), %rdi
movq %rax, (%rdi)
callq 0x2040
leaq 0x200b(%rip), %rdx      # 0x6d16
pushq $0x12
popq %rsi
movq %rbx, %rdi
movq %rax, %rcx
callq 0x2360
movabsq $0x3000000028, %rax     # imm = 0x3000000028
leaq -0x80(%rbp), %rcx
movq %rax, (%rcx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rcx)
movq %r15, 0x10(%rcx)
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdi
movq %r14, %rdx
callq 0x20c0
movq 0x52a3(%rip), %rax      # 0x9ff0
movq (%rax), %rdi
movl %r13d, %eax
leaq 0x203a(%rip), %rcx      # 0x6d94
movslq (%rcx,%rax,4), %r10
addq %rcx, %r10
leaq 0x2044(%rip), %rcx      # 0x6dac
movslq (%rcx,%rax,4), %r11
addq %rcx, %r11
subq $0x8, %rsp
leaq 0x1fae(%rip), %rsi      # 0x6d28
movq %rbx, %rdx
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %r8d
movq -0x40(%rbp), %r9
xorl %eax, %eax
pushq %r12
pushq %r11
pushq %r10
callq 0x2240
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/rbtree.c
// Function: rbtree_init
int rbtree_init(volatile rbtree_t* tree, rbtree_node_t* nil, rbtree_insert_func* insert) {
    if (tree == NULL) {
        log_error("rbtree ptr is NULL.");
        return -1;
    }

    rbtree_dye_black(nil);
    tree->root = nil;
    tree->nil = nil;
    tree->insert = insert;

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x4dbf
movb $0x0, 0x8(%rsi)
movq %rsi, (%rdi)
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x1ffa(%rip), %rsi      # 0x6dc4
leaq 0x2005(%rip), %rdx      # 0x6dd6
leaq 0x200a(%rip), %r8       # 0x6de2
pushq $0x4
popq %rdi
pushq $0x16
popq %rcx
xorl %eax, %eax
callq 0x4c60
pushq $-0x1
popq %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/rbtree.c
// Function: rbtree_get_min
rbtree_node_t* rbtree_get_min(volatile rbtree_t* tree) {
    rbtree_node_t* node;
    rbtree_node_t* nil;

    if (tree == NULL) {
        log_error("rbtree ptr is NULL.");
        return NULL;
    }
    
    node = tree->root;
    nil = tree->nil;

    if (node == nil) {
        return NULL;
    }

    while (node->left_son != nil) {
        node = node->left_son;
    }

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4e0f
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
cmpq %rax, %rcx
je 0x4e35
movq %rcx, %rbx
movq 0x10(%rcx), %rcx
cmpq %rax, %rcx
jne 0x4e01
jmp 0x4e37
leaq 0x1fae(%rip), %rsi      # 0x6dc4
leaq 0x1fd9(%rip), %rdx      # 0x6df6
leaq 0x1fbe(%rip), %r8       # 0x6de2
xorl %ebx, %ebx
pushq $0x4
popq %rdi
pushq $0x2a
popq %rcx
xorl %eax, %eax
callq 0x4c60
jmp 0x4e37
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/rbtree.c
// Function: rbtree_find
rbtree_node_t* rbtree_find(volatile rbtree_t* tree, rbtree_key_t key) {
    rbtree_node_t* now;
    rbtree_node_t* nil;
    rbtree_insert_func* insert;

    if (tree == NULL) {
        log_error("rbtree ptr is NULL.");
        return NULL;
    }

    now = tree->root;
    nil = tree->nil;
    insert = tree->insert;

    while (now != nil) {
        /* 通过有符号数比较进行的查找方式 */
        if (insert == rbtree_insert_value) {
            if ((rbtree_key_int_t)key < (rbtree_key_int_t)now->key) {
                now = now->left_son;
            } else if ((rbtree_key_int_t)key > (rbtree_key_int_t)now->key) {
                now = now->right_son;
            } else {
                return now;
            }
        } else if (insert == rbtree_insert_uvalue) {
            /* 通过无符号数比较进行的查找方式 */
            if (key < now->key) {
                now = now->left_son;
            } else if (key > now->key) {
                now = now->right_son;
            } else {
                return now;
            }
        } else if (insert == rbtree_insert_timer) {
            /* timer 的查找方式 */
            if ((rbtree_key_int_t)(key - now->key) < 0) {
                now = now->left_son;
            } else if ((rbtree_key_int_t)(key - now->key) > 0) {
                now = now->right_son;
            } else {
                return now;
            }
        }
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4ebc
movq (%rdi), %rbx
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
leaq 0x8c(%rip), %rdx        # 0x4eea
pushq $0x10
popq %rdi
pushq $0x18
popq %r8
leaq 0xba(%rip), %r9         # 0x4f26
leaq 0xef(%rip), %r10        # 0x4f62
cmpq %rax, %rbx
je 0x4eb8
cmpq %rdx, %rcx
je 0x4e96
cmpq %r9, %rcx
je 0x4ea5
cmpq %r10, %rcx
jne 0x4e73
cmpq (%rbx), %rsi
movq %rdi, %r11
js 0x4eb2
movq %r8, %r11
jne 0x4eb2
jmp 0x4ee0
movq %rdi, %r11
cmpq %rsi, (%rbx)
jg 0x4eb2
movq %r8, %r11
jl 0x4eb2
jmp 0x4ee0
movq %rdi, %r11
cmpq %rsi, (%rbx)
ja 0x4eb2
movq %r8, %r11
jae 0x4ee0
movq (%rbx,%r11), %rbx
jmp 0x4e73
xorl %ebx, %ebx
jmp 0x4ee0
leaq 0x1f01(%rip), %rsi      # 0x6dc4
leaq 0x1f3b(%rip), %rdx      # 0x6e05
leaq 0x1f11(%rip), %r8       # 0x6de2
xorl %ebx, %ebx
pushq $0x4
popq %rdi
pushq $0x52
popq %rcx
xorl %eax, %eax
callq 0x4c60
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/rio.c
// Function: rio_readn
ssize_t rio_readn(int fd, void* usrbuf, size_t* n) {
    size_t nleft = *n;              /* 剩余多少字节未读 */
    ssize_t nread;
    char* bufp = (char*)usrbuf;     /* 读到 usrbuf 的位置 */
    
    while (nleft > 0) {
        if ((nread = read(fd, bufp, nleft)) < 0) {
            if (errno != EINTR) {   /* 当 read 被中断则忽略，否则返回错误 */
                *n = *n - nleft;
                return -1;
            }
        } else if (nread == 0) {    /* 读到 EOF */
            break;
        } else {
            bufp += nread;
            nleft -= nread;
        }
    }
    return (*n - nleft);            /* 返回读了多少字节 */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movl %edi, %r12d
movq (%rdx), %r14
testq %r14, %r14
je 0x5529
movl %r12d, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2200
testq %rax, %rax
jns 0x551f
callq 0x2050
cmpl $0x4, (%rax)
je 0x54fb
jmp 0x5531
je 0x5529
addq %rax, %r15
subq %rax, %r14
jmp 0x54fb
movq (%rbx), %rax
subq %r14, %rax
jmp 0x5537
subq %r14, (%rbx)
pushq $-0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/rio.c
// Function: rio_writen
ssize_t rio_writen(int fd, void* usrbuf, size_t n) {
    size_t nleft = n;       /* 剩余多少字节未写 */
    ssize_t nwrite;       
    char* bufp = usrbuf;    /* 从 usrbuf 写的位置 */

    while (nleft > 0) {
        if ((nwrite = write(fd, bufp, nleft)) <= 0) {
            if (errno != EINTR && errno != EAGAIN) {   /* 当 write 被中断则忽略，否则返回错误 */
                return -1;
            }
        } else {
            bufp += nwrite;
            nleft -= nwrite;
        }
    }
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r15d
pushq $-0x1
popq %r13
movq %rdx, %r12
testq %r12, %r12
je 0x5594
movl %r15d, %edi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20f0
testq %rax, %rax
jg 0x5589
callq 0x2050
movl (%rax), %eax
cmpl $0x4, %eax
je 0x555e
cmpl $0xb, %eax
je 0x555e
jmp 0x5591
addq %rax, %r14
subq %rax, %r12
jmp 0x555e
movq %r13, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/rio.c
// Function: rio_readn_buf
ssize_t	rio_readn_buf(rio_t* rp, void* usrbuf, size_t n) {
    size_t nleft = n;       /* 剩余多少字节未读 */
    ssize_t nread;
    char* bufp = usrbuf;    /* 读到 usrbuf 的位置 */

    while (nleft > 0) {
        if ((nread = rio_read(rp, bufp, nleft)) < 0) {
            return -1;
        } else if (nread == 0) {
            return 0;       /* 读到 EOF，返回 0 */
        } else {
            bufp += nread;
            nleft -= nread;
        }
    }
    return (n - nleft);
}

// 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, %r15
pushq $-0x1
popq %r13
movq %rdx, %r12
testq %r12, %r12
je 0x5602
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x5614
testq %rax, %rax
js 0x55fb
je 0x5600
addq %rax, %r14
subq %rax, %r12
jmp 0x55d9
movq %r13, %rbx
jmp 0x5602
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ttoobne[P]bohttpd/src/core/rio.c
// Function: rio_read
static ssize_t rio_read(rio_t* rp, char* usrbuf, size_t n) {
    size_t cnt;

    while (rp->rio_unread <= 0) {   /* 当内部缓冲区没有内容可读时 */
        if ((rp->rio_unread = read(rp->rio_fd, rp->rio_buf, sizeof rp->rio_buf)) < 0) {
            if (errno != EINTR) {   /* 当 read 被中断则忽略，否则返回错误 */
                return -1;
            }
        } else if (rp->rio_unread == 0) {
            return 0;               /* 读到 EOF，返回 0 */
        } else {
            rp->rio_bufptr = rp->rio_buf;
        }
    }
    
    cnt = rp->rio_unread < n ? rp->rio_unread : n;  /* 实际读到的字节数 */
    memcpy(usrbuf, rp->rio_bufptr, cnt);
    rp->rio_bufptr += cnt;
    rp->rio_unread -= cnt;
    return cnt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, -0x30(%rbp)
movq %rdi, %r14
leaq 0x18(%rdi), %r13
movq 0x8(%rdi), %r15
pushq $-0x1
popq %r12
testq %r15, %r15
jg 0x566d
movl (%r14), %edi
movl $0x2000, %edx           # imm = 0x2000
movq %r13, %rsi
callq 0x2200
movq %rax, %r15
movq %rax, 0x8(%r14)
testq %rax, %rax
js 0x5661
je 0x5691
movq %r13, 0x10(%r14)
jmp 0x5638
callq 0x2050
cmpl $0x4, (%rax)
je 0x5638
jmp 0x5694
cmpq %rbx, %r15
cmovbq %r15, %rbx
movq 0x10(%r14), %rsi
movq -0x30(%rbp), %rdi
movq %rbx, %rdx
callq 0x2280
addq %rbx, 0x10(%r14)
subq %rbx, 0x8(%r14)
movq %rbx, %r12
jmp 0x5694
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq