LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH12_DynamicMemory/exercises/ex12_27_30.cc
// Function: TextQuery::query(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
QueryResult TextQuery::query(const string& sought) const
{
	static shared_ptr<set<line_no>> nodata(new set<line_no>);

	auto loc = wm.find(clean_str(sought));

	if (loc == wm.end())
		return QueryResult(sought, nodata, file);
	else
		return QueryResult(sought, loc->second, file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movb 0x474f(%rip), %al       # 0x7190
testb %al, %al
je 0x2b48
leaq 0x10(%r14), %r12
leaq -0x88(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x2996
movq %r12, %rdi
movq %r13, %rsi
callq 0x39ce
movq %rax, %r13
leaq -0x88(%rbp), %rdi
callq 0x20b0
leaq 0x18(%r14), %rax
cmpq %rax, %r13
je 0x2ad1
leaq -0xa8(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2210
addq $0x40, %r13
leaq -0x48(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x2f1c
leaq -0x38(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x2f5a
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x2ebc
leaq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %r14
jmp 0x2b1e
leaq -0xc8(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2210
leaq 0x4696(%rip), %rsi      # 0x7180
leaq -0x68(%rbp), %r15
movq %r15, %rdi
callq 0x2f1c
leaq -0x58(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x2f5a
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x2ebc
leaq -0x50(%rbp), %rdi
leaq -0x60(%rbp), %r14
callq 0x2648
movq %r14, %rdi
callq 0x2648
movq %r12, %rdi
callq 0x20b0
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4641(%rip), %rdi      # 0x7190
callq 0x2290
testl %eax, %eax
je 0x2a49
pushq $0x30
popq %rdi
callq 0x2190
movq %rax, %rcx
addq $0x8, %rcx
andl $0x0, 0x8(%rax)
andq $0x0, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
andq $0x0, 0x28(%rax)
leaq 0x45f8(%rip), %rdi      # 0x7180
movq %rax, %rsi
callq 0x36e8
leaq 0xb63(%rip), %rdi       # 0x36fa
leaq 0x45e2(%rip), %rsi      # 0x7180
leaq 0x45bb(%rip), %rdx      # 0x7160
callq 0x2160
leaq 0x45df(%rip), %rdi      # 0x7190
callq 0x2110
jmp 0x2a49
movq %rax, %rbx
leaq 0x45cb(%rip), %rdi      # 0x7190
callq 0x2100
jmp 0x2c17
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2648
leaq -0x60(%rbp), %rdi
callq 0x2648
leaq -0xc8(%rbp), %rdi
jmp 0x2c12
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2648
leaq -0x40(%rbp), %rdi
callq 0x2648
leaq -0xa8(%rbp), %rdi
jmp 0x2c12
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH12_DynamicMemory/exercises/ex12_27_30.cc
// Function: print(std::ostream&, QueryResult const&)
ostream& print(ostream& os, const QueryResult& qr)
{
	os << qr.sought << " occurs " << qr.lines->size() << " "
		<< "time(s)" << endl;

	for (auto num : *qr.lines) {
		os << "\t(line " << num + 1 << ") "
			<< qr.file->at(num) << endl;
	}

	return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, -0x30(%rbp)
callq 0x2170
leaq 0x13fd(%rip), %rsi      # 0x403d
movq %rax, %rdi
callq 0x2180
movq 0x20(%r14), %rcx
movq 0x28(%rcx), %rsi
movq %rax, %rdi
callq 0x2120
leaq 0x13f8(%rip), %rsi      # 0x4057
movq %rax, %rdi
callq 0x2180
leaq 0x13d8(%rip), %rsi      # 0x4046
movq %rax, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20d0
movq 0x20(%r14), %rbx
movq 0x18(%rbx), %r12
addq $0x8, %rbx
cmpq %rbx, %r12
je 0x2cee
movq 0x20(%r12), %r15
movq -0x30(%rbp), %rdi
leaq 0x13af(%rip), %rsi      # 0x404e
callq 0x2180
leaq 0x1(%r15), %rsi
movq %rax, %rdi
callq 0x2120
movq %rax, %rdi
leaq 0x139c(%rip), %rsi      # 0x4056
callq 0x2180
movq %rax, %r13
movq 0x30(%r14), %rdi
movq %r15, %rsi
callq 0x2efa
movq %r13, %rdi
movq %rax, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
movq %r12, %rdi
callq 0x21d0
movq %rax, %r12
jmp 0x2c8a
movq -0x30(%rbp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH12_DynamicMemory/exercises/ex12_27_30.cc
// Function: TextQuery::display_map()
void TextQuery::display_map()
{
	// auto iter = wm.cbegin();
	// auto iter_end = wm.cend();

	for (auto iter = wm.cbegin(); iter != wm.cend(); ++iter) {
		cout << "word: " << iter->first << " {";

		// auto text_locs = iter->second;
		// auto loc_iter = text_locs->cbeing()

		for (auto loc_iter = iter->second->cbegin();
			loc_iter != iter->second->cend(); ++loc_iter) {

			cout << *loc_iter << ", ";
		}

		cout << "}\n";

	}
	cout << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
addq $0x18, %rbx
movq 0x42a6(%rip), %r15      # 0x6fc8
leaq 0x133a(%rip), %r13      # 0x4063
cmpq %rbx, %r14
je 0x2db5
movq %r15, %rdi
leaq 0x131d(%rip), %rsi      # 0x4059
callq 0x2180
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
leaq 0x1309(%rip), %rsi      # 0x4060
callq 0x2180
movq 0x40(%r14), %rax
movq 0x18(%rax), %r12
addq $0x8, %rax
cmpq %rax, %r12
je 0x2d96
movq 0x20(%r12), %rsi
movq %r15, %rdi
callq 0x2120
movq %rax, %rdi
movq %r13, %rsi
callq 0x2180
movq %r12, %rdi
callq 0x21d0
movq %rax, %r12
movq 0x40(%r14), %rax
jmp 0x2d64
movq %r15, %rdi
leaq 0x12c6(%rip), %rsi      # 0x4066
callq 0x2180
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
jmp 0x2d29
movq 0x420c(%rip), %rdi      # 0x6fc8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/main.cpp
// Function: main
int main(int argc, char *argv[])
{
    //需要修改的数据库信息,登录名,密码,库名
    string user = "root";
    string passwd = "123456";
    string databasename = "yourdb";

    //命令行解析
    Config config;
    config.parse_arg(argc, argv);
    // 在实例化时 已运行构造函数
    WebServer server; // WebServer类进行封装，直接调用api接口

    //初始化
    server.init(config.PORT, user, passwd, databasename, config.LOGWrite, 
                config.OPT_LINGER, config.TRIGMode,  config.sql_num,  config.thread_num, 
                config.close_log, config.actor_model);
    //日志
    server.log_write();

    //数据库
    server.sql_pool();

    //线程池
    server.thread_pool();

    //触发模式
    server.trig_mode();

    //监听
    server.eventListen();

    //运行
    server.eventLoop();

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1d860, %rsp          # imm = 0x1D860
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4ad6(%rip), %rsi      # 0x847d
leaq 0xc8(%rsp), %rdi
leaq 0xe8(%rsp), %rdx
callq 0x3bd0
leaq 0x4641(%rip), %rsi      # 0x8004
leaq 0xa8(%rsp), %rdi
leaq 0xe8(%rsp), %rdx
callq 0x3bd0
leaq 0x462c(%rip), %rsi      # 0x800b
leaq 0x88(%rsp), %rdi
leaq 0xe8(%rsp), %rdx
callq 0x3bd0
movq %rsp, %rdi
callq 0x7e98
movq %rsp, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x7eb6
leaq 0xe8(%rsp), %rdi
callq 0x6b38
movl (%rsp), %ebx
leaq 0x68(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x3520
leaq 0x48(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x3520
leaq 0x28(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x3520
movl 0x14(%rsp), %eax
movl 0x4(%rsp), %r9d
movl 0x8(%rsp), %r10d
movl 0x18(%rsp), %r11d
movl 0x1c(%rsp), %r14d
movl 0x20(%rsp), %r15d
movl 0x24(%rsp), %r12d
leaq 0xe8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
leaq 0x48(%rsp), %rcx
leaq 0x28(%rsp), %r8
movl %ebx, %esi
pushq %r12
pushq %r15
pushq %r14
pushq %r11
pushq %r10
pushq %rax
callq 0x6d72
addq $0x30, %rsp
leaq 0x28(%rsp), %rdi
callq 0x3190
leaq 0x48(%rsp), %rdi
callq 0x3190
leaq 0x68(%rsp), %rdi
callq 0x3190
leaq 0xe8(%rsp), %rdi
callq 0x6e2e
leaq 0xe8(%rsp), %rdi
callq 0x6e76
leaq 0xe8(%rsp), %rdi
callq 0x6f82
leaq 0xe8(%rsp), %rdi
callq 0x6e00
leaq 0xe8(%rsp), %rdi
callq 0x6fda
leaq 0xe8(%rsp), %rdi
callq 0x781a
leaq 0xe8(%rsp), %rdi
callq 0x6c8c
leaq 0x88(%rsp), %rdi
callq 0x3190
leaq 0xa8(%rsp), %rdi
callq 0x3190
leaq 0xc8(%rsp), %rdi
callq 0x3190
xorl %eax, %eax
addq $0x1d860, %rsp          # imm = 0x1D860
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3190
jmp 0x3b62
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3190
jmp 0x3b71
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x3190
jmp 0x3b93
jmp 0x3b81
jmp 0x3b81
movq %rax, %rbx
jmp 0x3ba0
movq %rax, %rbx
jmp 0x3bad
movq %rax, %rbx
jmp 0x3bba
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x6c8c
leaq 0x88(%rsp), %rdi
callq 0x3190
leaq 0xa8(%rsp), %rdi
callq 0x3190
leaq 0xc8(%rsp), %rdi
callq 0x3190
movq %rbx, %rdi
callq 0x3630
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/time/time_wheel_timer.cpp
// Function: time_wheel::~time_wheel()
time_wheel::~time_wheel() {
    // 遍历每一个槽，并销毁其中的定时器
    for(int i = 0; i < N; ++i) {
        tw_timer* tmp = slots[i];
        while(tmp) {
            slots[i] = tmp->next;
            delete tmp;
            tmp = slots[i];
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
pushq $0x28
popq %r14
cmpq $0x3c, %r15
je 0x3cf3
movq 0x8(%rbx,%r15,8), %rdi
testq %rdi, %rdi
je 0x3cee
movq 0x18(%rdi), %rax
movq %rax, 0x8(%rbx,%r15,8)
movq %r14, %rsi
callq 0x33d0
jmp 0x3cd1
incq %r15
jmp 0x3ccb
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/time/time_wheel_timer.cpp
// Function: time_wheel::del_timer(tw_timer*)
void time_wheel::del_timer(tw_timer* timer) {
    if(!timer) {
        return;
    } 
    int ts = timer->time_slot;
    // 如果是头节点
    if(slots[ts] == timer) {
        slots[ts] = slots[ts]->next;
        if(slots[ts]) {
            slots[ts]->prev = NULL;
        }
        delete timer;
    } else {
        timer->prev->next = timer->next;
        if(timer->next) {
            timer->next->prev = timer->prev;
        }
        delete timer;
    }
}

// Assembly:
testq %rsi, %rsi
je 0x3d64
movslq 0x4(%rsi), %rcx
movq 0x8(%rdi,%rcx,8), %rax
cmpq %rsi, %rax
je 0x3d65
movq 0x18(%rsi), %rax
movq 0x20(%rsi), %rcx
movq %rax, 0x18(%rcx)
testq %rax, %rax
jne 0x3d75
jmp 0x3d79
retq
movq 0x18(%rax), %rax
movq %rax, 0x8(%rdi,%rcx,8)
testq %rax, %rax
je 0x3d79
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
pushq $0x28
popq %rax
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/time/time_wheel_timer.cpp
// Function: time_wheel::tick()
void time_wheel::tick() {
    tw_timer* tmp = slots[cur_slot]; // 取得时间轮上当前槽的头节点
    while(tmp) {
        // 将当前槽位上的定时器链表遍历一遍，对它们的圈数标记-1，表示新的一轮计时开始；
        if(tmp->ratation > 0) {
            tmp->ratation--;
            tmp = tmp->next;
        } else {
        // 说明定时器到期，执行定时任务，然后删除定时器
            tmp->cb_func(tmp->user_data);
            if(tmp == slots[cur_slot]) {
                slots[cur_slot] = tmp->next;
                delete tmp;
                if(slots[cur_slot]) {
                    slots[cur_slot]->prev = NULL;
                }
                tmp = slots[cur_slot];
            } else {
                tmp->prev->next = tmp->next;
                if(tmp->next) {
                    tmp->next->prev = tmp->prev;
                }
                tw_timer* tmp2 = tmp->next;
                delete tmp;
                tmp = tmp2;
            }
        }
    }
    cur_slot = ++cur_slot % N; // 更新时间轮的当前槽，以反映时间轮的转动
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq (%rdi), %rax
movq 0x8(%rdi,%rax,8), %r15
pushq $0x28
popq %r14
testq %r15, %r15
je 0x3e6f
movl (%r15), %eax
testl %eax, %eax
jle 0x3e08
decl %eax
movl %eax, (%r15)
movq 0x18(%r15), %r15
jmp 0x3df1
movq 0x10(%r15), %rdi
callq *0x8(%r15)
movslq (%rbx), %rax
movq 0x18(%r15), %r12
cmpq 0x8(%rbx,%rax,8), %r15
je 0x3e40
movq 0x20(%r15), %rax
movq %r12, 0x18(%rax)
testq %r12, %r12
je 0x3e30
movq %rax, 0x20(%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x33d0
movq %r12, %r15
jmp 0x3df1
movq %r12, 0x8(%rbx,%rax,8)
movq %r15, %rdi
movq %r14, %rsi
callq 0x33d0
movslq (%rbx), %rax
movq 0x8(%rbx,%rax,8), %rcx
movl $0x0, %r15d
testq %rcx, %rcx
je 0x3df1
andq $0x0, 0x20(%rcx)
movq 0x8(%rbx,%rax,8), %r15
jmp 0x3df1
movl (%rbx), %eax
incl %eax
pushq $0x3c
popq %rcx
cltd
idivl %ecx
movl %edx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/time/time_wheel_timer.cpp
// Function: Utils::setnonblocking(int)
int Utils::setnonblocking(int fd)
{
    int old_option = fcntl(fd, F_GETFL);
    int new_option = old_option | O_NONBLOCK;
    fcntl(fd, F_SETFL, new_option);
    return old_option;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
pushq $0x3
popq %rsi
movl %ebx, %edi
xorl %eax, %eax
callq 0x3260
movl %eax, %ebp
movl %eax, %edx
orl $0x800, %edx            # imm = 0x800
pushq $0x4
popq %rsi
movl %ebx, %edi
xorl %eax, %eax
callq 0x3260
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/time/time_wheel_timer.cpp
// Function: Utils::addfd(int, int, bool, int)
void Utils::addfd(int epollfd, int fd, bool one_shot, int TRIGMode)
{
    epoll_event event;
    event.data.fd = fd;

    if (1 == TRIGMode)
        event.events = EPOLLIN | EPOLLET | EPOLLRDHUP;
    else
        event.events = EPOLLIN | EPOLLRDHUP;

    if (one_shot)
        event.events |= EPOLLONESHOT;
    epoll_ctl(epollfd, EPOLL_CTL_ADD, fd, &event);
    setnonblocking(fd);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movl %esi, %edi
leaq 0x4(%rsp), %rax
movl %edx, 0x4(%rax)
xorl %edx, %edx
cmpl $0x1, %r8d
setne %dl
shll $0x1f, %edx
shll $0x1e, %ecx
addl %edx, %ecx
addl $0x80002001, %ecx       # imm = 0x80002001
movl %ecx, (%rax)
pushq $0x1
popq %rsi
movl %ebx, %edx
movq %rax, %rcx
callq 0x3530
movl %ebx, %esi
callq 0x3e90
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/time/time_wheel_timer.cpp
// Function: Utils::sig_handler(int)
void Utils::sig_handler(int sig)
{
    //为保证函数的可重入性，保留原来的errno
    int save_errno = errno;
    int msg = sig;
    send(u_pipefd[1], (char *)&msg, 1, 0);
    errno = save_errno;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
callq 0x3050
movq %rax, %r14
movl (%rax), %ebp
leaq 0xc(%rsp), %rsi
movl %ebx, (%rsi)
movq 0x84da(%rip), %rax      # 0xc400
movl 0x4(%rax), %edi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
callq 0x31d0
movl %ebp, (%r14)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/time/time_wheel_timer.cpp
// Function: Utils::addsig(int, void (*)(int), bool)
void Utils::addsig(int sig, void(handler)(int), bool restart)
{
    struct sigaction sa;
    memset(&sa, '\0', sizeof(sa));
    sa.sa_handler = handler;
    if (restart)
        sa.sa_flags |= SA_RESTART;
    sigfillset(&sa.sa_mask);
    assert(sigaction(sig, &sa, NULL) != -1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %ebx
leaq 0x8(%rsp), %r15
movl $0x90, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x3240
movq %r14, -0x8(%r15)
testl %ebp, %ebp
je 0x3f7b
movl $0x10000000, 0x88(%rsp) # imm = 0x10000000
leaq 0x8(%rsp), %rdi
callq 0x30f0
movq %rsp, %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0x34c0
cmpl $-0x1, %eax
je 0x3fa4
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4091(%rip), %rdi      # 0x803c
leaq 0x40aa(%rip), %rsi      # 0x805c
leaq 0x40bd(%rip), %rcx      # 0x8076
movl $0xed, %edx
callq 0x32b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/http/http_conn.cpp
// Function: http_conn::initmysql_result(connection_pool*)
void http_conn::initmysql_result(connection_pool *connPool)
{
    //先从连接池中取一个连接
    MYSQL *mysql = NULL;
    connectionRAII mysqlcon(&mysql, connPool);
 
    //在user表中检索username，passwd数据，浏览器端输入
    if (mysql_query(mysql, "SELECT username,passwd FROM user")) // 如果查询成功，返回0。如果出现错误，返回非0值。
    {
        LOG_ERROR("SELECT error:%s\n", mysql_error(mysql));
    }

    //从表中检索完整的结果集
    MYSQL_RES *result = mysql_store_result(mysql); // 查询之后必须调用；具有多个结果的MYSQL_RES结果集合。如果出现错误，返回NULL。

    //返回结果集中的列数
    int num_fields = mysql_num_fields(result);

    //返回所有字段结构的数组
    MYSQL_FIELD *fields = mysql_fetch_fields(result);

    //从结果集中获取下一行，将对应的用户名和密码，存入map中
    while (MYSQL_ROW row = mysql_fetch_row(result))
    {
        string temp1(row[0]);
        string temp2(row[1]);
        users[temp1] = temp2;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
andq $0x0, (%r14)
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
callq 0x6936
movq (%r14), %rdi
leaq 0x418f(%rip), %rsi      # 0x81f3
callq 0x32c0
testl %eax, %eax
je 0x40ac
cmpl $0x0, 0xe34(%rbx)
jne 0x40ac
callq 0x53e8
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x3170
leaq 0x4185(%rip), %rdx      # 0x8214
pushq $0x3
popq %rsi
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x5e86
callq 0x53e8
movq %rax, %rdi
callq 0x6246
movq 0x10(%rsp), %rdi
callq 0x3210
movq %rax, %rbx
movq %rax, %rdi
callq 0x35a0
movq %rbx, %rdi
callq 0x3410
leaq 0x48(%rsp), %r14
leaq 0x28(%rsp), %r15
leaq 0xf(%rsp), %r12
leaq 0x8361(%rip), %r13      # 0xc440
movq %rbx, %rdi
callq 0x33e0
movq %rax, %rbp
testq %rax, %rax
je 0x4135
movq (%rbp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x3bd0
movq 0x8(%rbp), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x3bd0
movq %r13, %rdi
movq %r14, %rsi
callq 0x5458
movq %rax, %rdi
movq %r15, %rsi
callq 0x3230
movq %r15, %rdi
callq 0x3190
movq %r14, %rdi
callq 0x3190
jmp 0x40df
leaq 0x18(%rsp), %rdi
callq 0x695c
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x415d
jmp 0x415d
jmp 0x415d
jmp 0x415d
movq %rax, %rbx
jmp 0x416f
jmp 0x415d
movq %rax, %rbx
jmp 0x4179
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3190
leaq 0x48(%rsp), %rdi
callq 0x3190
leaq 0x18(%rsp), %rdi
callq 0x695c
movq %rbx, %rdi
callq 0x3630
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/http/http_conn.cpp
// Function: setnonblocking(int)
int setnonblocking(int fd)
{
    int old_option = fcntl(fd, F_GETFL);
    int new_option = old_option | O_NONBLOCK;
    fcntl(fd, F_SETFL, new_option);
    return old_option;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x3
popq %rsi
xorl %eax, %eax
callq 0x3260
movl %eax, %ebp
movl %eax, %edx
orl $0x800, %edx            # imm = 0x800
pushq $0x4
popq %rsi
movl %ebx, %edi
xorl %eax, %eax
callq 0x3260
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/http/http_conn.cpp
// Function: addfd(int, int, bool, int)
void addfd(int epollfd, int fd, bool one_shot, int TRIGMode)
{
    epoll_event event;  // 用于注册所感兴趣的事件和回传所发生待处理的事件
    event.data.fd = fd;

    if (1 == TRIGMode)  // events表示感兴趣的事件和被触发的事件
    /*  EPOLLIN：表示对应的文件描述符可以读；
        EPOLLET：ET的epoll工作模式；
        EPOLLHUP：表示对应的文件描述符被挂断；*/
        event.events = EPOLLIN | EPOLLET | EPOLLRDHUP;
    else
        event.events = EPOLLIN | EPOLLRDHUP;

    if (one_shot)
        event.events |= EPOLLONESHOT;
        // EPOLL_CTL_ADD注册、EPOLL_CTL_MOD修改、EPOLL_CTL_DEL删除；
    epoll_ctl(epollfd, EPOLL_CTL_ADD, fd, &event); // 用于控制某个文件描述符上的事件，可以注册事件，修改事件，删除事件。
    setnonblocking(fd);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
leaq 0x4(%rsp), %rax
movl %esi, 0x4(%rax)
xorl %esi, %esi
cmpl $0x1, %ecx
setne %sil
shll $0x1f, %esi
shll $0x1e, %edx
leal (%rsi,%rdx), %ecx
addl $0x80002001, %ecx       # imm = 0x80002001
movl %ecx, (%rax)
pushq $0x1
popq %rsi
movl %ebx, %edx
movq %rax, %rcx
callq 0x3530
movl %ebx, %edi
callq 0x418b
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/http/http_conn.cpp
// Function: http_conn::close_conn(bool)
void http_conn::close_conn(bool real_close)
{
    if (real_close && (m_sockfd != -1))
    {
        printf("close %d\n", m_sockfd);
        removefd(m_epollfd, m_sockfd);
        m_sockfd = -1;
        m_user_count--;
    }
}

// Assembly:
testl %esi, %esi
je 0x4283
pushq %rbx
movq %rdi, %rbx
movl 0x14(%rdi), %esi
cmpl $-0x1, %esi
je 0x4282
leaq 0x3fc2(%rip), %rdi      # 0x8225
xorl %eax, %eax
callq 0x3060
movl 0x8178(%rip), %edi      # 0xc3e8
movl 0x14(%rbx), %esi
callq 0x41fc
orl $-0x1, 0x14(%rbx)
decl 0x81ee(%rip)            # 0xc470
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/http/http_conn.cpp
// Function: http_conn::init(int, sockaddr_in const&, char*, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void http_conn::init(int sockfd, const sockaddr_in &addr, char *root, int TRIGMode,
                     int close_log, string user, string passwd, string sqlname)
{
    m_sockfd = sockfd;
    m_address = addr;

    addfd(m_epollfd, sockfd, true, m_TRIGMode);  // m_TRIGMode ?? 传值 
    m_user_count++;

    //当浏览器出现连接重置时，可能是网站根目录出错或http响应格式出错或者访问的文件中内容完全为空
    doc_root = root;
    m_TRIGMode = TRIGMode;
    m_close_log = close_log;

    strcpy(sql_user, user.c_str());
    strcpy(sql_passwd, passwd.c_str());
    strcpy(sql_name, sqlname.c_str());

    init();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movl %r8d, %r14d
movq %rcx, %r15
movq %rdi, %rbx
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
movq 0x48(%rsp), %r13
movq 0x40(%rsp), %r12
movl %esi, 0x14(%rdi)
movups (%rdx), %xmm0
movups %xmm0, 0x18(%rdi)
movl 0x812a(%rip), %edi      # 0xc3e8
movl 0xe30(%rbx), %ecx
pushq $0x1
popq %rdx
callq 0x41b9
incl 0x819e(%rip)            # 0xc470
movq %r15, 0xdf8(%rbx)
movl %r14d, 0xe30(%rbx)
movl %ebp, 0xe34(%rbx)
leaq 0xe38(%rbx), %rdi
movq (%r12), %rsi
callq 0x33a0
leaq 0xe9c(%rbx), %rdi
movq (%r13), %rsi
callq 0x33a0
leaq 0xf00(%rbx), %rdi
movq (%rsp), %rax
movq (%rax), %rsi
callq 0x33a0
andq $0x0, 0xdf0(%rbx)
andl $0x0, 0xde4(%rbx)
leaq 0x28(%rbx), %rdi
xorps %xmm0, %xmm0
andl $0x0, 0x10(%rbx)
movups %xmm0, (%rbx)
movl $0xcfd, %edx            # imm = 0xCFD
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3240
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/http/http_conn.cpp
// Function: http_conn::parse_line()
http_conn::LINE_STATUS http_conn::parse_line()
{
    char temp;
    for (; m_checked_idx < m_read_idx; ++m_checked_idx)
    {
        temp = m_read_buf[m_checked_idx];
        if (temp == '\r')
        {
            if ((m_checked_idx + 1) == m_read_idx)
                return LINE_OPEN;
            else if (m_read_buf[m_checked_idx + 1] == '\n')
            {
                m_read_buf[m_checked_idx++] = '\0';
                m_read_buf[m_checked_idx++] = '\0';
                return LINE_OK;
            }
            return LINE_BAD;
        }
        else if (temp == '\n')
        {
            if (m_checked_idx > 1 && m_read_buf[m_checked_idx - 1] == '\r')
            {
                m_read_buf[m_checked_idx - 1] = '\0';
                m_read_buf[m_checked_idx++] = '\0';
                return LINE_OK;
            }
            return LINE_BAD;
        }
    }
    return LINE_OPEN;
}

// Assembly:
pushq %rbx
movslq 0x828(%rdi), %r8
movslq 0x82c(%rdi), %rdx
leaq 0x28(%rdi), %rcx
leal 0x1(%rdx), %r9d
leaq (%rdi,%rdx), %r10
addq $0x28, %r10
xorl %esi, %esi
movl $0x2, %eax
leaq (%rdx,%rsi), %r11
cmpq %r8, %r11
jge 0x4437
movzbl (%r10,%rsi), %ebx
cmpl $0xa, %ebx
je 0x4400
cmpl $0xd, %ebx
je 0x43ce
leal (%r9,%rsi), %r11d
movl %r11d, 0x82c(%rdi)
incq %rsi
jmp 0x43a2
leal 0x1(%rdx), %r9d
movl %r9d, %r10d
subl %r8d, %r10d
movl %esi, %r8d
addl %r10d, %r8d
je 0x4437
addq %rsi, %r9
movslq %r9d, %rax
cmpb $0xa, (%rcx,%rax)
jne 0x4432
addq %rdi, %rdx
leaq (%rsi,%rdx), %rcx
addq $0x28, %rcx
movl %r9d, 0x82c(%rdi)
jmp 0x4418
movl $0x1, %eax
cmpq $0x2, %r11
jl 0x4437
addl %esi, %edx
decl %edx
cmpb $0xd, (%rcx,%rdx)
jne 0x4437
addq %rdx, %rcx
xorl %eax, %eax
movb %al, (%rcx)
movslq 0x82c(%rdi), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x82c(%rdi)
movb %al, 0x28(%rdi,%rcx)
jmp 0x4437
movl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/http/http_conn.cpp
// Function: http_conn::read_once()
bool http_conn::read_once()
{
    if (m_read_idx >= READ_BUFFER_SIZE)
    {
        return false;
    }
    int bytes_read = 0;

    //LT读取数据
    if (0 == m_TRIGMode)
    {
        bytes_read = recv(m_sockfd, m_read_buf + m_read_idx, READ_BUFFER_SIZE - m_read_idx, 0);
        m_read_idx += bytes_read;

        if (bytes_read <= 0)
        {
            return false;
        }

        return true;
    }
    //ET读数据
    else
    {
        while (true)
        {
            bytes_read = recv(m_sockfd, m_read_buf + m_read_idx, READ_BUFFER_SIZE - m_read_idx, 0);
            if (bytes_read == -1)
            {
                if (errno == EAGAIN || errno == EWOULDBLOCK)
                    break;
                return false;
            }
            else if (bytes_read == 0)
            {
                return false;
            }
            m_read_idx += bytes_read;
        }
        return true;
    }
}

// Assembly:
movslq 0x828(%rdi), %rax
cmpq $0x7ff, %rax            # imm = 0x7FF
jle 0x444c
xorl %eax, %eax
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0xe30(%rdi)
je 0x4491
leaq 0x28(%rbx), %r14
movl 0x14(%rbx), %edi
cltq
leaq (%r14,%rax), %rsi
movl $0x800, %ecx            # imm = 0x800
subl %eax, %ecx
movslq %ecx, %rdx
xorl %ecx, %ecx
callq 0x3100
testl %eax, %eax
je 0x44c4
cmpl $-0x1, %eax
je 0x44b7
addl 0x828(%rbx), %eax
movl %eax, 0x828(%rbx)
jmp 0x4460
movl 0x14(%rbx), %edi
leaq (%rbx,%rax), %rsi
addq $0x28, %rsi
movl $0x800, %edx            # imm = 0x800
subl %eax, %edx
xorl %ecx, %ecx
callq 0x3100
addl %eax, 0x828(%rbx)
testl %eax, %eax
setg %al
jmp 0x44c6
callq 0x3050
cmpl $0xb, (%rax)
sete %al
jmp 0x44c6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/http/http_conn.cpp
// Function: http_conn::parse_headers(char*)
http_conn::HTTP_CODE http_conn::parse_headers(char *text)
{
    if (text[0] == '\0')
    {
        if (m_content_length != 0)
        {
            m_check_state = CHECK_STATE_CONTENT;
            return NO_REQUEST;
        }
        return GET_REQUEST;
    }
    else if (strncasecmp(text, "Connection:", 11) == 0)
    {
        text += 11;
        text += strspn(text, " \t");
        if (strcasecmp(text, "keep-alive") == 0)
        {
            m_linger = true;
        }
    }
    else if (strncasecmp(text, "Content-length:", 15) == 0)
    {
        text += 15;
        text += strspn(text, " \t");
        m_content_length = atol(text);
    }
    else if (strncasecmp(text, "Host:", 5) == 0)
    {
        text += 5;
        text += strspn(text, " \t");
        m_host = text;
    }
    else
    {
        LOG_INFO("oop!unknow header: %s", text);
    }
    return NO_REQUEST;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpb $0x0, (%rsi)
je 0x4744
movq %rsi, %r14
leaq 0x3ba2(%rip), %rsi      # 0x8260
pushq $0xb
popq %rdx
movq %r14, %rdi
callq 0x34d0
testl %eax, %eax
je 0x4759
leaq 0x3b9f(%rip), %rsi      # 0x8277
pushq $0xf
popq %rdx
movq %r14, %rdi
callq 0x34d0
testl %eax, %eax
je 0x478c
leaq 0x3b95(%rip), %rsi      # 0x8287
pushq $0x5
popq %rdx
movq %r14, %rdi
callq 0x34d0
testl %eax, %eax
je 0x47b6
xorl %ebp, %ebp
cmpl $0x0, 0xe34(%rbx)
jne 0x47d6
callq 0x53e8
leaq 0x3b6d(%rip), %rdx      # 0x828d
xorl %ebp, %ebp
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x5e86
callq 0x53e8
movq %rax, %rdi
callq 0x6246
jmp 0x47d6
cmpl $0x0, 0xd20(%rbx)
je 0x47b1
movl $0x2, 0xc38(%rbx)
jmp 0x47d4
leaq 0xb(%r14), %rdi
leaq 0x3acb(%rip), %rsi      # 0x822f
callq 0x3150
leaq (%r14,%rax), %rdi
addq $0xb, %rdi
leaq 0x3af4(%rip), %rsi      # 0x826c
callq 0x3400
xorl %ebp, %ebp
testl %eax, %eax
jne 0x47d6
movb $0x1, 0xd24(%rbx)
jmp 0x47d6
leaq 0xf(%r14), %rdi
leaq 0x3a98(%rip), %rsi      # 0x822f
callq 0x3150
leaq (%r14,%rax), %rdi
addq $0xf, %rdi
callq 0x3490
movl %eax, 0xd20(%rbx)
jmp 0x47d4
pushq $0x1
popq %rbp
jmp 0x47d6
leaq 0x5(%r14), %rdi
leaq 0x3a6e(%rip), %rsi      # 0x822f
callq 0x3150
addq %r14, %rax
addq $0x5, %rax
movq %rax, 0xd18(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/http/http_conn.cpp
// Function: http_conn::process_read()
http_conn::HTTP_CODE http_conn::process_read()
{
    LINE_STATUS line_status = LINE_OK;
    HTTP_CODE ret = NO_REQUEST;
    char *text = 0;

    while ((m_check_state == CHECK_STATE_CONTENT && line_status == LINE_OK) || ((line_status = parse_line()) == LINE_OK))
    {
        text = get_line();
        m_start_line = m_checked_idx;
        LOG_INFO("%s", text);
        switch (m_check_state)
        {
        case CHECK_STATE_REQUESTLINE:
        {
            ret = parse_request_line(text);
            if (ret == BAD_REQUEST)
                return BAD_REQUEST;
            break;
        }
        case CHECK_STATE_HEADER:
        {
            ret = parse_headers(text);
            if (ret == BAD_REQUEST)
                return BAD_REQUEST;
            else if (ret == GET_REQUEST)
            {
                return do_request();
            }
            break;
        }
        case CHECK_STATE_CONTENT:
        {
            ret = parse_content(text);
            if (ret == GET_REQUEST)
                return do_request();
            line_status = LINE_OPEN;
            break;
        }
        default:
            return INTERNAL_ERROR;
        }
    }
    return NO_REQUEST;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x28(%rdi), %r13
movb $0x1, %cl
leaq 0x3a7f(%rip), %r14      # 0x82a0
pushq $0x1
popq %r15
pushq $0x6
popq %rbp
testb $0x1, %cl
je 0x4836
cmpl $0x2, 0xc38(%rbx)
je 0x4846
movq %rbx, %rdi
callq 0x437c
testl %eax, %eax
jne 0x490c
movslq 0x830(%rbx), %r12
addq %r13, %r12
movl 0x82c(%rbx), %eax
movl %eax, 0x830(%rbx)
cmpl $0x0, 0xe34(%rbx)
jne 0x488a
callq 0x53e8
movq %rax, %rdi
movl %r15d, %esi
movq %r14, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x5e86
callq 0x53e8
movq %rax, %rdi
callq 0x6246
movl 0xc38(%rbx), %eax
cmpl $0x2, %eax
je 0x48cd
cmpl $0x1, %eax
je 0x48b6
testl %eax, %eax
jne 0x4913
movq %rbx, %rdi
movq %r12, %rsi
callq 0x44ce
movb $0x1, %cl
cmpl $0x2, %eax
jne 0x4828
jmp 0x4910
movq %rbx, %rdi
movq %r12, %rsi
callq 0x46a4
movb $0x1, %cl
testl %eax, %eax
je 0x4828
jmp 0x48f6
movslq 0xd20(%rbx), %rax
movl 0x82c(%rbx), %edx
addl %eax, %edx
xorl %ecx, %ecx
cmpl %edx, 0x828(%rbx)
jl 0x4828
movb $0x0, (%r12,%rax)
movq %r12, 0xde8(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4924
xorl %ebp, %ebp
jmp 0x4913
pushq $0x2
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/http/http_conn.cpp
// Function: http_conn::write()
bool http_conn::write()
{
    int temp = 0;

    if (bytes_to_send == 0)
    {
        modfd(m_epollfd, m_sockfd, EPOLLIN, m_TRIGMode);
        init();
        return true;
    }

    while (1)
    {
        temp = writev(m_sockfd, m_iv, m_iv_count);

        if (temp < 0)
        {
            if (errno == EAGAIN)
            {
                modfd(m_epollfd, m_sockfd, EPOLLOUT, m_TRIGMode);
                return true;
            }
            unmap();
            return false;
        }

        bytes_have_send += temp;
        bytes_to_send -= temp;
        if (bytes_have_send >= m_iv[0].iov_len)
        {
            m_iv[0].iov_len = 0;
            m_iv[1].iov_base = m_file_address + (bytes_have_send - m_write_idx);
            m_iv[1].iov_len = bytes_to_send;
        }
        else
        {
            m_iv[0].iov_base = m_write_buf + bytes_have_send;
            m_iv[0].iov_len = m_iv[0].iov_len - bytes_have_send;
        }

        if (bytes_to_send <= 0)
        {
            unmap();
            modfd(m_epollfd, m_sockfd, EPOLLIN, m_TRIGMode);

            if (m_linger) // 写完之后是否保持连接
            {
                init();
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0xdf0(%rdi)
je 0x4f7c
leaq 0xdc0(%rbx), %r14
leaq 0x834(%rbx), %r15
movl 0x14(%rbx), %edi
movl 0xde0(%rbx), %edx
movq %r14, %rsi
callq 0x3220
testl %eax, %eax
js 0x4fbe
movslq 0xdf4(%rbx), %rcx
movslq %eax, %rdx
addq %rdx, %rcx
movl %ecx, 0xdf4(%rbx)
movslq 0xdf0(%rbx), %rax
subq %rdx, %rax
movl %eax, 0xdf0(%rbx)
movq 0xdc8(%rbx), %rdx
subq %rcx, %rdx
jbe 0x4f23
addq %r15, %rcx
movq %rcx, (%r14)
jmp 0x4f47
movslq 0xc34(%rbx), %rdx
movslq %ecx, %rcx
subq %rdx, %rcx
addq 0xd28(%rbx), %rcx
movq %rcx, 0xdd0(%rbx)
movq %rax, 0xdd8(%rbx)
xorl %edx, %edx
movq %rdx, 0xdc8(%rbx)
testl %eax, %eax
jg 0x4ed3
movq %rbx, %rdi
callq 0x4e8a
movl 0x7488(%rip), %edi      # 0xc3e8
movl 0x14(%rbx), %esi
movl 0xe30(%rbx), %ecx
pushq $0x1
popq %rdx
callq 0x4213
cmpb $0x1, 0xd24(%rbx)
je 0x4f93
jmp 0x4feb
movl 0x7466(%rip), %edi      # 0xc3e8
movl 0x14(%rbx), %esi
movl 0xe30(%rbx), %ecx
pushq $0x1
popq %rdx
callq 0x4213
andq $0x0, 0xdf0(%rbx)
andl $0x0, 0xde4(%rbx)
leaq 0x28(%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andl $0x0, 0x10(%rbx)
movl $0xcfd, %edx            # imm = 0xCFD
xorl %esi, %esi
callq 0x3240
jmp 0x4fdf
callq 0x3050
cmpl $0xb, (%rax)
jne 0x4fe3
movl 0x741a(%rip), %edi      # 0xc3e8
movl 0x14(%rbx), %esi
movl 0xe30(%rbx), %ecx
pushq $0x4
popq %rdx
callq 0x4213
movb $0x1, %al
jmp 0x4fed
movq %rbx, %rdi
callq 0x4e8a
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/http/http_conn.cpp
// Function: http_conn::add_response(char const*, ...)
bool http_conn::add_response(const char *format, ...)
{
    if (m_write_idx >= WRITE_BUFFER_SIZE)
        return false;
    va_list arg_list;
    va_start(arg_list, format);
    int len = vsnprintf(m_write_buf + m_write_idx, WRITE_BUFFER_SIZE - 1 - m_write_idx, format, arg_list);
    if (len >= (WRITE_BUFFER_SIZE - 1 - m_write_idx))
    {
        va_end(arg_list);
        return false;
    }
    m_write_idx += len;
    va_end(arg_list);

    LOG_INFO("request:%s", m_write_buf);

    return true;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0xd8, %rsp
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x503d
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 %r8, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
cmpl $0x3ff, 0xc34(%rdi)     # imm = 0x3FF
jle 0x505f
xorl %ebp, %ebp
jmp 0x5101
movq %rsi, %r10
movq %rdi, %rbx
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
movslq 0xc34(%rdi), %rax
addq %rax, %rdi
addq $0x834, %rdi            # imm = 0x834
movl $0x3ff, %esi            # imm = 0x3FF
subq %rax, %rsi
movq %r10, %rdx
callq 0x3280
movl 0xc34(%rbx), %ecx
movl $0x3ff, %edx            # imm = 0x3FF
subl %ecx, %edx
cmpl %edx, %eax
setl %bpl
jge 0x5101
addl %eax, %ecx
movl %ecx, 0xc34(%rbx)
cmpl $0x0, 0xe34(%rbx)
jne 0x5101
addq $0x834, %rbx            # imm = 0x834
callq 0x53e8
leaq 0x3262(%rip), %rdx      # 0x8346
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x5e86
callq 0x53e8
movq %rax, %rdi
callq 0x6246
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/http/http_conn.cpp
// Function: http_conn::process()
void http_conn::process()
{
    HTTP_CODE read_ret = process_read();
    if (read_ret == NO_REQUEST)
    {
        modfd(m_epollfd, m_sockfd, EPOLLIN, m_TRIGMode);
        return;
    }
    bool write_ret = process_write(read_ret);
    if (!write_ret)
    {
        close_conn();
    }
    modfd(m_epollfd, m_sockfd, EPOLLOUT, m_TRIGMode);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4806
testl %eax, %eax
je 0x5383
movq %rbx, %rdi
movl %eax, %esi
callq 0x51c4
pushq $0x4
popq %rbp
testb %al, %al
jne 0x5386
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x424c
jmp 0x5386
pushq $0x1
popq %rbp
movl 0x705c(%rip), %edi      # 0xc3e8
movl 0x14(%rbx), %esi
movl 0xe30(%rbx), %ecx
movl %ebp, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4213
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/log/block_queue.h
// Function: block_queue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::block_queue(int)
block_queue(int max_size = 1000)
    {
        if (max_size <= 0)
        {
            exit(-1);
        }

        m_max_size = max_size;
        m_array = new T[max_size];
        m_size = 0;
        m_front = -1;
        m_back = -1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x53a2
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0x6490
testl %ebp, %ebp
jle 0x62e7
movl %ebp, 0x64(%rbx)
movl %ebp, %r12d
movq %r12, %r15
shlq $0x5, %r15
leaq 0x8(%r15), %rdi
callq 0x3030
movq %r12, (%rax)
leaq 0x8(%rax), %rcx
addq $0x18, %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
addq $0x20, %rax
addq $-0x20, %r15
jne 0x62bb
movq %rcx, 0x58(%rbx)
andl $0x0, 0x60(%rbx)
orq $-0x1, 0x68(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rdi
callq 0x34b0
movq %rax, %r15
movq %r14, %rdi
callq 0x36e0
jmp 0x62ff
movq %rax, %r15
movq %rbx, %rdi
callq 0x3450
movq %r15, %rdi
callq 0x3630
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/log/block_queue.h
// Function: block_queue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::push(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool push(const T &item)
    {

        m_mutex.lock();
        if (m_size >= m_max_size)
        {

            m_cond.broadcast();
            m_mutex.unlock();
            return false;
        }

        m_back = (m_back + 1) % m_max_size;
        m_array[m_back] = item;

        m_size++;

        m_cond.broadcast();
        m_mutex.unlock();
        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x54be
movl 0x60(%rbx), %ebp
movl 0x64(%rbx), %r15d
cmpl %r15d, %ebp
jge 0x6384
movl 0x6c(%rbx), %eax
incl %eax
cltd
idivl %r15d
movl %edx, 0x6c(%rbx)
movslq %edx, %rdi
shlq $0x5, %rdi
addq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x3230
incl 0x60(%rbx)
cmpl %r15d, %ebp
setl %bpl
leaq 0x28(%rbx), %rdi
callq 0x64ca
movq %rbx, %rdi
callq 0x5522
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/log/block_queue.h
// Function: block_queue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::pop(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool pop(T &item)
    {

        m_mutex.lock();
        while (m_size <= 0)
        {
            
            if (!m_cond.wait(m_mutex.get()))
            {
                m_mutex.unlock();
                return false;
            }
        }

        m_front = (m_front + 1) % m_max_size;
        item = m_array[m_front];
        m_size--;
        m_mutex.unlock();
        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x54be
leaq 0x28(%rbx), %r15
movl 0x60(%rbx), %ebp
testl %ebp, %ebp
jg 0x6444
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6482
testb %al, %al
jne 0x642c
jmp 0x6466
movl 0x68(%rbx), %eax
incl %eax
cltd
idivl 0x64(%rbx)
movl %edx, 0x68(%rbx)
movslq %edx, %rsi
shlq $0x5, %rsi
addq 0x58(%rbx), %rsi
movq %r14, %rdi
callq 0x3230
decl 0x60(%rbx)
testl %ebp, %ebp
setg %bpl
movq %rbx, %rdi
callq 0x5522
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/CGImysql/sql_connection_pool.cpp
// Function: connection_pool::init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int)
void connection_pool::init(string url, string User, string PassWord, string DBName, int Port, int MaxConn, int close_log)
{
	m_url = url;
	m_Port = Port;
	m_User = User;
	m_PassWord = PassWord;
	m_DatabaseName = DBName;
	m_close_log = close_log;

	for (int i = 0; i < MaxConn; i++)
	{
		MYSQL *con = NULL;
		con = mysql_init(con);

		if (con == NULL)
		{
			LOG_ERROR("MySQL Error");
			exit(1);
		}
		// mysql_real_connect()尝试与运行在主机上的MySQL数据库引擎建立连接
		con = mysql_real_connect(con, url.c_str(), User.c_str(), PassWord.c_str(), DBName.c_str(), Port, NULL, 0);
		// 连接失败，返回NULL
		if (con == NULL) 
		{
			LOG_ERROR("MySQL Error");
			exit(1);
		}
		connList.push_back(con);
		++m_FreeConn;
	}

	reserve = sem(m_FreeConn);

	m_MaxConn = m_FreeConn;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, %ebp
movq %r8, 0x18(%rsp)
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %rbx
movl 0x80(%rsp), %r14d
addq $0x70, %rdi
movq %rsi, 0x20(%rsp)
callq 0x3230
leaq 0x90(%rbx), %rdi
movl %ebp, 0x14(%rsp)
movsbl %bpl, %esi
callq 0x35f0
leaq 0xb0(%rbx), %rdi
movq %r13, %r15
movq %r13, %rsi
callq 0x3230
leaq 0xd0(%rbx), %rdi
movq %r12, %r13
movq %r12, %rsi
callq 0x3230
leaq 0xf0(%rbx), %rdi
movq 0x18(%rsp), %rsi
movq %rsi, %r12
callq 0x3230
movl 0x88(%rsp), %eax
movl %eax, 0x110(%rbx)
leaq 0x38(%rbx), %rbp
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
subl $0x1, %r14d
jb 0x6723
andq $0x0, 0x28(%rsp)
xorl %edi, %edi
callq 0x31a0
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x6760
movq 0x20(%rsp), %rcx
movq (%rcx), %rsi
movq (%r15), %rdx
movq (%r13), %rcx
movq (%r12), %r8
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
movl 0x14(%rsp), %r9d
callq 0x31e0
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x6760
movq %rbp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x69b0
incl 0x8(%rbx)
jmp 0x66bf
movl 0x8(%rbx), %esi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x69bc
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x60(%rbx)
movups %xmm0, 0x50(%rbx)
movq %r14, %rdi
callq 0x36c0
movl 0x8(%rbx), %eax
movl %eax, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x110(%rbx)
jne 0x678f
callq 0x53e8
leaq 0x1cfb(%rip), %rdx      # 0x8470
pushq $0x3
popq %rsi
movq %rax, %rdi
xorl %eax, %eax
callq 0x5e86
callq 0x53e8
movq %rax, %rdi
callq 0x6246
pushq $0x1
popq %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/CGImysql/sql_connection_pool.cpp
// Function: connection_pool::GetConnection()
MYSQL *connection_pool::GetConnection()
{
	MYSQL *con = NULL;

	if (0 == connList.size())
		return NULL;

	reserve.wait();
	
	lock.lock();

	con = connList.front();
	connList.pop_front();

	--m_FreeConn;
	++m_CurConn;

	lock.unlock();
	return con;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x48(%rdi)
je 0x67ef
movq %rdi, %rbx
leaq 0x38(%rdi), %r15
addq $0x50, %rdi
callq 0x69f8
leaq 0x10(%rbx), %r12
movq %r12, %rdi
callq 0x54be
movq 0x38(%rbx), %rax
movq 0x10(%rax), %r14
movq %r15, %rdi
callq 0x6a06
movq 0x4(%rbx), %xmm0
paddd 0x1c70(%rip), %xmm0     # 0x8450
movq %xmm0, 0x4(%rbx)
movq %r12, %rdi
callq 0x5522
jmp 0x67f2
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/CGImysql/sql_connection_pool.cpp
// Function: connection_pool::ReleaseConnection(MYSQL*)
bool connection_pool::ReleaseConnection(MYSQL *con) 
{
	if (NULL == con)
		return false;

	lock.lock();

	connList.push_back(con); // 连接地址 插入链表；
	++m_FreeConn;
	--m_CurConn;

	lock.unlock();

	reserve.post();
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rsi, 0x8(%rsp)
testq %rsi, %rsi
je 0x685d
movq %rdi, %r14
leaq 0x10(%rdi), %r15
movq %r15, %rdi
callq 0x54be
leaq 0x38(%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x69b0
movq 0x4(%r14), %xmm0
paddd 0x1c1d(%rip), %xmm0     # 0x8460
movq %xmm0, 0x4(%r14)
movq %r15, %rdi
callq 0x5522
addq $0x50, %r14
movq %r14, %rdi
callq 0x6a0e
testq %rbx, %rbx
setne %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/CGImysql/sql_connection_pool.cpp
// Function: connection_pool::DestroyPool()
void connection_pool::DestroyPool()
{

	lock.lock();
	if (connList.size() > 0)
	{
		list<MYSQL *>::iterator it;
		for (it = connList.begin(); it != connList.end(); ++it)
		{
			MYSQL *con = *it;
			mysql_close(con);
		}
		m_CurConn = 0;
		m_FreeConn = 0;
		connList.clear();
	}

	lock.unlock();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x54be
cmpq $0x0, 0x48(%r14)
je 0x68b5
leaq 0x38(%r14), %r15
movq %r15, %r12
movq (%r12), %r12
cmpq %r15, %r12
je 0x68a8
movq 0x10(%r12), %rdi
callq 0x3510
jmp 0x6893
andq $0x0, 0x4(%r14)
movq %r15, %rdi
callq 0x6a1c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5522
// File: /workspace/github_cpp_makefile_star2_O2/JianjiaoSQ[P]MyPoorWebServer/webserver.cpp
// Function: WebServer::WebServer()
WebServer::WebServer() {
    //http_conn类对象
    users = new http_conn[MAX_FD];

    //root文件夹路径
    char server_path[200];
    getcwd(server_path, 200);
    char root[6] = "/root";
    m_root = (char *)malloc(strlen(server_path) + strlen(root) + 1);
    strcpy(m_root, server_path);
    strcat(m_root, root);   // 文件地址

    //定时器
    users_timer = new client_data[MAX_FD];
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq 0x48(%rdi), %rax
movq %rax, 0x38(%rdi)
andq $0x0, 0x40(%rdi)
xorl %eax, %eax
movb %al, 0x48(%rdi)
leaq 0x68(%rdi), %rcx
movq %rcx, 0x58(%rdi)
andq $0x0, 0x60(%rdi)
movb %al, 0x68(%rdi)
leaq 0x88(%rdi), %rcx
movq %rcx, 0x78(%rdi)
andq $0x0, 0x80(%rdi)
movb %al, 0x88(%rdi)
leaq 0x1d588(%rdi), %r14
movq %r14, %rdi
callq 0x3ca4
movl $0xf680008, %edi        # imm = 0xF680008
callq 0x3030
movq $0x10000, (%rax)        # imm = 0x10000
leaq 0xe10(%rax), %rcx
xorl %edx, %edx
leaq (%rcx,%rdx), %rsi
andl $0x0, (%rcx,%rdx)
andq $0x0, 0x8(%rcx,%rdx)
movq %rsi, 0x10(%rcx,%rdx)
movq %rsi, 0x18(%rcx,%rdx)
andq $0x0, 0x20(%rcx,%rdx)
addq $0xf68, %rdx            # imm = 0xF68
cmpq $0xf680000, %rdx        # imm = 0xF680000
jne 0x6bad
addq $0x8, %rax
movq %rax, 0x28(%rbx)
movq %rsp, %r15
movl $0xc8, %esi
movq %r15, %rdi
callq 0x31f0
movq %r15, %rdi
callq 0x3160
leaq 0x6(%rax), %rdi
callq 0x3500
movq %rax, %r12
movq %rax, 0x8(%rbx)
movq %rax, %rdi
movq %r15, %rsi
callq 0x33a0
movq %r12, %rdi
callq 0x3160
movl $0x6f6f722f, (%r12,%rax) # imm = 0x6F6F722F
movw $0x74, 0x4(%r12,%rax)
movl $0x200000, %edi         # imm = 0x200000
callq 0x3030
movq %rax, 0x1d580(%rbx)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x6c50
movq %rax, %r15
movq %r14, %rdi
callq 0x3cbc
jmp 0x6c60
movq %rax, %r15
leaq 0x38(%rbx), %r14
leaq 0x58(%rbx), %r12
addq $0x78, %rbx
movq %rbx, %rdi
callq 0x3190
movq %r12, %rdi
callq 0x3190
movq %r14, %rdi
callq 0x3190
movq %r15, %rdi
callq 0x3630