LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/pstuifzand[P]magento-tools/src/position.cpp
// Function: character_data_handler(void*, char const*, int)
void character_data_handler(void* udata, const XML_Char* s, int len)
{
    user_data* data = (user_data*)udata;
    if (data->state == State::NOT_FOUND) {
        if (XML_GetCurrentLineNumber(data->parser->handle()) >= data->line
         && XML_GetCurrentColumnNumber(data->parser->handle()) >= data->col) {
            data->state = State::FOUND;
            print_stack(data->stack.begin(), data->stack.end());
            std::cout << "\n";
        }
    }
}

// Assembly:
pushq %rbx
cmpl $0x0, 0x30(%rdi)
jne 0x25ab
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movq (%rax), %rdi
callq 0x20e0
movslq 0x28(%rbx), %rcx
cmpq %rcx, %rax
jb 0x25ab
movq 0x20(%rbx), %rax
movq (%rax), %rdi
callq 0x2150
movslq 0x2c(%rbx), %rcx
cmpq %rcx, %rax
jae 0x25ad
popq %rbx
retq
movl $0x1, 0x30(%rbx)
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rsi
callq 0x2a0f
movq 0x2a08(%rip), %rdi      # 0x4fd0
leaq 0xa51(%rip), %rsi       # 0x3020
movl $0x1, %edx
popq %rbx
jmp 0x2190
// File: /workspace/github_cpp_makefile_star2_O1/pstuifzand[P]magento-tools/src/position.cpp
// Function: void print_stack<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>, __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>)
void print_stack(I p, I l)
{
    if (p != l) { std::cout << *p; ++p; }
    while (p != l) {
        std::cout << "/" << *p;
        ++p;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rsi, %rdi
je 0x2a39
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x25a0(%rip), %rdi      # 0x4fd0
callq 0x2190
addq $0x20, %r14
cmpq %rbx, %r14
je 0x2a74
movq 0x258b(%rip), %r15      # 0x4fd0
leaq 0x61f(%rip), %r12       # 0x306b
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2190
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x2190
addq $0x20, %r14
cmpq %rbx, %r14
jne 0x2a4c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/guoxuanhan[P]NetServer/channel.cpp
// Function: Channel::HandleEvent()
void Channel::HandleEvent()
{
    if(events_ & EPOLLRDHUP)
    {
        //对方异常关闭事件
        std::cout<< "Event EPOLLRDHUP!" << std::endl;
        closehandler_();
    } else if(events_ & (EPOLLIN | EPOLLPRI))
    {
        //读事件，对端有数据或者正常关闭
        std::cout<< "Event EPOLLIN!" << std::endl;
        readhandler_();
    } else if(events_ & EPOLLOUT)
    {
        //写事件
        std::cout << "Event EPOLLOUT!" << std::endl;
        writehandler_();
    } else
    {
        //连接错误
        std::cout << "Event EPOLLERR!" << std::endl;
        errorhandler_();
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rcx
movl 0x4(%rdi), %eax
btl $0xd, %eax
jb 0x4c41
testb $0x3, %al
je 0x4cab
movq 0x133cf(%rip), %rbx     # 0x17fb8
leaq 0xb426(%rip), %rsi      # 0x10016
movl $0xe, %edx
movq %rbx, %rdi
movq %rcx, %r14
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
cmpq $0x0, 0x18(%r14)
je 0x4d5e
movq %r14, %rcx
movl $0x20, %eax
movl $0x8, %edi
jmp 0x4c9e
movq 0x13370(%rip), %rbx     # 0x17fb8
leaq 0xb3b5(%rip), %rsi      # 0x10004
movl $0x11, %edx
movq %rbx, %rdi
movq %rcx, %r14
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
cmpq $0x0, 0x78(%r14)
je 0x4d5e
movq %r14, %rcx
movl $0x80, %eax
movl $0x68, %edi
addq %rcx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *(%rcx,%rax)
movq %rcx, %r14
movq 0x13303(%rip), %rbx     # 0x17fb8
testb $0x4, %al
jne 0x4d0a
leaq 0xb375(%rip), %rsi      # 0x10035
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
cmpq $0x0, 0x58(%r14)
je 0x4d5e
movq %r14, %rcx
movl $0x60, %eax
movl $0x48, %edi
jmp 0x4c9e
leaq 0xb314(%rip), %rsi      # 0x10025
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
cmpq $0x0, 0x38(%r14)
je 0x4d5e
movq %r14, %rcx
movl $0x40, %eax
movl $0x28, %edi
jmp 0x4c9e
callq 0x4140
nop
// File: /workspace/github_cpp_makefile_star2_O1/guoxuanhan[P]NetServer/echoserver.cpp
// Function: EchoServer::HandleMessage(std::shared_ptr<TcpConnection> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void EchoServer::HandleMessage(const spTcpConnection& sptcpconn, std::string &s)
{
    //std::string msg("reply msg:");
    //msg += s;
    //s.clear();
    //swap优化
    std::string msg;
    msg.swap(s);
    msg.insert(0, "reply msg:");
    sptcpconn->Send(msg);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movq %rsp, %r14
movq %r14, %rdi
movq %rdx, %rsi
callq 0x4280
leaq 0xaec3(%rip), %rcx      # 0x1007f
movl $0xa, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4390
movq (%rbx), %rdi
movq %rsp, %rsi
callq 0xc866
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x51e7
callq 0x4310
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5202
callq 0x4310
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/guoxuanhan[P]NetServer/eventloop.cpp
// Function: CreateEventFd()
int CreateEventFd()
{
    int evtfd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
    if(evtfd < 0)
    {
        std::cout<< "Failed in eventfd!" << std::endl;
        exit(1);
    }
    return evtfd;
}

// Assembly:
pushq %rax
xorl %edi, %edi
movl $0x80800, %esi          # imm = 0x80800
callq 0x4410
testl %eax, %eax
js 0x558b
popq %rcx
retq
movq 0x12a26(%rip), %rdi     # 0x17fb8
leaq 0xadbb(%rip), %rsi      # 0x10354
callq 0x4330
movq %rax, %rdi
callq 0x41a0
movl $0x1, %edi
callq 0x43f0
// File: /workspace/github_cpp_makefile_star2_O1/guoxuanhan[P]NetServer/eventloop.cpp
// Function: EventLoop::EventLoop()
EventLoop::EventLoop() :
    functorlist_(), channellist_(), activechannellist_(), poller_(),
    quit_(true), tid_(std::this_thread::get_id()), mutex_(),
    wakeupfd_(CreateEventFd()), wakeupchannel_()
{
    wakeupchannel_.SetFd(wakeupfd_);
    wakeupchannel_.SetEvents(EPOLLIN | EPOLLET);
    wakeupchannel_.SetReadHandle(std::bind(&EventLoop::HandleRead, this));
    wakeupchannel_.SetErrorHandle(std::bind(&EventLoop::HandleError, this));
    AddChannelToPoller(&wakeupchannel_);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x48(%rdi), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq $0x0, 0x40(%rdi)
movq %r14, %rdi
callq 0xae6c
movb $0x1, 0xc0(%rbx)
callq 0x42f0
movq %rax, 0xc8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%rbx)
movups %xmm0, 0xe0(%rbx)
movq $0x0, 0xf0(%rbx)
callq 0x5578
movl %eax, 0xf8(%rbx)
leaq 0x100(%rbx), %r15
movq %r15, %rdi
callq 0x4b1c
movl 0xf8(%rbx), %esi
movq %r15, %rdi
callq 0x4bba
movq %r15, %rdi
movl $0x80000001, %esi       # imm = 0x80000001
callq 0x4bc2
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x14f(%rip), %rcx       # 0x57b6
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0x41d(%rip), %r12       # 0x5aa0
movq %r12, 0x18(%rsi)
leaq 0x42e(%rip), %r13       # 0x5abc
movq %r13, 0x10(%rsi)
movq %r15, %rdi
callq 0x4d64
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x56b1
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x18, %edi
callq 0x4350
leaq 0x106(%rip), %rcx       # 0x57d4
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r12, 0x18(%rsi)
movq %r13, 0x10(%rsi)
movq %r15, %rdi
callq 0x4d78
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x570a
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %r14, %rdi
movq %r15, %rsi
callq 0xb1d2
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x5763
jmp 0x5763
movq %rax, %r12
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x577a
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x577a
jmp 0x5763
jmp 0x5777
movq %rax, %r12
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x577a
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x577a
movq %rax, %rdi
callq 0x4df2
jmp 0x5777
movq %rax, %r12
jmp 0x578a
movq %rax, %r12
jmp 0x5782
movq %rax, %r12
movq %r15, %rdi
callq 0x4b46
movq %r14, %rdi
callq 0xaf8e
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x5798
callq 0x4310
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x57a6
callq 0x4310
movq %rbx, %rdi
callq 0x5a0e
movq %r12, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movb $0x0, 0xc0(%rdi)
leaq 0x48(%rdi), %r14
leaq 0x30(%rdi), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xafbc
movq 0x30(%rbx), %r12
movq 0x38(%rbx), %r13
cmpq %r13, %r12
je 0x5874
movq (%r12), %rdi
callq 0x4bca
addq $0x8, %r12
jmp 0x5860
movq 0x30(%rbx), %rax
cmpq %rax, 0x38(%rbx)
je 0x5882
movq %rax, 0x38(%rbx)
movq %rbx, %rdi
callq 0x589e
cmpb $0x0, 0xc0(%rbx)
je 0x584d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0xd0(%rdi), %r14
movq %r14, %rdi
callq 0x4480
testl %eax, %eax
jne 0x5937
movq 0x10(%rsp), %rax
movups (%rbx), %xmm0
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rsp)
movaps (%rsp), %xmm1
movaps %xmm0, (%rsp)
movups %xmm1, (%rbx)
movq %rax, 0x10(%rbx)
movq %r14, %rdi
callq 0x42a0
movq (%rsp), %rbx
movq 0x8(%rsp), %r14
cmpq %r14, %rbx
je 0x5914
cmpq $0x0, 0x10(%rbx)
je 0x5932
movq %rbx, %rdi
callq *0x18(%rbx)
addq $0x20, %rbx
jmp 0x58fc
movq %rsp, %rbx
movq (%rbx), %rsi
movq %rbx, %rdi
callq 0x5d36
movq %rbx, %rdi
callq 0x5a0e
addq $0x18, %rsp
popq %rbx
popq %r14
retq
callq 0x4140
movl %eax, %edi
callq 0x4220
jmp 0x5942
jmp 0x5942
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5a0e
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/guoxuanhan[P]NetServer/eventloop.cpp
// Function: EventLoop::AddTask(std::function<void ()>)
void EventLoop::AddTask(Functor functor)
{
    {
        std::lock_guard<std::mutex> lock(mutex_);
        functorlist_.push_back(functor);
    }
    //跨线程唤醒，worker线程唤醒IO线程
    WakeUp();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xd0(%rdi), %r14
movq %r14, %rdi
callq 0x4480
testl %eax, %eax
jne 0x59f3
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5a36
movq %r14, %rdi
callq 0x42a0
leaq 0x8(%rsp), %rsi
movq $0x1, (%rsi)
movl 0xf8(%rbx), %edi
movl $0x8, %edx
callq 0x4120
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
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_O1/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:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x121f2(%rip), %r14     # 0x17fb8
leaq 0xa637(%rip), %rsi      # 0x10404
movl $0x20, %edx
movq %r14, %rdi
callq 0x43a0
callq 0x42f0
testq %rax, %rax
je 0x5df8
movq 0x121cd(%rip), %rdi     # 0x17fb8
movq %rax, %rsi
callq 0x4230
movq %rax, %r14
jmp 0x5e0c
leaq 0xa697(%rip), %rsi      # 0x10496
movl $0x24, %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
movq 0x30(%rbx), %rdi
callq 0x596a
movq %rbx, %rdi
callq 0x4560
movq 0x10(%rbx), %rdi
leaq 0x20(%rbx), %rax
cmpq %rax, %rdi
je 0x5e56
callq 0x4310
cmpq $0x0, (%rbx)
jne 0x5e64
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x40b0
movq %rax, %rdi
callq 0x4df2
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r14
pushq %rbx
subq $0x338, %rsp            # imm = 0x338
movq %rdi, %rbx
leaq 0x1b0(%rsp), %r14
movq %r14, %rdi
callq 0x55b0
movq %r14, 0x30(%rbx)
callq 0x42f0
movq %rax, 0x8(%rbx)
leaq 0x28(%rsp), %rdi
callq 0x4260
leaq 0x38(%rsp), %rdi
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x5f09
callq 0x4230
jmp 0x5f1a
leaq 0xa586(%rip), %rsi      # 0x10496
movl $0x24, %edx
callq 0x43a0
leaq 0x40(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x44f0
leaq 0x10(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x40f0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5f4f
callq 0x4310
movq 0x12062(%rip), %rdi     # 0x17fb8
leaq 0xa4c8(%rip), %rsi      # 0x10425
movl $0xf, %edx
callq 0x43a0
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
movq 0x12042(%rip), %rdi     # 0x17fb8
callq 0x43a0
movq %rax, %r14
movq (%rax), %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
movq 0x30(%rbx), %rdi
callq 0x5832
movq 0x11fe3(%rip), %rsi     # 0x17f98
leaq 0x28(%rsp), %rdi
callq 0x4290
leaq 0xa8(%rsp), %rdi
callq 0x4110
leaq 0x1b0(%rsp), %rdi
callq 0x57e0
addq $0x338, %rsp            # imm = 0x338
popq %rbx
popq %r14
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x6073
movq %rbx, %rdi
callq 0x4150
movq %rax, %rbx
movq 0x11fe6(%rip), %rdi     # 0x17fe8
leaq 0xa42c(%rip), %rsi      # 0x10435
movl $0x36, %edx
callq 0x43a0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x11fc5(%rip), %rdi     # 0x17fe8
movq %rax, %rsi
callq 0x4330
movq %rax, %rdi
callq 0x41a0
callq 0x4530
jmp 0x5fae
jmp 0x6070
movq %rax, %rbx
callq 0x4530
jmp 0x6073
movq %rax, %rdi
callq 0x4df2
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6073
callq 0x4310
jmp 0x6073
jmp 0x6070
movq %rax, %rbx
jmp 0x6091
movq %rax, %rbx
movq 0x11f1e(%rip), %rsi     # 0x17f98
leaq 0x28(%rsp), %rdi
callq 0x4290
leaq 0xa8(%rsp), %rdi
callq 0x4110
leaq 0x1b0(%rsp), %rdi
callq 0x57e0
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x11d0b(%rip), %r14     # 0x17fb8
leaq 0xa257(%rip), %rsi      # 0x1050b
movl $0x20, %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 0x11cd9(%rip), %rdi     # 0x17fb8
callq 0x4030
movq %rax, %rdi
callq 0x4240
cmpl $0x0, 0x8(%rbx)
jle 0x631e
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x6312
movq %r14, %rdi
callq 0x5db8
movq %r14, %rdi
callq 0x4310
incq %r15
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jl 0x62f5
movq 0x10(%rbx), %rdi
cmpq %rdi, 0x18(%rbx)
je 0x632c
movq %rdi, 0x18(%rbx)
testq %rdi, %rdi
je 0x633b
popq %rbx
popq %r14
popq %r15
jmp 0x4310
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x4df2
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x8(%rdi)
jle 0x63ab
movslq 0x28(%rbx), %rax
movq 0x10(%rbx), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x5e72
movq %rax, %rcx
movl 0x28(%rbx), %eax
incl %eax
cltd
idivl 0x8(%rbx)
movl %edx, 0x28(%rbx)
movq %rcx, %rax
popq %rbx
retq
movq (%rbx), %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %r13d, %r13d
leaq 0x28(%rsp), %r15
movq %r13, -0x8(%r15)
leaq 0x20(%rsp), %rsi
leaq 0x30(%rsp), %r12
movq %r15, %rdi
movq %r12, %rdx
callq 0x7f70
movl $0x1388, 0xc(%rsp)      # imm = 0x1388
movl $0x0, 0x8(%rsp)
leaq 0x62ff(%rip), %rax      # 0xcbb8
movq %rax, (%r12)
movq %r13, 0x8(%r12)
movq (%rbx), %rax
movq %rax, 0x10(%r12)
movq 0x8(%rbx), %rax
movq %rax, 0x18(%r12)
testq %rax, %rax
je 0x68ed
movq 0x116d1(%rip), %rcx     # 0x17fb0
cmpb $0x0, (%rcx)
je 0x68e9
incl 0x8(%rax)
jmp 0x68ed
lock
incl 0x8(%rax)
leaq 0x18(%rsp), %r12
movq $0x0, -0x8(%r12)
leaq 0x10(%rsp), %rsi
leaq 0x7(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0x8(%rsp), %r8
leaq 0x30(%rsp), %r9
movq %r12, %rdi
callq 0x803e
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x692b
callq 0x7984
movq 0x10(%rsp), %rdi
callq 0xf27a
leaq 0x60(%r14), %r13
movq %r13, %rdi
callq 0x4480
testl %eax, %eax
jne 0x69c1
movq %r14, %rdi
movq %rbx, %rsi
callq 0x76d6
movq 0x20(%rsp), %rcx
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, %rdi
movq %r15, %rsi
callq 0x7a6e
addq $0x30, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x773c
movq 0x10(%rsp), %rcx
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, %rdi
movq %r12, %rsi
callq 0x7a6e
movq %r13, %rdi
callq 0x42a0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x69a4
callq 0x7984
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x69b3
callq 0x7984
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x4220
jmp 0x69ca
movq %rax, %rbx
jmp 0x69e4
movq %rax, %rbx
movq 0x48(%rsp), %rdi
jmp 0x69e9
movq %rax, %rbx
movq %r13, %rdi
callq 0x42a0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x69f3
callq 0x7984
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x6a02
callq 0x7984
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/guoxuanhan[P]NetServer/main.cpp
// Function: main
int main(int argc, char *argv[])
{
    signal(SIGUSR1, sighandler1);
    signal(SIGUSR2, sighandler2);
    signal(SIGINT, sighandler2);
    signal(SIGPIPE, SIG_IGN);  //SIG_IGN,系统函数，忽略信号的处理程序,客户端发送RST包后，服务器还调用write会触发

    int port = 80;
    int iothreadnum = 4;
    int workerthreadnum = 4;
    if(argc == 4)
    {
        port = atoi(argv[1]);
        iothreadnum = atoi(argv[2]);
        workerthreadnum = atoi(argv[3]);
    }

    EventLoop loop;
    lp = &loop;
    HttpServer httpserver(&loop, port, iothreadnum, workerthreadnum);
    httpserver.Start();

    try
    {
        loop.loop();
    }
    catch (std::bad_alloc& ba)
    {
        std::cerr << "bad_alloc caught in ThreadPool::ThreadFunc task: " << ba.what() << '\n';
    }
    //loop.loop();

    // EventLoop loop;
    // lp = &loop;
    // EchoServer echoserver(&loop, port, iothreadnum);
    // echoserver.Start();
    // loop.loop();
    // return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x4a8, %rsp            # imm = 0x4A8
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x17a(%rip), %rsi       # 0xae57
movl $0xa, %edi
callq 0x43e0
leaq 0x171(%rip), %r14       # 0xae5f
movl $0xc, %edi
movq %r14, %rsi
callq 0x43e0
movl $0x2, %edi
movq %r14, %rsi
callq 0x43e0
movl $0x1, %esi
movl $0xd, %edi
callq 0x43e0
cmpl $0x4, %ebp
jne 0xad40
movq 0x8(%rbx), %rdi
callq 0x44d0
movl %eax, %ebp
movq 0x10(%rbx), %rdi
callq 0x44d0
movl %eax, %r14d
movq 0x18(%rbx), %rdi
callq 0x44d0
movl %eax, %ebx
jmp 0xad50
movl $0x50, %ebp
movl $0x4, %r14d
movl $0x4, %ebx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x55b0
movq %r15, 0xd5e4(%rip)      # 0x18348
leaq 0x190(%rsp), %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0x64e8
leaq 0x190(%rsp), %rdi
callq 0x74e0
leaq 0x8(%rsp), %rdi
callq 0x5832
leaq 0x190(%rsp), %rdi
callq 0x7434
leaq 0x8(%rsp), %rdi
callq 0x57e0
xorl %eax, %eax
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0xae33
movq %rbx, %rdi
callq 0x4150
movq %rax, %rbx
movq 0xd214(%rip), %rdi      # 0x17fe8
leaq 0x611e(%rip), %rsi      # 0x10ef9
movl $0x31, %edx
callq 0x43a0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0xd1f3(%rip), %rdi      # 0x17fe8
movq %rax, %rsi
callq 0x4330
leaq 0x7(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x43a0
callq 0x4530
jmp 0xad93
jmp 0xae30
movq %rax, %rbx
callq 0x4530
jmp 0xae33
movq %rax, %rdi
callq 0x4df2
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x7434
jmp 0xae45
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x57e0
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/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 0xaeb8
movq %rcx, 0x10(%rbx)
leaq 0x28(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x20(%rbx)
movq %rax, 0x38(%rbx)
movq %rax, 0x40(%rbx)
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x68(%rbx)
movups %xmm0, 0x48(%rbx)
movl $0x100, %edi            # imm = 0x100
callq 0x45e0
movl %eax, (%rbx)
cmpl $-0x1, %eax
je 0xaf69
leaq 0x20(%rbx), %r14
movq 0xd09e(%rip), %rdi      # 0x17fb8
leaq 0x601e(%rip), %rsi      # 0x10f3f
movl $0xe, %edx
callq 0x43a0
movl (%rbx), %esi
movq 0xd084(%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 0x4644
movq %rax, %rbx
movq %r14, %rdi
callq 0xb4c6
movq (%r15), %rdi
testq %rdi, %rdi
je 0xaf86
callq 0x4310
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/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 0xb289
leaq 0x20(%rbx), %rdi
movq %rsp, %rsi
callq 0xb462
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 0xb290
movq 0xcd74(%rip), %rbx      # 0x17fb8
leaq 0x5d40(%rip), %rsi      # 0x10f8b
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 0x4659
movq %rax, %rbx
movq %r15, %rdi
callq 0x42a0
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/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 0xb36e
leaq 0x20(%rbx), %r15
movq %rsp, %rsi
movq %r15, %rdi
callq 0xba24
movq %r15, %rdi
movq %rax, %rsi
callq 0xba9c
movq %r14, %rdi
callq 0x42a0
movl (%rbx), %edi
movl (%rsp), %edx
leaq 0x4(%rsp), %rcx
movl $0x2, %esi
callq 0x4430
cmpl $-0x1, %eax
je 0xb375
movq 0xcc8f(%rip), %rbx      # 0x17fb8
leaq 0x5c79(%rip), %rsi      # 0x10fa9
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 0x466e
movq %rax, %rbx
movq %r14, %rdi
callq 0x42a0
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xb418
movq 0xcbe4(%rip), %rbx      # 0x17fb8
leaq 0x5bf2(%rip), %rsi      # 0x10fcd
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 0x4683
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xbbb1
movq 0xc456(%rip), %r14      # 0x17fb8
leaq 0x54a3(%rip), %rsi      # 0x1100c
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 0x46c3
// File: /workspace/github_cpp_makefile_star2_O1/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 0xbca8
movl (%rbx), %edi
orl $0x800, %eax            # imm = 0x800
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x4200
testl %eax, %eax
js 0xbcad
movq 0xc34c(%rip), %rbx      # 0x17fb8
leaq 0x53f1(%rip), %rsi      # 0x11064
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 0x46ed
callq 0x46d8
// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
movq %rsp, %rax
movaps %xmm0, (%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 0xbd35
movq 0xc2c6(%rip), %rbx      # 0x17fb8
leaq 0x538f(%rip), %rsi      # 0x11088
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 0x4702
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xbd98
movq 0xc25f(%rip), %rbx      # 0x17fb8
leaq 0x534b(%rip), %rsi      # 0x110ab
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 0x471e
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rdx
movl $0x10, (%rdx)
movl (%rdi), %edi
callq 0x4100
movl %eax, %ebx
testl %eax, %eax
jns 0xbdca
callq 0x4050
xorl %ecx, %ecx
cmpl $0xb, (%rax)
cmovel %ecx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xce86
testl %eax, %eax
jle 0xc249
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xd1ba
cmpq $0x0, 0x88(%rbx)
je 0xc266
leaq 0x78(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movq %r14, %rdx
callq *0x90(%rbx)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc241
callq 0x7984
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
je 0xc25a
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0xc520
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0xc358
callq 0x4140
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc27d
callq 0x7984
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xca8b
testl %eax, %eax
jle 0xc2ce
movq 0x18(%rbx), %rdi
callq 0x4bc6
cmpq $0x0, 0x60(%rbx)
movq 0x18(%rbx), %rdi
je 0xc2dd
orl $0x4, %eax
movl %eax, %esi
callq 0x4bc2
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
addq $0x10, %rsp
popq %rbx
jmp 0x5960
movq %rbx, %rdi
js 0xc32f
addq $0x10, %rsp
popq %rbx
jmp 0xc358
andl $-0x5, %eax
movl %eax, %esi
callq 0x4bc2
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xd1ba
cmpq $0x0, 0xa8(%rbx)
je 0xc339
leaq 0x98(%rbx), %rdi
movq %rsp, %rsi
callq *0xb0(%rbx)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc31b
callq 0x7984
cmpb $0x1, 0x34(%rbx)
jne 0xc329
movq %rbx, %rdi
callq 0xc358
addq $0x10, %rsp
popq %rbx
retq
addq $0x10, %rsp
popq %rbx
jmp 0xc520
callq 0x4140
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc350
callq 0x7984
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/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)
jne 0xc4ad
movq %rdi, %rbx
movq 0x40(%rdi), %rax
orq 0x60(%rdi), %rax
jne 0xc37e
cmpb $0x1, 0x36(%rbx)
jne 0xc3d3
movb $0x1, 0x34(%rbx)
cmpq $0x0, 0x40(%rbx)
je 0xc4ad
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0xd1ba
cmpq $0x0, 0x88(%rbx)
je 0xc4b7
leaq 0x38(%rbx), %rdx
leaq 0x78(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq *0x90(%rbx)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc4ad
callq 0x7984
jmp 0xc4ad
movq 0x10(%rbx), %r14
leaq 0xf8(%rbx), %r15
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xd1ba
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5306
movaps (%rsp), %xmm0
leaq 0x10(%rsp), %rsi
movups %xmm0, 0x20(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x40(%rsp), %rdi
callq 0xcfd4
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x5998
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xc43a
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xc449
callq 0x7984
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0xc462
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc471
callq 0x7984
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0xd1ba
cmpq $0x0, 0xc8(%rbx)
je 0xc4bc
leaq 0xb8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq *0xd0(%rbx)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc4a9
callq 0x7984
movb $0x1, 0x35(%rbx)
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x4140
callq 0x4140
jmp 0xc4e3
jmp 0xc4e3
movq %rax, %rbx
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xc4ee
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc4ee
movq %rax, %rdi
callq 0x4df2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xd032
jmp 0xc4fd
movq %rax, %rbx
movq 0x8(%rsp), %rdi
jmp 0xc50e
jmp 0xc506
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc518
callq 0x7984
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/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 0xc614
movq %rdi, %rbx
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0xd1ba
cmpq $0x0, 0xe8(%rbx)
je 0xc61e
leaq 0xd8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq *0xf0(%rbx)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc572
callq 0x7984
movq 0x10(%rbx), %r14
leaq 0xf8(%rbx), %r15
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xd1ba
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5306
movaps (%rsp), %xmm0
leaq 0x10(%rsp), %rsi
movups %xmm0, 0x20(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x40(%rsp), %rdi
callq 0xcfd4
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x5998
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xc5d9
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xc5e8
callq 0x7984
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0xc601
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc610
callq 0x7984
movb $0x1, 0x35(%rbx)
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x4140
jmp 0xc645
jmp 0xc645
movq %rax, %rbx
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xc650
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xc650
movq %rax, %rdi
callq 0x4df2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xd032
jmp 0xc65f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
jmp 0xc66e
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xc678
callq 0x7984
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5956
movl 0x20(%rbx), %edi
callq 0x4600
movq 0x108(%rbx), %rax
testq %rax, %rax
je 0xc6b9
leaq 0xf8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xe8(%rbx), %rax
testq %rax, %rax
je 0xc6d6
leaq 0xd8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xc8(%rbx), %rax
testq %rax, %rax
je 0xc6f3
leaq 0xb8(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xa8(%rbx), %rax
testq %rax, %rax
je 0xc710
leaq 0x98(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x88(%rbx), %rax
testq %rax, %rax
je 0xc72a
leaq 0x78(%rbx), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x58(%rbx), %rdi
leaq 0x68(%rbx), %rax
cmpq %rax, %rdi
je 0xc73c
callq 0x4310
leaq 0x18(%rbx), %r14
movq 0x38(%rbx), %rdi
leaq 0x48(%rbx), %rax
cmpq %rax, %rdi
je 0xc752
callq 0x4310
movq %r14, %rdi
callq 0xcf70
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0xc796
movq 0xb846(%rip), %rax      # 0x17fb0
cmpb $0x0, (%rax)
je 0xc77a
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0xc784
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0xc796
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0xc7a8
jmp 0xc7a8
jmp 0xc7a8
jmp 0xc7a8
jmp 0xc7a8
movq %rax, %rdi
callq 0x4df2
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
subq $0x20, %rsp
movq 0x10(%rdi), %rbx
movq 0x18(%rdi), %r15
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movl $0x20, %edi
callq 0x4350
leaq -0x700b(%rip), %rcx     # 0x57d6
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %r15, 0x10(%rax)
movq %rbx, 0x18(%rax)
movq %rax, (%r14)
leaq 0x90e(%rip), %rax       # 0xd10c
movq %rax, 0x18(%r14)
leaq 0x923(%rip), %rax       # 0xd12c
movq %rax, 0x10(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5998
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xc82f
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0xc85d
movq %rax, %rbx
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xc855
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %rbx, %rdi
callq 0x45a0
movq %rax, %rdi
callq 0x4df2
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5972
movq %rax, %rbx
callq 0x42f0
cmpq %rax, %rbx
jne 0xc8b0
movq %r14, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc9aa
movb $0x0, 0x36(%r14)
movq 0x10(%r14), %rbx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xd1ba
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 0xb9(%rip), %rcx        # 0xc9aa
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %r14, 0x18(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
leaq -0x4269(%rip), %rax     # 0x86a8
movq %rax, 0x18(%rsi)
leaq -0x4258(%rip), %rax     # 0x86c4
movq %rax, 0x10(%rsi)
movq %rbx, %rdi
callq 0x5998
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xc93f
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xc94e
callq 0x7984
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xc97b
movq %rax, %rbx
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xc976
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
xorl %r14d, %r14d
jmp 0xc986
movq %rax, %rdi
callq 0x4df2
movq %rax, %rbx
testq %r14, %r14
je 0xc993
movq %r14, %rdi
callq 0x7984
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xc9a2
callq 0x7984
movq %rbx, %rdi
callq 0x45a0