LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0xc9bb
addq $0x10, %rsp
popq %rbx
retq
movq %rdi, %rbx
movl 0x20(%rdi), %edi
leaq 0x58(%rbx), %rsi
callq 0xca8b
testl %eax, %eax
jle 0xc9fe
movq 0x18(%rbx), %rdi
callq 0x4bc6
cmpq $0x0, 0x60(%rbx)
movq 0x18(%rbx), %rdi
je 0xca0d
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 0xca62
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 0xca6c
leaq 0x98(%rbx), %rdi
movq %rsp, %rsi
callq *0xb0(%rbx)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xca4b
callq 0x7984
cmpb $0x1, 0x34(%rbx)
jne 0xc9b5
movq %rbx, %rdi
callq 0xc358
jmp 0xc9b5
addq $0x10, %rsp
popq %rbx
jmp 0xc520
callq 0x4140
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xca83
callq 0x7984
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5972
movq %rax, %rbx
callq 0x42f0
cmpq %rax, %rbx
jne 0xcbef
movq %r14, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xcce4
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        # 0xcce4
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %r14, 0x18(%rax)
movq %rsp, %rsi
movq %rax, (%rsi)
leaq -0x45a3(%rip), %rax     # 0x86a8
movq %rax, 0x18(%rsi)
leaq -0x4592(%rip), %rax     # 0x86c4
movq %rax, 0x10(%rsi)
movq %rbx, %rdi
callq 0x5998
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xcc79
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xcc88
callq 0x7984
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xccb5
movq %rax, %rbx
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xccb0
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
xorl %r14d, %r14d
jmp 0xccc0
movq %rax, %rdi
callq 0x4df2
movq %rax, %rbx
testq %r14, %r14
je 0xcccd
movq %r14, %rdi
callq 0x7984
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xccdc
callq 0x7984
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/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 0xce1a
movq %rdi, %rbx
movq 0xb2b7(%rip), %r14      # 0x17fb8
leaq 0x43e8(%rip), %rsi      # 0x110f0
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 0xd1ba
cmpq $0x0, 0xc8(%rbx)
je 0xce24
leaq 0xb8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq *0xd0(%rbx)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xcd78
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 0xcddf
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xcdee
callq 0x7984
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0xce07
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xce16
callq 0x7984
movb $0x1, 0x35(%rbx)
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x4140
jmp 0xce4b
jmp 0xce4b
movq %rax, %rbx
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xce56
leaq 0x40(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0xce56
movq %rax, %rdi
callq 0x4df2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xd032
jmp 0xce65
movq %rax, %rbx
movq 0x8(%rsp), %rdi
jmp 0xce74
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xce7e
callq 0x7984
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/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 0xb10c(%rip), %r12      # 0x17fb8
leaq 0x4279(%rip), %r13      # 0x1112c
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r15, %rsi
callq 0x4460
movq %rax, %r14
testl %r14d, %r14d
jg 0xcf19
testl %r14d, %r14d
jns 0xcf59
callq 0x4050
movl (%rax), %eax
cmpl $0x4, %eax
jne 0xcf41
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 0xceb3
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 0xceb3
jmp 0xcf5b
cmpl $0xb, %eax
je 0xcf5b
leaq 0x41ac(%rip), %rdi      # 0x110f9
callq 0x42d0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0xcf5b
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_O1/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 0xdb79
orl $0x800, %eax            # imm = 0x800
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x4200
testl %eax, %eax
js 0xdb7e
popq %rbx
retq
callq 0x47b0
callq 0x479b
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xdbe6
decl 0x98(%r14)
addq $0xa0, %r14
movq (%r15), %rax
movl 0x20(%rax), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movq %r14, %rdi
callq 0xe24e
movq %r14, %rdi
movq %rax, %rsi
callq 0xe2c6
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_O1/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 0x9b8d(%rip), %r14      # 0x17fb8
leaq 0x319d(%rip), %rsi      # 0x115cf
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 0x9b5b(%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 0xe49e
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x4560
incq %r15
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jl 0xe485
cmpl $0x0, 0x4(%rbx)
jle 0xe4cb
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0xe4bf
cmpq $0x0, (%rdi)
jne 0xe503
callq 0x4310
incq %r15
movslq 0x4(%rbx), %rax
cmpq %rax, %r15
jl 0xe4a7
movq 0x8(%rbx), %rax
cmpq %rax, 0x10(%rbx)
je 0xe4d9
movq %rax, 0x10(%rbx)
movq %r14, %rdi
callq 0x45d0
leaq 0x20(%rbx), %rdi
callq 0xead4
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0xe4fd
popq %rbx
popq %r14
popq %r15
jmp 0x4310
popq %rbx
popq %r14
popq %r15
retq
callq 0x40b0
jmp 0xe50a
movq %rax, %rdi
callq 0x4df2
// File: /workspace/github_cpp_makefile_star2_O1/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 0xe5cf
movq %rdi, %rbx
movb $0x1, (%rdi)
cmpl $0x0, 0x4(%rdi)
jle 0xe5c0
leaq 0x8(%rbx), %rax
movq %rax, (%rsp)
xorl %r13d, %r13d
leaq 0xda(%rip), %r14        # 0xe632
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 0xea28
movq %rbp, 0x10(%rsp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0xe5a9
movq %rbp, (%rsi)
addq $0x8, 0x10(%rbx)
jmp 0xe5b7
movq (%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0xed80
incl %r13d
cmpl 0x4(%rbx), %r13d
jl 0xe562
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x99e2(%rip), %rbx      # 0x17fb8
leaq 0x300b(%rip), %rsi      # 0x115e8
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_O1/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 0xea09
leaq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0xeeb6
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_O1/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 0xf37e
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
jmp 0xf5f4
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
cmpq $0x0, 0x8fd6(%rip)      # 0x18360
jne 0xf42d
leaq 0x8fd1(%rip), %rdi      # 0x18368
callq 0x4480
testl %eax, %eax
jne 0xf43c
cmpq $0x0, 0x8fb4(%rip)      # 0x18360
jne 0xf421
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, 0x10(%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, 0x8f3f(%rip)      # 0x18360
leaq 0x8f40(%rip), %rdi      # 0x18368
callq 0x42a0
movq 0x8f2c(%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 0xf453
movq %rax, %r14
leaq 0x8f0e(%rip), %rdi      # 0x18368
callq 0x42a0
movq %r14, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/guoxuanhan[P]NetServer/timermanager.cpp
// Function: TimerManager::AddTimer(Timer*)
void TimerManager::AddTimer(Timer* ptimer)
{
    if(ptimer == nullptr)
        return;
    std::lock_guard<std::mutex> lock(timewheelmutex_);
    CalculateTimer(ptimer);
    AddTimerToTimeWheel(ptimer);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0xf4e5
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0x4480
testl %eax, %eax
jne 0xf4eb
movl (%rbx), %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movl %ecx, %eax
shrl $0xa, %eax
movl %eax, 0x28(%rbx)
movl (%r15), %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(%r15), %rcx
movq (%rcx,%rax,8), %rdx
testq %rdx, %rdx
je 0xf4d4
movq %rdx, 0x38(%rbx)
movq (%rcx,%rax,8), %rdx
movq %rbx, 0x30(%rdx)
movq %rbx, (%rcx,%rax,8)
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x42a0
popq %rbx
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x4220
// File: /workspace/github_cpp_makefile_star2_O1/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 0xf588
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rdi), %r15
movq %r15, %rdi
callq 0x4480
testl %eax, %eax
jne 0xf58e
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf596
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_O1/guoxuanhan[P]NetServer/timermanager.cpp
// Function: TimerManager::RemoveTimerFromTimeWheel(Timer*)
void TimerManager::RemoveTimerFromTimeWheel(Timer* ptimer)
{
    if(ptimer == nullptr)
        return;

    int timeslot = ptimer->timeslot;

    if(ptimer == timewheel[timeslot])
    {
        //头结点
        timewheel[timeslot] = ptimer->next;
        if(ptimer->next != nullptr)
        {
            ptimer->next->prev = nullptr;
        }
        ptimer->prev = ptimer->next = nullptr;
    }
    else
    {
        if(ptimer->prev == nullptr) //不在时间轮的链表中，即已经被删除了
            return;
        ptimer->prev->next = ptimer->next;
        if(ptimer->next != nullptr)
            ptimer->next->prev = ptimer->prev;

        ptimer->prev = ptimer->next = nullptr;
    }
}

// Assembly:
testq %rsi, %rsi
je 0xf5f3
movslq 0x2c(%rsi), %rax
movq 0x8(%rdi), %rcx
cmpq %rsi, (%rcx,%rax,8)
je 0xf5cd
movq 0x30(%rsi), %rcx
testq %rcx, %rcx
je 0xf5f3
leaq 0x30(%rsi), %rax
movq 0x38(%rsi), %rdx
movq %rdx, 0x38(%rcx)
movq 0x38(%rsi), %rdx
testq %rdx, %rdx
je 0xf5ed
movq %rcx, 0x30(%rdx)
jmp 0xf5ed
movq 0x38(%rsi), %rdx
movq %rdx, (%rcx,%rax,8)
movq 0x38(%rsi), %rax
testq %rax, %rax
je 0xf5e6
movq $0x0, 0x30(%rax)
addq $0x30, %rsi
movq %rsi, %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xf62c
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rdi), %r15
movq %r15, %rdi
callq 0x4480
testl %eax, %eax
jne 0xf632
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf63a
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_O1/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 0xf6a5
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0xf596
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 0xf69a
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_O1/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 0xf771
movslq (%r14), %rax
movq 0x8(%r14), %rcx
movq (%rcx,%rax,8), %r15
testq %r15, %r15
je 0xf739
movl 0x28(%r15), %eax
testl %eax, %eax
jle 0xf6f1
decl %eax
movl %eax, 0x28(%r15)
movq 0x38(%r15), %r12
movq %r12, %r15
testq %r12, %r12
jne 0xf6d5
jmp 0xf739
cmpq $0x0, 0x18(%r15)
je 0xf76c
leaq 0x8(%r15), %rdi
callq *0x20(%r15)
cmpl $0x0, 0x4(%r15)
movq 0x38(%r15), %r12
movq %r14, %rdi
je 0xf72f
movq %r15, %rsi
callq 0xf63a
movl (%r14), %eax
cmpl 0x2c(%r15), %eax
jne 0xf6e7
movl 0x28(%r15), %eax
testl %eax, %eax
jle 0xf6e7
decl %eax
movl %eax, 0x28(%r15)
jmp 0xf6e7
movq %r15, %rsi
callq 0xf596
jmp 0xf6e7
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 0xf77a
movq %rax, %r14
movq %rbx, %rdi
callq 0x42a0
movq %r14, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xf8c1
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 0xf88b
xorl %ebp, %ebp
callq 0xf37e
movq %rax, %rdi
callq 0xf6a6
incl %ebp
cmpl %r14d, %ebp
jl 0xf877
movq $0x0, 0x18(%rsp)
movq $0x7a120, 0x20(%rsp)    # imm = 0x7A120
movq %r12, %rdi
movq %r12, %rsi
callq 0x40e0
cmpl $-0x1, %eax
jne 0xf8b7
callq 0x4050
cmpl $0x4, (%rax)
je 0xf89d
cmpb $0x0, 0x48(%rbx)
jne 0xf812
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x26543
je 0x26544
xorl %eax, %eax
retq
setne %r8b
movzwl 0x2(%rdi), %eax
cmpw 0x2(%rsi), %ax
setl %al
orb %al, %r8b
jne 0x26543
movzwl 0x2(%rdi), %eax
cmpw 0x2(%rsi), %ax
jne 0x26579
cmpw %dx, %cx
setne %cl
movzwl 0x4(%rdi), %eax
cmpw 0x4(%rsi), %ax
setl %al
orb %al, %cl
je 0x2657e
jmp 0x26543
cmpw %dx, %cx
jne 0x26541
movzwl 0x2(%rdi), %eax
cmpw 0x2(%rsi), %ax
jne 0x26541
movzwl 0x4(%rdi), %eax
cmpw 0x4(%rsi), %ax
jne 0x26541
movzwl 0x6(%rdi), %eax
cmpw 0x6(%rsi), %ax
setl %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/bonetblai[P]mdp-engine/race/parsing.cc
// Function: ps::draw_text(std::ostream&, float, float, float, int, char*)
void draw_text(ostream &os, float x, float y, float angle, int ptsz, char *text) {
    os << "0 0 0 setrgbcolor" << endl
       << "/Helvetica " << ptsz << " selectfont" << endl
       << x << " " << y << " moveto " << angle << " rotate" << endl
       << "(" << text << ") show" << endl;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movss %xmm2, 0xc(%rsp)
movss %xmm1, 0x8(%rsp)
movss %xmm0, 0x4(%rsp)
movq %rdi, %r14
leaq 0x4853(%rip), %rsi      # 0x2bd7e
movl $0x11, %edx
callq 0x62d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6250
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x61b0
movq %rax, %r14
leaq 0x4890(%rip), %rsi      # 0x2bdf6
movl $0xb, %edx
movq %rax, %rdi
callq 0x62d0
movq %r14, %rdi
movl %ebp, %esi
callq 0x6430
movq %rax, %r14
leaq 0x487b(%rip), %rsi      # 0x2be02
movl $0xb, %edx
movq %rax, %rdi
callq 0x62d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6250
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x61b0
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movq %rax, %rdi
callq 0x63b0
movq %rax, %r14
leaq 0x4908(%rip), %rsi      # 0x2bede
movl $0x1, %edx
movq %rax, %rdi
callq 0x62d0
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
movq %r14, %rdi
callq 0x63b0
movq %rax, %r14
leaq 0x4745(%rip), %rsi      # 0x2bd43
movl $0x8, %edx
movq %rax, %rdi
callq 0x62d0
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movq %r14, %rdi
callq 0x63b0
movq %rax, %r14
leaq 0x47e8(%rip), %rsi      # 0x2be0e
movl $0x7, %edx
movq %rax, %rdi
callq 0x62d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6250
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x61b0
movq %rax, %r14
leaq 0x1831(%rip), %rsi      # 0x28e95
movl $0x1, %edx
movq %rax, %rdi
callq 0x62d0
testq %rbx, %rbx
je 0x2768e
movq %rbx, %rdi
callq 0x6110
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x62d0
jmp 0x276a8
movq (%r14), %rax
movq -0x18(%rax), %rax
movq %r14, %rdi
addq %rax, %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x6410
leaq 0x4767(%rip), %rsi      # 0x2be16
movl $0x6, %edx
movq %r14, %rdi
callq 0x62d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6250
movsbl %al, %esi
movq %r14, %rdi
callq 0x6040
movq %rax, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x61b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/multi-shell-extrude.cc
// Function: CalcPolygonLen(std::vector<Vector2D, std::allocator<Vector2D>> const&)
double CalcPolygonLen(const Polygon &polygon) {
  double len = 0;
  const int size = polygon.size();
  for (int i = 1; i < size; ++i) {
    len += distance(polygon[i].x - polygon[i-1].x,
                    polygon[i].y - polygon[i-1].y, 0);
  }
  // Back to the beginning.
  len += distance(polygon[size-1].x - polygon[0].x,
                  polygon[size-1].y - polygon[0].y, 0);
  return len;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %r14
subq (%rdi), %r14
movq %r14, %r15
shrq $0x4, %r15
xorpd %xmm2, %xmm2
cmpl $0x2, %r15d
jl 0x3949
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
decq %r15
xorpd %xmm3, %xmm3
movl $0x18, %r12d
movq (%rbx), %rax
movsd -0x8(%rax,%r12), %xmm0
subsd -0x18(%rax,%r12), %xmm0
movsd (%rax,%r12), %xmm1
subsd -0x10(%rax,%r12), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm3, %xmm0
jb 0x3929
sqrtsd %xmm0, %xmm0
jmp 0x393c
movsd %xmm2, (%rsp)
callq 0x31a0
xorpd %xmm3, %xmm3
movsd (%rsp), %xmm2
addsd %xmm0, %xmm2
addq $0x10, %r12
decq %r15
jne 0x38f3
shlq $0x1c, %r14
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %r14, %rax
movq (%rbx), %rcx
sarq $0x1c, %rax
movsd (%rcx,%rax), %xmm0
subsd (%rcx), %xmm0
movsd 0x8(%rcx,%rax), %xmm1
subsd 0x8(%rcx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x1067f(%rip), %xmm0    # 0x14008
jb 0x3991
sqrtsd %xmm0, %xmm0
jmp 0x39a0
movsd %xmm2, (%rsp)
callq 0x31a0
movsd (%rsp), %xmm2
addsd %xmm0, %xmm2
movapd %xmm2, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/multi-shell-extrude.cc
// Function: OffsetCenter(std::vector<Vector2D, std::allocator<Vector2D>> const&, double, double)
Polygon OffsetCenter(const Polygon& polygon, double x_offset, double y_offset) {
  Polygon result;
  for (const Vector2D &p : polygon) {
    result.push_back(Vector2D(p.x + x_offset, p.y + y_offset));
  }
  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq (%rsi), %r15
movq 0x8(%rsi), %r12
cmpq %r12, %r15
je 0x3a41
leaq 0x18(%rsp), %r14
movsd (%r15), %xmm0
addsd 0x8(%rsp), %xmm0
movsd 0x8(%r15), %xmm1
addsd 0x10(%rsp), %xmm1
movsd %xmm0, 0x18(%rsp)
movsd %xmm1, 0x20(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x3a2d
movupd 0x18(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x3a38
movq %rbx, %rdi
movq %r14, %rdx
callq 0x6796
addq $0x10, %r15
cmpq %r12, %r15
jne 0x39ef
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3a67
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x3220
movq %r14, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/multi-shell-extrude.cc
// Function: RadialPumpPolygon(std::vector<Vector2D, std::allocator<Vector2D>> const&, double)
Polygon RadialPumpPolygon(const Polygon& polygon, double pump_r) {
  if (pump_r <= 0)
    return polygon;
  Polygon result;
  for (const Vector2D &p : polygon) {
    double from_center = distance(p.x, p.y, 0);
    double stretch = (from_center + pump_r) / from_center;
    result.push_back(Vector2D(p.x * stretch, p.y * stretch));
  }
  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorpd %xmm1, %xmm1
movsd %xmm0, (%rsp)
ucomisd %xmm0, %xmm1
jae 0x3d16
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq (%rsi), %r15
movq 0x8(%rsi), %r12
cmpq %r12, %r15
je 0x3d1e
leaq 0x8(%rsp), %r14
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x1035c(%rip), %xmm0    # 0x14008
jb 0x3cb4
sqrtsd %xmm0, %xmm0
jmp 0x3cb9
callq 0x31a0
movapd %xmm0, %xmm1
addsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd (%r15), %xmm0
mulsd %xmm1, %xmm0
mulsd 0x8(%r15), %xmm1
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x3cfc
movupd 0x8(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x3d07
movq %rbx, %rdi
movq %r14, %rdx
callq 0x6796
addq $0x10, %r15
cmpq %r12, %r15
jne 0x3c8d
jmp 0x3d1e
movq %rbx, %rdi
callq 0x64f8
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3d44
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x3220
movq %r14, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/printer.cc
// Function: (anonymous namespace)::GCodePrinter::Postamble()
virtual void Postamble() {
    printf("M104 S0 ; hotend off\n");
    printf("M140 S0 ; heated bed off\n");
    printf("M106 S0 ; fan off\n");
    printf("G1 X0\n");  // We keep z-axis as is.
    printf("G92 E0.0\n");
    printf("M84\n");
  }

// Assembly:
pushq %rax
leaq 0xda8f(%rip), %rdi      # 0x154f3
callq 0x32f0
leaq 0xda98(%rip), %rdi      # 0x15508
callq 0x32f0
leaq 0xdaa5(%rip), %rdi      # 0x15521
callq 0x32f0
leaq 0xdaab(%rip), %rdi      # 0x15533
callq 0x32f0
leaq 0xdaa5(%rip), %rdi      # 0x15539
callq 0x32f0
leaq 0xdaa2(%rip), %rdi      # 0x15542
popq %rax
jmp 0x32f0
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/printer.cc
// Function: (anonymous namespace)::GCodePrinter::SetSpeed(double)
virtual void SetSpeed(double feed_mm_per_sec) {
    if (feed_mm_per_sec != current_feedrate_) {
      printf("G1 F%.1f  ; feedrate=%.1fmm/s\n", feed_mm_per_sec * 60,
             feed_mm_per_sec);
      current_feedrate_ = feed_mm_per_sec;
    }
  }

// Assembly:
movapd %xmm0, %xmm1
movsd 0x18(%rdi), %xmm0
ucomisd %xmm1, %xmm0
jne 0x7b8f
jnp 0x7bc7
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movsd 0xd3b9(%rip), %xmm0     # 0x14f58
mulsd %xmm1, %xmm0
leaq 0xd50b(%rip), %rdi      # 0x150b5
movsd %xmm1, 0x8(%rsp)
movb $0x2, %al
callq 0x3040
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x18(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/printer.cc
// Function: (anonymous namespace)::GCodePrinter::ResetExtrude()
virtual void ResetExtrude() {
    assert(in_retract_);
    in_retract_ = false;
    printf("M83      ; relative E\n"  // extruder relative mode
           "G1 E%.1f  ; filament back to nozzle tip\n"
           "M82      ; absolute E\n", // extruder absolute mode
           1.1 * retract_amount_);  // fudging... a bit more squeeze.
    printf("G92 E0.0 ; start extrusion, set E to zero\n");
    extrude_dist_ = 0;
  }

// Assembly:
pushq %rbx
cmpb $0x0, 0x50(%rdi)
je 0x7c07
movq %rdi, %rbx
movb $0x0, 0x50(%rdi)
movsd 0x10(%rdi), %xmm0
mulsd 0xd395(%rip), %xmm0     # 0x14f78
leaq 0xd536(%rip), %rdi      # 0x15120
movb $0x1, %al
callq 0x3040
leaq 0xd94e(%rip), %rdi      # 0x15546
callq 0x32f0
movq $0x0, 0x48(%rbx)
popq %rbx
retq
leaq 0xd568(%rip), %rdi      # 0x15176
leaq 0xd4bf(%rip), %rsi      # 0x150d4
leaq 0xd4c3(%rip), %rcx      # 0x150df
movl $0x76, %edx
callq 0x3150
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/printer.cc
// Function: (anonymous namespace)::GCodePrinter::Retract()
virtual void Retract() {
    assert(!in_retract_);
    printf("M83      ; relative E\n"
           "G1 E%.1f ; retract\n"
           "M82      ; Back to absolute\n", -retract_amount_);
    in_retract_ = true;
  }

// Assembly:
pushq %rbx
cmpb $0x1, 0x50(%rdi)
je 0x7c50
movq %rdi, %rbx
movsd 0x10(%rdi), %xmm0
xorps 0xc484(%rip), %xmm0     # 0x140c0
leaq 0xd57b(%rip), %rdi      # 0x151be
movb $0x1, %al
callq 0x3040
movb $0x1, 0x50(%rbx)
popq %rbx
retq
leaq 0xd51e(%rip), %rdi      # 0x15175
leaq 0xd476(%rip), %rsi      # 0x150d4
leaq 0xd51d(%rip), %rcx      # 0x15182
movl $0x80, %edx
callq 0x3150
nop
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/printer.cc
// Function: (anonymous namespace)::GCodePrinter::ExtrudeTo(Vector2D const&, double, double)
virtual void ExtrudeTo(const Vector2D &pos, double z,
                         double extrusion_multiplier) {
    extrude_dist_ += distance(pos.x - last_x, pos.y - last_y, z - last_z);
    printf("G1 X%.3f Y%.3f Z%.3f E%.3f\n", pos.x, pos.y, z,
           extrude_dist_ * filament_extrusion_factor_ * extrusion_multiplier);
    last_x = pos.x; last_y = pos.y; last_z = z;
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movapd %xmm1, %xmm4
movq %rsi, %r14
movq %rdi, %rbx
movsd (%rsi), %xmm1
movsd 0x8(%rsi), %xmm2
subsd 0x30(%rdi), %xmm1
subsd 0x38(%rdi), %xmm2
movsd %xmm0, 0x8(%rsp)
subsd 0x40(%rdi), %xmm0
mulsd %xmm2, %xmm2
mulsd %xmm1, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7d23
sqrtsd %xmm0, %xmm3
jmp 0x7d38
movsd %xmm4, 0x10(%rsp)
callq 0x31a0
movsd 0x10(%rsp), %xmm4
movapd %xmm0, %xmm3
addsd 0x48(%rbx), %xmm3
movsd %xmm3, 0x48(%rbx)
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
mulsd 0x8(%rbx), %xmm3
mulsd %xmm4, %xmm3
leaq 0xd4c7(%rip), %rdi      # 0x15224
movsd 0x8(%rsp), %xmm2
movb $0x4, %al
callq 0x3040
movsd (%r14), %xmm0
movsd %xmm0, 0x30(%rbx)
movsd 0x8(%r14), %xmm0
movsd %xmm0, 0x38(%rbx)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x40(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/printer.cc
// Function: (anonymous namespace)::PostScriptPrinter::Init(Vector2D const&, double)
virtual void Init(const Vector2D &machine_limit,
                    double feed_mm_per_sec) {
    printf("/extrude-to { lineto } def\n");
    printf("72.0 25.4 div dup scale  %% Switch to mm\n");
    printf("1 setlinejoin\n");
    printf("%.2f setlinewidth %% mm\n", line_thickness_);
    printf("0 0 moveto\n");
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xd791(%rip), %rdi      # 0x15570
callq 0x32f0
leaq 0xd490(%rip), %rdi      # 0x1527b
xorl %eax, %eax
callq 0x3040
leaq 0xd792(%rip), %rdi      # 0x1558b
callq 0x32f0
cvtss2sd 0xc(%rbx), %xmm0
leaq 0xd49b(%rip), %rdi      # 0x152a5
movb $0x1, %al
callq 0x3040
leaq 0xd781(%rip), %rdi      # 0x15599
popq %rbx
jmp 0x32f0
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/printer.cc
// Function: (anonymous namespace)::PostScriptPrinter::MoveTo(Vector2D const&, double)
virtual void MoveTo(const Vector2D &pos, double z) {
    if (show_move_as_line_) {
      if (!in_move_color_) {
        ColorSwitch(0, 0, 0, 0.9);  // blue move color
        in_move_color_ = true;
      }
      printf("%.3f %.3f lineto\n", pos.x, pos.y);
    } else {
      printf("%.3f %.3f moveto\n", pos.x, pos.y);
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
cmpb $0x1, 0x8(%rdi)
jne 0x7f19
movq %rdi, %r15
leaq 0xd412(%rip), %r14      # 0x15308
cmpb $0x0, 0x10(%rdi)
jne 0x7f20
movss 0xd084(%rip), %xmm3     # 0x14f88
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x7fb0
movb $0x1, 0x10(%r15)
jmp 0x7f20
leaq 0xd3fa(%rip), %r14      # 0x1531a
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq %r14, %rdi
movb $0x2, %al
popq %rbx
popq %r14
popq %r15
jmp 0x3040
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/printer.cc
// Function: (anonymous namespace)::PostScriptPrinter::ExtrudeTo(Vector2D const&, double, double)
virtual void ExtrudeTo(const Vector2D &pos, double /*z*/,
                         double /*extrusion_multiplier*/) {
    if (in_move_color_) {
      ColorSwitch(line_thickness_, r_, g_, b_);
      in_move_color_ = false;
    }
    printf("%.3f %.3f extrude-to\n", pos.x, pos.y);
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpb $0x1, 0x10(%rdi)
jne 0x7f66
movq %rdi, %r14
movss 0xc(%rdi), %xmm0
movss 0x14(%rdi), %xmm1
movss 0x18(%rdi), %xmm2
movss 0x1c(%rdi), %xmm3
callq 0x7fb0
movb $0x0, 0x10(%r14)
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
leaq 0xd3eb(%rip), %rdi      # 0x15361
movb $0x2, %al
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3040
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/printer.cc
// Function: (anonymous namespace)::PostScriptPrinter::ColorSwitch(float, float, float, float)
void ColorSwitch(float line_width, float r, float g, float b) {
    printf("currentpoint\nstroke\n");   // finish last path; remember pos
    printf("%.1f setlinewidth %% mm\n", line_width);
    printf("%.1f %.1f %.1f setrgbcolor\n", r, g, b);
    printf("moveto\n");   // set current point to remembered pos.
  }

// Assembly:
subq $0x18, %rsp
movss %xmm3, 0x14(%rsp)
movss %xmm2, 0x10(%rsp)
movss %xmm1, 0xc(%rsp)
movss %xmm0, 0x8(%rsp)
leaq 0xd5e1(%rip), %rdi      # 0x155b4
callq 0x32f0
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
leaq 0xd344(%rip), %rdi      # 0x1532c
movb $0x1, %al
callq 0x3040
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x10(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x14(%rsp), %xmm2
leaq 0xd334(%rip), %rdi      # 0x15345
movb $0x3, %al
callq 0x3040
leaq 0xd57e(%rip), %rdi      # 0x1559d
addq $0x18, %rsp
jmp 0x32f0
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/config-values.cc
// Function: TypedParameter<bool>::FromString(char const*)
bool TypedParameter<bool>::FromString(const char *s) {
  if (s == NULL || strlen(s) == 0) {
    value_ = !value_;    // no parameter: just toggling.
  } else {
    value_ = (strcasecmp(s, "on") == 0 || strcasecmp(s, "true") == 0);
  }
  return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x820b
movq %rsi, %r14
cmpb $0x0, (%rsi)
je 0x820b
leaq 0xc259(%rip), %rsi      # 0x14442
movq %r14, %rdi
callq 0x3250
testl %eax, %eax
je 0x8211
leaq 0xd3cf(%rip), %rsi      # 0x155cb
movq %r14, %rdi
callq 0x3250
testl %eax, %eax
sete %al
jmp 0x8213
xorb $0x1, 0x20(%rbx)
jmp 0x8216
movb $0x1, %al
movb %al, 0x20(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/vector2d.cc
// Function: Centroid(std::vector<Vector2D, std::allocator<Vector2D>> const&)
Vector2D Centroid(const Polygon &polygon) {
    Vector2D result;
    for (Polygon::size_type i = 0; i < polygon.size(); ++i) {
        result = result + polygon[i];
    }
    return result / polygon.size();
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x4, %rax
cmpq %rcx, %rdx
je 0x86f9
cmpq $0x1, %rax
movq %rax, %rdx
adcq $0x0, %rdx
addq $0x8, %rcx
xorpd %xmm1, %xmm1
xorpd %xmm0, %xmm0
addsd -0x8(%rcx), %xmm0
addsd (%rcx), %xmm1
addq $0x10, %rcx
decq %rdx
jne 0x86e5
jmp 0x8701
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
testq %rax, %rax
js 0x870d
cvtsi2ss %rax, %xmm2
jmp 0x8722
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm2
addss %xmm2, %xmm2
cvtss2sd %xmm2, %xmm2
divsd %xmm2, %xmm0
divsd %xmm2, %xmm1
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::PolyTree::Clear()
void PolyTree::Clear()
{
    for (PolyNodes::size_type i = 0; i < AllNodes.size(); ++i)
      delete AllNodes[i];
    AllNodes.resize(0); 
    Childs.resize(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rax
cmpq %rax, 0x50(%rdi)
je 0x879b
xorl %r15d, %r15d
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x8784
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x8763
movq 0x28(%r14), %rsi
subq %rdi, %rsi
callq 0x3220
movq (%r14), %rdi
testq %rdi, %rdi
je 0x8777
movq 0x10(%r14), %rsi
subq %rdi, %rsi
callq 0x3220
movl $0x48, %esi
movq %r14, %rdi
callq 0x3220
incq %r15
movq 0x48(%rbx), %rax
movq 0x50(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r15
jb 0x8745
leaq 0x48(%rbx), %rdi
xorl %esi, %esi
callq 0x12220
addq $0x18, %rbx
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x12220
nop
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::PolyNode::AddChild(ClipperLib::PolyNode&)
void PolyNode::AddChild(PolyNode& child)
{
  unsigned cnt = (unsigned)Childs.size();
  Childs.push_back(&child);
  child.Parent = this;
  child.Index = cnt;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rdi), %r15
subq 0x18(%rdi), %r15
addq $0x18, %rdi
shrq $0x3, %r15
leaq 0x8(%rsp), %rsi
movq %rbx, (%rsi)
callq 0x12bd0
movq %r14, 0x30(%rbx)
movl %r15d, 0x38(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::PolyNode::GetNextSiblingUp() const
PolyNode* PolyNode::GetNextSiblingUp() const
{ 
  if (!Parent) //protects against PolyTree.GetNextSiblingUp()
      return 0;
  else if (Index == Parent->Childs.size() - 1)
      return Parent->GetNextSiblingUp();
  else
      return Parent->Childs[Index + 1];
}

// Assembly:
xorl %eax, %eax
movq 0x30(%rdi), %rsi
testq %rsi, %rsi
je 0x887a
movl 0x38(%rdi), %ecx
movq 0x18(%rsi), %rdx
movq 0x20(%rsi), %r8
subq %rdx, %r8
sarq $0x3, %r8
decq %r8
movq %rsi, %rdi
cmpq %rcx, %r8
je 0x884e
incl %ecx
movq (%rdx,%rcx,8), %rax
retq
nop