LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0xffffffff, (%rdi)     # imm = 0xFFFFFFFF
leaq 0x8(%rdi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
xorl %r14d, %r14d
movq %r14, 0x18(%rdi)
movl $0xc000, %edi           # imm = 0xC000
callq 0x4350
movq %rax, 0x8(%rbx)
movq %rax, 0x10(%rbx)
leaq 0xc000(%rax), %rcx
movq %rcx, 0x18(%rbx)
movq %r14, (%rax)
movl $0x0, 0x8(%rax)
movl $0xc, %edx
movl 0x8(%rax), %esi
movl %esi, 0x8(%rax,%rdx)
movq (%rax), %rsi
movq %rsi, (%rax,%rdx)
addq $0xc, %rdx
cmpq $0xc000, %rdx           # imm = 0xC000
jne 0xae68
movq %rcx, 0x10(%rbx)
leaq 0x28(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movq $0x0, 0x30(%rbx)
movq %rax, 0x38(%rbx)
movq %rax, 0x40(%rbx)
movups %xmm0, 0x48(%rbx)
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x68(%rbx)
movl $0x100, %edi            # imm = 0x100
callq 0x45e0
movl %eax, (%rbx)
cmpl $-0x1, %eax
je 0xaf19
leaq 0x20(%rbx), %r14
movq 0xd0ee(%rip), %rdi      # 0x17fb8
leaq 0x605e(%rip), %rsi      # 0x10f2f
movl $0xe, %edx
callq 0x43a0
movl (%rbx), %esi
movq 0xd0d4(%rip), %rdi      # 0x17fb8
callq 0x4580
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4240
popq %rbx
popq %r14
popq %r15
retq
callq 0x4642
movq %rax, %rbx
movq %r14, %rdi
callq 0xb46c
movq (%r15), %rdi
testq %rdi, %rdi
je 0xaf36
callq 0x4310
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4bbe
movl %eax, (%rsp)
movq %r14, %rdi
callq 0x4bc6
movl %eax, 0x4(%rsp)
movq %r14, 0x8(%rsp)
leaq 0x50(%rbx), %r15
movq %r15, %rdi
callq 0x4480
testl %eax, %eax
jne 0xb22d
leaq 0x20(%rbx), %rdi
movq %rsp, %rsi
callq 0xb406
movq %r14, (%rax)
movq %r15, %rdi
callq 0x42a0
movl (%rbx), %edi
movl (%rsp), %edx
leaq 0x4(%rsp), %rcx
movl $0x1, %esi
callq 0x4430
cmpl $-0x1, %eax
je 0xb234
movq 0xcdd0(%rip), %rbx      # 0x17fb8
leaq 0x5d8c(%rip), %rsi      # 0x10f7b
movl $0xc, %edx
movq %rbx, %rdi
callq 0x43a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4240
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x4220
callq 0x4657
movq %rax, %rbx
movq %r15, %rdi
callq 0x42a0
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4bbe
movl %eax, (%rsp)
movq %r14, %rdi
callq 0x4bc6
movl %eax, 0x4(%rsp)
movq %r14, 0x8(%rsp)
leaq 0x50(%rbx), %r14
movq %r14, %rdi
callq 0x4480
testl %eax, %eax
jne 0xb312
leaq 0x20(%rbx), %r15
movq %rsp, %rsi
movq %r15, %rdi
callq 0xb9ca
movq %r15, %rdi
movq %rax, %rsi
callq 0xba48
movq %r14, %rdi
callq 0x42a0
movl (%rbx), %edi
movl (%rsp), %edx
leaq 0x4(%rsp), %rcx
movl $0x2, %esi
callq 0x4430
cmpl $-0x1, %eax
je 0xb319
movq 0xcceb(%rip), %rbx      # 0x17fb8
leaq 0x5cc5(%rip), %rsi      # 0x10f99
movl $0xf, %edx
movq %rbx, %rdi
callq 0x43a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4240
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x4220
callq 0x466c
movq %rax, %rbx
movq %r14, %rdi
callq 0x42a0
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x4bbe
movl %eax, %ebp
movq %rbx, %rdi
callq 0x4bc6
leaq 0x4(%rsp), %rcx
movl %eax, (%rcx)
movq %rbx, 0x4(%rcx)
movl (%r14), %edi
movl $0x3, %esi
movl %ebp, %edx
callq 0x4430
cmpl $-0x1, %eax
je 0xb3bc
movq 0xcc40(%rip), %rbx      # 0x17fb8
leaq 0x5c3e(%rip), %rsi      # 0x10fbd
movl $0xf, %edx
movq %rbx, %rdi
callq 0x43a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4240
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x4681
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x40a0
movl %eax, (%rbx)
cmpl $-0x1, %eax
je 0xbb5d
movq 0xc4aa(%rip), %r14      # 0x17fb8
leaq 0x54e7(%rip), %rsi      # 0x10ffc
movl $0x14, %edx
movq %r14, %rdi
callq 0x43a0
movl (%rbx), %esi
movq %r14, %rdi
callq 0x4580
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4240
callq 0x46c1
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
movl $0x3, %esi
xorl %eax, %eax
callq 0x4200
testl %eax, %eax
js 0xbc54
movl (%rbx), %edi
orl $0x800, %eax            # imm = 0x800
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x4200
testl %eax, %eax
js 0xbc59
movq 0xc3a0(%rip), %rbx      # 0x17fb8
leaq 0x5435(%rip), %rsi      # 0x11054
movl $0x18, %edx
movq %rbx, %rdi
callq 0x43a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
popq %rbx
jmp 0x4240
callq 0x46eb
callq 0x46d6
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsp, %rax
movq $0x0, 0x8(%rax)
movw $0x2, (%rax)
movl $0x0, 0x4(%rax)
rolw $0x8, %si
movw %si, 0x2(%rax)
movl (%rdi), %edi
movq %rax, %rsi
movl $0x10, %edx
callq 0x4070
cmpl $-0x1, %eax
je 0xbce3
movq 0xc318(%rip), %rbx      # 0x17fb8
leaq 0x53d1(%rip), %rsi      # 0x11078
movl $0x15, %edx
movq %rbx, %rdi
callq 0x43a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4240
movb $0x1, %al
addq $0x10, %rsp
popq %rbx
retq
movq %rbx, %rdi
callq 0x4700
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
movl $0x2000, %esi           # imm = 0x2000
callq 0x4380
testl %eax, %eax
js 0xbd46
movq 0xc2b1(%rip), %rbx      # 0x17fb8
leaq 0x538d(%rip), %rsi      # 0x1109b
movl $0x14, %edx
movq %rbx, %rdi
callq 0x43a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4240
movb $0x1, %al
popq %rbx
retq
movq %rbx, %rdi
callq 0x471c
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x20(%rdi), %edi
leaq 0x38(%rbx), %r14
movq %r14, %rsi
callq 0xce3c
testl %eax, %eax
jle 0xc205
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xd166
cmpq $0x0, 0x88(%rbx)
je 0xc222
leaq 0x78(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movq %r14, %rdx
callq *0x90(%rbx)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc1fd
callq 0x795e
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
je 0xc216
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0xc4da
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0xc314
callq 0x4140
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc239
callq 0x795e
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x20(%rdi), %edi
leaq 0x58(%rbx), %rsi
callq 0xca43
testl %eax, %eax
jle 0xc28a
movq 0x18(%rbx), %rdi
callq 0x4bc6
cmpq $0x0, 0x60(%rbx)
movq 0x18(%rbx), %rdi
je 0xc299
orl $0x4, %eax
movl %eax, %esi
callq 0x4bc2
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
addq $0x10, %rsp
popq %rbx
jmp 0x5952
movq %rbx, %rdi
js 0xc2eb
addq $0x10, %rsp
popq %rbx
jmp 0xc314
andl $-0x5, %eax
movl %eax, %esi
callq 0x4bc2
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xd166
cmpq $0x0, 0xa8(%rbx)
je 0xc2f5
leaq 0x98(%rbx), %rdi
movq %rsp, %rsi
callq *0xb0(%rbx)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc2d7
callq 0x795e
cmpb $0x1, 0x34(%rbx)
jne 0xc2e5
movq %rbx, %rdi
callq 0xc314
addq $0x10, %rsp
popq %rbx
retq
addq $0x10, %rsp
popq %rbx
jmp 0xc4da
callq 0x4140
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc30c
callq 0x795e
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
cmpb $0x0, 0x35(%rdi)
je 0xc32d
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x60(%rdi), %rcx
orq %rax, %rcx
jne 0xc349
cmpb $0x1, 0x36(%rbx)
jne 0xc391
movb $0x1, 0x34(%rbx)
jmp 0xc323
movb $0x1, 0x34(%rbx)
testq %rax, %rax
je 0xc323
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0xd166
cmpq $0x0, 0x88(%rbx)
je 0xc470
leaq 0x38(%rbx), %rdx
leaq 0x78(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq *0x90(%rbx)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc323
callq 0x795e
jmp 0xc323
movq 0x10(%rbx), %r14
leaq 0xf8(%rbx), %r15
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xd166
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x52f6
movaps (%rsp), %xmm0
leaq 0x10(%rsp), %rsi
movups %xmm0, 0x20(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x40(%rsp), %rdi
callq 0xcf8a
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x598a
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xc3f8
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xc407
callq 0x795e
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0xc420
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc42f
callq 0x795e
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0xd166
cmpq $0x0, 0xc8(%rbx)
je 0xc475
leaq 0xb8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq *0xd0(%rbx)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc467
callq 0x795e
movb $0x1, 0x35(%rbx)
jmp 0xc323
callq 0x4140
callq 0x4140
jmp 0xc49c
jmp 0xc49c
movq %rax, %rbx
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xc4a7
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc4a7
movq %rax, %rdi
callq 0x4df2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xcfe8
jmp 0xc4b6
movq %rax, %rbx
movq 0x8(%rsp), %rdi
jmp 0xc4c7
jmp 0xc4bf
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc4d1
callq 0x795e
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
cmpb $0x0, 0x35(%rdi)
jne 0xc5ce
movq %rdi, %rbx
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0xd166
cmpq $0x0, 0xe8(%rbx)
je 0xc5d8
leaq 0xd8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq *0xf0(%rbx)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc52c
callq 0x795e
movq 0x10(%rbx), %r14
leaq 0xf8(%rbx), %r15
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xd166
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x52f6
movaps (%rsp), %xmm0
leaq 0x10(%rsp), %rsi
movups %xmm0, 0x20(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x40(%rsp), %rdi
callq 0xcf8a
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x598a
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xc593
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xc5a2
callq 0x795e
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0xc5bb
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc5ca
callq 0x795e
movb $0x1, 0x35(%rbx)
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x4140
jmp 0xc5ff
jmp 0xc5ff
movq %rax, %rbx
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xc60a
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc60a
movq %rax, %rdi
callq 0x4df2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xcfe8
jmp 0xc619
movq %rax, %rbx
movq 0x8(%rsp), %rdi
jmp 0xc628
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc632
callq 0x795e
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O3/guoxuanhan[P]NetServer/tcpconnection.cpp
// Function: TcpConnection::~TcpConnection()
TcpConnection::~TcpConnection()
{
    //多线程下，加入loop的任务队列？不用，因为已经在当前loop线程
    //移除事件,析构成员变量
    loop_->RemoveChannelToPoller(spchannel_.get());
    close(fd_);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq 0x18(%rbx), %rsi
callq 0x5948
movl 0x20(%rbx), %edi
callq 0x4600
movq 0x108(%rbx), %rax
testq %rax, %rax
je 0xc673
leaq 0xf8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xe8(%rbx), %rax
testq %rax, %rax
je 0xc690
leaq 0xd8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xc8(%rbx), %rax
testq %rax, %rax
je 0xc6ad
leaq 0xb8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xa8(%rbx), %rax
testq %rax, %rax
je 0xc6ca
leaq 0x98(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x88(%rbx), %rax
testq %rax, %rax
je 0xc6e4
leaq 0x78(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x58(%rbx), %rdi
leaq 0x68(%rbx), %rax
cmpq %rax, %rdi
je 0xc6f6
callq 0x4310
leaq 0x18(%rbx), %r14
movq 0x38(%rbx), %rdi
leaq 0x48(%rbx), %rax
cmpq %rax, %rdi
je 0xc70c
callq 0x4310
movq %r14, %rdi
callq 0xcf26
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0xc750
movq 0xb88c(%rip), %rax      # 0x17fb0
cmpb $0x0, (%rax)
je 0xc734
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0xc73e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0xc750
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0xc762
jmp 0xc762
jmp 0xc762
jmp 0xc762
jmp 0xc762
movq %rax, %rdi
callq 0x4df2
// File: /workspace/github_cpp_makefile_star2_O3/guoxuanhan[P]NetServer/tcpconnection.cpp
// Function: TcpConnection::AddChannelToLoop()
void TcpConnection::AddChannelToLoop()
{
    //bug segement fault
    //https://blog.csdn.net/littlefang/article/details/37922113
    //多线程下，加入loop的任务队列
    //主线程直接执行
    //loop_->AddChannelToPoller(pchannel_);
    loop_->AddTask(std::bind(&EventLoop::AddChannelToPoller, loop_, spchannel_.get()));

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x10(%rdi), %rbx
movq 0x18(%rdi), %r15
xorl %r12d, %r12d
leaq 0x8(%rsp), %r14
movq %r12, 0x8(%r14)
movl $0x20, %edi
callq 0x4350
leaq -0x6fe2(%rip), %rcx     # 0x57b8
movq %rcx, (%rax)
movq %r12, 0x8(%rax)
movq %r15, 0x10(%rax)
movq %rbx, 0x18(%rax)
movq %rax, (%r14)
leaq 0x90b(%rip), %rax       # 0xd0be
movq %rax, 0x18(%r14)
leaq 0x920(%rip), %rax       # 0xd0de
movq %rax, 0x10(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x598a
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xc7e6
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xc818
movq %rax, %rbx
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xc810
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %rbx, %rdi
callq 0x45a0
movq %rax, %rdi
callq 0x4df2
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
addq $0x58, %rdi
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
movq %rax, %rsi
callq 0x40f0
movq 0x10(%r14), %rdi
callq 0x5964
movq %rax, %rbx
callq 0x42f0
cmpq %rax, %rbx
jne 0xc86a
movq %r14, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc962
movb $0x0, 0x36(%r14)
movq 0x10(%r14), %rbx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xd166
movq (%r15), %r12
movq 0x8(%r15), %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movaps %xmm0, (%rsp)
movaps %xmm0, 0x10(%rsp)
movl $0x20, %edi
callq 0x4350
leaq 0xb7(%rip), %rcx        # 0xc962
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %r14, 0x18(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
leaq -0x425d(%rip), %rax     # 0x866e
movq %rax, 0x18(%rsi)
leaq -0x424c(%rip), %rax     # 0x868a
movq %rax, 0x10(%rsi)
movq %rbx, %rdi
callq 0x598a
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xc8f9
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xc908
callq 0x795e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xc932
movq %rax, %rbx
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xc94a
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc94a
movq %rax, %rdi
callq 0x4df2
movq %rax, %rbx
testq %r14, %r14
je 0xc94a
movq %r14, %rdi
callq 0x795e
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xc959
callq 0x795e
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbx
subq $0x10, %rsp
cmpb $0x0, 0x35(%rdi)
je 0xc973
addq $0x10, %rsp
popq %rbx
retq
movq %rdi, %rbx
movl 0x20(%rdi), %edi
leaq 0x58(%rbx), %rsi
callq 0xca43
testl %eax, %eax
jle 0xc9b6
movq 0x18(%rbx), %rdi
callq 0x4bc6
cmpq $0x0, 0x60(%rbx)
movq 0x18(%rbx), %rdi
je 0xc9c5
orl $0x4, %eax
movl %eax, %esi
callq 0x4bc2
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
addq $0x10, %rsp
popq %rbx
jmp 0x5952
movq %rbx, %rdi
js 0xca1a
addq $0x10, %rsp
popq %rbx
jmp 0xc314
andl $-0x5, %eax
movl %eax, %esi
callq 0x4bc2
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xd166
cmpq $0x0, 0xa8(%rbx)
je 0xca24
leaq 0x98(%rbx), %rdi
movq %rsp, %rsi
callq *0xb0(%rbx)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xca03
callq 0x795e
cmpb $0x1, 0x34(%rbx)
jne 0xc96d
movq %rbx, %rdi
callq 0xc314
jmp 0xc96d
addq $0x10, %rsp
popq %rbx
jmp 0xc4da
callq 0x4140
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xca3b
callq 0x795e
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
movq 0x10(%rdi), %rdi
callq 0x5964
movq %rax, %rbx
callq 0x42f0
cmpq %rax, %rbx
jne 0xcba7
movq %r14, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xcc9a
movq 0x10(%r14), %rbx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xd166
movq (%r15), %r12
movq 0x8(%r15), %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movaps %xmm0, (%rsp)
movaps %xmm0, 0x10(%rsp)
movl $0x20, %edi
callq 0x4350
leaq 0xb7(%rip), %rcx        # 0xcc9a
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %r14, 0x18(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
leaq -0x4595(%rip), %rax     # 0x866e
movq %rax, 0x18(%rsi)
leaq -0x4584(%rip), %rax     # 0x868a
movq %rax, 0x10(%rsi)
movq %rbx, %rdi
callq 0x598a
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xcc31
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xcc40
callq 0x795e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xcc6a
movq %rax, %rbx
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xcc82
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xcc82
movq %rax, %rdi
callq 0x4df2
movq %rax, %rbx
testq %r14, %r14
je 0xcc82
movq %r14, %rdi
callq 0x795e
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xcc91
callq 0x795e
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
cmpb $0x0, 0x35(%rdi)
jne 0xcdd0
movq %rdi, %rbx
movq 0xb301(%rip), %r14      # 0x17fb8
leaq 0x4422(%rip), %rsi      # 0x110e0
movl $0x8, %edx
movq %r14, %rdi
callq 0x43a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4240
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0xd166
cmpq $0x0, 0xc8(%rbx)
je 0xcdda
leaq 0xb8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq *0xd0(%rbx)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xcd2e
callq 0x795e
movq 0x10(%rbx), %r14
leaq 0xf8(%rbx), %r15
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xd166
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x52f6
movaps (%rsp), %xmm0
leaq 0x10(%rsp), %rsi
movups %xmm0, 0x20(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x40(%rsp), %rdi
callq 0xcf8a
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x598a
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xcd95
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xcda4
callq 0x795e
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0xcdbd
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xcdcc
callq 0x795e
movb $0x1, 0x35(%rbx)
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x4140
jmp 0xce01
jmp 0xce01
movq %rax, %rbx
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xce0c
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xce0c
movq %rax, %rdi
callq 0x4df2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xcfe8
jmp 0xce1b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
jmp 0xce2a
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xce34
callq 0x795e
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rsi, 0x8(%rsp)
movl %edi, %ebp
xorl %ebx, %ebx
leaq 0x10(%rsp), %r15
movq 0xb156(%rip), %r12      # 0x17fb8
leaq 0x42b3(%rip), %r13      # 0x1111c
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r15, %rsi
callq 0x4460
movq %rax, %r14
testl %r14d, %r14d
jg 0xcecf
testl %r14d, %r14d
jns 0xcf0f
callq 0x4050
movl (%rax), %eax
cmpl $0x4, %eax
jne 0xcef7
movl $0xe, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x43a0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %r12, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4240
jmp 0xce69
movq %r14, %rdx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x4060
addl %r14d, %ebx
cmpl $0x1000, %r14d          # imm = 0x1000
jae 0xce69
jmp 0xcf11
cmpl $0xb, %eax
je 0xcf11
leaq 0x41e6(%rip), %rdi      # 0x110e9
callq 0x42d0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0xcf11
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
movl %edi, %ebx
movl $0x3, %esi
xorl %eax, %eax
callq 0x4200
testl %eax, %eax
js 0xdb11
orl $0x800, %eax            # imm = 0x800
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x4200
testl %eax, %eax
js 0xdb16
popq %rbx
retq
callq 0x47ae
callq 0x4799
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0xd0(%rdi), %rbx
movq %rbx, %rdi
callq 0x4480
testl %eax, %eax
jne 0xdb7e
decl 0x98(%r14)
addq $0xa0, %r14
movq (%r15), %rax
movl 0x20(%rax), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movq %r14, %rdi
callq 0xe1d8
movq %r14, %rdi
movq %rax, %rsi
callq 0xe256
movq %rbx, %rdi
callq 0x42a0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x4220
movq %rax, %r14
movq %rbx, %rdi
callq 0x42a0
movq %r14, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x9bfd(%rip), %r14      # 0x17fb8
leaq 0x31fd(%rip), %rsi      # 0x115bf
movl $0x18, %edx
movq %r14, %rdi
callq 0x43a0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq 0x9bcb(%rip), %rdi      # 0x17fb8
callq 0x4030
movq %rax, %rdi
callq 0x4240
movb $0x0, (%rbx)
leaq 0x98(%rbx), %r14
movq %r14, %rdi
callq 0x4550
cmpl $0x0, 0x4(%rbx)
jle 0xe459
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x4560
incq %r15
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jl 0xe415
testl %eax, %eax
jle 0xe459
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0xe448
cmpq $0x0, (%rdi)
jne 0xe491
callq 0x4310
incq %r15
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jl 0xe435
movq 0x8(%rbx), %rax
cmpq %rax, 0x10(%rbx)
je 0xe467
movq %rax, 0x10(%rbx)
movq %r14, %rdi
callq 0x45d0
leaq 0x20(%rbx), %rdi
callq 0xea44
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0xe48b
popq %rbx
popq %r14
popq %r15
jmp 0x4310
popq %rbx
popq %r14
popq %r15
retq
callq 0x40b0
jmp 0xe498
movq %rax, %rdi
callq 0x4df2
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x0, 0x4(%rdi)
jle 0xe557
movq %rdi, %rbx
movb $0x1, (%rdi)
leaq 0x8(%rdi), %rax
movq %rax, (%rsp)
xorl %r13d, %r13d
leaq 0xda(%rip), %r14        # 0xe5ba
leaq 0x18(%rsp), %r15
leaq 0x8(%rsp), %r12
movl $0x8, %edi
callq 0x4350
movq %rax, %rbp
movq %r14, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movq %rbx, 0x8(%rsp)
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xe9aa
movq %rbp, 0x10(%rsp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0xe531
movq %rbp, (%rsi)
addq $0x8, 0x10(%rbx)
jmp 0xe53f
movq (%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0xecfc
incl %r13d
cmpl 0x4(%rbx), %r13d
jl 0xe4ea
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9a5a(%rip), %rbx      # 0x17fb8
leaq 0x3073(%rip), %rsi      # 0x115d8
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x43a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4240
movq %rax, %rbx
movq %rbp, %rdi
callq 0x4310
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O3/guoxuanhan[P]NetServer/threadpool.cpp
// Function: ThreadPool::AddTask(std::function<void ()>)
void ThreadPool::AddTask(Task task)
{
    {
        std::lock_guard<std::mutex> lock(mutex_);
        taskqueue_.push(task);
    }
    //依次唤醒等待队列的线程
    condition_.notify_one();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x70(%rdi), %r14
movq %r14, %rdi
callq 0x4480
testl %eax, %eax
jne 0xe98b
leaq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0xee32
movq %r14, %rdi
callq 0x42a0
addq $0x98, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x41c0
movl %eax, %edi
callq 0x4220
movq %rax, %rbx
movq %r14, %rdi
callq 0x42a0
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/guoxuanhan[P]NetServer/timer.cpp
// Function: Timer::Adjust(int, Timer::TimerType, std::function<void ()> const&)
void Timer::Adjust(int timeout, Timer::TimerType timertype, const CallBack &timercallback)
{
    timeout_ = timeout;
    timertype_ = timertype;
    timercallback_ = timercallback;
    TimerManager::GetTimerManagerInstance()->AdjustTimer(this);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
addq $0x8, %rdi
movq %rcx, %rsi
callq 0x4d8c
callq 0xf2fe
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
jmp 0xf568
nop
// File: /workspace/github_cpp_makefile_star2_O3/guoxuanhan[P]NetServer/timermanager.cpp
// Function: TimerManager::GetTimerManagerInstance()
TimerManager* TimerManager::GetTimerManagerInstance()
{
    if(ptimermanager_ == nullptr) //指针为空，则创建管理器
    {
        std::lock_guard<std::mutex> lock(mutex_);
        if(ptimermanager_ == nullptr) //双重检测
        {
            ptimermanager_ = new TimerManager();
        }
    }
    return ptimermanager_;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x9057(%rip), %rax      # 0x18360
testq %rax, %rax
jne 0xf3b2
leaq 0x904f(%rip), %rdi      # 0x18368
callq 0x4480
testl %eax, %eax
jne 0xf3ba
cmpq $0x0, 0x9032(%rip)      # 0x18360
jne 0xf39f
movl $0x58, %edi
callq 0x4350
movq %rax, %rbx
movl $0x0, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movl $0x2000, %edi           # imm = 0x2000
callq 0x4350
movq %rax, 0x8(%rbx)
movq %rax, %r14
addq $0x2000, %r14           # imm = 0x2000
movq %r14, 0x18(%rbx)
movl $0x2000, %edx           # imm = 0x2000
movq %rax, %rdi
xorl %esi, %esi
callq 0x41f0
movq %r14, 0x10(%rbx)
movq $0x0, 0x50(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x39(%rbx)
movq %rbx, 0x8fc1(%rip)      # 0x18360
leaq 0x8fc2(%rip), %rdi      # 0x18368
callq 0x42a0
movq 0x8fae(%rip), %rax      # 0x18360
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl %eax, %edi
callq 0x4220
movq %rax, %r14
movq %rbx, %rdi
callq 0x4310
jmp 0xf3d1
movq %rax, %r14
leaq 0x8f90(%rip), %rdi      # 0x18368
callq 0x42a0
movq %r14, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/guoxuanhan[P]NetServer/timermanager.cpp
// Function: TimerManager::RemoveTimer(Timer*)
void TimerManager::RemoveTimer(Timer* ptimer)
{
    if(ptimer == nullptr)
        return;
    std::lock_guard<std::mutex> lock(timewheelmutex_);
    RemoveTimerFromTimeWheel(ptimer);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0xf506
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rdi), %r15
movq %r15, %rdi
callq 0x4480
testl %eax, %eax
jne 0xf50c
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf514
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x42a0
popq %rbx
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x4220
nop
// File: /workspace/github_cpp_makefile_star2_O3/guoxuanhan[P]NetServer/timermanager.cpp
// Function: TimerManager::AdjustTimer(Timer*)
void TimerManager::AdjustTimer(Timer* ptimer)
{
    if(ptimer == nullptr)
        return;

    std::lock_guard<std::mutex> lock(timewheelmutex_);
    AdjustTimerToWheel(ptimer);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0xf5a0
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rdi), %r15
movq %r15, %rdi
callq 0x4480
testl %eax, %eax
jne 0xf5a6
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf5ae
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x42a0
popq %rbx
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x4220
nop
// File: /workspace/github_cpp_makefile_star2_O3/guoxuanhan[P]NetServer/timermanager.cpp
// Function: TimerManager::AdjustTimerToWheel(Timer*)
void TimerManager::AdjustTimerToWheel(Timer* ptimer)
{
    if(ptimer == nullptr)
        return;

    RemoveTimerFromTimeWheel(ptimer);
    CalculateTimer(ptimer);
    AddTimerToTimeWheel(ptimer);
}

// Assembly:
testq %rsi, %rsi
je 0xf619
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0xf514
movl (%rbx), %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movl %ecx, %eax
shrl $0xa, %eax
movl %eax, 0x28(%rbx)
movl (%r14), %eax
leal (%rax,%rcx), %edx
addl $0x3ff, %edx            # imm = 0x3FF
addl %ecx, %eax
cmovnsl %eax, %edx
andl $0xfffffc00, %edx       # imm = 0xFFFFFC00
subl %edx, %eax
movl %eax, 0x2c(%rbx)
cltq
movq 0x8(%r14), %rcx
movq (%rcx,%rax,8), %rdx
testq %rdx, %rdx
je 0xf60e
movq %rdx, 0x38(%rbx)
movq (%rcx,%rax,8), %rdx
movq %rbx, 0x30(%rdx)
movq %rbx, (%rcx,%rax,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/guoxuanhan[P]NetServer/timermanager.cpp
// Function: TimerManager::CheckTimer()
void TimerManager::CheckTimer()//执行当前slot的任务
{
    std::lock_guard<std::mutex> lock(timewheelmutex_);
    Timer *ptimer = timewheel[currentslot];
    while(ptimer != nullptr)
    {
        if(ptimer->rotation > 0)
        {
            --ptimer->rotation;
            ptimer = ptimer->next;
        }
        else
        {
            //可执行定时器任务
            ptimer->timercallback_(); //注意：任务里不能把定时器自身给清理掉！！！我认为应该先移除再执行任务
            if(ptimer->timertype_ == Timer::TimerType::TIMER_ONCE)
            {
                Timer *ptemptimer = ptimer;
                ptimer = ptimer->next;
                RemoveTimerFromTimeWheel(ptemptimer);
            }
            else
            {
                Timer *ptemptimer = ptimer;
                ptimer = ptimer->next;
                AdjustTimerToWheel(ptemptimer);
                if(currentslot == ptemptimer->timeslot && ptemptimer->rotation > 0)
                {
                    //如果定时器多于一转的话，需要先对rotation减1，否则会等待两个周期
                    --ptemptimer->rotation;
                }
            }
        }
    }
    currentslot = (++currentslot) % TimerManager::slotnum; //移动至下一个时间槽
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x4480
testl %eax, %eax
jne 0xf6e5
movslq (%r14), %rax
movq 0x8(%r14), %rcx
movq (%rcx,%rax,8), %r15
testq %r15, %r15
je 0xf6b0
movl 0x28(%r15), %eax
testl %eax, %eax
jle 0xf665
decl %eax
movl %eax, 0x28(%r15)
movq 0x38(%r15), %r12
movq %r12, %r15
testq %r12, %r12
jne 0xf649
jmp 0xf6ad
cmpq $0x0, 0x18(%r15)
je 0xf6e0
leaq 0x8(%r15), %rdi
callq *0x20(%r15)
cmpl $0x0, 0x4(%r15)
movq 0x38(%r15), %r12
movq %r14, %rdi
je 0xf6a3
movq %r15, %rsi
callq 0xf5ae
movl (%r14), %eax
cmpl 0x2c(%r15), %eax
jne 0xf65b
movl 0x28(%r15), %eax
testl %eax, %eax
jle 0xf65b
decl %eax
movl %eax, 0x28(%r15)
jmp 0xf65b
movq %r15, %rsi
callq 0xf514
jmp 0xf65b
movl (%r14), %eax
leal 0x1(%rax), %ecx
leal 0x400(%rax), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
andl $0xfffffc00, %edx       # imm = 0xFFFFFC00
negl %edx
addl %edx, %eax
incl %eax
movl %eax, (%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x42a0
callq 0x4140
movl %eax, %edi
callq 0x4220
jmp 0xf6ee
movq %rax, %r14
movq %rbx, %rdi
callq 0x42a0
movq %r14, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/guoxuanhan[P]NetServer/timermanager.cpp
// Function: TimerManager::CheckTick()
void TimerManager::CheckTick()
{
    // steady_clock::time_point t1 = steady_clock::now();
    // steady_clock::time_point t2 = steady_clock::now();
    // duration<double> time_span;
    int si = TimerManager::slotinterval;
    struct timeval tv;
    gettimeofday(&tv, NULL);
    int oldtime = (tv.tv_sec % 10000) * 1000 + tv.tv_usec / 1000;
    int time;
    int tickcount;
    while(running_)
    {
        gettimeofday(&tv, NULL);
        time = (tv.tv_sec % 10000) * 1000 + tv.tv_usec / 1000;
        tickcount = (time - oldtime)/slotinterval; //计算两次check的时间间隔占多少个slot
        //oldtime = time;
        oldtime = oldtime + tickcount*slotinterval;

        for(int i = 0; i < tickcount; ++i)
        {
            TimerManager::GetTimerManagerInstance()->CheckTimer();
        }
        std::this_thread::sleep_for(std::chrono::microseconds(500)); //milliseconds(si)时间粒度越小，延时越不精确，因为上下文切换耗时
        // t2 = steady_clock::now();
        // time_span = duration_cast<duration<double>>(t2 - t1);
        // t1 = t2;
        // std::cout << "thread " << time_span.count() << " seconds." << std::endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x4510
cmpb $0x1, 0x48(%rbx)
jne 0xf835
leaq 0x8(%rsp), %rsi
movq (%rsi), %rcx
movabsq $0x346dc5d63886594b, %rdx # imm = 0x346DC5D63886594B
movq %rcx, %rax
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0xb, %rdx
addl %eax, %edx
imull $0x2710, %edx, %eax     # imm = 0x2710
subl %eax, %ecx
movabsq $0x20c49ba5e353f7cf, %r15 # imm = 0x20C49BA5E353F7CF
movq %r15, %rax
imulq 0x8(%rsi)
movq %rdx, %r13
imull $0x3e8, %ecx, %eax      # imm = 0x3E8
movq %rdx, %rcx
shrq $0x3f, %rcx
shrq $0x7, %r13
addl %ecx, %r13d
addl %eax, %r13d
leaq 0x18(%rsp), %r12
movl %r13d, %ebp
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x4510
movq 0x8(%rsp), %rcx
movq %rcx, %rax
movabsq $0x346dc5d63886594b, %rdx # imm = 0x346DC5D63886594B
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0xb, %rdx
addl %eax, %edx
imull $0x2710, %edx, %eax     # imm = 0x2710
subl %eax, %ecx
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
movq %r15, %rax
imulq 0x10(%rsp)
movq %rdx, %r13
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x7, %r13
addl %eax, %r13d
addl %ecx, %r13d
movl %r13d, %r14d
subl %ebp, %r14d
jle 0xf7ff
xorl %ebp, %ebp
callq 0xf2fe
movq %rax, %rdi
callq 0xf61a
incl %ebp
cmpl %r14d, %ebp
jl 0xf7eb
movq $0x0, 0x18(%rsp)
movq $0x7a120, 0x20(%rsp)    # imm = 0x7A120
movq %r12, %rdi
movq %r12, %rsi
callq 0x40e0
cmpl $-0x1, %eax
jne 0xf82b
callq 0x4050
cmpl $0x4, (%rax)
je 0xf811
cmpb $0x0, 0x48(%rbx)
jne 0xf786
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/bonetblai[P]mdp-engine/race/./race.h
// Function: state_t::operator<(state_t const&) const
bool operator<(const state_t &s) const {
        return (x_ < s.x_) ||
               ((x_ == s.x_) && (y_ < s.y_)) ||
               ((x_ == s.x_) && (y_ == s.y_) && (dx_ < s.dx_)) ||
               ((x_ == s.x_) && (y_ == s.y_) && (dx_ == s.dx_) && (dy_ < s.dy_));
    }

// Assembly:
movzwl (%rdi), %ecx
movzwl (%rsi), %edx
movb $0x1, %al
cmpw %dx, %cx
jl 0x248aa
jne 0x248a8
movzwl 0x2(%rdi), %ecx
movzwl 0x2(%rsi), %edx
cmpw %dx, %cx
jl 0x248aa
jne 0x248a8
movzwl 0x4(%rdi), %ecx
cmpw 0x4(%rsi), %cx
jl 0x248aa
movzwl 0x4(%rdi), %eax
cmpw 0x4(%rsi), %ax
jne 0x248a8
movzwl 0x6(%rdi), %eax
cmpw 0x6(%rsi), %ax
setl %al
retq
xorl %eax, %eax
retq
nop