LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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
movq $0x0, (%r14)
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0x7020
movq (%r14), %rdi
leaq 0x4f6c(%rip), %rsi      # 0x91f3
callq 0x32a0
testl %eax, %eax
je 0x42d1
cmpl $0x0, 0xe34(%rbx)
jne 0x42d1
callq 0x58ee
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x3160
leaq 0x4f62(%rip), %rdx      # 0x9214
movq %rbx, %rdi
movl $0x3, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x6444
callq 0x58ee
movq %rax, %rdi
callq 0x6886
movq 0x10(%rsp), %rdi
callq 0x31f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x3560
movq %rbx, %rdi
callq 0x33e0
leaq 0x38(%rsp), %r14
leaq 0x18(%rsp), %r15
leaq 0xf(%rsp), %r12
leaq 0x9114(%rip), %r13      # 0xd418
movq %rbx, %rdi
callq 0x33b0
movq %rax, %rbp
testq %rax, %rax
je 0x4382
movq (%rbp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x595e
movq 0x8(%rbp), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x595e
movq %r13, %rdi
movq %r14, %rsi
callq 0x599c
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x4364
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x4304
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x33a0
jmp 0x4304
leaq 0x58(%rsp), %rdi
callq 0x7046
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x43aa
jmp 0x43aa
jmp 0x43aa
jmp 0x43aa
movq %rax, %rbx
jmp 0x43ce
jmp 0x43aa
movq %rax, %rbx
jmp 0x43ea
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x43ce
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x43ea
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x33a0
leaq 0x58(%rsp), %rdi
callq 0x7046
movq %rbx, %rdi
callq 0x35e0
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x3, %esi
xorl %eax, %eax
callq 0x3240
movl %eax, %ebp
movl %eax, %edx
orl $0x800, %edx            # imm = 0x800
movl %ebx, %edi
movl $0x4, %esi
xorl %eax, %eax
callq 0x3240
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4533
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x14(%rdi), %esi
cmpl $-0x1, %esi
je 0x452d
leaq 0x4d2a(%rip), %rdi      # 0x9225
xorl %eax, %eax
callq 0x3060
movl 0x8eb8(%rip), %edi      # 0xd3c0
movl 0x14(%rbx), %ebp
movl $0x2, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x34e0
movl %ebp, %edi
callq 0x36b0
movl $0xffffffff, 0x14(%rbx) # imm = 0xFFFFFFFF
decl 0x8f1b(%rip)            # 0xd448
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
movl 0x828(%rdi), %r9d
movl 0x82c(%rdi), %edx
movl $0x2, %eax
movl %edx, %r10d
subl %r9d, %r10d
jge 0x46f8
pushq %rbx
movslq %edx, %r8
leaq 0x28(%rdi), %rcx
leaq (%rdi,%r8), %r11
addq $0x28, %r11
xorl %esi, %esi
movzbl (%r11,%rsi), %ebx
cmpl $0xa, %ebx
je 0x46c4
cmpl $0xd, %ebx
je 0x468c
leal (%rdx,%rsi), %ebx
incl %ebx
movl %ebx, 0x82c(%rdi)
incq %rsi
movl %r10d, %ebx
addl %esi, %ebx
jne 0x4666
jmp 0x46f7
movl %edx, %r10d
subl %r9d, %r10d
leal (%rsi,%r10), %r9d
cmpl $-0x1, %r9d
je 0x46f7
addq %rsi, %rdx
incq %rdx
movslq %edx, %r9
movl $0x1, %eax
cmpb $0xa, (%rcx,%r9)
jne 0x46f7
addq %rdi, %r8
leaq (%rsi,%r8), %rcx
addq $0x28, %rcx
movl %edx, 0x82c(%rdi)
jmp 0x46df
addq %rsi, %r8
movl $0x1, %eax
cmpq $0x2, %r8
jl 0x46f7
addl %esi, %edx
decl %edx
cmpb $0xd, (%rcx,%rdx)
jne 0x46f7
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)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x470c
xorl %eax, %eax
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0xe30(%rdi)
je 0x4751
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 0x4784
cmpl $-0x1, %eax
je 0x4777
addl 0x828(%rbx), %eax
movl %eax, 0x828(%rbx)
jmp 0x4720
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 0x4786
callq 0x3050
cmpl $0xb, (%rax)
sete %al
jmp 0x4786
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4a18
movq %rsi, %r14
leaq 0x48d6(%rip), %rsi      # 0x9260
movl $0xb, %edx
movq %r14, %rdi
callq 0x34a0
testl %eax, %eax
je 0x4a2d
leaq 0x48d1(%rip), %rsi      # 0x9277
movl $0xf, %edx
movq %r14, %rdi
callq 0x34a0
testl %eax, %eax
je 0x4a60
leaq 0x48c5(%rip), %rsi      # 0x9287
movl $0x5, %edx
movq %r14, %rdi
callq 0x34a0
testl %eax, %eax
je 0x4a8c
xorl %ebp, %ebp
cmpl $0x0, 0xe34(%rbx)
jne 0x4aac
callq 0x58ee
leaq 0x489b(%rip), %rdx      # 0x928d
xorl %ebp, %ebp
movq %rax, %rdi
movl $0x1, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x6444
callq 0x58ee
movq %rax, %rdi
callq 0x6886
jmp 0x4aac
cmpl $0x0, 0xd20(%rbx)
je 0x4a85
movl $0x2, 0xc38(%rbx)
jmp 0x4aaa
leaq 0xb(%r14), %rdi
leaq 0x47f7(%rip), %rsi      # 0x922f
callq 0x3140
leaq (%r14,%rax), %rdi
addq $0xb, %rdi
leaq 0x4820(%rip), %rsi      # 0x926c
callq 0x33d0
xorl %ebp, %ebp
testl %eax, %eax
jne 0x4aac
movb $0x1, 0xd24(%rbx)
jmp 0x4aac
leaq 0xf(%r14), %rdi
leaq 0x47c4(%rip), %rsi      # 0x922f
callq 0x3140
leaq (%r14,%rax), %rdi
addq $0xf, %rdi
callq 0x3460
movl %eax, 0xd20(%rbx)
jmp 0x4aaa
movl $0x1, %ebp
jmp 0x4aac
leaq 0x5(%r14), %rdi
leaq 0x4798(%rip), %rsi      # 0x922f
callq 0x3140
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_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x28(%rdi), %r12
movb $0x1, %cl
leaq 0x47aa(%rip), %r14      # 0x92a0
testb $0x1, %cl
je 0x4b04
cmpl $0x2, 0xc38(%rbx)
je 0x4b14
movq %rbx, %rdi
callq 0x4636
testl %eax, %eax
jne 0x4bd9
movslq 0x830(%rbx), %r15
addq %r12, %r15
movl 0x82c(%rbx), %eax
movl %eax, 0x830(%rbx)
cmpl $0x0, 0xe34(%rbx)
jne 0x4b5a
callq 0x58ee
movq %rax, %rdi
movl $0x1, %esi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x6444
callq 0x58ee
movq %rax, %rdi
callq 0x6886
movl 0xc38(%rbx), %eax
cmpl $0x2, %eax
je 0x4b9d
cmpl $0x1, %eax
je 0x4b86
testl %eax, %eax
jne 0x4bdd
movq %rbx, %rdi
movq %r15, %rsi
callq 0x478e
movb $0x1, %cl
cmpl $0x2, %eax
jne 0x4af6
jmp 0x4be4
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4970
movb $0x1, %cl
testl %eax, %eax
je 0x4af6
jmp 0x4bc6
movslq 0xd20(%rbx), %rax
movl 0x82c(%rbx), %edx
addl %eax, %edx
xorl %ecx, %ecx
cmpl %edx, 0x828(%rbx)
jl 0x4af6
movb $0x0, (%r15,%rax)
movq %r15, 0xde8(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4bf6
xorl %eax, %eax
jmp 0x4be9
movl $0x6, %eax
jmp 0x4be9
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x545b
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 0x547d
xorl %ebp, %ebp
jmp 0x5521
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 0x3260
movl 0xc34(%rbx), %ecx
movl $0x3ff, %edx            # imm = 0x3FF
subl %ecx, %edx
cmpl %edx, %eax
setl %bpl
jge 0x5521
addl %eax, %ecx
movl %ecx, 0xc34(%rbx)
cmpl $0x0, 0xe34(%rbx)
jne 0x5521
addq $0x834, %rbx            # imm = 0x834
callq 0x58ee
leaq 0x3e44(%rip), %rdx      # 0x9346
movq %rax, %rdi
movl $0x1, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6444
callq 0x58ee
movq %rax, %rdi
callq 0x6886
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x4ade
testl %eax, %eax
je 0x586b
movq %rbx, %rdi
movl %eax, %esi
callq 0x5622
testb %al, %al
jne 0x5840
movq %rbx, %rdi
movl $0x1, %esi
callq 0x44e2
movl 0x7b7a(%rip), %edi      # 0xd3c0
movl 0x14(%rbx), %edx
movl 0xe30(%rbx), %eax
leaq 0x4(%rsp), %rcx
movl %edx, 0x4(%rcx)
xorl %esi, %esi
cmpl $0x1, %eax
setne %sil
shll $0x1f, %esi
addl $0xc0002004, %esi       # imm = 0xC0002004
jmp 0x5894
movl 0x7b4f(%rip), %edi      # 0xd3c0
movl 0x14(%rbx), %edx
movl 0xe30(%rbx), %eax
leaq 0x4(%rsp), %rcx
movl %edx, 0x4(%rcx)
xorl %esi, %esi
cmpl $0x1, %eax
setne %sil
shll $0x1f, %esi
addl $0xc0002001, %esi       # imm = 0xC0002001
movl %esi, (%rcx)
movl $0x3, %esi
callq 0x34e0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/log/log.cpp
// Function: Log::flush()
void Log::flush(void)
{
    m_mutex.lock();
    //强制刷新写入流缓冲区
    fflush(m_fp);
    m_mutex.unlock();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x140(%rdi), %r14
movq %r14, %rdi
callq 0x3500
movq 0x120(%rbx), %rdi
callq 0x3430
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3300
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x58a6
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0x6ab2
testl %ebp, %ebp
jle 0x6930
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)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
addq $0x20, %rax
addq $-0x20, %r15
jne 0x68fb
movq %rcx, 0x58(%rbx)
movl $0x0, 0x60(%rbx)
movq $-0x1, 0x68(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3480
movq %rax, %r15
movq %r14, %rdi
callq 0x3690
jmp 0x694a
movq %rax, %r15
movq %rbx, %rdi
callq 0x3420
movq %r15, %rdi
callq 0x35e0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3500
movl 0x60(%rbx), %ebp
movl 0x64(%rbx), %r15d
cmpl %r15d, %ebp
jge 0x699a
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 0x3210
incl 0x60(%rbx)
cmpl %r15d, %ebp
setl %bpl
leaq 0x28(%rbx), %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3300
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/log/log.h
// Function: Log::async_write_log()
void *async_write_log()
    {
        string single_log;
        //从阻塞队列中取出一个日志string，写入文件
        while (m_log_queue->pop(single_log))
        {
            m_mutex.lock();
            fputs(single_log.c_str(), m_fp);
            m_mutex.unlock();
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x140(%rdi), %r14
leaq 0x8(%rsp), %r15
movq 0x130(%rbx), %rdi
movq %r15, %rsi
callq 0x6a46
movq %r14, %rdi
callq 0x3500
movq 0x8(%rsp), %rdi
movq 0x120(%rbx), %rsi
callq 0x3400
movq %r14, %rdi
callq 0x3300
jmp 0x69f2
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6a3e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x33a0
movq %rbx, %rdi
callq 0x35e0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3500
leaq 0x28(%rbx), %r15
movl 0x60(%rbx), %ebp
testl %ebp, %ebp
jg 0x6a74
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3520
testl %eax, %eax
je 0x6a5c
jmp 0x6a96
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 0x3210
decl 0x60(%rbx)
testl %ebp, %ebp
setg %bpl
movq %rbx, %rdi
callq 0x3300
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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, %r14d
movq %r8, %rbp
movq %rcx, %r13
movq %rdx, %r12
movq %rdi, %rbx
movl 0x80(%rsp), %r15d
addq $0x70, %rdi
movq %rsi, 0x18(%rsp)
callq 0x3210
leaq 0x90(%rbx), %rdi
movq 0x98(%rbx), %rdx
movl %r14d, 0x14(%rsp)
movsbl %r14b, %r8d
movl $0x1, %ecx
xorl %esi, %esi
callq 0x3650
leaq 0xb0(%rbx), %rdi
movq %r12, 0x20(%rsp)
movq %r12, %rsi
callq 0x3210
leaq 0xd0(%rbx), %rdi
movq %r13, %r12
movq %r13, %rsi
callq 0x3210
leaq 0xf0(%rbx), %rdi
movq %rbp, %r13
movq %rbp, %rsi
callq 0x3210
movl 0x88(%rsp), %eax
movl %eax, 0x110(%rbx)
testl %r15d, %r15d
jle 0x6d70
leaq 0x38(%rbx), %rbp
xorl %edi, %edi
callq 0x3180
testq %rax, %rax
je 0x6dad
movq 0x18(%rsp), %rcx
movq (%rcx), %rsi
movq 0x20(%rsp), %rcx
movq (%rcx), %rdx
movq (%r12), %rcx
movq (%r13), %r8
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
movl 0x14(%rsp), %r9d
callq 0x31c0
testq %rax, %rax
je 0x6dad
movq %rax, %r14
movl $0x18, %edi
callq 0x3390
movq %r14, 0x10(%rax)
movq %rax, %rdi
movq %rbp, %rsi
callq 0x3070
incq 0x48(%rbx)
movl 0x8(%rbx), %esi
incl %esi
movl %esi, 0x8(%rbx)
decl %r15d
jne 0x6d00
jmp 0x6d73
movl 0x8(%rbx), %esi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x709c
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x60(%rbx)
movups %xmm0, 0x50(%rbx)
movq %r14, %rdi
callq 0x3680
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 0x6dde
callq 0x58ee
leaq 0x26ae(%rip), %rdx      # 0x9470
movq %rax, %rdi
movl $0x3, %esi
xorl %eax, %eax
callq 0x6444
callq 0x58ee
movq %rax, %rdi
callq 0x6886
movl $0x1, %edi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6e4d
movq %rdi, %rbx
addq $0x50, %rdi
callq 0x3250
leaq 0x10(%rbx), %r15
movq %r15, %rdi
callq 0x3500
movq 0x38(%rbx), %r12
movq 0x10(%r12), %r14
decq 0x48(%rbx)
movq %r12, %rdi
callq 0x3590
movl $0x18, %esi
movq %r12, %rdi
callq 0x33a0
movq 0x4(%rbx), %xmm0
paddd 0x2612(%rip), %xmm0     # 0x9450
movq %xmm0, 0x4(%rbx)
movq %r15, %rdi
callq 0x3300
jmp 0x6e50
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_O3/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 %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rsi, %rsi
je 0x6ec8
movq %rdi, %r14
leaq 0x10(%rdi), %r15
movq %r15, %rdi
callq 0x3500
leaq 0x38(%r14), %r12
movl $0x18, %edi
callq 0x3390
movq %rbx, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x3070
incq 0x48(%r14)
movq 0x4(%r14), %xmm0
paddd 0x25b2(%rip), %xmm0     # 0x9460
movq %xmm0, 0x4(%r14)
movq %r15, %rdi
callq 0x3300
addq $0x50, %r14
movq %r14, %rdi
callq 0x35b0
testq %rbx, %rbx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3500
cmpq $0x0, 0x48(%r14)
je 0x6f24
leaq 0x38(%r14), %r15
movq (%r15), %r12
cmpq %r15, %r12
je 0x6f14
movq 0x10(%r12), %rdi
callq 0x34d0
movq (%r12), %r12
jmp 0x6eff
movq $0x0, 0x4(%r14)
movq %r15, %rdi
callq 0x70da
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3300
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x48(%rdi), %rax
movq %rax, 0x8(%rsp)
movq %rax, 0x38(%rdi)
xorl %eax, %eax
movq %rax, 0x40(%rdi)
movb %al, 0x48(%rdi)
leaq 0x68(%rdi), %rbp
movq %rbp, 0x58(%rdi)
movq %rax, 0x60(%rdi)
movb %al, 0x68(%rdi)
leaq 0x88(%rdi), %r13
movq %r13, 0x78(%rdi)
movq %rax, 0x80(%rdi)
movb %al, 0x88(%rdi)
leaq 0x1d588(%rdi), %r14
movq %r14, %rdi
callq 0x3e08
movl $0xf680008, %edi        # imm = 0xF680008
callq 0x3030
movq $0x10000, (%rax)        # imm = 0x10000
leaq 0xe10(%rax), %rcx
xorl %edx, %edx
xorl %esi, %esi
leaq (%rcx,%rsi), %rdi
movl $0x0, (%rcx,%rsi)
movq %rdx, 0x8(%rcx,%rsi)
movq %rdi, 0x10(%rcx,%rsi)
movq %rdi, 0x18(%rcx,%rsi)
movq %rdx, 0x20(%rcx,%rsi)
addq $0xf68, %rsi            # imm = 0xF68
cmpq $0xf680000, %rsi        # imm = 0xF680000
jne 0x7194
addq $0x8, %rax
movq %rax, 0x28(%rbx)
leaq 0x10(%rsp), %r15
movl $0xc8, %esi
movq %r15, %rdi
callq 0x31d0
movq %r15, %rdi
callq 0x3150
leaq 0x6(%rax), %rdi
callq 0x34c0
movq %rax, %r12
movq %rax, 0x8(%rbx)
movq %rax, %rdi
movq %r15, %rsi
callq 0x3370
movq %r12, %rdi
callq 0x3150
movl $0x6f6f722f, (%r12,%rax) # imm = 0x6F6F722F
movw $0x74, 0x4(%r12,%rax)
movl $0x200000, %edi         # imm = 0x200000
callq 0x3030
movq %rax, 0x1d580(%rbx)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x723d
movq %rax, %r15
movq %r14, %rdi
callq 0x3e1e
jmp 0x724d
movq %rax, %r15
movq 0x78(%rbx), %rdi
cmpq %r13, %rdi
je 0x7262
movq (%r13), %rsi
incq %rsi
callq 0x33a0
movq 0x58(%rbx), %rdi
cmpq %rbp, %rdi
je 0x7277
movq (%rbp), %rsi
incq %rsi
callq 0x33a0
movq 0x38(%rbx), %rdi
cmpq 0x8(%rsp), %rdi
je 0x7292
movq 0x8(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x33a0
movq %r15, %rdi
callq 0x35e0
// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/webserver.cpp
// Function: WebServer::~WebServer()
WebServer::~WebServer() {
    close(m_epollfd);
    close(m_listenfd);
    close(m_pipefd[1]);
    close(m_pipefd[0]);
    delete[] users;
    delete[] users_timer;
    delete m_pool;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x24(%rdi), %edi
callq 0x36b0
movl 0x1d56c(%rbx), %edi
callq 0x36b0
movl 0x20(%rbx), %edi
callq 0x36b0
movl 0x1c(%rbx), %edi
callq 0x36b0
movq 0x28(%rbx), %r15
testq %r15, %r15
je 0x7312
leaq -0x8(%r15), %r14
movq -0x8(%r15), %r12
testq %r12, %r12
je 0x72ff
addq $-0x168, %r15           # imm = 0xFE98
imulq $0xf68, %r12, %r13      # imm = 0xF68
leaq (%r15,%r13), %rdi
callq 0x5b54
addq $-0xf68, %r13           # imm = 0xF098
jne 0x72ed
imulq $0xf68, %r12, %rsi      # imm = 0xF68
addq $0x8, %rsi
movq %r14, %rdi
callq 0x36a0
movq 0x1d580(%rbx), %rdi
testq %rdi, %rdi
je 0x7323
callq 0x34b0
movq 0xa0(%rbx), %r14
testq %r14, %r14
je 0x7337
movq %r14, %rdi
callq 0x8204
movl $0x80, %esi
movq %r14, %rdi
callq 0x33a0
leaq 0x1d588(%rbx), %rdi
callq 0x3e1e
movq 0x78(%rbx), %rdi
leaq 0x88(%rbx), %rax
cmpq %rax, %rdi
je 0x736b
movq (%rax), %rsi
incq %rsi
callq 0x33a0
movq 0x58(%rbx), %rdi
leaq 0x68(%rbx), %rax
cmpq %rax, %rdi
je 0x7383
movq (%rax), %rsi
incq %rsi
callq 0x33a0
movq 0x38(%rbx), %rdi
addq $0x48, %rbx
cmpq %rbx, %rdi
je 0x73a4
movq (%rbx), %rsi
incq %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x33a0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x5b48
// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/webserver.cpp
// Function: WebServer::sql_pool()
void WebServer::sql_pool() {
    //初始化数据库连接池
    m_connPool = connection_pool::GetInstance();
    // MySQL的默认端口号是 3306
    m_connPool->init("localhost", m_user, m_passWord, m_databaseName, 3306, m_sql_num, m_close_log);

    //初始化数据库读取表
    users->initmysql_result(m_connPool);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
callq 0x6bec
movq %rax, %r14
movq %rax, 0x30(%rbx)
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1fa4(%rip), %rsi      # 0x948e
leaq 0x1fa6(%rip), %rdx      # 0x9497
leaq 0x68(%rsp), %rdi
callq 0x3d72
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x38(%rbx), %rsi
movq 0x40(%rbx), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x3cdc
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x58(%rbx), %rsi
movq 0x60(%rbx), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x3cdc
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x78(%rbx), %rsi
movq 0x80(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x3cdc
movl 0x14(%rbx), %eax
movl 0x98(%rbx), %r10d
leaq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %r14, %rdi
movl $0xcea, %r9d            # imm = 0xCEA
pushq %rax
pushq %r10
callq 0x6c5c
addq $0x10, %rsp
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x75a3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x75ba
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x75d1
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x75e8
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x28(%rbx), %rdi
movq 0x30(%rbx), %rsi
callq 0x4250
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7626
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x33a0
jmp 0x7626
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x7642
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x33a0
jmp 0x7642
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x765e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x33a0
jmp 0x765e
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x7675
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x33a0
movq %rbx, %rdi
callq 0x35e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/webserver.cpp
// Function: WebServer::adjust_timer(tw_timer*)
void WebServer::adjust_timer(tw_timer* timer) {
    /* time_t cur = time(NULL);
    timer->expire = cur + 3 * TIMESLOT;
    utils.m_timer_lst.adjust_timer(timer); 
    int cur = utils.m_time_wheel.cur_slot;
    int ticks = 3*TIMESLOT / utils.m_time_wheel.SI;
    int N = utils.m_time_wheel.N;
    int ts = (cur + (ticks % N)) % N;
    timer->ratation += ticks/N;
    timer->time_slot = ts; */

    utils.m_time_wheel.adjust_timer(timer,3 * TIMESLOT); 

    LOG_INFO("%s", "adjust timer once");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x1d588, %rdi          # imm = 0x1D588
movl $0xc, %edx
callq 0x3f0a
cmpl $0x0, 0x14(%rbx)
je 0x7b93
popq %rbx
retq
callq 0x58ee
leaq 0x1701(%rip), %rdx      # 0x92a0
leaq 0x1951(%rip), %rcx      # 0x94f7
movq %rax, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x6444
callq 0x58ee
movq %rax, %rdi
popq %rbx
jmp 0x6886
nop
// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/webserver.cpp
// Function: WebServer::deal_timer(tw_timer*, int)
void WebServer::deal_timer(tw_timer *timer, int sockfd) {
    timer->cb_func(&users_timer[sockfd]);
    if (timer) {
        // utils.m_timer_lst.del_timer(timer);
        utils.m_time_wheel.del_timer(timer);
    }

    LOG_INFO("close fd %d", users_timer[sockfd].sockfd);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movslq %edx, %r15
shlq $0x5, %r15
movq 0x1d580(%rdi), %rdi
addq %r15, %rdi
callq *0x8(%rsi)
leaq 0x1d588(%rbx), %rdi
movq %r14, %rsi
callq 0x3ebe
cmpl $0x0, 0x14(%rbx)
je 0x7bfe
popq %rbx
popq %r14
popq %r15
retq
callq 0x58ee
movq 0x1d580(%rbx), %rcx
movl 0x10(%rcx,%r15), %ecx
leaq 0x18f3(%rip), %rdx      # 0x9509
movq %rax, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x6444
callq 0x58ee
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x6886
nop
// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/webserver.cpp
// Function: WebServer::dealclinetdata()
bool WebServer::dealclinetdata() {
    struct sockaddr_in client_address;
    socklen_t client_addrlength = sizeof(client_address);
    if (0 == m_LISTENTrigmode)
    {
        int connfd = accept(m_listenfd, (struct sockaddr *)&client_address, &client_addrlength);
        if (connfd < 0)
        {
            LOG_ERROR("%s:errno is:%d", "accept error", errno);
            return false;
        }
        if (http_conn::m_user_count >= MAX_FD)
        {
            utils.show_error(connfd, "Internal server busy");
            LOG_ERROR("%s", "Internal server busy");
            return false;
        }
        timer(connfd, client_address);
    }

    else
    {
        while (1)
        {
            int connfd = accept(m_listenfd, (struct sockaddr *)&client_address, &client_addrlength);
            if (connfd < 0)
            {
                LOG_ERROR("%s:errno is:%d", "accept error", errno);
                break;
            }
            if (http_conn::m_user_count >= MAX_FD)
            {
                utils.show_error(connfd, "Internal server busy");
                LOG_ERROR("%s", "Internal server busy");
                break;
            }
            timer(connfd, client_address);
        }
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %rdx
movl $0x10, (%rdx)
movl 0x1d578(%rdi), %ebp
movl 0x1d56c(%rdi), %edi
leaq 0x10(%rsp), %rsi
callq 0x30e0
testl %ebp, %ebp
je 0x7cba
testl %eax, %eax
js 0x7d12
leaq 0x57cd(%rip), %r12      # 0xd448
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r15
cmpl $0x10000, (%r12)        # imm = 0x10000
jge 0x7cd1
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq 0x7962
movl 0x1d56c(%rbx), %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x30e0
testl %eax, %eax
jns 0x7c85
jmp 0x7d12
testl %eax, %eax
js 0x7d12
leaq 0x5783(%rip), %rcx      # 0xd448
cmpl $0x10000, (%rcx)        # imm = 0x10000
jl 0x7d5a
leaq 0x1d588(%rbx), %rdi
leaq 0x1852(%rip), %rdx      # 0x9531
movl %eax, %esi
callq 0x41f8
cmpl $0x0, 0x14(%rbx)
jne 0x7d18
callq 0x58ee
leaq 0x15a8(%rip), %rdx      # 0x92a0
leaq 0x1832(%rip), %rcx      # 0x9531
xorl %ebx, %ebx
movq %rax, %rdi
movl $0x3, %esi
xorl %eax, %eax
callq 0x6444
jmp 0x7d4b
cmpl $0x0, 0x14(%rbx)
je 0x7d1c
xorl %ebx, %ebx
jmp 0x7d70
callq 0x58ee
movq %rax, %r14
callq 0x3050
movl (%rax), %r8d
leaq 0x17e2(%rip), %rdx      # 0x9515
leaq 0x17ea(%rip), %rcx      # 0x9524
xorl %ebx, %ebx
movq %r14, %rdi
movl $0x3, %esi
xorl %eax, %eax
callq 0x6444
callq 0x58ee
movq %rax, %rdi
callq 0x6886
jmp 0x7d70
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq 0x7962
movb $0x1, %bl
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/webserver.cpp
// Function: WebServer::dealwithsignal(bool&, bool&)
bool WebServer::dealwithsignal(bool &timeout, bool &stop_server)
{
    int ret = 0;
    int sig;
    char signals[1024];
    ret = recv(m_pipefd[0], signals, sizeof(signals), 0);
    if (ret == -1)
    {
        return false;
    }
    else if (ret == 0)
    {
        return false;
    }
    else
    {
        for (int i = 0; i < ret; ++i)
        {
            switch (signals[i])
            {
            case SIGALRM:
            {
                timeout = true;
                break;
            }
            case SIGTERM:
            {
                stop_server = true;
                break;
            }
            }
        }
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rdx, %rbx
movq %rsi, %r14
movl 0x1c(%rdi), %edi
movq %rsp, %rsi
xorl %ebp, %ebp
movl $0x400, %edx            # imm = 0x400
xorl %ecx, %ecx
callq 0x3100
leal 0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x7dda
movb $0x1, %bpl
testl %eax, %eax
jle 0x7dda
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movzbl (%rsp,%rcx), %edx
movq %r14, %rsi
cmpl $0xe, %edx
je 0x7dcf
cmpl $0xf, %edx
jne 0x7dd2
movq %rbx, %rsi
movb $0x1, (%rsi)
incq %rcx
cmpq %rcx, %rax
jne 0x7dbb
movl %ebp, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/webserver.cpp
// Function: WebServer::dealwithread(int)
void WebServer::dealwithread(int sockfd)
{
    tw_timer *timer = users_timer[sockfd].timer;

    //reactor
    if (1 == m_actormodel)
    {
        if (timer)
        {
            adjust_timer(timer);
        }

        //若监测到读事件，将该事件放入请求队列
        m_pool->append(users + sockfd, 0);

        while (true)
        {
            if (1 == users[sockfd].improv)
            {
                if (1 == users[sockfd].timer_flag)
                {
                    deal_timer(timer, sockfd);
                    users[sockfd].timer_flag = 0;
                }
                users[sockfd].improv = 0;
                break;
            }
        }
    }
    else
    {
        //proactor
        if (users[sockfd].read_once())
        {
            LOG_INFO("deal with the client(%s)", inet_ntoa(users[sockfd].get_address()->sin_addr));

            //若监测到读事件，将该事件放入请求队列
            m_pool->append_p(users + sockfd);

            if (timer)
            {
                adjust_timer(timer);
            }
        }
        else
        {
            deal_timer(timer, sockfd);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x1d580(%rdi), %rax
movslq %esi, %r15
movq %r15, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %r14
cmpl $0x1, 0x18(%rdi)
jne 0x7e73
testq %r14, %r14
je 0x7e21
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7b76
movq 0xa0(%rbx), %rdi
imulq $0xf68, %r15, %r15      # imm = 0xF68
movq 0x28(%rbx), %rsi
addq %r15, %rsi
xorl %edx, %edx
callq 0x83e8
movq 0x28(%rbx), %rax
cmpl $0x1, (%rax,%r15)
jne 0x7e61
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x7bc4
movq 0x28(%rbx), %rax
movl $0x0, (%rax,%r15)
movl $0x0, 0x4(%rax,%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
imulq $0xf68, %r15, %r15      # imm = 0xF68
movq 0x28(%rbx), %rdi
addq %r15, %rdi
callq 0x46fa
testb %al, %al
je 0x7ef7
cmpl $0x0, 0x14(%rbx)
jne 0x7ecc
callq 0x58ee
movq %rax, %r12
movq 0x28(%rbx), %rax
movl 0x1c(%rax,%r15), %edi
callq 0x3170
leaq 0x1699(%rip), %rdx      # 0x9546
movq %r12, %rdi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x6444
callq 0x58ee
movq %rax, %rdi
callq 0x6886
movq 0xa0(%rbx), %rdi
addq 0x28(%rbx), %r15
movq %r15, %rsi
callq 0x8472
testq %r14, %r14
je 0x7e6a
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7b76
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7bc4
// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/webserver.cpp
// Function: WebServer::dealwithwrite(int)
void WebServer::dealwithwrite(int sockfd)
{
    tw_timer *timer = users_timer[sockfd].timer;
    //reactor
    if (1 == m_actormodel)
    {
        if (timer)
        {
            adjust_timer(timer);
        }

        m_pool->append(users + sockfd, 1);

        while (true)
        {
            if (1 == users[sockfd].improv)
            {
                if (1 == users[sockfd].timer_flag)
                {
                    deal_timer(timer, sockfd);
                    users[sockfd].timer_flag = 0;
                }
                users[sockfd].improv = 0;
                break;
            }
        }
    }
    else
    {
        //proactor
        if (users[sockfd].write())
        {
            LOG_INFO("send data to the client(%s)", inet_ntoa(users[sockfd].get_address()->sin_addr));

            if (timer)
            {
                adjust_timer(timer);
            }
        }
        else
        {
            deal_timer(timer, sockfd);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x1d580(%rdi), %rax
movslq %esi, %r15
movq %r15, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %r14
cmpl $0x1, 0x18(%rdi)
jne 0x7f9a
testq %r14, %r14
je 0x7f45
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7b76
movq 0xa0(%rbx), %rdi
imulq $0xf68, %r15, %r15      # imm = 0xF68
movq 0x28(%rbx), %rsi
addq %r15, %rsi
movl $0x1, %edx
callq 0x83e8
movq 0x28(%rbx), %rax
cmpl $0x1, (%rax,%r15)
jne 0x7f88
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x7bc4
movq 0x28(%rbx), %rax
movl $0x0, (%rax,%r15)
movl $0x0, 0x4(%rax,%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
imulq $0xf68, %r15, %r12      # imm = 0xF68
movq 0x28(%rbx), %rdi
addq %r12, %rdi
callq 0x5222
testb %al, %al
je 0x800b
cmpl $0x0, 0x14(%rbx)
jne 0x7ff3
callq 0x58ee
movq %rax, %r15
movq 0x28(%rbx), %rax
movl 0x1c(%rax,%r12), %edi
callq 0x3170
leaq 0x158b(%rip), %rdx      # 0x955f
movq %r15, %rdi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x6444
callq 0x58ee
movq %rax, %rdi
callq 0x6886
testq %r14, %r14
je 0x7f91
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7b76
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7bc4
// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/././threadpool/threadpool.h
// Function: threadpool<http_conn>::threadpool(int, connection_pool*, int, int)
threadpool<T>::threadpool( int actor_model, connection_pool *connPool, int thread_number, int max_requests) : m_actor_model(actor_model),m_thread_number(thread_number), m_max_requests(max_requests), m_threads(NULL),m_connPool(connPool)
{
    if (thread_number <= 0 || max_requests <= 0)
        throw std::exception();
    m_threads = new pthread_t[m_thread_number];
    if (!m_threads)
        throw std::exception();
    for (int i = 0; i < thread_number; ++i)
    {
        if (pthread_create(m_threads + i, NULL, worker, this) != 0)
        {
            delete[] m_threads;
            throw std::exception();
        }
        if (pthread_detach(m_threads[i]))
        {
            delete[] m_threads;
            throw std::exception();
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %r12d
movl %ecx, %ebp
movq %rdx, %rbx
movl %esi, %r13d
movq %rdi, %r15
movl %ecx, (%rdi)
movl %r8d, 0x4(%rdi)
xorl %eax, %eax
movq %rax, 0x8(%rdi)
leaq 0x10(%rdi), %r14
movq %r14, 0x18(%rdi)
movq %r14, 0x10(%rdi)
movq %rax, 0x20(%rdi)
addq $0x28, %rdi
movq %rdi, 0x10(%rsp)
callq 0x58a6
leaq 0x50(%r15), %rdi
movq %rdi, 0x8(%rsp)
callq 0x705e
movq %rbx, 0x70(%r15)
movl %r13d, 0x78(%r15)
testl %ebp, %ebp
jle 0x8372
testl %r12d, %r12d
jle 0x8372
movslq (%r15), %rax
leaq (,%rax,8), %rcx
testq %rax, %rax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x3030
movq %rax, 0x8(%r15)
movl %ebp, %ebx
shlq $0x3, %rbx
xorl %r13d, %r13d
leaq 0x1fb(%rip), %r12       # 0x84f0
movq 0x8(%r15), %rdi
addq %r13, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
callq 0x3640
movq 0x8(%r15), %rdi
testl %eax, %eax
jne 0x833a
movq (%rdi,%r13), %rdi
callq 0x32d0
testl %eax, %eax
jne 0x8336
addq $0x8, %r13
cmpq %r13, %rbx
jne 0x82f5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x8344
callq 0x34b0
movl $0x8, %edi
callq 0x31a0
movq 0x4c73(%rip), %rcx      # 0xcfc8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x4c75(%rip), %rsi      # 0xcfd8
movq 0x4c86(%rip), %rdx      # 0xcff0
movq %rax, %rdi
callq 0x35c0
movl $0x8, %edi
callq 0x31a0
movq 0x4c45(%rip), %rcx      # 0xcfc8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x4c47(%rip), %rsi      # 0xcfd8
movq 0x4c58(%rip), %rdx      # 0xcff0
movq %rax, %rdi
callq 0x35c0
movq %rax, %r15
jmp 0x83b9
movq %rax, %r15
jmp 0x83c3
jmp 0x83ac
movq %rax, %r15
movq 0x8(%rsp), %rdi
callq 0x3680
movq 0x10(%rsp), %rdi
callq 0x3420
movq (%r14), %rdi
cmpq %r14, %rdi
je 0x83e0
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x33a0
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x83cb
movq %r15, %rdi
callq 0x35e0
// File: /workspace/github_cpp_makefile_star2_O3/JianjiaoSQ[P]MyPoorWebServer/././threadpool/threadpool.h
// Function: threadpool<http_conn>::append(http_conn*, int)
bool threadpool<T>::append(T *request, int state)
{
    m_queuelocker.lock();
    if (m_workqueue.size() >= m_max_requests)
    {
        m_queuelocker.unlock();
        return false;
    }
    request->m_state = state;
    m_workqueue.push_back(request);
    m_queuelocker.unlock();
    m_queuestat.post();
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movq %r14, %rdi
callq 0x3500
movq 0x20(%rbx), %r13
movslq 0x4(%rbx), %r12
cmpq %r12, %r13
jae 0x8454
leaq 0x10(%rbx), %rax
movq %rax, (%rsp)
movl %ebp, 0x10(%r15)
movl $0x18, %edi
callq 0x3390
movq %r15, 0x10(%rax)
movq %rax, %rdi
movq (%rsp), %rsi
callq 0x3070
incq 0x20(%rbx)
movq %r14, %rdi
callq 0x3300
addq $0x50, %rbx
movq %rbx, %rdi
callq 0x35b0
jmp 0x845c
movq %r14, %rdi
callq 0x3300
cmpq %r12, %r13
setb %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop