LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: guoxuanhan[P]NetServer/eventloop.cpp
// Function: EventLoop::loop()
void EventLoop::loop()
{
    quit_ = false;
    while(!quit_)
    {
        poller_.poll(activechannellist_);
        for(Channel* pchannel : activechannellist_)
        {
            //处理事件
            pchannel->HandleEvent();
        }
        activechannellist_.clear();
        ExecuteTask();
    }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movb $0x0, 0xc0(%rax)
movq 0x8(%rsp), %rax
movb 0xc0(%rax), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x8590
jmp 0x862b
movq 0x8(%rsp), %rsi
movq %rsi, %rdi
addq $0x48, %rdi
addq $0x30, %rsi
callq 0x183a0
movq 0x8(%rsp), %rax
addq $0x30, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
callq 0x8b30
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rdi
callq 0x8b60
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x8b90
testb $0x1, %al
jne 0x85e6
jmp 0x860e
leaq 0x20(%rsp), %rdi
callq 0x8bd0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x5cd0
leaq 0x20(%rsp), %rdi
callq 0x8be0
jmp 0x85d1
movq 0x8(%rsp), %rdi
addq $0x30, %rdi
callq 0x8c00
movq 0x8(%rsp), %rdi
callq 0x8630
jmp 0x857a
addq $0x38, %rsp
retq
// File: guoxuanhan[P]NetServer/eventloop.cpp
// Function: EventLoop::ExecuteTask()
void EventLoop::ExecuteTask()
{
    std::vector<Functor> functorlist;
    {
        std::lock_guard<std::mutex> lock(mutex_);
        functorlist.swap(functorlist_);
    }
    for(Functor & functor : functorlist)
    {
        functor();
    }
    functorlist.clear();
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x8920
movq 0x8(%rsp), %rsi
addq $0xd0, %rsi
leaq 0x40(%rsp), %rdi
callq 0x8c20
jmp 0x8665
movq 0x8(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x8ce0
leaq 0x40(%rsp), %rdi
callq 0x8cc0
leaq 0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
callq 0x8d40
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rdi
callq 0x8d70
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x8da0
testb $0x1, %al
jne 0x86bb
jmp 0x86fe
leaq 0x20(%rsp), %rdi
callq 0x8de0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x5f00
jmp 0x86d6
jmp 0x86d8
leaq 0x20(%rsp), %rdi
callq 0x8df0
jmp 0x86a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x8ad0
jmp 0x8717
leaq 0x48(%rsp), %rdi
callq 0x8e10
leaq 0x48(%rsp), %rdi
callq 0x8ad0
addq $0x68, %rsp
retq
movq 0x38(%rsp), %rdi
callq 0x5660
nopw %cs:(%rax,%rax)
// File: guoxuanhan[P]NetServer/eventloopthread.cpp
// Function: EventLoopThread::~EventLoopThread()
EventLoopThread::~EventLoopThread()
{
    //线程结束时清理
    std::cout<< "Clean up the EventLoopThread id:" << std::this_thread::get_id() << std::endl;
    //停止IO线程运行
    loop_->Quit();
    //清理IO线程防止内存泄漏，因为pthread_create会calloc
    th_.join();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x309a6(%rip), %rdi     # 0x3afb0
leaq 0x1ddf3(%rip), %rsi     # 0x28404
callq 0x53a0
movq %rax, 0x10(%rsp)
jmp 0xa61d
callq 0x8940
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rsi
callq 0xa970
movq %rax, (%rsp)
jmp 0xa63c
movq (%rsp), %rdi
movq 0x30939(%rip), %rsi     # 0x3af80
callq 0x53f0
jmp 0xa64e
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x8790
jmp 0xa65e
movq 0x8(%rsp), %rdi
callq 0x5620
jmp 0xa66a
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
callq 0x5270
movq 0x8(%rsp), %rdi
callq 0xa950
addq $0x28, %rsp
retq
movq %rax, %rdi
callq 0x5fd0
nop
// File: guoxuanhan[P]NetServer/eventloopthread.cpp
// Function: EventLoopThread::ThreadFunc()
void EventLoopThread::ThreadFunc()
{
    EventLoop loop;
    loop_ = &loop;

    threadid_ = std::this_thread::get_id();
    std::stringstream sin;
    sin << threadid_;
    threadname_ += sin.str();
    std::cout<< "in the thread: " << threadname_ << std::endl;

    try
    {
        loop_->loop();
    } catch(std::bad_alloc& bad)
    {
        std::cerr << "Bad_alloc caught in EventLoopThread::ThreadFunc loop: " << bad.what() << std::endl;
    }
}

// Assembly:
subq $0x398, %rsp            # imm = 0x398
movq %rdi, 0x390(%rsp)
movq 0x390(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x208(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x8100
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x30(%rax)
callq 0x8940
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x200(%rsp)
movq 0x200(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x78(%rsp), %rdi
callq 0x52c0
jmp 0xa769
movq 0x30(%rsp), %rax
leaq 0x88(%rsp), %rdi
movq 0x8(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rsi
callq 0xa970
jmp 0xa78b
leaq 0x40(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x5390
jmp 0xa79c
movq 0x30(%rsp), %rdi
addq $0x10, %rdi
leaq 0x40(%rsp), %rsi
callq 0x54a0
jmp 0xa7b1
leaq 0x40(%rsp), %rdi
callq 0x5270
movq 0x307ee(%rip), %rdi     # 0x3afb0
leaq 0x1dc5c(%rip), %rsi     # 0x28425
callq 0x53a0
movq %rax, 0x20(%rsp)
jmp 0xa7d5
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq $0x10, %rsi
callq 0x5340
movq %rax, 0x18(%rsp)
jmp 0xa7ef
movq 0x18(%rsp), %rdi
movq 0x30785(%rip), %rsi     # 0x3af80
callq 0x53f0
jmp 0xa802
movq 0x30(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x8560
jmp 0xa812
jmp 0xa8e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0xa920
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0xa916
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x5270
jmp 0xa916
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0xa916
movq 0x70(%rsp), %rdi
callq 0x5180
movq %rax, 0x38(%rsp)
movq 0x30751(%rip), %rdi     # 0x3afe0
leaq 0x1db9f(%rip), %rsi     # 0x28435
callq 0x53a0
movq %rax, 0x10(%rsp)
jmp 0xa8a2
movq 0x38(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x53a0
movq %rax, 0x8(%rsp)
jmp 0xa8c4
movq 0x8(%rsp), %rdi
movq 0x306b0(%rip), %rsi     # 0x3af80
callq 0x53f0
jmp 0xa8d7
callq 0x55e0
jmp 0xa8de
jmp 0xa8e0
leaq 0x78(%rsp), %rdi
callq 0x52e0
leaq 0x208(%rsp), %rdi
callq 0x84e0
addq $0x398, %rsp            # imm = 0x398
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
callq 0x55e0
jmp 0xa914
jmp 0xa916
leaq 0x78(%rsp), %rdi
callq 0x52e0
leaq 0x208(%rsp), %rdi
callq 0x84e0
movq 0x70(%rsp), %rdi
callq 0x5660
movq %rax, %rdi
callq 0x5fd0
nop
// File: guoxuanhan[P]NetServer/eventloopthreadpool.cpp
// Function: EventLoopThreadPool::~EventLoopThreadPool()
EventLoopThreadPool::~EventLoopThreadPool()
{
    std::cout << "Clean up the EventLoopThreadPool" << std::endl;
    for(int i = 0; i < threadnum_; ++i)
    {
        delete threadlist_[i];
    }
    threadlist_.clear();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x2fc76(%rip), %rdi     # 0x3afb0
leaq 0x1d1a0(%rip), %rsi     # 0x284e1
callq 0x53a0
movq %rax, 0x10(%rsp)
jmp 0xb34d
movq 0x10(%rsp), %rdi
movq 0x2fc27(%rip), %rsi     # 0x3af80
callq 0x53f0
jmp 0xb360
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rcx
movl 0x1c(%rsp), %eax
cmpl 0x8(%rcx), %eax
jge 0xb3b7
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
movslq 0x1c(%rsp), %rsi
callq 0xb5a0
movq (%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0xb3a8
movq (%rsp), %rdi
callq 0xa5f0
movq (%rsp), %rdi
callq 0x5370
jmp 0xb3aa
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xb368
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
callq 0xb5c0
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
callq 0xb540
addq $0x28, %rsp
retq
movq %rax, %rdi
callq 0x5fd0
// File: guoxuanhan[P]NetServer/eventloopthreadpool.cpp
// Function: EventLoopThreadPool::GetNextLoop()
EventLoop* EventLoopThreadPool::GetNextLoop()
{
    if(threadnum_ > 0)
    {
        EventLoop *loop = threadlist_[index_]->GetLoop();
        index_ = (index_ + 1) % threadnum_;
        return loop;
        //LC策略,还没写
        //EventLoop *loop = threadlist_[index_]->GetLoop();
        //index_ = (index_ + 1) % threadnum_;
        //return loop;
    }
    else
    {
        return mainloop_;
    }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x8(%rax)
jle 0xb49e
movq 0x8(%rsp), %rax
movq %rax, %rdi
addq $0x10, %rdi
movslq 0x28(%rax), %rsi
callq 0xb5a0
movq (%rax), %rdi
callq 0xa690
movq 0x8(%rsp), %rcx
movq %rax, 0x10(%rsp)
movl 0x28(%rcx), %eax
addl $0x1, %eax
cltd
idivl 0x8(%rcx)
movq 0x8(%rsp), %rax
movl %edx, 0x28(%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0xb4ab
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: guoxuanhan[P]NetServer/httpserver.cpp
// Function: HttpServer::HandleNewConnection(std::shared_ptr<TcpConnection> const&)
void HttpServer::HandleNewConnection(const spTcpConnection& sptcpconn)
{
    //std::string msg(s);
    std::shared_ptr<HttpSession> sphttpsession = std::make_shared<HttpSession>(); //创建应用层会话
    spTimer sptimer = std::make_shared<Timer>(5000, Timer::TimerType::TIMER_ONCE, std::bind(&TcpConnection::Shutdown, sptcpconn));
    sptimer->Start();
    //可以优化成无锁，放入conn里面就行
    {
        std::lock_guard <std::mutex> lock(mutex_);
        httpsessionnlist_[sptcpconn] = sphttpsession;
        timerlist_[sptcpconn] = sptimer;
    }
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x78(%rsp), %rdi
callq 0xd7e0
movl $0x1388, 0x64(%rsp)     # imm = 0x1388
movl $0x0, 0x60(%rsp)
leaq 0x10a1b(%rip), %rax     # 0x1cee0
movq %rax, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x88(%rsp), %rdx
leaq 0x40(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xd8e0
jmp 0xc4ec
leaq 0x68(%rsp), %rdi
leaq 0x64(%rsp), %rsi
leaq 0x60(%rsp), %rdx
leaq 0x40(%rsp), %rcx
callq 0xd850
jmp 0xc507
leaq 0x40(%rsp), %rdi
callq 0xd920
leaq 0x68(%rsp), %rdi
callq 0xd940
movq %rax, %rdi
callq 0x25ef0
jmp 0xc525
movq 0x10(%rsp), %rsi
addq $0x60, %rsi
leaq 0x18(%rsp), %rdi
callq 0x8c20
jmp 0xc53a
movq 0x10(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0xd950
movq %rax, 0x8(%rsp)
jmp 0xc553
movq 0x8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0xda40
movq 0x10(%rsp), %rdi
addq $0x30, %rdi
movq 0x88(%rsp), %rsi
callq 0xda70
movq %rax, (%rsp)
jmp 0xc57e
movq (%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xdb60
leaq 0x18(%rsp), %rdi
callq 0x8cc0
leaq 0x68(%rsp), %rdi
callq 0xdb90
leaq 0x78(%rsp), %rdi
callq 0xdba0
addq $0x98, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
jmp 0xc60e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xd920
jmp 0xc60e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
jmp 0xc604
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x8cc0
leaq 0x68(%rsp), %rdi
callq 0xdb90
leaq 0x78(%rsp), %rdi
callq 0xdba0
movq 0x28(%rsp), %rdi
callq 0x5660
nopw %cs:(%rax,%rax)
// File: guoxuanhan[P]NetServer/poller.cpp
// Function: Poller::Poller()
Poller::Poller() :
    pollfd_(-1), eventlist_(EVENTNUM), channelmap_(), mutex_()
{
    pollfd_ = epoll_create(256);
    if(pollfd_ == -1)
    {
        perror("epoll_create error!");
        exit(1);
    }
    std::cout<< "epoll_create: " << pollfd_ << std::endl;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
addq $0x8, %rax
movq %rax, 0x28(%rsp)
leaq 0x4f(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x18970
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rdx
movl $0x1000, %esi           # imm = 0x1000
callq 0x18980
jmp 0x18237
leaq 0x4f(%rsp), %rdi
callq 0x18a00
movq 0x20(%rsp), %rdi
addq $0x20, %rdi
movq %rdi, 0x10(%rsp)
xorl %esi, %esi
movl $0x30, %edx
callq 0x5220
movq 0x10(%rsp), %rdi
callq 0x18a10
movq 0x20(%rsp), %rdi
addq $0x50, %rdi
movq %rdi, 0x18(%rsp)
xorl %esi, %esi
movl $0x28, %edx
callq 0x5220
movq 0x18(%rsp), %rdi
callq 0x8970
movl $0x100, %edi            # imm = 0x100
callq 0x56b0
movl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
cmpl $-0x1, (%rax)
jne 0x182f7
leaq 0x10c43(%rip), %rdi     # 0x28eeb
callq 0x5320
jmp 0x182af
movl $0x1, %edi
callq 0x5460
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
leaq 0x4f(%rsp), %rdi
callq 0x18a00
jmp 0x1833f
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
callq 0x18a20
movq 0x28(%rsp), %rdi
callq 0x18a30
jmp 0x1833f
movq 0x22cb2(%rip), %rdi     # 0x3afb0
leaq 0x10bfa(%rip), %rsi     # 0x28eff
callq 0x53a0
movq %rax, 0x8(%rsp)
jmp 0x18311
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rax
movl (%rax), %esi
callq 0x5650
movq %rax, (%rsp)
jmp 0x18328
movq (%rsp), %rdi
movq 0x22c4d(%rip), %rsi     # 0x3af80
callq 0x53f0
jmp 0x1833a
addq $0x58, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0x5660
nopl (%rax)
// File: guoxuanhan[P]NetServer/poller.cpp
// Function: Poller::AddChannel(Channel*)
void Poller::AddChannel(Channel* pchannel)
{
    int fd = pchannel->GetFd();
    struct epoll_event ev;
    ev.events = pchannel->GetEvents();
    //data是联合体
    //ev.data.fd == fd
    ev.data.ptr = pchannel;
    {
        std::lock_guard<std::mutex> lock(mutex_);
        channelmap_[fd] = pchannel;
    }

    if(epoll_ctl(pollfd_, EPOLL_CTL_ADD, fd, &ev) == -1)
    {
        perror("epoll add error!");
        exit(1);
    }
    std::cout<< "Add Channel!" << std::endl;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x48(%rsp), %rdi
callq 0x5c90
movl %eax, 0x44(%rsp)
movq 0x48(%rsp), %rdi
callq 0x5cc0
movq 0x8(%rsp), %rsi
movl %eax, 0x38(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x3c(%rsp)
addq $0x50, %rsi
leaq 0x30(%rsp), %rdi
callq 0x8c20
movq 0x8(%rsp), %rdi
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x20, %rdi
leaq 0x44(%rsp), %rsi
callq 0x18ce0
movq %rax, 0x18(%rsp)
jmp 0x186b5
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, (%rax)
leaq 0x30(%rsp), %rdi
callq 0x8cc0
movq 0x8(%rsp), %rax
movl (%rax), %edi
movl 0x44(%rsp), %edx
movl $0x1, %esi
leaq 0x38(%rsp), %rcx
callq 0x54e0
cmpl $-0x1, %eax
jne 0x1871b
leaq 0x10848(%rip), %rdi     # 0x28f3a
callq 0x5320
movl $0x1, %edi
callq 0x5460
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x8cc0
jmp 0x18742
movq 0x2288e(%rip), %rdi     # 0x3afb0
leaq 0x10822(%rip), %rsi     # 0x28f4b
callq 0x53a0
movq %rax, %rdi
movq 0x22848(%rip), %rsi     # 0x3af80
callq 0x53f0
addq $0x58, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0x5660
nopl (%rax)
// File: guoxuanhan[P]NetServer/poller.cpp
// Function: Poller::RemoveChannel(Channel*)
void Poller::RemoveChannel(Channel* pchannel)
{
    int fd = pchannel->GetFd();
    struct epoll_event ev;
    ev.events = pchannel->GetEvents();
    ev.data.ptr = pchannel;
    {
        std::lock_guard<std::mutex> lock(mutex_);
        channelmap_.erase(fd);
    }

    if(epoll_ctl(pollfd_, EPOLL_CTL_DEL, fd, &ev) == -1)
    {
        perror("epoll del error!");
        exit(1);
    }
    std::cout<< "Remove Channel!" << std::endl;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
callq 0x5c90
movl %eax, 0x34(%rsp)
movq 0x38(%rsp), %rdi
callq 0x5cc0
movq 0x8(%rsp), %rsi
movl %eax, 0x28(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x2c(%rsp)
addq $0x50, %rsi
leaq 0x20(%rsp), %rdi
callq 0x8c20
movq 0x8(%rsp), %rdi
addq $0x20, %rdi
leaq 0x34(%rsp), %rsi
callq 0x18dd0
jmp 0x187b6
leaq 0x20(%rsp), %rdi
callq 0x8cc0
movq 0x8(%rsp), %rax
movl (%rax), %edi
movl 0x34(%rsp), %edx
movl $0x2, %esi
leaq 0x28(%rsp), %rcx
callq 0x54e0
cmpl $-0x1, %eax
jne 0x1880f
leaq 0x10772(%rip), %rdi     # 0x28f58
callq 0x5320
movl $0x1, %edi
callq 0x5460
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x8cc0
jmp 0x18836
movq 0x2279a(%rip), %rdi     # 0x3afb0
leaq 0x1074c(%rip), %rsi     # 0x28f69
callq 0x53a0
movq %rax, %rdi
movq 0x22754(%rip), %rsi     # 0x3af80
callq 0x53f0
addq $0x48, %rsp
retq
movq 0x18(%rsp), %rdi
callq 0x5660
// File: guoxuanhan[P]NetServer/poller.cpp
// Function: Poller::UpdateChannel(Channel*)
void Poller::UpdateChannel(Channel* pchannel)
{
    int fd = pchannel->GetFd();
    struct epoll_event ev;
    ev.events = pchannel->GetEvents();
    ev.data.ptr = pchannel;

    if(epoll_ctl(pollfd_, EPOLL_CTL_MOD, fd, &ev) == -1)
    {
        perror("epoll update error!");
        exit(1);
    }
    std::cout<< "Update Channel!" << std::endl;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
callq 0x5c90
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rdi
callq 0x5cc0
movl %eax, %ecx
movq (%rsp), %rax
movl %ecx, 0x8(%rsp)
movq 0x18(%rsp), %rcx
movq %rcx, 0xc(%rsp)
movl (%rax), %edi
movl 0x14(%rsp), %edx
movl $0x3, %esi
leaq 0x8(%rsp), %rcx
callq 0x54e0
cmpl $-0x1, %eax
jne 0x188b3
leaq 0x106d5(%rip), %rdi     # 0x28f79
callq 0x5320
movl $0x1, %edi
callq 0x5460
movq 0x226f6(%rip), %rdi     # 0x3afb0
leaq 0x106cc(%rip), %rsi     # 0x28f8d
callq 0x53a0
movq %rax, %rdi
movq 0x226b0(%rip), %rsi     # 0x3af80
callq 0x53f0
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: guoxuanhan[P]NetServer/socket.cpp
// Function: Socket::Socket()
Socket::Socket()
{
    serverfd_ = socket(AF_INET, SOCK_STREAM, 0);
    if(-1 == serverfd_)
    {
        perror("socket create fail!");
        exit(-1);
    }
    std::cout << "server create socket" << serverfd_ << std::endl;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x50d0
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl (%rcx), %eax
jne 0x1b9da
leaq 0xd61e(%rip), %rdi      # 0x28fe9
callq 0x5320
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x5460
movq 0x1f5cf(%rip), %rdi     # 0x3afb0
leaq 0xd615(%rip), %rsi      # 0x28ffd
callq 0x53a0
movq %rax, %rdi
movq 0x8(%rsp), %rax
movl (%rax), %esi
callq 0x5650
movq %rax, %rdi
movq 0x1f57a(%rip), %rsi     # 0x3af80
callq 0x53f0
addq $0x18, %rsp
retq
// File: guoxuanhan[P]NetServer/socket.cpp
// Function: Socket::Setnonblocking()
void Socket::Setnonblocking()
{
    int opts = fcntl(serverfd_, F_GETFL);
    if (opts<0)
    {
        perror("fcntl(serverfd_,GETFL)");
        exit(1);
    }
    if (fcntl(serverfd_, F_SETFL, opts | O_NONBLOCK) < 0)
    {
        perror("fcntl(serverfd_,SETFL,opts)");
        exit(1);
    }
    std::cout << "server setnonblocking..." << std::endl;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movl (%rax), %edi
movl $0x3, %esi
movb $0x0, %al
callq 0x5240
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jge 0x1bb01
leaq 0xd530(%rip), %rdi      # 0x29022
callq 0x5320
movl $0x1, %edi
callq 0x5460
movq (%rsp), %rax
movl (%rax), %edi
movl 0xc(%rsp), %edx
orl $0x800, %edx            # imm = 0x800
movl $0x4, %esi
movb $0x0, %al
callq 0x5240
cmpl $0x0, %eax
jge 0x1bb38
leaq 0xd510(%rip), %rdi      # 0x29039
callq 0x5320
movl $0x1, %edi
callq 0x5460
movq 0x1f471(%rip), %rdi     # 0x3afb0
leaq 0xd50f(%rip), %rsi      # 0x29055
callq 0x53a0
movq %rax, %rdi
movq 0x1f42b(%rip), %rsi     # 0x3af80
callq 0x53f0
addq $0x18, %rsp
retq
nop
// File: guoxuanhan[P]NetServer/socket.cpp
// Function: Socket::BindAddress(int)
bool Socket::BindAddress(int serverport)
{
    struct sockaddr_in serveraddr;
    memset(&serveraddr, 0, sizeof(serveraddr));
    serveraddr.sin_family = AF_INET;
    serveraddr.sin_addr.s_addr = htonl(INADDR_ANY);//inet_addr(_ServerIP.c_str());
    serveraddr.sin_port = htons(serverport);
    int resval = bind(serverfd_, (struct sockaddr*)&serveraddr, sizeof(serveraddr));
    if (resval == -1)
    {
        close(serverfd_);
        perror("error bind");
        exit(1);
    }
    std::cout << "server bindaddress..." << std::endl;
    return true;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
leaq 0xc(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x5220
movw $0x2, 0xc(%rsp)
xorl %edi, %edi
callq 0x5300
movl %eax, 0x10(%rsp)
movl 0x1c(%rsp), %eax
movzwl %ax, %edi
callq 0x5070
movw %ax, %cx
movq (%rsp), %rax
movw %cx, 0xe(%rsp)
movl (%rax), %edi
leaq 0xc(%rsp), %rsi
movl $0x10, %edx
callq 0x5090
movl %eax, 0x8(%rsp)
cmpl $-0x1, 0x8(%rsp)
jne 0x1bbee
movq (%rsp), %rax
movl (%rax), %edi
callq 0x56e0
leaq 0xd48f(%rip), %rdi      # 0x2906e
callq 0x5320
movl $0x1, %edi
callq 0x5460
movq 0x1f3bb(%rip), %rdi     # 0x3afb0
leaq 0xd47d(%rip), %rsi      # 0x29079
callq 0x53a0
movq %rax, %rdi
movq 0x1f375(%rip), %rsi     # 0x3af80
callq 0x53f0
movb $0x1, %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopl (%rax)
// File: guoxuanhan[P]NetServer/socket.cpp
// Function: Socket::Listen()
bool Socket::Listen()
{
    if (listen(serverfd_, 8192) < 0)
    {
        perror("error listen");
        close(serverfd_);
        exit(1);
    }
    std::cout << "server listenning..." << std::endl;
    return true;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movl (%rax), %edi
movl $0x2000, %esi           # imm = 0x2000
callq 0x5410
cmpl $0x0, %eax
jge 0x1bc66
leaq 0xd444(%rip), %rdi      # 0x2908f
callq 0x5320
movq 0x8(%rsp), %rax
movl (%rax), %edi
callq 0x56e0
movl $0x1, %edi
callq 0x5460
movq 0x1f343(%rip), %rdi     # 0x3afb0
leaq 0xd428(%rip), %rsi      # 0x2909c
callq 0x53a0
movq %rax, %rdi
movq 0x1f2fd(%rip), %rsi     # 0x3af80
callq 0x53f0
movb $0x1, %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: guoxuanhan[P]NetServer/socket.cpp
// Function: Socket::Accept(sockaddr_in&)
int Socket::Accept(struct sockaddr_in &clientaddr)
{
    socklen_t lengthofsockaddr = sizeof(clientaddr);
    int clientfd = accept(serverfd_, (struct sockaddr*)&clientaddr, &lengthofsockaddr);
    if (clientfd < 0)
    {
        //perror("error accept");
        if(errno == EAGAIN)
            return 0;
        //std::cout << "error accept:there is no new connection accept..." << std::endl;
        return clientfd;
    }
    //std::cout << "server accept,clientfd: " << clientfd << std::endl;
    return clientfd;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movl $0x10, 0xc(%rsp)
movl (%rax), %edi
movq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x5130
movl %eax, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
jge 0x1bcf5
callq 0x5060
cmpl $0xb, (%rax)
jne 0x1bceb
movl $0x0, 0x24(%rsp)
jmp 0x1bcfd
movl 0x8(%rsp), %eax
movl %eax, 0x24(%rsp)
jmp 0x1bcfd
movl 0x8(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: guoxuanhan[P]NetServer/tcpconnection.cpp
// Function: TcpConnection::HandleRead()
void TcpConnection::HandleRead()
{
    //接收数据，写入缓冲区
    int result = recvn(fd_, bufferin_);

    //业务回调,可以利用工作线程池处理，投递任务
    if(result > 0)
    {
        messagecallback_(shared_from_this(), bufferin_);//可以用右值引用优化
        //bufferin_.clear();
    }
    else if(result == 0)
    {
        HandleClose();
    }
    else
    {
        HandleError();
    }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq 0x40(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movl 0x20(%rsi), %edi
addq $0x38, %rsi
callq 0x1d1e0
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x3c(%rsp)
jle 0x1c2e8
movq 0x10(%rsp), %rsi
movq %rsi, %rax
addq $0x78, %rax
movq %rax, (%rsp)
leaq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1d6a0
movq 0x10(%rsp), %rdx
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
addq $0x38, %rdx
callq 0x1d830
jmp 0x1c2c2
leaq 0x28(%rsp), %rdi
callq 0xe320
jmp 0x1c307
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0xe320
jmp 0x1c30c
cmpl $0x0, 0x3c(%rsp)
jne 0x1c2fb
movq 0x10(%rsp), %rdi
callq 0x1c480
jmp 0x1c305
movq 0x10(%rsp), %rdi
callq 0x1c6e0
jmp 0x1c307
addq $0x48, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x5660
nopw %cs:(%rax,%rax)
// File: guoxuanhan[P]NetServer/tcpconnection.cpp
// Function: TcpConnection::HandleWrite()
void TcpConnection::HandleWrite()
{
    int result = sendn(fd_, bufferout_);
    if(result > 0)
    {
        uint32_t events = spchannel_->GetEvents();
        if(bufferout_.size() > 0)
        {
            //缓冲区满了，数据没发完，就设置EPOLLOUT事件触发
            spchannel_->SetEvents(events | EPOLLOUT);
            loop_->UpdateChannelToPoller(spchannel_.get());
        }
        else
        {
            //数据已发完
            spchannel_->SetEvents(events & (~EPOLLOUT));
            sendcompletecallback_(shared_from_this());
            //发送完毕，如果是半关闭状态，则可以close了
            if(halfclose_)
                HandleClose();
        }
    }
    else if(result < 0)
    {
        HandleError();
    }
    else
    {
        HandleClose();
    }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rsi
movq %rsi, 0x20(%rsp)
movl 0x20(%rsi), %edi
addq $0x58, %rsi
callq 0x1ccf0
movl %eax, 0x4c(%rsp)
cmpl $0x0, 0x4c(%rsp)
jle 0x1c451
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
callq 0x1d3d0
movq %rax, %rdi
callq 0x5cc0
movq 0x20(%rsp), %rdi
movl %eax, 0x48(%rsp)
addq $0x58, %rdi
callq 0x52b0
cmpq $0x0, %rax
jbe 0x1c3c2
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
callq 0x1d3d0
movq %rax, %rdi
movl 0x48(%rsp), %esi
orl $0x4, %esi
callq 0x5ca0
movq 0x20(%rsp), %rdi
movq 0x10(%rdi), %rax
movq %rax, 0x18(%rsp)
addq $0x18, %rdi
callq 0x1d540
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x8760
jmp 0x1c44f
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
callq 0x1d3d0
movq %rax, %rdi
movl 0x48(%rsp), %esi
andl $-0x5, %esi
callq 0x5ca0
movq 0x20(%rsp), %rsi
movq %rsi, %rax
addq $0x98, %rax
movq %rax, 0x8(%rsp)
leaq 0x38(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x1d6a0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x1d6d0
jmp 0x1c412
leaq 0x38(%rsp), %rdi
callq 0xe320
movq 0x20(%rsp), %rax
testb $0x1, 0x34(%rax)
je 0x1c44d
movq 0x20(%rsp), %rdi
callq 0x1c480
jmp 0x1c44d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x38(%rsp), %rdi
callq 0xe320
jmp 0x1c475
jmp 0x1c44f
jmp 0x1c470
cmpl $0x0, 0x4c(%rsp)
jge 0x1c464
movq 0x20(%rsp), %rdi
callq 0x1c6e0
jmp 0x1c46e
movq 0x20(%rsp), %rdi
callq 0x1c480
jmp 0x1c470
addq $0x58, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0x5660
nop
// File: guoxuanhan[P]NetServer/tcpconnection.cpp
// Function: TcpConnection::HandleClose()
void TcpConnection::HandleClose()
{
    //移除事件
    //loop_->RemoveChannelToPoller(pchannel_);
    //连接标记为清理
    //task添加
    //loop_->AddTask(connectioncleanup_);
    //closecallback_(this);

    //20190217 优雅关闭，发完数据再关闭
    if(disconnected_) {return;}
    if(bufferout_.size() > 0 || bufferin_.size() > 0 || asyncprocessing_)
    {
        //如果还有数据待发送，则先发完,设置半关闭标志位
        halfclose_ = true;
        //还有数据刚刚才收到，但同时又收到FIN
        if(bufferin_.size() > 0)
        {
            messagecallback_(shared_from_this(), bufferin_);
        }
    }
    else
    {
        loop_->AddTask(std::bind(connectioncleanup_, shared_from_this()));
        closecallback_(shared_from_this());
        disconnected_ = true;
    }
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xd0(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x38(%rsp)
testb $0x1, 0x35(%rax)
je 0x1c4a7
jmp 0x1c6c3
movq 0x38(%rsp), %rdi
addq $0x58, %rdi
callq 0x52b0
cmpq $0x0, %rax
ja 0x1c4de
movq 0x38(%rsp), %rdi
addq $0x38, %rdi
callq 0x52b0
cmpq $0x0, %rax
ja 0x1c4de
movq 0x38(%rsp), %rax
testb $0x1, 0x36(%rax)
je 0x1c56d
movq 0x38(%rsp), %rdi
movb $0x1, 0x34(%rdi)
addq $0x38, %rdi
callq 0x52b0
cmpq $0x0, %rax
jbe 0x1c568
movq 0x38(%rsp), %rsi
movq %rsi, %rax
addq $0x78, %rax
movq %rax, 0x28(%rsp)
leaq 0xc0(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x1d6a0
movq 0x38(%rsp), %rdx
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq $0x38, %rdx
callq 0x1d830
jmp 0x1c533
leaq 0xc0(%rsp), %rdi
callq 0xe320
jmp 0x1c568
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xe320
jmp 0x1c6cb
jmp 0x1c6c3
movq 0x38(%rsp), %rsi
movq 0x10(%rsi), %rax
movq %rax, 0x10(%rsp)
movq %rsi, %rax
addq $0xf8, %rax
movq %rax, 0x18(%rsp)
leaq 0x50(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x1d6a0
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x60(%rsp), %rdi
callq 0x1d710
jmp 0x1c5ae
leaq 0x90(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x1d750
jmp 0x1c5c2
movq 0x10(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x8810
jmp 0x1c5d6
leaq 0x90(%rsp), %rdi
callq 0x5ef0
leaq 0x60(%rsp), %rdi
callq 0x1d800
leaq 0x50(%rsp), %rdi
callq 0xe320
movq 0x38(%rsp), %rsi
movq %rsi, %rax
addq $0xb8, %rax
movq %rax, (%rsp)
leaq 0x40(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1d6a0
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x1d6d0
jmp 0x1c628
leaq 0x40(%rsp), %rdi
callq 0xe320
movq 0x38(%rsp), %rax
movb $0x1, 0x35(%rax)
jmp 0x1c6c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x1c697
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x1c68d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x5ef0
leaq 0x60(%rsp), %rdi
callq 0x1d800
leaq 0x50(%rsp), %rdi
callq 0xe320
jmp 0x1c6cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xe320
jmp 0x1c6cb
addq $0xd8, %rsp
retq
movq 0xb8(%rsp), %rdi
callq 0x5660
nopl (%rax,%rax)
// File: guoxuanhan[P]NetServer/tcpconnection.cpp
// Function: TcpConnection::HandleError()
void TcpConnection::HandleError()
{
    if(disconnected_) {return;}
    errorcallback_(shared_from_this());
    //loop_->RemoveChannelToPoller(pchannel_);
    //连接标记为清理
    //task添加
    loop_->AddTask(std::bind(connectioncleanup_, shared_from_this())); //自己不能清理自己，交给loop执行，Tcpserver清理
    disconnected_ = true;
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x28(%rsp)
testb $0x1, 0x35(%rax)
je 0x1c707
jmp 0x1c7d2
movq 0x28(%rsp), %rsi
movq %rsi, %rax
addq $0xd8, %rax
movq %rax, 0x18(%rsp)
leaq 0xa0(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x1d6a0
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1d6d0
jmp 0x1c73d
leaq 0xa0(%rsp), %rdi
callq 0xe320
movq 0x28(%rsp), %rsi
movq 0x10(%rsi), %rax
movq %rax, (%rsp)
movq %rsi, %rax
addq $0xf8, %rax
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x1d6a0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x1d710
jmp 0x1c78a
leaq 0x70(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1d750
jmp 0x1c79b
movq (%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x8810
jmp 0x1c7ab
leaq 0x70(%rsp), %rdi
callq 0x5ef0
leaq 0x40(%rsp), %rdi
callq 0x1d800
leaq 0x30(%rsp), %rdi
callq 0xe320
movq 0x28(%rsp), %rax
movb $0x1, 0x35(%rax)
addq $0xb8, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xe320
jmp 0x1c85b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x1c851
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x1c847
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x5ef0
leaq 0x40(%rsp), %rdi
callq 0x1d800
leaq 0x30(%rsp), %rdi
callq 0xe320
movq 0x98(%rsp), %rdi
callq 0x5660
nopl (%rax,%rax)
// File: guoxuanhan[P]NetServer/tcpconnection.cpp
// Function: TcpConnection::Send(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void TcpConnection::Send(const std::string &s)
{
    //std::cout << "TcpConnection::Send" << std::endl;
    bufferout_ += s; //跨线程消息投递成功
    //判断当前线程是不是Loop IO线程
    if(loop_->GetThreadId() == std::this_thread::get_id())
    {
        SendInLoop();
    }
    else
    {
        asyncprocessing_ = false; //异步调用结束
        //std::cout << "asyncprocessing_" << std::endl;
        loop_->AddTask(std::bind(&TcpConnection::SendInLoop, shared_from_this()));//跨线程调用,加入IO线程的任务队列，唤醒
    }
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq 0xa0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movq 0x98(%rsp), %rsi
addq $0x58, %rdi
callq 0x54a0
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x87b0
movq %rax, 0x90(%rsp)
callq 0x8940
movq %rax, 0x88(%rsp)
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0xab50
testb $0x1, %al
jne 0x1ca83
jmp 0x1ca92
movq 0x10(%rsp), %rdi
callq 0x1cb80
jmp 0x1cb6c
movq 0x10(%rsp), %rsi
movb $0x0, 0x36(%rsi)
movq 0x10(%rsi), %rax
movq %rax, (%rsp)
leaq 0xd6(%rip), %rax        # 0x1cb80
movq %rax, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1d6a0
movq 0x8(%rsp), %rdx
leaq 0x48(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x1d660
jmp 0x1cadd
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0xdbd0
jmp 0x1caee
movq (%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x8810
jmp 0x1cafe
leaq 0x68(%rsp), %rdi
callq 0x5ef0
leaq 0x48(%rsp), %rdi
callq 0xd920
leaq 0x28(%rsp), %rdi
callq 0xe320
jmp 0x1cb6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
jmp 0x1cb60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
jmp 0x1cb56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x5ef0
leaq 0x48(%rsp), %rdi
callq 0xd920
leaq 0x28(%rsp), %rdi
callq 0xe320
jmp 0x1cb74
addq $0xa8, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x5660
nop
// File: guoxuanhan[P]NetServer/tcpconnection.cpp
// Function: TcpConnection::SendInLoop()
void TcpConnection::SendInLoop()
{
    //bufferout_ += s;//copy一次
    if(disconnected_)
    {
        return;
    }
    int result = sendn(fd_, bufferout_);
    if(result > 0)
    {
        uint32_t events = spchannel_->GetEvents();
        if(bufferout_.size() > 0)
        {
            //缓冲区满了，数据没发完，就设置EPOLLOUT事件触发
            spchannel_->SetEvents(events | EPOLLOUT);
            loop_->UpdateChannelToPoller(spchannel_.get());
        }
        else
        {
            //数据已发完
            spchannel_->SetEvents(events & (~EPOLLOUT));
            sendcompletecallback_(shared_from_this());
            //20190217
            if(halfclose_)
                HandleClose();
        }
    }
    else if(result < 0)
    {
        HandleError();
    }
    else
    {
        HandleClose();
    }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
testb $0x1, 0x35(%rax)
je 0x1cb9e
jmp 0x1cce0
movq 0x20(%rsp), %rsi
movl 0x20(%rsi), %edi
addq $0x58, %rsi
callq 0x1ccf0
movl %eax, 0x4c(%rsp)
cmpl $0x0, 0x4c(%rsp)
jle 0x1ccc1
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
callq 0x1d3d0
movq %rax, %rdi
callq 0x5cc0
movq 0x20(%rsp), %rdi
movl %eax, 0x48(%rsp)
addq $0x58, %rdi
callq 0x52b0
cmpq $0x0, %rax
jbe 0x1cc32
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
callq 0x1d3d0
movq %rax, %rdi
movl 0x48(%rsp), %esi
orl $0x4, %esi
callq 0x5ca0
movq 0x20(%rsp), %rdi
movq 0x10(%rdi), %rax
movq %rax, 0x18(%rsp)
addq $0x18, %rdi
callq 0x1d540
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x8760
jmp 0x1ccbf
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
callq 0x1d3d0
movq %rax, %rdi
movl 0x48(%rsp), %esi
andl $-0x5, %esi
callq 0x5ca0
movq 0x20(%rsp), %rsi
movq %rsi, %rax
addq $0x98, %rax
movq %rax, 0x8(%rsp)
leaq 0x38(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x1d6a0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x1d6d0
jmp 0x1cc82
leaq 0x38(%rsp), %rdi
callq 0xe320
movq 0x20(%rsp), %rax
testb $0x1, 0x34(%rax)
je 0x1ccbd
movq 0x20(%rsp), %rdi
callq 0x1c480
jmp 0x1ccbd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x38(%rsp), %rdi
callq 0xe320
jmp 0x1cce5
jmp 0x1ccbf
jmp 0x1cce0
cmpl $0x0, 0x4c(%rsp)
jge 0x1ccd4
movq 0x20(%rsp), %rdi
callq 0x1c6e0
jmp 0x1ccde
movq 0x20(%rsp), %rdi
callq 0x1c480
jmp 0x1cce0
addq $0x58, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0x5660
nop
// File: guoxuanhan[P]NetServer/tcpconnection.cpp
// Function: TcpConnection::Shutdown()
void TcpConnection::Shutdown()
{
    if(loop_->GetThreadId() == std::this_thread::get_id())
    {
        ShutdownInLoop();
    }
    else
    {
        //不是IO线程，则是跨线程调用,加入IO线程的任务队列，唤醒
        loop_->AddTask(std::bind(&TcpConnection::ShutdownInLoop, shared_from_this()));
    }
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x10(%rax), %rdi
callq 0x87b0
movq %rax, 0x98(%rsp)
callq 0x8940
movq %rax, 0x90(%rsp)
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0xab50
testb $0x1, %al
jne 0x1cf35
jmp 0x1cf44
movq 0x18(%rsp), %rdi
callq 0x1d030
jmp 0x1d01c
movq 0x18(%rsp), %rsi
movq 0x10(%rsi), %rax
movq %rax, 0x8(%rsp)
leaq 0xd7(%rip), %rax        # 0x1d030
movq %rax, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
leaq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x1d6a0
movq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1d660
jmp 0x1cf8c
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xdbd0
jmp 0x1cf9d
movq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x8810
jmp 0x1cfae
leaq 0x70(%rsp), %rdi
callq 0x5ef0
leaq 0x50(%rsp), %rdi
callq 0xd920
leaq 0x30(%rsp), %rdi
callq 0xe320
jmp 0x1d01c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
jmp 0x1d010
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
jmp 0x1d006
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x5ef0
leaq 0x50(%rsp), %rdi
callq 0xd920
leaq 0x30(%rsp), %rdi
callq 0xe320
jmp 0x1d024
addq $0xa8, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0x5660
nop
// File: guoxuanhan[P]NetServer/tcpconnection.cpp
// Function: TcpConnection::ShutdownInLoop()
void TcpConnection::ShutdownInLoop()
{
    if(disconnected_) {return;}
    std::cout << "shutdown" << std::endl;
    closecallback_(shared_from_this()); //应用层清理连接回调
    loop_->AddTask(std::bind(connectioncleanup_, shared_from_this())); //自己不能清理自己，交给loop执行，Tcpserver清理TcpConnection
    disconnected_ = true;
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x28(%rsp)
testb $0x1, 0x35(%rax)
je 0x1d057
jmp 0x1d144
movq 0x1df52(%rip), %rdi     # 0x3afb0
leaq 0xc07f(%rip), %rsi      # 0x290e4
callq 0x53a0
movq %rax, %rdi
movq 0x1df0c(%rip), %rsi     # 0x3af80
callq 0x53f0
movq 0x28(%rsp), %rsi
movq %rsi, %rax
addq $0xb8, %rax
movq %rax, 0x18(%rsp)
leaq 0xa0(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x1d6a0
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1d6d0
jmp 0x1d0af
leaq 0xa0(%rsp), %rdi
callq 0xe320
movq 0x28(%rsp), %rsi
movq 0x10(%rsi), %rax
movq %rax, (%rsp)
movq %rsi, %rax
addq $0xf8, %rax
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x1d6a0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x1d710
jmp 0x1d0fc
leaq 0x70(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1d750
jmp 0x1d10d
movq (%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x8810
jmp 0x1d11d
leaq 0x70(%rsp), %rdi
callq 0x5ef0
leaq 0x40(%rsp), %rdi
callq 0x1d800
leaq 0x30(%rsp), %rdi
callq 0xe320
movq 0x28(%rsp), %rax
movb $0x1, 0x35(%rax)
addq $0xb8, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xe320
jmp 0x1d1cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x1d1c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x1d1b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x5ef0
leaq 0x40(%rsp), %rdi
callq 0x1d800
leaq 0x30(%rsp), %rdi
callq 0xe320
movq 0x98(%rsp), %rdi
callq 0x5660
nopw (%rax,%rax)
// File: guoxuanhan[P]NetServer/tcpconnection.cpp
// Function: recvn(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
int recvn(int fd, std::string &bufferin)
{
    int nbyte = 0;
    int readsum = 0;
    char buffer[BUFSIZE];
    for(;;)
    {
        //nbyte = recv(fd, buffer, BUFSIZE, 0);
        nbyte = read(fd, buffer, BUFSIZE);

        if (nbyte > 0)
        {
            bufferin.append(buffer, nbyte);//效率较低，2次拷贝
            readsum += nbyte;
            if(nbyte < BUFSIZE)
                return readsum;//读优化，减小一次读调用，因为一次调用耗时10+us
            else
                continue;
        }
        else if (nbyte < 0)//异常
        {
            if (errno == EAGAIN)//系统缓冲区未有数据，非阻塞返回
            {
                //std::cout << "EAGAIN,系统缓冲区未有数据，非阻塞返回" << std::endl;
                return readsum;
            }
            else if (errno == EINTR)
            {
                std::cout << "errno == EINTR" << std::endl;
                continue;
            }
            else
            {
                //可能是RST
                perror("recv error");
                //std::cout << "recv error" << std::endl;
                return -1;
            }
        }
        else//返回0，客户端关闭socket，FIN
        {
            //std::cout << "client close the Socket" << std::endl;
            return 0;
        }
    }
}

// Assembly:
subq $0x1018, %rsp           # imm = 0x1018
movl %edi, 0x1010(%rsp)
movq %rsi, 0x1008(%rsp)
movl $0x0, 0x1004(%rsp)
movl $0x0, 0x1000(%rsp)
movl 0x1010(%rsp), %edi
movq %rsp, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x5520
movl %eax, 0x1004(%rsp)
cmpl $0x0, 0x1004(%rsp)
jle 0x1d27d
movq 0x1008(%rsp), %rdi
movq %rsp, %rsi
movslq 0x1004(%rsp), %rdx
callq 0x5080
movl 0x1004(%rsp), %eax
addl 0x1000(%rsp), %eax
movl %eax, 0x1000(%rsp)
cmpl $0x1000, 0x1004(%rsp) # imm = 0x1000
jge 0x1d27b
movl 0x1000(%rsp), %eax
movl %eax, 0x1014(%rsp)
jmp 0x1d2f6
jmp 0x1d20c
cmpl $0x0, 0x1004(%rsp)
jge 0x1d2eb
callq 0x5060
cmpl $0xb, (%rax)
jne 0x1d2a1
movl 0x1000(%rsp), %eax
movl %eax, 0x1014(%rsp)
jmp 0x1d2f6
callq 0x5060
cmpl $0x4, (%rax)
jne 0x1d2d2
movq 0x1dcfe(%rip), %rdi     # 0x3afb0
leaq 0xbe67(%rip), %rsi      # 0x29120
callq 0x53a0
movq %rax, %rdi
movq 0x1dcb8(%rip), %rsi     # 0x3af80
callq 0x53f0
jmp 0x1d20c
leaq 0xbe14(%rip), %rdi      # 0x290ed
callq 0x5320
movl $0xffffffff, 0x1014(%rsp) # imm = 0xFFFFFFFF
jmp 0x1d2f6
movl $0x0, 0x1014(%rsp)
movl 0x1014(%rsp), %eax
addq $0x1018, %rsp           # imm = 0x1018
retq
nopw %cs:(%rax,%rax)
nop
// File: guoxuanhan[P]NetServer/tcpserver.cpp
// Function: Setnonblocking(int)
void Setnonblocking(int fd)
{
    int opts = fcntl(fd, F_GETFL);
    if (opts < 0)
    {
        perror("fcntl(fd,GETFL)");
        exit(1);
    }
    if (fcntl(fd, F_SETFL, opts | O_NONBLOCK) < 0)
    {
        perror("fcntl(fd,SETFL,opts)");
        exit(1);
    }
}

// Assembly:
pushq %rax
movl %edi, 0x4(%rsp)
movl 0x4(%rsp), %edi
movl $0x3, %esi
movb $0x0, %al
callq 0x5240
movl %eax, (%rsp)
cmpl $0x0, (%rsp)
jge 0x1f9f4
leaq 0x9a05(%rip), %rdi      # 0x293ea
callq 0x5320
movl $0x1, %edi
callq 0x5460
movl 0x4(%rsp), %edi
movl (%rsp), %edx
orl $0x800, %edx            # imm = 0x800
movl $0x4, %esi
movb $0x0, %al
callq 0x5240
cmpl $0x0, %eax
jge 0x1fa28
leaq 0x99e1(%rip), %rdi      # 0x293fa
callq 0x5320
movl $0x1, %edi
callq 0x5460
popq %rax
retq
nopw (%rax,%rax)
// File: guoxuanhan[P]NetServer/tcpserver.cpp
// Function: TcpServer::RemoveConnection(std::shared_ptr<TcpConnection>)
void TcpServer::RemoveConnection(std::shared_ptr<TcpConnection> sptcpconnection)
{
    std::lock_guard<std::mutex> lock(mutex_);
    --conncount_;
    //std::cout << "clean up connection, conncount is" << conncount_ << std::endl;
    tcpconnlist_.erase(sptcpconnection->fd());
}

// Assembly:
subq $0x48, %rsp
movq %rsi, 0x8(%rsp)
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rsi
movq %rsi, (%rsp)
addq $0xd0, %rsi
leaq 0x30(%rsp), %rdi
callq 0x8c20
movq (%rsp), %rax
movq 0x8(%rsp), %rdi
movl 0x98(%rax), %ecx
decl %ecx
movl %ecx, 0x98(%rax)
addq $0xa0, %rax
movq %rax, 0x10(%rsp)
callq 0x6aa0
movq %rax, %rdi
callq 0x20050
movl %eax, 0x18(%rsp)
jmp 0x1fa92
movq 0x10(%rsp), %rdi
movl 0x18(%rsp), %eax
movl %eax, 0x2c(%rsp)
leaq 0x2c(%rsp), %rsi
callq 0x20020
jmp 0x1faab
leaq 0x30(%rsp), %rdi
callq 0x8cc0
addq $0x48, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x8cc0
movq 0x20(%rsp), %rdi
callq 0x5660
nopl (%rax)
// File: guoxuanhan[P]NetServer/threadpool.cpp
// Function: ThreadPool::~ThreadPool()
ThreadPool::~ThreadPool()
{
    std::cout<< "Clean up the ThreadPool!" << std::endl;
    Stop();
    for(int i = 0; i < threadnum_; i++)
    {
        threadlist_[i]->join();
    }
    for(int i = 0; i < threadnum_; i++)
    {
        delete threadlist_[i];
    }
    threadlist_.clear();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x17ed6(%rip), %rdi     # 0x3afb0
leaq 0x64e2(%rip), %rsi      # 0x295c3
callq 0x53a0
movq %rax, 0x10(%rsp)
jmp 0x230ed
movq 0x10(%rsp), %rdi
movq 0x17e87(%rip), %rsi     # 0x3af80
callq 0x53f0
jmp 0x23100
movq 0x8(%rsp), %rdi
callq 0x231f0
jmp 0x2310c
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rcx
movl 0x1c(%rsp), %eax
cmpl 0x4(%rcx), %eax
jge 0x2314e
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
movslq 0x1c(%rsp), %rsi
callq 0x238c0
movq (%rax), %rdi
callq 0x5620
jmp 0x2313f
jmp 0x23141
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x23114
movl $0x0, 0x18(%rsp)
movq 0x8(%rsp), %rcx
movl 0x18(%rsp), %eax
cmpl 0x4(%rcx), %eax
jge 0x231a5
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
movslq 0x18(%rsp), %rsi
callq 0x238c0
movq (%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x23196
movq (%rsp), %rdi
callq 0xa950
movq (%rsp), %rdi
callq 0x5370
jmp 0x23198
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x23156
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
callq 0x238e0
movq 0x8(%rsp), %rdi
addq $0x98, %rdi
callq 0x5690
movq 0x8(%rsp), %rdi
addq $0x20, %rdi
callq 0x23900
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
callq 0x23860
addq $0x28, %rsp
retq
movq %rax, %rdi
callq 0x5fd0
nopl (%rax)
// File: guoxuanhan[P]NetServer/threadpool.cpp
// Function: ThreadPool::Start()
void ThreadPool::Start()
{
    if(threadnum_ > 0)
    {
        started_ = true;
        for(int i = 0; i < threadnum_; i++)
        {
            std::thread *pthread = new std::thread(&ThreadPool::ThreadFunc, this);
            threadlist_.push_back(pthread);
        }
    } else
    {
        std::cout<< "ThreadPool: threadnum < 0!" << std::endl;
    }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x4(%rax)
jle 0x232dd
movq 0x10(%rsp), %rax
movb $0x1, (%rax)
movl $0x0, 0x4c(%rsp)
movq 0x10(%rsp), %rcx
movl 0x4c(%rsp), %eax
cmpl 0x4(%rcx), %eax
jge 0x232db
movl $0x8, %edi
callq 0x53c0
movq %rax, %rdi
movq 0x10(%rsp), %rax
movq %rdi, %rcx
movq %rcx, 0x8(%rsp)
leaq 0xa0(%rip), %rcx        # 0x23310
movq %rcx, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x23910
jmp 0x23294
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rax
movq %rax, 0x40(%rsp)
addq $0x8, %rdi
leaq 0x40(%rsp), %rsi
callq 0x239e0
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x2323d
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
callq 0x5370
jmp 0x23304
jmp 0x232ff
movq 0x17ccc(%rip), %rdi     # 0x3afb0
leaq 0x62f1(%rip), %rsi      # 0x295dc
callq 0x53a0
movq %rax, %rdi
movq 0x17c86(%rip), %rsi     # 0x3af80
callq 0x53f0
addq $0x58, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x5660
nop
// File: guoxuanhan[P]NetServer/timer.cpp
// Function: Timer::Timer(int, Timer::TimerType, std::function<void ()> const&)
Timer::Timer(int timeout, TimerType timertype, const CallBack &timercallback) :
    timeout_(timeout),
    timertype_(timertype),
    timercallback_(timercallback),
    rotation(0),
    timeslot(0),
    prev(nullptr),
    next(nullptr)
{
    if(timeout < 0)
    {
        return;
    }
    // struct timeval tv;
    // gettimeofday(&tv, NULL);
    // timeout_ = (tv.tv_sec % 10000) * 1000 + tv.tv_usec / 1000 + timeout;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, (%rdi)
movl 0x18(%rsp), %eax
movl %eax, 0x4(%rdi)
addq $0x8, %rdi
movq 0x10(%rsp), %rsi
callq 0x6020
movq 0x8(%rsp), %rax
movl $0x0, 0x28(%rax)
movl $0x0, 0x2c(%rax)
movq $0x0, 0x30(%rax)
movq $0x0, 0x38(%rax)
cmpl $0x0, 0x1c(%rsp)
jge 0x25e77
jmp 0x25e77
addq $0x28, %rsp
retq
nopl (%rax)