// File: /workspace/github_cpp_makefile_star2_O3/yckwong[P]tinywebserver/http/http_conn.cpp
// Function: http_conn::initresultFile(connection_pool*)
void http_conn::initresultFile(connection_pool *connPool)
{
    ofstream out("./CGImysql/id_passwd.txt");
    //先从连接池中取一个连接
    MYSQL *mysql = NULL;
    connectionRAII mysqlcon(&mysql, connPool);

    //在user表中检索username，passwd数据，浏览器端输入
    if (mysql_query(mysql, "SELECT username,passwd FROM user"))
    {
        LOG_ERROR("SELECT error:%s\n", mysql_error(mysql));
    }

    //从表中检索完整的结果集
    MYSQL_RES *result = mysql_store_result(mysql);

    //返回结果集中的列数
    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]);
        out << temp1 << " " << temp2 << endl;
        users[temp1] = temp2;
    }

    out.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x5d1f(%rip), %rsi      # 0xa219
leaq 0x68(%rsp), %rdi
movl $0x10, %edx
callq 0x3460
leaq 0x10(%rsp), %rsi
movq $0x0, (%rsi)
leaq 0x58(%rsp), %rdi
movq %r14, %rdx
callq 0x7a08
movq 0x10(%rsp), %rdi
leaq 0x5cb9(%rip), %rsi      # 0xa1e7
callq 0x32e0
testl %eax, %eax
je 0x4578
cmpl $0x0, 0xe38(%rbx)
jne 0x4578
callq 0x62d8
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x3190
leaq 0x5caf(%rip), %rdx      # 0xa208
movq %rbx, %rdi
movl $0x3, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x6e2c
callq 0x62d8
movq %rax, %rdi
callq 0x726e
movq 0x10(%rsp), %rdi
callq 0x3230
movq %rax, %rbx
movq %rax, %rdi
callq 0x3660
movq %rbx, %rdi
callq 0x3480
leaq 0x38(%rsp), %r14
leaq 0x18(%rsp), %r15
leaq 0x5f01(%rip), %rbp      # 0xa4a7
leaq 0x9eeb(%rip), %r12      # 0xe498
movq %rbx, %rdi
callq 0x3440
movq %rax, %r13
testq %rax, %rax
je 0x469b
movq (%r13), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x6348
movq 0x8(%r13), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x6348
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
leaq 0x68(%rsp), %rdi
callq 0x34c0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x34c0
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %r13, %rdi
callq 0x34c0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3400
movsbl %al, %esi
movq %r13, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x32f0
movq %r12, %rdi
movq %r14, %rsi
callq 0x6386
movq %rax, %rdi
movq %r15, %rsi
callq 0x3250
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x4676
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3430
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x45ad
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3430
jmp 0x45ad
leaq 0x68(%rsp), %rdi
callq 0x35c0
leaq 0x58(%rsp), %rdi
callq 0x7a2e
movq 0x990a(%rip), %rax      # 0xdfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x70(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x68(%rsp,%rcx)
callq 0x3380
leaq 0x160(%rsp), %rdi
callq 0x3130
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4707
jmp 0x4707
movq %rax, %rbx
jmp 0x4751
jmp 0x4707
jmp 0x4707
jmp 0x4707
movq %rax, %rbx
jmp 0x472b
movq %rax, %rbx
jmp 0x4747
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x472b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3430
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x4747
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3430
leaq 0x58(%rsp), %rdi
callq 0x7a2e
leaq 0x68(%rsp), %rdi
callq 0x3600
movq %rbx, %rdi
callq 0x36e0