// File: 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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movl $0x10, -0x24(%rbp)
xorl %eax, %eax
cmpl 0x1d578(%rcx), %eax
jne 0xbf3e
movq -0x58(%rbp), %rax
movl 0x1d56c(%rax), %edi
leaq -0x20(%rbp), %rsi
leaq -0x24(%rbp), %rdx
callq 0x3110
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jge 0xbea9
movq -0x58(%rbp), %rcx
xorl %eax, %eax
cmpl 0x14(%rcx), %eax
jne 0xbea0
callq 0x6df0
movq %rax, -0x60(%rbp)
callq 0x3060
movq -0x60(%rbp), %rdi
movl (%rax), %r8d
movl $0x3, %esi
leaq 0x2677(%rip), %rdx      # 0xe4fc
leaq 0x267f(%rip), %rcx      # 0xe50b
movb $0x0, %al
callq 0x9300
callq 0x6df0
movq %rax, %rdi
callq 0x9870
movb $0x0, -0x1(%rbp)
jmp 0xc044
leaq 0x8638(%rip), %rax      # 0x144e8
cmpl $0x10000, (%rax)        # imm = 0x10000
jl 0xbf15
movq -0x58(%rbp), %rdi
addq $0x1d588, %rdi          # imm = 0x1D588
movl -0x28(%rbp), %esi
leaq 0x264b(%rip), %rdx      # 0xe518
callq 0x4950
movq -0x58(%rbp), %rcx
xorl %eax, %eax
cmpl 0x14(%rcx), %eax
jne 0xbf0c
callq 0x6df0
movq %rax, %rdi
movl $0x3, %esi
leaq 0x23b7(%rip), %rdx      # 0xe2a8
leaq 0x2620(%rip), %rcx      # 0xe518
movb $0x0, %al
callq 0x9300
callq 0x6df0
movq %rax, %rdi
callq 0x9870
movb $0x0, -0x1(%rbp)
jmp 0xc044
movq -0x58(%rbp), %rdi
movl -0x28(%rbp), %esi
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0xbaa0
jmp 0xc040
jmp 0xbf40
movq -0x58(%rbp), %rax
movl 0x1d56c(%rax), %edi
leaq -0x20(%rbp), %rsi
leaq -0x24(%rbp), %rdx
callq 0x3110
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0xbfac
movq -0x58(%rbp), %rcx
xorl %eax, %eax
cmpl 0x14(%rcx), %eax
jne 0xbfa7
callq 0x6df0
movq %rax, -0x68(%rbp)
callq 0x3060
movq -0x68(%rbp), %rdi
movl (%rax), %r8d
movl $0x3, %esi
leaq 0x2570(%rip), %rdx      # 0xe4fc
leaq 0x2578(%rip), %rcx      # 0xe50b
movb $0x0, %al
callq 0x9300
callq 0x6df0
movq %rax, %rdi
callq 0x9870
jmp 0xc03a
leaq 0x8535(%rip), %rax      # 0x144e8
cmpl $0x10000, (%rax)        # imm = 0x10000
jl 0xc011
movq -0x58(%rbp), %rdi
addq $0x1d588, %rdi          # imm = 0x1D588
movl -0x3c(%rbp), %esi
leaq 0x2548(%rip), %rdx      # 0xe518
callq 0x4950
movq -0x58(%rbp), %rcx
xorl %eax, %eax
cmpl 0x14(%rcx), %eax
jne 0xc00f
callq 0x6df0
movq %rax, %rdi
movl $0x3, %esi
leaq 0x22b4(%rip), %rdx      # 0xe2a8
leaq 0x251d(%rip), %rcx      # 0xe518
movb $0x0, %al
callq 0x9300
callq 0x6df0
movq %rax, %rdi
callq 0x9870
jmp 0xc03a
movq -0x58(%rbp), %rdi
movl -0x3c(%rbp), %esi
movq -0x20(%rbp), %rax
movq %rax, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x44(%rbp)
movq -0x4c(%rbp), %rdx
movq -0x44(%rbp), %rcx
callq 0xbaa0
jmp 0xbf40
movb $0x0, -0x1(%rbp)
jmp 0xc044
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
nop