// File: /workspace/github_cpp_makefile_star2_O1/guoxuanhan[P]NetServer/tcpserver.cpp
// Function: TcpServer::TcpServer(EventLoop*, int, int)
TcpServer::TcpServer(EventLoop* loop, const int port, const int threadnum)
    : serversocket_(),
    loop_(loop),
    serverchannel_(),
    conncount_(0),
    eventloopthreadpool(loop, threadnum)
{
    //serversocket_.SetSocketOption();
    serversocket_.SetReuseAddr();
    serversocket_.BindAddress(port);
    serversocket_.Listen();
    serversocket_.Setnonblocking();

    serverchannel_.SetFd(serversocket_.fd());
    serverchannel_.SetReadHandle(std::bind(&TcpServer::OnNewConnection, this));
    serverchannel_.SetErrorHandle(std::bind(&TcpServer::OnConnectionError, this));

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r12d
movl %edx, %ebp
movq %rsi, %r13
movq %rdi, %rbx
callq 0xbb3c
movq %r13, 0x8(%rbx)
leaq 0x10(%rbx), %r14
movq %r14, %rdi
callq 0x4b1c
xorl %eax, %eax
movl %eax, 0x98(%rbx)
leaq 0xa8(%rbx), %rcx
movl %eax, 0xa8(%rbx)
movq $0x0, 0xb0(%rbx)
movq %rcx, 0xb8(%rbx)
movq %rcx, 0xc0(%rbx)
leaq 0xf8(%rbx), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0xc8(%rbx)
movups %xmm0, 0xd8(%rbx)
movups %xmm0, 0xe8(%rbx)
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x61fc
leaq 0x128(%rbx), %r12
movl $0xa0, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x41f0
movq %rbx, %rdi
callq 0xbc10
movq %rbx, %rdi
movl %ebp, %esi
callq 0xbcb2
movq %rbx, %rdi
callq 0xbd3e
movq %rbx, %rdi
callq 0xbc36
movl (%rbx), %esi
movq %r14, %rdi
callq 0x4bba
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x1de(%rip), %rcx       # 0xd67e
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0x81c(%rip), %r13       # 0xdcd8
movq %r13, 0x18(%rsi)
leaq 0x82d(%rip), %rbp       # 0xdcf4
movq %rbp, 0x10(%rsi)
movq %r14, %rdi
callq 0x4d64
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xd4ea
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x4e5(%rip), %rcx       # 0xd9ec
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r13, 0x18(%rsi)
movq %rbp, 0x10(%rsi)
movq %r14, %rdi
callq 0x4d78
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xd543
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd676
jmp 0xd676
movq %rax, %r13
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xd5b5
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xd5b5
jmp 0xd676
jmp 0xd5b2
movq %rax, %r13
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xd5b5
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xd5b5
jmp 0xd676
jmp 0xd5b2
movq %rax, %r13
jmp 0xd64a
movq %rax, %r13
jmp 0xd65e
movq %rax, %r13
movq 0x1b8(%rbx), %rax
testq %rax, %rax
je 0xd5d2
leaq 0x1a8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x198(%rbx), %rax
testq %rax, %rax
je 0xd5ef
leaq 0x188(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x178(%rbx), %rax
testq %rax, %rax
je 0xd60c
leaq 0x168(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x158(%rbx), %rax
testq %rax, %rax
je 0xd629
leaq 0x148(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x138(%rbx), %rax
testq %rax, %rax
je 0xd642
movq %r12, %rdi
movq %r12, %rsi
movl $0x3, %edx
callq *%rax
movq %r15, %rdi
callq 0x629e
leaq 0xa0(%rbx), %rdi
callq 0xdc64
movq %r14, %rdi
callq 0x4b46
movq %rbx, %rdi
callq 0xbbb6
movq %r13, %rdi
callq 0x45a0
jmp 0xd676
jmp 0xd676
jmp 0xd676
jmp 0xd676
movq %rax, %rdi
callq 0x4df2