LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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 0x4a9a
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 0x4a66
cmpl $0xd, %ebx
je 0x4a2e
leal (%rdx,%rsi), %ebx
incl %ebx
movl %ebx, 0x82c(%rdi)
incq %rsi
movl %r10d, %ebx
addl %esi, %ebx
jne 0x4a08
jmp 0x4a99
movl %edx, %r10d
subl %r9d, %r10d
leal (%rsi,%r10), %r9d
cmpl $-0x1, %r9d
je 0x4a99
addq %rsi, %rdx
incq %rdx
movslq %edx, %r9
movl $0x1, %eax
cmpb $0xa, (%rcx,%r9)
jne 0x4a99
addq %rdi, %r8
leaq (%rsi,%r8), %rcx
addq $0x28, %rcx
movl %edx, 0x82c(%rdi)
jmp 0x4a81
addq %rsi, %r8
movl $0x1, %eax
cmpq $0x2, %r8
jl 0x4a99
addl %esi, %edx
decl %edx
cmpb $0xd, (%rcx,%rdx)
jne 0x4a99
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_O1/lszp[P]SmallWebServer/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;
    while (true)
    {
        // 从套接字接受数据，存储在m_read_buf缓冲区
        bytes_read = recv(m_sockfd, m_read_buf + m_read_idx, READ_BUFFER_SIZE - m_read_idx, 0);
        if (bytes_read == -1)
        {
            // 非阻塞ET模式下，需要一次性将数据读完
            if (errno == EAGAIN || errno == EWOULDBLOCK)
                break;
            return false;
        }
        else if (bytes_read == 0)
        {
            return false;
        }
        m_read_idx += bytes_read;
    }
    return true;
}

// Assembly:
cmpl $0x7ff, 0x828(%rdi)     # imm = 0x7FF
jle 0x4aab
xorl %eax, %eax
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movl 0x14(%rbx), %edi
movslq 0x828(%rbx), %rax
leaq (%r14,%rax), %rsi
movl $0x800, %edx            # imm = 0x800
subq %rax, %rdx
xorl %ecx, %ecx
callq 0x3120
testl %eax, %eax
je 0x4af1
cmpl $-0x1, %eax
je 0x4ae4
addl %eax, 0x828(%rbx)
jmp 0x4ab6
callq 0x3060
cmpl $0xb, (%rax)
sete %al
jmp 0x4af3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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 0x4d8e
movq %rsi, %r14
leaq 0x55a1(%rip), %rsi      # 0xa2a1
movl $0xb, %edx
movq %r14, %rdi
callq 0x3560
testl %eax, %eax
je 0x4da3
leaq 0x559c(%rip), %rsi      # 0xa2b8
movl $0xf, %edx
movq %r14, %rdi
callq 0x3560
testl %eax, %eax
je 0x4dd6
leaq 0x5590(%rip), %rsi      # 0xa2c8
movl $0x5, %edx
movq %r14, %rdi
callq 0x3560
testl %eax, %eax
je 0x4e02
xorl %ebp, %ebp
cmpl $0x0, 0xe38(%rbx)
jne 0x4e22
callq 0x629e
leaq 0x5566(%rip), %rdx      # 0xa2ce
xorl %ebp, %ebp
movq %rax, %rdi
movl $0x1, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
callq 0x7216
jmp 0x4e22
cmpl $0x0, 0xd20(%rbx)
je 0x4dfb
movl $0x2, 0xc38(%rbx)
jmp 0x4e20
leaq 0xb(%r14), %rdi
leaq 0x54c2(%rip), %rsi      # 0xa270
callq 0x3170
leaq (%r14,%rax), %rdi
addq $0xb, %rdi
leaq 0x54eb(%rip), %rsi      # 0xa2ad
callq 0x3470
xorl %ebp, %ebp
testl %eax, %eax
jne 0x4e22
movb $0x1, 0xd24(%rbx)
jmp 0x4e22
leaq 0xf(%r14), %rdi
leaq 0x548f(%rip), %rsi      # 0xa270
callq 0x3170
leaq (%r14,%rax), %rdi
addq $0xf, %rdi
callq 0x3510
movl %eax, 0xd20(%rbx)
jmp 0x4e20
movl $0x1, %ebp
jmp 0x4e22
leaq 0x5(%r14), %rdi
leaq 0x5463(%rip), %rsi      # 0xa270
callq 0x3170
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_O1/lszp[P]SmallWebServer/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 0x5475(%rip), %r14      # 0xa2e1
testb $0x1, %cl
je 0x4e7a
cmpl $0x2, 0xc38(%rbx)
je 0x4e8a
movq %rbx, %rdi
callq 0x49d8
testl %eax, %eax
jne 0x4f4f
movslq 0x830(%rbx), %r15
addq %r12, %r15
movl 0x82c(%rbx), %eax
movl %eax, 0x830(%rbx)
cmpl $0x0, 0xe38(%rbx)
jne 0x4ed0
callq 0x629e
movq %rax, %rdi
movl $0x1, %esi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
callq 0x7216
movl 0xc38(%rbx), %eax
cmpl $0x2, %eax
je 0x4f13
cmpl $0x1, %eax
je 0x4efc
testl %eax, %eax
jne 0x4f53
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4afc
movb $0x1, %cl
cmpl $0x2, %eax
jne 0x4e6c
jmp 0x4f5a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4ce6
movb $0x1, %cl
testl %eax, %eax
je 0x4e6c
jmp 0x4f3c
movslq 0xd20(%rbx), %rax
movl 0x82c(%rbx), %edx
addl %eax, %edx
xorl %ecx, %ecx
cmpl %edx, 0x828(%rbx)
jl 0x4e6c
movb $0x0, (%r15,%rax)
movq %r15, 0xde8(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4f6c
xorl %eax, %eax
jmp 0x4f5f
movl $0x6, %eax
jmp 0x4f5f
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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 0x5e0b
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 0x5e2d
xorl %ebp, %ebp
jmp 0x5ed1
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 0x32a0
movl 0xc34(%rbx), %ecx
movl $0x3ff, %edx            # imm = 0x3FF
subl %ecx, %edx
cmpl %edx, %eax
setl %bpl
jge 0x5ed1
addl %eax, %ecx
movl %ecx, 0xc34(%rbx)
cmpl $0x0, 0xe38(%rbx)
jne 0x5ed1
addq $0x834, %rbx            # imm = 0x834
callq 0x629e
leaq 0x4528(%rip), %rdx      # 0xa3da
movq %rax, %rdi
movl $0x1, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
callq 0x7216
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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 0x4e54
testl %eax, %eax
je 0x621b
movq %rbx, %rdi
movl %eax, %esi
callq 0x5fd2
testb %al, %al
jne 0x61f0
movq %rbx, %rdi
movl $0x1, %esi
callq 0x486a
movl 0x824a(%rip), %edi      # 0xe440
movl 0x14(%rbx), %edx
movl 0xe34(%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 0x6244
movl 0x821f(%rip), %edi      # 0xe440
movl 0x14(%rbx), %edx
movl 0xe34(%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 0x35b0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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 0x35f0
movq 0x120(%rbx), %rdi
callq 0x34e0
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3350
nop
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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 0x6256
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0x7468
testl %ebp, %ebp
jle 0x72c0
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 0x728b
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 0x3530
movq %rax, %r15
movq %r14, %rdi
callq 0x3790
jmp 0x72da
movq %rax, %r15
movq %rbx, %rdi
callq 0x34d0
movq %r15, %rdi
callq 0x36e0
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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 0x35f0
movl 0x60(%rbx), %ebp
movl 0x64(%rbx), %r15d
cmpl %r15d, %ebp
jge 0x7350
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 0x3250
incl 0x60(%rbx)
cmpl %r15d, %ebp
setl %bpl
leaq 0x28(%rbx), %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x3350
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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 0x73fc
movq %r14, %rdi
callq 0x35f0
movq 0x8(%rsp), %rdi
movq 0x120(%rbx), %rsi
callq 0x34a0
movq %r14, %rdi
callq 0x3350
jmp 0x73a8
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x73f4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3430
movq %rbx, %rdi
callq 0x36e0
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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 0x35f0
leaq 0x28(%rbx), %r15
movl 0x60(%rbx), %ebp
testl %ebp, %ebp
jg 0x742a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3620
testl %eax, %eax
je 0x7412
jmp 0x744c
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 0x3250
decl 0x60(%rbx)
testl %ebp, %ebp
setg %bpl
movq %rbx, %rdi
callq 0x3350
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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);
		}
		con = mysql_real_connect(con, url.c_str(), User.c_str(), PassWord.c_str(), DBName.c_str(), Port, NULL, 0);  // 连接MYSQL服务器

		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 0x3250
leaq 0x90(%rbx), %rdi
movq 0x98(%rbx), %rdx
movl %r14d, 0x14(%rsp)
movsbl %r14b, %r8d
movl $0x1, %ecx
xorl %esi, %esi
callq 0x3750
leaq 0xb0(%rbx), %rdi
movq %r12, 0x20(%rsp)
movq %r12, %rsi
callq 0x3250
leaq 0xd0(%rbx), %rdi
movq %r13, %r12
movq %r13, %rsi
callq 0x3250
leaq 0xf0(%rbx), %rdi
movq %rbp, %r13
movq %rbp, %rsi
callq 0x3250
movl 0x88(%rsp), %eax
movl %eax, 0x110(%rbx)
testl %r15d, %r15d
jle 0x771d
leaq 0x38(%rbx), %rbp
xorl %edi, %edi
callq 0x31b0
testq %rax, %rax
je 0x775a
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 0x3200
testq %rax, %rax
je 0x775a
movq %rax, %r14
movl $0x18, %edi
callq 0x3420
movq %r14, 0x10(%rax)
movq %rax, %rdi
movq %rbp, %rsi
callq 0x3080
incq 0x48(%rbx)
incl 0x8(%rbx)
decl %r15d
jne 0x76b4
movl 0x8(%rbx), %esi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x7a32
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x60(%rbx)
movups %xmm0, 0x50(%rbx)
movq %r14, %rdi
callq 0x3780
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 0x778b
callq 0x629e
leaq 0x2d78(%rip), %rdx      # 0xa4e7
movq %rax, %rdi
movl $0x3, %esi
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
callq 0x7216
movl $0x1, %edi
callq 0x3530
nop
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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 0x77ef
movq %rdi, %rbx
addq $0x50, %rdi
callq 0x3290
leaq 0x10(%rbx), %r15
movq %r15, %rdi
callq 0x35f0
movq 0x38(%rbx), %r12
movq 0x10(%r12), %r14
decq 0x48(%rbx)
movq %r12, %rdi
callq 0x3690
movl $0x18, %esi
movq %r12, %rdi
callq 0x3430
decl 0x8(%rbx)
incl 0x4(%rbx)
movq %r15, %rdi
callq 0x3350
jmp 0x77f2
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_O1/lszp[P]SmallWebServer/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 0x785e
movq %rdi, %r14
leaq 0x10(%rdi), %r15
movq %r15, %rdi
callq 0x35f0
leaq 0x38(%r14), %r12
movl $0x18, %edi
callq 0x3420
movq %rbx, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x3080
incq 0x48(%r14)
incl 0x8(%r14)
decl 0x4(%r14)
movq %r15, %rdi
callq 0x3350
addq $0x50, %r14
movq %r14, %rdi
callq 0x36b0
testq %rbx, %rbx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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 0x35f0
cmpq $0x0, 0x48(%r14)
je 0x78ba
leaq 0x38(%r14), %r15
movq (%r15), %r12
cmpq %r15, %r12
je 0x78aa
movq 0x10(%r12), %rdi
callq 0x3590
movq (%r12), %r12
jmp 0x7895
movq $0x0, 0x4(%r14)
movq %r15, %rdi
callq 0x7a70
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3350
nop
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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), %rcx
movq %rcx, (%rsp)
movq %rcx, 0x58(%rdi)
movq %rax, 0x60(%rdi)
movb %al, 0x68(%rdi)
leaq 0x88(%rdi), %rbp
movq %rbp, 0x78(%rdi)
movq %rax, 0x80(%rdi)
movb %al, 0x88(%rdi)
leaq 0x1d578(%rdi), %r14
movq %r14, %rdi
callq 0x3f10
leaq 0x1d590(%rbx), %r15
movq %r15, %rdi
callq 0x3f10
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 0x7b3b
addq $0x8, %rax
movq %rax, 0x28(%rbx)
leaq 0x10(%rsp), %r12
movl $0xc8, %esi
movq %r12, %rdi
callq 0x3210
movq %r12, %rdi
callq 0x3180
leaq 0x6(%rax), %rdi
callq 0x3580
movq %rax, %r13
movq %rax, 0x8(%rbx)
movq %rax, %rdi
movq %r12, %rsi
callq 0x33f0
movq %r13, %rdi
callq 0x3180
movl $0x6f6f722f, (%r13,%rax) # imm = 0x6F6F722F
movw $0x74, 0x4(%r13,%rax)
movl $0x200000, %edi         # imm = 0x200000
callq 0x3030
movq %rax, 0x1d588(%rbx)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7be5
movq %rax, %r12
movq %r15, %rdi
callq 0x3f18
jmp 0x7bf5
movq %rax, %r12
movq %r14, %rdi
callq 0x3f18
jmp 0x7c02
movq %rax, %r12
movq 0x78(%rbx), %rdi
cmpq %rbp, %rdi
je 0x7c17
movq (%rbp), %rsi
incq %rsi
callq 0x3430
movq 0x58(%rbx), %rdi
cmpq (%rsp), %rdi
je 0x7c30
movq (%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3430
movq 0x38(%rbx), %rdi
cmpq 0x8(%rsp), %rdi
je 0x7c4b
movq 0x8(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3430
movq %r12, %rdi
callq 0x36e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/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 0x37b0
movl 0x1d56c(%rbx), %edi
callq 0x37b0
movl 0x20(%rbx), %edi
callq 0x37b0
movl 0x1c(%rbx), %edi
callq 0x37b0
movq 0x28(%rbx), %r15
testq %r15, %r15
je 0x7ccc
leaq -0x8(%r15), %r14
movq -0x8(%r15), %r12
testq %r12, %r12
je 0x7cb9
addq $-0x168, %r15           # imm = 0xFE98
imulq $0xf68, %r12, %r13      # imm = 0xF68
leaq (%r15,%r13), %rdi
callq 0x6504
addq $-0xf68, %r13           # imm = 0xF098
jne 0x7ca7
imulq $0xf68, %r12, %rsi      # imm = 0xF68
addq $0x8, %rsi
movq %r14, %rdi
callq 0x37a0
movq 0x1d588(%rbx), %rdi
testq %rdi, %rdi
je 0x7cdd
callq 0x3570
movq 0xa0(%rbx), %r14
testq %r14, %r14
je 0x7cfe
movq %r14, %rdi
callq 0x8bec
movl $0x80, %esi
movq %r14, %rdi
callq 0x3430
leaq 0x1d590(%rbx), %rdi
callq 0x3f18
leaq 0x1d578(%rbx), %rdi
callq 0x3f18
movq 0x78(%rbx), %rdi
leaq 0x88(%rbx), %rax
cmpq %rax, %rdi
je 0x7d31
movq (%rax), %rsi
incq %rsi
callq 0x3430
movq 0x58(%rbx), %rdi
leaq 0x68(%rbx), %rax
cmpq %rax, %rdi
je 0x7d49
movq (%rax), %rsi
incq %rsi
callq 0x3430
movq 0x38(%rbx), %rdi
addq $0x48, %rbx
cmpq %rbx, %rdi
je 0x7d6a
movq (%rbx), %rsi
incq %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3430
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x64f8
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/webserver.cpp
// Function: WebServer::init(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>>, int, int, int, int, int, int, int, int)
void WebServer::init(int port, string user, string passWord, string databaseName, int log_write, int sqlverify,
                     int opt_linger, int trigmode, int sql_num, int thread_num, int close_log, int actor_model)
{
    m_port = port;
    m_user = user;
    m_passWord = passWord;
    m_databaseName = databaseName;
    m_sql_num = sql_num;
    m_thread_num = thread_num;
    m_log_write = log_write;
    m_SQLVerify = sqlverify;
    m_OPT_LINGER = opt_linger;
    m_TRIGMode = trigmode;
    m_close_log = close_log;
    m_actormodel = actor_model;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movq %r8, %r14
movq %rcx, %r15
movq %rdi, %rbx
movl 0x60(%rsp), %r13d
movl 0x58(%rsp), %r12d
movl %esi, (%rdi)
addq $0x38, %rdi
movq %rdx, %rsi
callq 0x3250
leaq 0x58(%rbx), %rdi
movq %r15, %rsi
callq 0x3250
leaq 0x78(%rbx), %rdi
movq %r14, %rsi
callq 0x3250
movl %r12d, 0x98(%rbx)
movl %r13d, 0xa8(%rbx)
movl %ebp, 0x10(%rbx)
movl 0x40(%rsp), %eax
movl %eax, 0x9c(%rbx)
movl 0x48(%rsp), %eax
movl %eax, 0x1d570(%rbx)
movl 0x50(%rsp), %eax
movl %eax, 0x1d574(%rbx)
movl 0x68(%rsp), %eax
movl %eax, 0x14(%rbx)
movl 0x70(%rsp), %eax
movl %eax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/webserver.cpp
// Function: WebServer::sql_pool()
void WebServer::sql_pool()
{
    //初始化数据库连接池
    m_connPool = connection_pool::GetInstance();
    m_connPool->init("localhost", m_user, m_passWord, m_databaseName, 3306, m_sql_num, m_close_log);

    //初始化数据库读取表
    if (0 == m_SQLVerify)
        users->initmysql_result(m_connPool);
    else if (1 == m_SQLVerify)
        users->initresultFile(m_connPool);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
callq 0x75a0
movq %rax, %r14
movq %rax, 0x30(%rbx)
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x267d(%rip), %rsi      # 0xa505
leaq 0x267f(%rip), %rdx      # 0xa50e
leaq 0x68(%rsp), %rdi
callq 0x3e80
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x38(%rbx), %rsi
movq 0x40(%rbx), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x3df0
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x58(%rbx), %rsi
movq 0x60(%rbx), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x3df0
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x78(%rbx), %rsi
movq 0x80(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x3df0
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 0x7610
addq $0x10, %rsp
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7f41
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3430
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x7f58
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3430
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x7f6f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3430
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x7f86
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3430
movl 0x9c(%rbx), %eax
cmpl $0x1, %eax
je 0x7fa4
testl %eax, %eax
jne 0x7fb1
movq 0x28(%rbx), %rdi
movq 0x30(%rbx), %rsi
callq 0x434c
jmp 0x7fb1
movq 0x28(%rbx), %rdi
movq 0x30(%rbx), %rsi
callq 0x4500
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 0x7fe2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3430
jmp 0x7fe2
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x7ffe
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3430
jmp 0x7ffe
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x801a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3430
jmp 0x801a
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x8031
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3430
movq %rbx, %rdi
callq 0x36e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/webserver.cpp
// Function: WebServer::adjust_timer(util_timer*)
void WebServer::adjust_timer(util_timer *timer)
{
    time_t cur = time(NULL);
    timer->expire = cur + 3 * TIMESLOT;
    timer_lst.adjust_timer(timer);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %edi, %edi
callq 0x33d0
addq $0xf, %rax
movq %rax, (%rbx)
leaq 0x1d578(%r14), %rdi
movq %rbx, %rsi
callq 0x3fd4
cmpl $0x0, 0x14(%r14)
je 0x85a8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x629e
leaq 0x1d2d(%rip), %rdx      # 0xa2e1
leaq 0x1fb3(%rip), %rcx      # 0xa56e
movq %rax, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x7216
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/webserver.cpp
// Function: WebServer::deal_timer(util_timer*, int)
void WebServer::deal_timer(util_timer *timer, int sockfd)
{
    timer->cb_func(&users_timer[sockfd]);
    if (timer)
    {
        timer_lst.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 0x1d588(%rdi), %rdi
addq %r15, %rdi
callq *0x8(%rsi)
testq %r14, %r14
je 0x8611
leaq 0x1d578(%rbx), %rdi
movq %r14, %rsi
callq 0x4082
cmpl $0x0, 0x14(%rbx)
je 0x861d
popq %rbx
popq %r14
popq %r15
retq
callq 0x629e
movq 0x1d588(%rbx), %rcx
movl 0x10(%rcx,%r15), %ecx
leaq 0x1f4b(%rip), %rdx      # 0xa580
movq %rax, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x7216
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/webserver.cpp
// Function: WebServer::dealclinetdata()
bool WebServer::dealclinetdata()
{
    struct sockaddr_in client_address;
    socklen_t client_addrlength = sizeof(client_address);
    if (0 == m_TRIGMode)
    {
        int connfd = accept(m_listenfd, (struct sockaddr *)&client_address, &client_addrlength); 
        // accept()系统调用主要用在基于连接的套接字类型，比如SOCK_STREAM和SOCK_SEQPACKET。它提取出所监听套接字的等待连接队列中第一个连接请求，
        // 创建一个新的套接字，并返回指向该套接字的文件描述符。新建立的套接字不在监听状态，原来所监听的套接字也不受该系统调用的影响。
        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 0x1d574(%rdi), %ebp
movl 0x1d56c(%rdi), %edi
leaq 0x10(%rsp), %rsi
callq 0x3100
testl %ebp, %ebp
je 0x86d8
testl %eax, %eax
js 0x8730
leaq 0x5e2f(%rip), %r12      # 0xe4c8
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r15
cmpl $0x10000, (%r12)        # imm = 0x10000
jge 0x86ef
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq 0x834a
movl 0x1d56c(%rbx), %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3100
testl %eax, %eax
jns 0x86a3
jmp 0x8730
testl %eax, %eax
js 0x8730
leaq 0x5de5(%rip), %rcx      # 0xe4c8
cmpl $0x10000, (%rcx)        # imm = 0x10000
jl 0x8778
leaq 0x1d590(%rbx), %rdi
leaq 0x1eab(%rip), %rdx      # 0xa5a8
movl %eax, %esi
callq 0x42ce
cmpl $0x0, 0x14(%rbx)
jne 0x8736
callq 0x629e
leaq 0x1bcb(%rip), %rdx      # 0xa2e1
leaq 0x1e8b(%rip), %rcx      # 0xa5a8
xorl %ebx, %ebx
movq %rax, %rdi
movl $0x3, %esi
xorl %eax, %eax
callq 0x6df4
jmp 0x8769
cmpl $0x0, 0x14(%rbx)
je 0x873a
xorl %ebx, %ebx
jmp 0x878e
callq 0x629e
movq %rax, %r14
callq 0x3060
movl (%rax), %r8d
leaq 0x1e3b(%rip), %rdx      # 0xa58c
leaq 0x1e43(%rip), %rcx      # 0xa59b
xorl %ebx, %ebx
movq %r14, %rdi
movl $0x3, %esi
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
callq 0x7216
jmp 0x878e
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %rbx, %rdi
movl %eax, %esi
callq 0x834a
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_O1/lszp[P]SmallWebServer/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);  // 从TCP另一端接受数据，signals为缓冲区，返回接受的字节数。
    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 0x3120
leal 0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x87f8
movb $0x1, %bpl
testl %eax, %eax
jle 0x87f8
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movzbl (%rsp,%rcx), %edx
movq %r14, %rsi
cmpl $0xe, %edx
je 0x87ed
cmpl $0xf, %edx
jne 0x87f0
movq %rbx, %rsi
movb $0x1, (%rsi)
incq %rcx
cmpq %rcx, %rax
jne 0x87d9
movl %ebp, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/webserver.cpp
// Function: WebServer::dealwithread(int)
void WebServer::dealwithread(int sockfd)
{
    util_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 0x1d588(%rdi), %rax
movslq %esi, %r15
movq %r15, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %r14
cmpl $0x1, 0x18(%rdi)
jne 0x8895
testq %r14, %r14
je 0x883f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8572
movq 0xa0(%rbx), %rdi
imulq $0xf68, %r15, %r15      # imm = 0xF68
movq 0x28(%rbx), %rsi
addq %r15, %rsi
xorl %edx, %edx
callq 0x8dd4
movq 0x28(%rbx), %rax
cmpl $0x1, (%rax,%r15)
jne 0x887f
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x85de
movq 0x28(%rbx), %rax
movl $0x0, (%rax,%r15)
movq 0x28(%rbx), %rax
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 0x4a9c
testb %al, %al
je 0x8919
cmpl $0x0, 0x14(%rbx)
jne 0x88ee
callq 0x629e
movq %rax, %r12
movq 0x28(%rbx), %rax
movl 0x1c(%rax,%r15), %edi
callq 0x31a0
leaq 0x1cee(%rip), %rdx      # 0xa5bd
movq %r12, %rdi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
callq 0x7216
movq 0xa0(%rbx), %rdi
addq 0x28(%rbx), %r15
movq %r15, %rsi
callq 0x8e5e
testq %r14, %r14
je 0x888c
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8572
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x85de
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/webserver.cpp
// Function: WebServer::dealwithwrite(int)
void WebServer::dealwithwrite(int sockfd)
{
    util_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 0x1d588(%rdi), %rax
movslq %esi, %r15
movq %r15, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %r14
cmpl $0x1, 0x18(%rdi)
jne 0x89c0
testq %r14, %r14
je 0x8967
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8572
movq 0xa0(%rbx), %rdi
imulq $0xf68, %r15, %r15      # imm = 0xF68
movq 0x28(%rbx), %rsi
addq %r15, %rsi
movl $0x1, %edx
callq 0x8dd4
movq 0x28(%rbx), %rax
cmpl $0x1, (%rax,%r15)
jne 0x89aa
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x85de
movq 0x28(%rbx), %rax
movl $0x0, (%rax,%r15)
movq 0x28(%rbx), %rax
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 0x5bc2
testb %al, %al
je 0x8a31
cmpl $0x0, 0x14(%rbx)
jne 0x8a19
callq 0x629e
movq %rax, %r15
movq 0x28(%rbx), %rax
movl 0x1c(%rax,%r12), %edi
callq 0x31a0
leaq 0x1bdc(%rip), %rdx      # 0xa5d6
movq %r15, %rdi
movl $0x1, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
callq 0x7216
testq %r14, %r14
je 0x89b7
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8572
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x85de
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/././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 0x6256
leaq 0x50(%r15), %rdi
movq %rdi, 0x8(%rsp)
callq 0x79f4
movq %rbx, 0x70(%r15)
movl %r13d, 0x78(%r15)
testl %ebp, %ebp
jle 0x8d5e
testl %r12d, %r12d
jle 0x8d5e
movslq (%r15), %rax
leaq (,%rax,8), %rcx
testq %rax, %rax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x3030
movq %rax, 0x8(%r15)
testl %ebp, %ebp
jle 0x8d13
movl %ebp, %ebx
shlq $0x3, %rbx
xorl %r13d, %r13d
leaq 0x1fb(%rip), %r12       # 0x8edc
movq 0x8(%r15), %rdi
addq %r13, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
callq 0x3740
movq 0x8(%r15), %rdi
testl %eax, %eax
jne 0x8d26
movq (%rdi,%r13), %rdi
callq 0x3320
testl %eax, %eax
jne 0x8d22
addq $0x8, %r13
cmpq %r13, %rbx
jne 0x8ce1
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x8d30
callq 0x3570
movl $0x8, %edi
callq 0x31e0
movq 0x5287(%rip), %rcx      # 0xdfc8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x5289(%rip), %rsi      # 0xdfd8
movq 0x529a(%rip), %rdx      # 0xdff0
movq %rax, %rdi
callq 0x36c0
movl $0x8, %edi
callq 0x31e0
movq 0x5259(%rip), %rcx      # 0xdfc8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x525b(%rip), %rsi      # 0xdfd8
movq 0x526c(%rip), %rdx      # 0xdff0
movq %rax, %rdi
callq 0x36c0
movq %rax, %r15
jmp 0x8da5
movq %rax, %r15
jmp 0x8daf
jmp 0x8d98
movq %rax, %r15
movq 0x8(%rsp), %rdi
callq 0x3780
movq 0x10(%rsp), %rdi
callq 0x34d0
movq (%r14), %rdi
cmpq %r14, %rdi
je 0x8dcc
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x3430
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x8db7
movq %r15, %rdi
callq 0x36e0
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/././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 0x35f0
movq 0x20(%rbx), %r13
movslq 0x4(%rbx), %r12
cmpq %r12, %r13
jae 0x8e40
leaq 0x10(%rbx), %rax
movq %rax, (%rsp)
movl %ebp, 0x10(%r15)
movl $0x18, %edi
callq 0x3420
movq %r15, 0x10(%rax)
movq %rax, %rdi
movq (%rsp), %rsi
callq 0x3080
incq 0x20(%rbx)
movq %r14, %rdi
callq 0x3350
addq $0x50, %rbx
movq %rbx, %rdi
callq 0x36b0
jmp 0x8e48
movq %r14, %rdi
callq 0x3350
cmpq %r12, %r13
setb %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/././threadpool/threadpool.h
// Function: threadpool<http_conn>::append_p(http_conn*)
bool threadpool<T>::append_p(T *request)
{
    m_queuelocker.lock();
    if (m_workqueue.size() >= m_max_requests)
    {
        m_queuelocker.unlock();
        return false;
    }
    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
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movq %r14, %rdi
callq 0x35f0
movq 0x20(%rbx), %r13
movslq 0x4(%rbx), %rbp
cmpq %rbp, %r13
jae 0x8ebf
leaq 0x10(%rbx), %r12
movl $0x18, %edi
callq 0x3420
movq %r15, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x3080
incq 0x20(%rbx)
movq %r14, %rdi
callq 0x3350
addq $0x50, %rbx
movq %rbx, %rdi
callq 0x36b0
jmp 0x8ec7
movq %r14, %rdi
callq 0x3350
cmpq %rbp, %r13
setb %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq