LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/./cybozu/reactor.hpp
// Function: bool cybozu::resource::with_fd<cybozu::tcp_socket::send(char const*, unsigned long, bool)::'lambda'(int)>(cybozu::tcp_socket::send(char const*, unsigned long, bool)::'lambda'(int)&&)
bool with_fd(Func&& f) {
        read_lock g(m_lock);
        if( ! valid() ) return false;
        // no need to check m_closed because it becomes true only after m_valid is set to false.

        if( f(m_fd) ) {
            return true;
        }

        invalidate_and_close_();
        return false;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r12
movq %rdi, %r14
leaq 0x18(%rdi), %rbx
movq %rbx, %rdi
callq 0x1288a
movb 0x10(%r14), %al
testb $0x1, %al
je 0x17bc7
movl 0x50(%r14), %ebp
movq (%r12), %r15
leaq 0xa8(%r15), %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
movb $0x0, 0x8(%rdi)
callq 0x17c58
leaq 0x8(%rsp), %r8
movb $0x1, 0x8(%r8)
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rcx
movq %r15, %rdi
movl %ebp, %esi
callq 0x20820
movl %eax, %r13d
testb %al, %al
je 0x17bb5
cmpb $0x1, 0x18(%r12)
jne 0x17ba1
movq 0x70(%r15), %rax
cmpq 0x78(%r15), %rax
jne 0x17ba1
movq 0x90(%r15), %rax
cmpq %rax, 0x88(%r15)
jne 0x17ba1
movq %r15, %rdi
movl %ebp, %esi
callq 0x17c04
leaq 0x8(%rsp), %rdi
callq 0x17c42
movb $0x1, %bpl
testb %r13b, %r13b
je 0x17bbf
jmp 0x17bc9
leaq 0x8(%rsp), %rdi
callq 0x17c42
movq %r14, %rdi
callq 0xa110
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x76a0
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x17c42
jmp 0x17bf4
movq %rax, %r14
movq %rbx, %rdi
callq 0x76a0
movq %r14, %rdi
callq 0x79b0
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/cybozu/signal.hpp
// Function: cybozu::signal_reader::on_readable(int)
virtual bool on_readable(int fd) override final {
        while( true ) {
            struct signalfd_siginfo si;
            ssize_t n = read(fd, &si, sizeof(si));
            if( n == -1 ) {
                if( errno == EINTR ) continue;
                if( errno == EAGAIN || errno ==EWOULDBLOCK ) return true;
                throw_unix_error(errno, "read");
            }
            if( n != sizeof(si) )
                throw std::runtime_error("<signal_reader::on_readable> bug?");
            if( m_callback ) m_callback(si, *m_reactor);
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x58(%rdi), %r15
leaq 0x8(%rsp), %r12
movl $0x80, %edx
movl %ebx, %edi
movq %r12, %rsi
callq 0x7790
cmpq $0x80, %rax
je 0x127a3
cmpq $-0x1, %rax
jne 0x127d0
callq 0x7040
movl (%rax), %edi
cmpl $0x4, %edi
je 0x12778
jmp 0x127ba
cmpq $0x0, 0x68(%r14)
je 0x12778
movq 0x8(%r14), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq *0x70(%r14)
jmp 0x12778
cmpl $0xb, %edi
jne 0x12802
movb $0x1, %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x7220
movq %rax, %rbx
leaq 0x22510(%rip), %rsi     # 0x34cf4
movq %rax, %rdi
callq 0x7190
movq 0x337fd(%rip), %rsi     # 0x45ff0
movq 0x33776(%rip), %rdx     # 0x45f70
movq %rbx, %rdi
callq 0x7970
leaq 0x22352(%rip), %rsi     # 0x34b5b
callq 0x8dd3
movq %rax, %r14
movq %rbx, %rdi
callq 0x7370
movq %r14, %rdi
callq 0x79b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/handler.cpp
// Function: yrmcds::counter::handler::gc_ready()
bool handler::gc_ready() {
    std::time_t now = g_current_time.load(relaxed);

    if( m_gc_thread.get() != nullptr ) {
        if( ! m_gc_thread->done() )
            return false;
        m_last_gc = now;
        m_gc_thread = nullptr;  // join
    }

    unsigned int interval = g_config.counter().stat_interval();
    std::time_t boundary = (now / interval) * interval;
    return m_last_gc < boundary;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3453c(%rip), %rax     # 0x46e80
movq (%rax), %r14
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0x12965
movb (%rax), %al
testb $0x1, %al
je 0x12986
leaq 0x58(%rbx), %rdi
movq %r14, 0x50(%rbx)
xorl %esi, %esi
callq 0x13472
leaq 0x34254(%rip), %rax     # 0x46bc0
movl 0x11c(%rax), %ecx
movq %r14, %rax
cqto
idivq %rcx
subq %rdx, %r14
cmpq %r14, 0x50(%rbx)
setl %al
jmp 0x12988
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/handler.cpp
// Function: yrmcds::counter::handler::make_counter_socket(int)
std::unique_ptr<cybozu::tcp_socket> handler::make_counter_socket(int s) {
    unsigned int mc = g_config.counter().max_connections();
    if( mc != 0 &&
        g_stats.curr_connections.load(relaxed) >= mc )
        return nullptr;

    return std::unique_ptr<cybozu::tcp_socket>(
        new counter_socket(s, m_finder, m_hash) );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x33e2a(%rip), %rax     # 0x46bc0
movl 0x114(%rax), %eax
testq %rax, %rax
je 0x12db4
leaq 0x33f58(%rip), %rcx     # 0x46d00
movq 0x80(%rcx), %rcx
cmpq %rax, %rcx
jae 0x12ddd
movl $0x1c0, %edi            # imm = 0x1C0
movl $0x40, %esi
callq 0x7540
movq %rax, %r15
leaq 0x8(%r14), %rdx
addq $0x30, %r14
movq %rax, %rdi
movl %ebp, %esi
movq %r14, %rcx
callq 0x13888
jmp 0x12de7
movq $0x0, (%rbx)
xorl %r15d, %r15d
movq %r15, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x40, %esi
movq %r15, %rdi
callq 0x7690
movq %rbx, %rdi
callq 0x79b0
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/handler.cpp
// Function: yrmcds::counter::handler::dump_stats()
void handler::dump_stats() {
    std::uint64_t ops = 0;
    for( auto& v: g_stats.ops ) {
        ops += v.load(relaxed);
    }
    using logger = cybozu::logger;
    logger::info() << "counter: "
                   << g_stats.objects.load(relaxed) << " objects, "
                   << g_stats.curr_connections.load(relaxed) << " clients, "
                   << ops << " total ops.";
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq $-0x98, %rax
xorl %ebx, %ebx
leaq 0x33dfb(%rip), %r15     # 0x46d00
movq 0x158(%r15,%rax), %rcx
addq %rcx, %rbx
addq $0x8, %rax
jne 0x12f05
leaq 0x33b7b(%rip), %rax     # 0x46a98
movl (%rax), %eax
xorl %esi, %esi
cmpl $0x2, %eax
setge %sil
leaq 0x21aea(%rip), %rdx     # 0x34a19
movq %rsp, %r14
movq %r14, %rdi
callq 0x9718
cmpb $0x1, (%r14)
jne 0x12f56
movq 0x8(%rsp), %rdi
leaq 0x21e04(%rip), %rsi     # 0x34d50
movl $0x9, %edx
callq 0x7580
movl (%r15), %esi
cmpb $0x1, (%rsp)
jne 0x12f69
movq 0x8(%rsp), %rdi
callq 0x7330
cmpb $0x1, (%rsp)
jne 0x12f85
movq 0x8(%rsp), %rdi
leaq 0x21ddf(%rip), %rsi     # 0x34d5a
movl $0xa, %edx
callq 0x7580
movq 0x80(%r15), %rsi
cmpb $0x1, (%rsp)
jne 0x12f9c
movq 0x8(%rsp), %rdi
callq 0x7330
cmpb $0x1, (%rsp)
jne 0x12fb8
movq 0x8(%rsp), %rdi
leaq 0x21db7(%rip), %rsi     # 0x34d65
movl $0xa, %edx
callq 0x7580
cmpb $0x1, (%rsp)
jne 0x12fcb
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x7330
cmpb $0x1, (%rsp)
jne 0x12fe7
movq 0x8(%rsp), %rdi
leaq 0x21d93(%rip), %rsi     # 0x34d70
movl $0xb, %edx
callq 0x7580
movq %rsp, %rdi
callq 0x8f94
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x12ffd
jmp 0x12ffd
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8f94
movq %rbx, %rdi
callq 0x79b0
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/./cybozu/hash_map.hpp
// Function: cybozu::hash_map<yrmcds::memcache::object>::bucket::clear_nolock()
void clear_nolock() {
            while( m_objects ) {
                item* next = m_objects->next;
                delete m_objects;
                m_objects = next;
            }
        }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x28(%rdi), %r14
testq %r14, %r14
je 0x17578
movq %rdi, %rbx
movq 0x60(%r14), %rsi
movq 0x90(%r14), %r15
testq %rsi, %rsi
je 0x1753a
leaq 0x60(%r14), %rdi
callq 0x18286
movq $0x0, 0x60(%r14)
leaq 0x38(%r14), %rdi
callq 0x96e2
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1755f
movq 0x10(%r14), %rsi
subq %rdi, %rsi
callq 0x7510
movl $0x98, %esi
movq %r14, %rdi
callq 0x7510
movq %r15, 0x28(%rbx)
movq %r15, %r14
testq %r15, %r15
jne 0x17521
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/sockets.cpp
// Function: yrmcds::counter::counter_socket::release_all()
void counter_socket::release_all() {
    for( auto& res: m_acquired_resources ) {
        uint32_t count = res.second;
        auto h = [count](const cybozu::hash_key&, object& obj) -> bool {
            if( ! obj.release(count) ) {
                cybozu::dump_stack();
                throw std::logic_error("<counter_socket::release_all> release failed");
            }
            return true;
        };
        if( ! m_hash.apply(*res.first, h, nullptr) ) {
            cybozu::dump_stack();
            throw std::logic_error("<counter_socket::release_all> not found: "
                                   + res.first->str());
        }
    }
    m_acquired_resources.clear();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x190(%rdi), %r12
leaq 0x1249(%rip), %r13      # 0x14d28
movq %rsp, %r14
leaq 0x20(%rsp), %r15
movq (%r12), %r12
testq %r12, %r12
je 0x13bf7
movl 0x10(%r12), %eax
movq 0x110(%rbx), %rcx
movq 0x8(%r12), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movaps %xmm0, 0x10(%rsp)
movl %eax, (%rsp)
leaq 0x116d(%rip), %rax      # 0x14c88
movq %rax, 0x18(%rsp)
movq %r13, 0x10(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq 0x28(%rsi), %rax
xorl %edx, %edx
divq (%rcx)
leaq (%rdx,%rdx,2), %rdi
shlq $0x4, %rdi
addq 0x8(%rcx), %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0x153d6
movl %eax, %ebp
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x13b68
movq %r15, %rdi
movq %r15, %rsi
movl $0x3, %edx
callq *%rax
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x13b7f
movq %r14, %rdi
movq %r14, %rsi
movl $0x3, %edx
callq *%rax
testb %bpl, %bpl
jne 0x13ae7
callq 0xbb8e
movl $0x10, %edi
callq 0x7220
movq %rax, %rbx
movq 0x8(%r12), %rax
movq 0x18(%rax), %rsi
leaq 0x30(%rsp), %r15
movq 0x20(%rax), %rdx
addq %rsi, %rdx
movq %r15, -0x10(%r15)
leaq 0x20(%rsp), %rdi
callq 0x97a0
leaq 0x215e1(%rip), %rsi     # 0x351a5
movq %rsp, %rdi
leaq 0x20(%rsp), %rdx
callq 0xe3b5
movb $0x1, %bpl
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x7800
xorl %ebp, %ebp
movq 0x323d0(%rip), %rsi     # 0x45fb8
movq 0x323a1(%rip), %rdx     # 0x45f90
movq %rbx, %rdi
callq 0x7970
addq $0x180, %rbx            # imm = 0x180
movq %rbx, %rdi
callq 0x14eee
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13c3b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x7510
jmp 0x13c3b
movq %rax, %r14
movb $0x1, %bpl
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x13c5a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7510
jmp 0x13c5a
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x13ca0
movq %rbx, %rdi
callq 0x7370
jmp 0x13ca0
jmp 0x13caa
jmp 0x13caa
movq %rax, %r14
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x13c89
leaq 0x20(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x13ca0
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %r14, %rdi
callq 0x79b0
jmp 0x13caa
movq %rax, %rdi
callq 0x8fc6
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/sockets.cpp
// Function: yrmcds::counter::counter_socket::on_readable(int)
bool counter_socket::on_readable(int fd) {
    if( m_busy.load(std::memory_order_acquire) ) {
        m_reactor->add_readable(*this);
        return true;
    }

    // find an idle worker.
    cybozu::worker* w = m_finder();
    if( w == nullptr ) {
        m_reactor->add_readable(*this);
        return true;
    }

    m_busy.store(true, std::memory_order_release);
    w->post_job(m_recvjob);
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movb 0x100(%rdi), %al
testb $0x1, %al
jne 0x13d4f
movq 0x108(%rbx), %rdi
cmpq $0x0, 0x10(%rdi)
je 0x13d87
callq *0x18(%rdi)
testq %rax, %rax
je 0x13d4f
movq %rax, %r14
movb $0x1, 0x100(%rbx)
addq $0x140, %rbx            # imm = 0x140
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x14d4e
leaq 0x70(%r14), %rdi
movq %r15, %rsi
callq 0x14f38
movb $0x1, 0x40(%r14)
movq %r14, %rdi
callq 0x104fc
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x13d7b
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x13d7b
movq 0x8(%rbx), %rdi
addq $0x50, %rbx
movq 0x48(%rdi), %rsi
cmpq 0x50(%rdi), %rsi
je 0x13d6f
movl (%rbx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rdi)
jmp 0x13d7b
addq $0x40, %rdi
movq %rbx, %rdx
callq 0xaac6
movb $0x1, %al
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x7170
jmp 0x13db0
movq %rax, %rbx
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x13da8
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %rbx, %rdi
callq 0x79b0
movq %rax, %rdi
callq 0x8fc6
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/sockets.cpp
// Function: yrmcds::counter::counter_socket::on_writable(int)
bool counter_socket::on_writable(int fd) {
    cybozu::worker* w = m_finder();
    if( w == nullptr ) {
        // if there is no idle worker, fallback to the default.
        return cybozu::tcp_socket::on_writable(fd);
    }

    w->post_job(m_sendjob);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq 0x108(%rdi), %rdi
cmpq $0x0, 0x10(%rdi)
je 0x13e49
movl %esi, %ebp
callq *0x18(%rdi)
testq %rax, %rax
je 0x13e35
movq %rax, %rbx
addq $0x160, %r14            # imm = 0x160
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x14d4e
leaq 0x70(%rbx), %rdi
movq %r15, %rsi
callq 0x14f38
movb $0x1, 0x40(%rbx)
movq %rbx, %rdi
callq 0x104fc
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x13e28
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movl %ebp, %esi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x14db4
callq 0x7170
jmp 0x13e74
movq %rax, %rbx
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x13e6c
leaq 0x8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %rbx, %rdi
callq 0x79b0
movq %rax, %rdi
callq 0x8fc6
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/sockets.cpp
// Function: yrmcds::counter::counter_socket::cmd_get(yrmcds::counter::request const&, yrmcds::counter::response&)
void counter_socket::cmd_get(const counter::request& cmd, counter::response& r) {
    auto h = [this,&cmd,&r](const cybozu::hash_key& k, object& obj) -> bool {
        r.get(obj.consumption());
        return true;
    };
    if( ! m_hash.apply(cybozu::hash_key(cmd.name().p, cmd.name().len), h, nullptr) )
        r.error( counter::status::NotFound );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x110(%rdi), %r13
movq 0x20(%rsi), %rdi
movq 0x28(%rsi), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq %rdi, 0x38(%rsp)
movq %rsi, 0x40(%rsp)
callq 0xb88a
movq %rax, %r12
movq %rax, 0x48(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x18, %edi
callq 0x7500
movq %r15, (%rax)
movq %r14, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %rsp, %r8
movq %rax, (%r8)
leaq 0x8b2(%rip), %rax       # 0x148b8
movq %rax, 0x18(%r8)
leaq 0x8bb(%rip), %rax       # 0x148cc
movq %rax, 0x10(%r8)
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rcx
movaps %xmm0, 0x10(%rcx)
movaps %xmm0, (%rcx)
movq %r12, %rax
xorl %edx, %edx
divq (%r13)
leaq (%rdx,%rdx,2), %rdi
shlq $0x4, %rdi
addq 0x8(%r13), %rdi
leaq 0x20(%rsp), %rsi
movq %r8, %rdx
callq 0x153d6
movl %eax, %ebp
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x14061
leaq 0x50(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x14078
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1408f
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x7510
testb %bpl, %bpl
jne 0x140a1
movq %rbx, %rdi
movl $0x1, %esi
callq 0x22536
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1410f
jmp 0x1410f
movq %rax, %rbx
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x140d0
leaq 0x50(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x140f0
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x140f0
jmp 0x1410f
jmp 0x1410f
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x14107
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x7510
movq %rbx, %rdi
callq 0x79b0
movq %rax, %rdi
callq 0x8fc6
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/sockets.cpp
// Function: yrmcds::counter::counter_socket::cmd_acquire(yrmcds::counter::request const&, yrmcds::counter::response&)
void counter_socket::cmd_acquire(const counter::request& cmd, counter::response& r) {
    uint32_t resources = cmd.resources();
    uint32_t maximum = cmd.maximum();
    auto h = [this,resources,maximum,&r](const cybozu::hash_key& k, object& obj) -> bool {
        if( ! obj.acquire(resources, maximum) ) {
            r.error( counter::status::ResourceNotAvailable );
            return true;
        }
        on_acquire(k, resources);
        r.acquire(resources);
        return true;
    };
    auto c = [this,resources,&r](const cybozu::hash_key& k) -> object {
        on_acquire(k, resources);
        r.acquire(resources);
        return object(resources);
    };
    m_hash.apply(cybozu::hash_key(cmd.name().p, cmd.name().len), h, c);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movl 0x18(%rsi), %ebp
movl 0x1c(%rsi), %r13d
movq 0x110(%rdi), %r12
movq 0x20(%rsi), %rdi
movq 0x28(%rsi), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq %rdi, 0x58(%rsp)
movq %rsi, 0x60(%rsp)
callq 0xb88a
movq %rax, %r15
movq %rax, 0x68(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x18, %edi
callq 0x7500
movq %r14, (%rax)
movl %ebp, 0x8(%rax)
movl %r13d, 0xc(%rax)
movq %rbx, 0x10(%rax)
movq %rax, (%rsp)
leaq 0x79d(%rip), %rax       # 0x14936
movq %rax, 0x18(%rsp)
leaq 0x821(%rip), %rax       # 0x149c6
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movl $0x18, %edi
callq 0x7500
movq %r14, (%rax)
movl %ebp, 0x8(%rax)
movq %rbx, 0x10(%rax)
leaq 0x20(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x856(%rip), %rax       # 0x14a30
movq %rax, 0x18(%rcx)
leaq 0x88b(%rip), %rax       # 0x14a70
movq %rax, 0x10(%rcx)
movq %r15, %rax
xorl %edx, %edx
divq (%r12)
leaq (%rdx,%rdx,2), %rdi
shlq $0x4, %rdi
addq 0x8(%r12), %rdi
leaq 0x40(%rsp), %rsi
movq %rsp, %rdx
callq 0x153d6
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x14225
leaq 0x20(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x1423c
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x14253
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x7510
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x142c6
jmp 0x142c6
movq %rax, %rbx
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x14289
leaq 0x20(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x14289
jmp 0x142c6
movq %rax, %rbx
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x142a7
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x142a7
jmp 0x142c6
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x142be
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x7510
movq %rbx, %rdi
callq 0x79b0
movq %rax, %rdi
callq 0x8fc6
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/sockets.cpp
// Function: yrmcds::counter::counter_socket::cmd_release(yrmcds::counter::request const&, yrmcds::counter::response&)
void counter_socket::cmd_release(const counter::request& cmd, counter::response& r) {
    uint32_t resources = cmd.resources();
    auto h = [this,resources,&r](const cybozu::hash_key& k, object& obj) -> bool {
        if( ! on_release(k, resources) ) {
            r.error( counter::status::NotAcquired );
            return true;
        }
        if( ! obj.release(resources) ) {
            cybozu::dump_stack();
            throw std::logic_error("<counter_socket::cmd_release> bug");
        }
        r.success();
        return true;
    };
    if( ! m_hash.apply(cybozu::hash_key(cmd.name().p, cmd.name().len), h, nullptr) )
        r.error( counter::status::NotFound );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movl 0x18(%rsi), %ebp
movq 0x110(%rdi), %r12
movq 0x20(%rsi), %rdi
movq 0x28(%rsi), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq %rdi, 0x38(%rsp)
movq %rsi, 0x40(%rsp)
callq 0xb88a
movq %rax, %r15
movq %rax, 0x48(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x18, %edi
callq 0x7500
movq %r14, (%rax)
movl %ebp, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %rsp, %r8
movq %rax, (%r8)
leaq 0x793(%rip), %rax       # 0x14ada
movq %rax, 0x18(%r8)
leaq 0x852(%rip), %rax       # 0x14ba4
movq %rax, 0x10(%r8)
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rcx
movaps %xmm0, 0x10(%rcx)
movaps %xmm0, (%rcx)
movq %r15, %rax
xorl %edx, %edx
divq (%r12)
leaq (%rdx,%rdx,2), %rdi
shlq $0x4, %rdi
addq 0x8(%r12), %rdi
leaq 0x20(%rsp), %rsi
movq %r8, %rdx
callq 0x153d6
movl %eax, %ebp
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x143a3
leaq 0x50(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x143ba
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x143d1
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x7510
testb %bpl, %bpl
jne 0x143e3
movq %rbx, %rdi
movl $0x1, %esi
callq 0x22536
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1444f
jmp 0x1444f
movq %rax, %rbx
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x14410
leaq 0x50(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x14430
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x14430
jmp 0x1444f
jmp 0x1444f
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x14447
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x7510
movq %rbx, %rdi
callq 0x79b0
movq %rax, %rdi
callq 0x8fc6
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/sockets.cpp
// Function: yrmcds::counter::counter_socket::cmd_dump(yrmcds::counter::response&)
void counter_socket::cmd_dump(counter::response& r) {
    auto pred = [this,&r](const cybozu::hash_key& k, object& obj) {
        r.dump(k.data(), k.length(), obj.consumption(), obj.max_consumption());
    };
    m_hash.foreach(pred);
    r.success();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq 0x110(%rdi), %rax
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movaps %xmm0, 0x10(%rsp)
movq %rdi, (%rsp)
movq %rsi, 0x8(%rsp)
leaq 0x785(%rip), %rcx       # 0x14c0e
movq %rcx, 0x18(%rsp)
leaq 0x7cb(%rip), %rcx       # 0x14c60
movq %rcx, 0x10(%rsp)
movq 0x8(%rax), %r14
movq 0x10(%rax), %r12
cmpq %r12, %r14
je 0x144be
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x1564e
addq $0x30, %r14
cmpq %r12, %r14
jne 0x144aa
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x144d5
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %rbx, %rdi
callq 0x224e4
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x1450d
movq %rax, %rbx
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x14505
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %rbx, %rdi
callq 0x79b0
movq %rax, %rdi
callq 0x8fc6
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/sockets.cpp
// Function: yrmcds::counter::counter_socket::on_acquire(cybozu::hash_key const&, unsigned int)
void counter_socket::on_acquire(const cybozu::hash_key& k, std::uint32_t resources) {
    auto it = m_acquired_resources.find(&k);
    if( it != m_acquired_resources.end() ) {
        it->second += resources;
        return;
    }
    m_acquired_resources.emplace(&k, resources);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %ecx
movq %rsi, %r10
movl %edx, 0xc(%rsp)
movq 0x180(%rdi), %r9
movq 0x188(%rdi), %rsi
xorl %ebx, %ebx
movq %r10, %rax
xorl %edx, %edx
divq %rsi
movq (%r9,%rdx,8), %rax
testq %rax, %rax
je 0x14583
movq (%rax), %r11
movq %rax, %rbx
cmpq %r10, 0x8(%r11)
je 0x14583
movq %rdx, %r8
movq %r11, %r14
movq (%r11), %r11
testq %r11, %r11
je 0x14581
movq 0x8(%r11), %r9
movq %r9, %rax
xorl %edx, %edx
divq %rsi
movl $0x0, %ebx
cmpq %r8, %rdx
jne 0x14583
movq %r14, %rbx
cmpq %r10, %r9
jne 0x14556
jmp 0x14583
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x1458d
movq (%rbx), %rax
jmp 0x1458f
xorl %eax, %eax
testq %rax, %rax
je 0x14599
addl %ecx, 0x10(%rax)
jmp 0x145b2
addq $0x180, %rdi            # imm = 0x180
leaq 0x10(%rsp), %rsi
movq %r10, (%rsi)
leaq 0xc(%rsp), %rdx
callq 0x156fc
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/sockets.cpp
// Function: yrmcds::counter::counter_socket::on_release(cybozu::hash_key const&, unsigned int)
bool counter_socket::on_release(const cybozu::hash_key& k, std::uint32_t resources) {
    auto it = m_acquired_resources.find(&k);
    if( it == m_acquired_resources.end() )
        return false;
    if( it->second < resources )
        return false;
    if( it->second == resources ) {
        m_acquired_resources.erase(it);
        return true;
    }
    it->second -= resources;
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ecx
movq 0x180(%rdi), %r9
movq 0x188(%rdi), %r10
xorl %ebx, %ebx
movq %rsi, %rax
xorl %edx, %edx
divq %r10
movq (%r9,%rdx,8), %rax
testq %rax, %rax
je 0x1461d
movq (%rax), %r11
movq %rax, %rbx
cmpq %rsi, 0x8(%r11)
je 0x1461d
movq %rdx, %r8
movq %r11, %r14
movq (%r11), %r11
testq %r11, %r11
je 0x1461b
movq 0x8(%r11), %r9
movq %r9, %rax
xorl %edx, %edx
divq %r10
movl $0x0, %ebx
cmpq %r8, %rdx
jne 0x1461d
movq %r14, %rbx
cmpq %rsi, %r9
jne 0x145f0
jmp 0x1461d
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x14627
movq (%rbx), %rsi
jmp 0x14629
xorl %esi, %esi
testq %rsi, %rsi
je 0x1463c
addq $0x180, %rdi            # imm = 0x180
movl 0x10(%rsi), %eax
subl %ecx, %eax
jae 0x14640
xorl %eax, %eax
jmp 0x1464e
jne 0x14649
callq 0x159a2
jmp 0x1464c
movl %eax, 0x10(%rsi)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/./cybozu/dynbuf.hpp
// Function: cybozu::dynbuf::append(char const*, unsigned long)
void append(const char* p, std::size_t len) {
        if( freebytes() < len )
            enlarge(len);
        std::memcpy(m_p+m_used, p, len);
        m_used += len;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x10(%rdi), %rax
subq 0x20(%rdi), %rax
cmpq %rdx, %rax
jae 0x14fcc
movq %r14, %rdi
movq %rbx, %rsi
callq 0x15236
movq (%r14), %rdi
addq 0x20(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x7410
addq %rbx, 0x20(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/./cybozu/tcp.hpp
// Function: cybozu::tcp_socket::receive(cybozu::dynbuf&, unsigned long)
recv_result receive(dynbuf& buf, const std::size_t max_recvsize) {
        char* p = buf.prepare(max_recvsize);
        ::ssize_t n;
        auto ret = with_fd([=, &n](int fd) -> bool {
            do {
                n = ::recv(fd, p, max_recvsize, 0);
            } while( n == -1 && errno == EINTR );

            return (n != -1) || (errno != ECONNRESET);
        });

        if( ! ret ) {
            return recv_result::RESET;
        }

        if( n == 0 ) {
            return recv_result::NONE;
        }

        if( n == -1 ) {
            if( errno == EAGAIN || errno == EWOULDBLOCK )
                return recv_result::AGAIN;
            throw_unix_error(errno, "recv");
        }

        buf.consume(n);
        return recv_result::OK;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rax
subq 0x20(%rsi), %rax
cmpq %rdx, %rax
jae 0x15012
movq %rbx, %rdi
movq %r15, %rsi
callq 0x15236
movq (%rbx), %rax
addq 0x20(%rbx), %rax
movq %rsp, %rcx
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, 0x8(%rsi)
movq %r15, 0x10(%rsi)
movq %r14, %rdi
callq 0x15304
movl %eax, %ecx
movl $0x2, %eax
testb %cl, %cl
je 0x15078
movq (%rsp), %rax
testq %rax, %rax
je 0x1506b
cmpq $-0x1, %rax
jne 0x15072
callq 0x7040
movl (%rax), %edi
movl $0x1, %eax
cmpl $0xb, %edi
je 0x15078
leaq 0x201ac(%rip), %rsi     # 0x35212
callq 0x8dd3
movl $0x3, %eax
jmp 0x15078
addq %rax, 0x20(%rbx)
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/counter/counter.hpp
// Function: yrmcds::counter::request::request(char const*, unsigned long)
request(const char* p, std::size_t len) {
        if( p == nullptr )
            throw std::logic_error("<counter::request> `p` must not be nullptr");
        if( len == 0 )
            throw std::logic_error("<counter::request> `len` must not be zero");
        parse(p, len);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq $0x0, (%rdi)
movw $0x12, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rdi)
movups %xmm0, 0x1c(%rdi)
movl $0x0, 0x2c(%rdi)
movb $0x4, 0x30(%rdi)
testq %rsi, %rsi
je 0x150bf
testq %rdx, %rdx
je 0x150dd
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x223d4
movl $0x10, %edi
callq 0x7220
movq %rax, %rbx
leaq 0x20144(%rip), %rsi     # 0x35217
movq %rax, %rdi
callq 0x77a0
jmp 0x150f9
movl $0x10, %edi
callq 0x7220
movq %rax, %rbx
leaq 0x20151(%rip), %rsi     # 0x35242
movq %rax, %rdi
callq 0x77a0
movq 0x30eb8(%rip), %rsi     # 0x45fb8
movq 0x30e89(%rip), %rdx     # 0x45f90
movq %rbx, %rdi
callq 0x7970
jmp 0x15111
movq %rax, %r14
movq %rbx, %rdi
callq 0x7370
movq %r14, %rdi
callq 0x79b0
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/./cybozu/dynbuf.hpp
// Function: cybozu::dynbuf::erase(unsigned long)
void erase(const std::size_t len) {
        if( m_used < len )
            throw std::invalid_argument("<cybozu::dynbuf::erase>");
        if( len == 0 ) return;
        std::size_t remain = m_used - len;
        if( remain == 0 ) {
            reset();
            return;
        }
        if( remain <= m_default_capacity && m_capacity != m_default_capacity ) {
            char* new_p = _malloc(m_default_capacity);
            std::memcpy(new_p, m_p+len, remain);
            if( m_erase )
                clear_memory(m_p, m_used);
            _free(m_p);
            m_p = new_p;
            m_capacity = m_default_capacity;
            m_used = remain;
            return;
        }
        std::memmove(m_p, m_p+len, remain);
        if( m_erase )
            clear_memory(m_p+remain, len);
        m_used = remain;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x20(%rdi), %r14
cmpq %rsi, %r14
jb 0x151f0
movq %rsi, %r15
testq %rsi, %rsi
je 0x151e4
movq %rdi, %rbx
subq %r15, %r14
jne 0x15160
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x10f0c
movq 0x8(%rbx), %rdi
cmpq %rdi, %r14
ja 0x1516f
cmpq %rdi, 0x10(%rbx)
jne 0x1519b
movq (%rbx), %rdi
leaq (%rdi,%r15), %rsi
movq %r14, %rdx
callq 0x78e0
cmpb $0x1, 0x18(%rbx)
jne 0x151e0
leaq 0x301ad(%rip), %rax     # 0x45338
movq (%rax), %rax
movq (%rbx), %rdi
addq %r14, %rdi
movq %r15, %rsi
callq *%rax
jmp 0x151e0
callq 0x104a0
movq %rax, %r12
addq (%rbx), %r15
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x7410
cmpb $0x1, 0x18(%rbx)
jne 0x151cd
leaq 0x30177(%rip), %rax     # 0x45338
movq (%rax), %rax
movq (%rbx), %rdi
movq 0x20(%rbx), %rsi
callq *%rax
movq (%rbx), %rdi
callq 0x75b0
movq %r12, (%rbx)
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %r14, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x7220
movq %rax, %rbx
leaq 0x20068(%rip), %rsi     # 0x3526c
movq %rax, %rdi
callq 0x7a70
movq 0x30dad(%rip), %rsi     # 0x45fc0
movq 0x30d86(%rip), %rdx     # 0x45fa0
movq %rbx, %rdi
callq 0x7970
movq %rax, %r14
movq %rbx, %rdi
callq 0x7370
movq %r14, %rdi
callq 0x79b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/./cybozu/dynbuf.hpp
// Function: cybozu::dynbuf::enlarge(unsigned long)
void enlarge(std::size_t additional) {
        if( additional == 0 )
            return;
        const std::size_t new_capacity = m_capacity + additional;
        if( m_erase ) {
            char * const new_p = _malloc(new_capacity);
            if( m_p ) {
                std::memcpy(new_p, m_p, m_used);
                clear_memory(m_p, m_used);
                _free(m_p);
            }
            m_p = new_p;
        } else {
            m_p = _realloc(m_p, new_capacity);
        }
        m_capacity = new_capacity;
    }

// Assembly:
testq %rsi, %rsi
je 0x152a6
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq 0x10(%rdi), %rbx
cmpb $0x1, 0x18(%rdi)
jne 0x1528c
movq %rbx, %rdi
callq 0x104a0
movq %rax, %r15
movq (%r14), %rsi
testq %rsi, %rsi
je 0x1529a
movq 0x20(%r14), %rdx
movq %r15, %rdi
callq 0x7410
leaq 0x300c2(%rip), %rax     # 0x45338
movq (%rax), %rax
movq (%r14), %rdi
movq 0x20(%r14), %rsi
callq *%rax
movq (%r14), %rdi
callq 0x75b0
jmp 0x1529a
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x152a8
movq %rax, %r15
movq %r15, (%r14)
movq %rbx, 0x10(%r14)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/./cybozu/dynbuf.hpp
// Function: cybozu::dynbuf::_realloc(void*, unsigned long)
static char* _realloc(void* p, std::size_t new_len) {
#ifdef USE_TCMALLOC
        char* np = (char*)tc_realloc(p, new_len);
#else
        char* np = (char*)std::realloc(p, new_len);
#endif
        if( np == nullptr )
            throw std::runtime_error("failed to re-allocate memory.");
        return np;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x7900
testq %rax, %rax
je 0x152be
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x7220
movq %rax, %rbx
leaq 0x1ff22(%rip), %rsi     # 0x351f4
movq %rax, %rdi
callq 0x7190
movq 0x30d0f(%rip), %rsi     # 0x45ff0
movq 0x30c88(%rip), %rdx     # 0x45f70
movq %rbx, %rdi
callq 0x7970
movq %rax, %r14
movq %rbx, %rdi
callq 0x7370
movq %r14, %rdi
callq 0x79b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/./cybozu/hash_map.hpp
// Function: cybozu::hash_map<yrmcds::counter::object>::bucket::apply_nolock(cybozu::hash_key const&, std::function<bool (cybozu::hash_key const&, yrmcds::counter::object&)> const&, std::function<yrmcds::counter::object (cybozu::hash_key const&)> const&)
bool apply_nolock(const hash_key& key,
                          const handler& h, const creator& c) {
            for( item* p = m_objects; p != nullptr; p = p->next ) {
                if( p->key == key ) {
                    if( ! h ) return false;
                    return h(p->key, p->object);
                }
            }
            if( ! c ) return false;
            m_objects = new item(key, c, m_objects);
            return true;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, 0x8(%rsp)
movq 0x28(%rdi), %r13
testq %r13, %r13
sete %r14b
je 0x15494
movq %rdx, %r12
movq 0x18(%r15), %rbp
movq 0x20(%r15), %rbx
movq 0x20(%r13), %rdx
cmpq %rbx, %rdx
jne 0x15485
movq 0x18(%r13), %rdi
cmpq %rbp, %rdi
je 0x15496
movq %rbp, %rsi
callq 0x7520
testl %eax, %eax
je 0x15496
movq 0x40(%r13), %r13
testq %r13, %r13
sete %r14b
jne 0x15467
jmp 0x154b1
jmp 0x154b1
cmpq $0x0, 0x10(%r12)
je 0x154af
leaq 0x30(%r13), %rdx
movq %r12, %rdi
movq %r13, %rsi
callq *0x18(%r12)
jmp 0x154b1
xorl %eax, %eax
testb $0x1, %r14b
je 0x154f1
movq 0x10(%rsp), %r14
cmpq $0x0, 0x10(%r14)
je 0x154ef
movl $0x48, %edi
callq 0x7500
movq %rax, %r12
movq 0x8(%rsp), %rbx
movq 0x28(%rbx), %rcx
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1551a
movq %r12, 0x28(%rbx)
movb $0x1, %al
jmp 0x154f1
xorl %eax, %eax
andb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x48, %esi
movq %r12, %rdi
callq 0x7510
movq %rbx, %rdi
callq 0x79b0
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/memcache/handler.cpp
// Function: yrmcds::memcache::handler::gc_ready(long)
bool handler::gc_ready(std::time_t now) {
    if( m_gc_thread.get() != nullptr ) {
        if( ! m_gc_thread->done() )
            return false;
        m_last_gc = now;
        m_gc_thread = nullptr;
    }

    std::time_t t = g_stats.flush_time.load(relaxed);
    if( t != 0 && now >= t )
        return true;

    // run GC immediately if the heap is over used.
    if( g_stats.used_memory.load(relaxed) >
        g_config.memory_limit() ) return true;

    // Run GC when there are new slaves.
    // In case there are unstable slaves that try to connect to
    // the master too frequently, the number of consecutive GCs is limited.
    if( ! m_new_slaves.empty() && m_consecutive_gcs < MAX_CONSECUTIVE_GCS ) {
        ++m_consecutive_gcs;
        return true;
    }

    if( now > (m_last_gc + g_config.gc_interval()) ) {
        m_consecutive_gcs = 0;
        return true;
    }

    return false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x68(%rdi), %rax
testq %rax, %rax
je 0x15c04
movb (%rax), %al
testb $0x1, %al
je 0x15c71
leaq 0x68(%rbx), %rdi
movq %r14, 0x60(%rbx)
xorl %esi, %esi
callq 0x17a7c
leaq 0x312b5(%rip), %rcx     # 0x46ec0
movq 0xc0(%rcx), %rax
testq %rax, %rax
setne %dl
cmpq %r14, %rax
setle %sil
movb $0x1, %al
testb %sil, %dl
jne 0x15c73
movq 0x28(%rcx), %rdx
leaq 0x30f8f(%rip), %rcx     # 0x46bc0
cmpq 0xe8(%rcx), %rdx
ja 0x15c73
movq 0x90(%rbx), %rdx
cmpq 0x98(%rbx), %rdx
je 0x15c59
movl 0x70(%rbx), %edx
cmpl $0x2, %edx
jg 0x15c59
incl %edx
movl %edx, 0x70(%rbx)
jmp 0x15c73
movl 0x108(%rcx), %ecx
addq 0x60(%rbx), %rcx
cmpq %r14, %rcx
jge 0x15c71
movl $0x0, 0x70(%rbx)
jmp 0x15c73
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/memcache/handler.cpp
// Function: yrmcds::memcache::handler::make_memcache_socket(int)
std::unique_ptr<cybozu::tcp_socket> handler::make_memcache_socket(int s) {
    if( m_is_slave )
        return nullptr;

    unsigned int mc = g_config.max_connections();
    if( mc != 0 &&
        (g_stats.curr_connections.load(relaxed) >= mc) )
        return nullptr;

    return std::unique_ptr<cybozu::tcp_socket>(
        new memcache_socket(s, m_finder, m_hash, m_slaves) );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0x38(%rsi)
jne 0x16d40
movl %edx, %ebp
movq %rsi, %r14
leaq 0x2fec8(%rip), %rax     # 0x46bc0
movl 0x40(%rax), %eax
testq %rax, %rax
je 0x16d13
leaq 0x301b9(%rip), %rcx     # 0x46ec0
movq 0x100(%rcx), %rcx
cmpq %rax, %rcx
jae 0x16d40
movl $0x1c0, %edi            # imm = 0x1C0
movl $0x40, %esi
callq 0x7540
movq %rax, %r15
leaq 0x8(%r14), %rdx
leaq 0x40(%r14), %rcx
addq $0x78, %r14
movq %rax, %rdi
movl %ebp, %esi
movq %r14, %r8
callq 0x18d2c
jmp 0x16d4a
movq $0x0, (%rbx)
xorl %r15d, %r15d
movq %r15, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x40, %esi
movq %r15, %rdi
callq 0x7690
movq %rbx, %rdi
callq 0x79b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/memcache/sockets.hpp
// Function: yrmcds::memcache::repl_socket::peer_ip[abi:cxx11]()
std::string peer_ip() {
        std::string addr = "unknown address";
        try {
            with_fd([&addr](int fd) -> bool {
                addr = cybozu::get_peer_ip_address(fd).str();
                return true;
            });
        } catch (...) {
            // ignore errors
        }
        return addr;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
leaq 0x1e173(%rip), %rsi     # 0x353a2
leaq 0x1e17b(%rip), %rdx     # 0x353b1
callq 0x97a0
leaq 0x8(%rsp), %rsi
movq %rbx, (%rsi)
movq %r14, %rdi
callq 0x17780
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x71a0
callq 0x78f0
jmp 0x1724b
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x1727d
movq (%r15), %rsi
incq %rsi
callq 0x7510
movq %r14, %rdi
callq 0x79b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/memcache/gc.hpp
// Function: yrmcds::memcache::gc_thread::gc_thread(cybozu::hash_map<yrmcds::memcache::object>&, std::vector<yrmcds::memcache::repl_socket*, std::allocator<yrmcds::memcache::repl_socket*>> const&, std::vector<yrmcds::memcache::repl_socket*, std::allocator<yrmcds::memcache::repl_socket*>> const&)
gc_thread(cybozu::hash_map<object>& m,
              const std::vector<repl_socket*>& slaves,
              const std::vector<repl_socket*>& new_slaves):
        m_hash(m), m_slaves(slaves), m_new_slaves(new_slaves) {
        for( repl_socket* s: new_slaves ) {
            if( std::find(slaves.begin(), slaves.end(), s) == slaves.end() )
                m_slaves.push_back(s);
        }
        m_flushers.reserve(10);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbp
movq %rdx, %r13
movq %rdi, %rbx
movq $0x0, 0x8(%rdi)
movq %rsi, 0x10(%rdi)
leaq 0x18(%rdi), %r14
movq %r14, %rdi
movq %rdx, %rsi
callq 0x1781a
leaq 0x30(%rbx), %rdi
movq %rdi, 0x10(%rsp)
movq %rbp, %rsi
callq 0x1781a
leaq 0x98(%rbx), %rax
movq %rax, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x98(%rbx)
movq $0x0, 0xa8(%rbx)
movups %xmm0, 0x48(%rbx)
movups %xmm0, 0x58(%rbx)
xorl %eax, %eax
movl %eax, 0x68(%rbx)
movups %xmm0, 0x70(%rbx)
movups %xmm0, 0x80(%rbx)
movl %eax, 0x90(%rbx)
movq (%rbp), %r15
movq 0x8(%rbp), %r12
cmpq %r12, %r15
je 0x17364
leaq 0x8(%rsp), %rbp
movq (%r15), %rax
movq %rax, 0x8(%rsp)
movq (%r13), %rdi
movq 0x8(%r13), %rsi
movq %rbp, %rdx
callq 0x179c1
cmpq 0x8(%r13), %rax
jne 0x1735b
movq 0x20(%rbx), %rsi
cmpq 0x28(%rbx), %rsi
je 0x17350
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x20(%rbx)
jmp 0x1735b
movq %r14, %rdi
movq %rbp, %rdx
callq 0x17dde
addq $0x8, %r15
cmpq %r12, %r15
jne 0x17319
movl $0xa, %esi
movq (%rsp), %rdi
callq 0x1789a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1738f
movq %rax, %r13
jmp 0x173b4
movq %rax, %r13
jmp 0x173c8
jmp 0x1738f
movq %rax, %r13
movq (%rsp), %rdi
callq 0x17964
movq 0x10(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x173b4
movq 0x40(%rbx), %rsi
subq %rdi, %rsi
callq 0x7510
movq (%r14), %rdi
testq %rdi, %rdi
je 0x173c8
movq 0x28(%rbx), %rsi
subq %rdi, %rsi
callq 0x7510
cmpq $0x0, 0x8(%rbx)
jne 0x173d7
movq %r13, %rdi
callq 0x79b0
callq 0x70e0
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/memcache/sockets.hpp
// Function: yrmcds::memcache::repl_socket::repl_socket(int, unsigned int, std::function<cybozu::worker* ()> const&)
repl_socket(int fd, unsigned int bufcnt,
                const std::function<cybozu::worker*()>& finder)
        : cybozu::tcp_socket(fd, bufcnt),
          m_finder(finder),
          m_recvbuf(MAX_RECVSIZE),
          m_last_heartbeat(g_current_time.load(std::memory_order_relaxed))
    {
        m_sendjob = [this](cybozu::dynbuf&) {
            with_fd([=](int fd) -> bool {
                return write_pending_data(fd);
            });
        };
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdi, %rbx
callq 0x20460
leaq 0x2e404(%rip), %rax     # 0x45998
addq $0x10, %rax
movq %rax, (%rbx)
movq %r14, 0x100(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x108(%rbx)
movq $0x0, 0x118(%rbx)
movl $0x200000, %edi         # imm = 0x200000
callq 0x7500
movq %rax, 0x108(%rbx)
movq %rax, 0x110(%rbx)
movq %rax, %r14
addq $0x200000, %r14         # imm = 0x200000
movq %r14, 0x118(%rbx)
movl $0x200000, %edx         # imm = 0x200000
movq %rax, %rdi
xorl %esi, %esi
callq 0x7290
movq %r14, 0x110(%rbx)
leaq 0x120(%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x120(%rbx)
movups %xmm0, 0x130(%rbx)
leaq 0x2f86b(%rip), %rax     # 0x46e80
movq (%rax), %rax
movq %rax, 0x140(%rbx)
movq %rsp, %rsi
movq %rbx, (%rsi)
callq 0x17cbc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x14e28
movq %r14, %rdi
callq 0x79b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/./cybozu/tcp.hpp
// Function: cybozu::tcp_socket::_flush(int)
void _flush(int fd) {
        // with TCP_CORK, setting TCP_NODELAY effectively flushes
        // the kernel send buffer.
        int v = 1;
        if( setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &v, sizeof(v)) == -1 )
            throw_unix_error(errno, "setsockopt(TCP_NODELAY)");
    }

// Assembly:
pushq %rax
movl %esi, %edi
leaq 0x4(%rsp), %rcx
movl $0x1, (%rcx)
movl $0x6, %esi
movl $0x1, %edx
movl $0x4, %r8d
callq 0x79d0
cmpl $-0x1, %eax
je 0x17c2e
popq %rax
retq
callq 0x7040
movl (%rax), %edi
leaq 0x1d792(%rip), %rsi     # 0x353ce
callq 0x8dd3
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/memcache/object.cpp
// Function: yrmcds::memcache::file_flusher::~file_flusher()
file_flusher::~file_flusher() {
    if( m_fd == -1 ) return;
    if( ::fdatasync(m_fd) == 0 )
        ::posix_fadvise(m_fd, 0, 0, POSIX_FADV_DONTNEED);
    ::close(m_fd);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
cmpl $-0x1, %edi
je 0x182db
callq 0x7210
testl %eax, %eax
jne 0x182d4
movl (%rbx), %edi
xorl %esi, %esi
xorl %edx, %edx
movl $0x4, %ecx
callq 0x73a0
movl (%rbx), %edi
callq 0x7a90
popq %rbx
retq
movq %rax, %rdi
callq 0x8fc6
nop
// File: /workspace/github_cpp_makefile_star2_O1/cybozu[P]yrmcds/src/memcache/object.cpp
// Function: yrmcds::memcache::object::object(char const*, unsigned long, unsigned int, long)
object::object(const char* p, std::size_t len,
               std::uint32_t flags_, std::time_t exptime)
    : m_length(len), m_data(0, g_config.secure_erase()), m_file(nullptr),
      m_flags(flags_), m_exptime(exptime) {
    if( len > g_config.heap_data_limit() ) {
        m_file = std::unique_ptr<tempfile>(new tempfile);
        m_file->write(p, len);
    } else {
        if( len > 0 )
            m_data.append(p, len);
    }
    g_stats.total_objects.fetch_add(1, std::memory_order_relaxed);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdx, (%rdi)
leaq 0x8(%rdi), %rbx
leaq 0x2e8bb(%rip), %r13     # 0x46bc0
movb 0x100(%r13), %al
xorl %edx, %edx
movq %rdx, 0x18(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movb %al, 0x20(%rdi)
leaq 0x30(%rdi), %r14
movups %xmm0, 0x28(%rdi)
movl %ecx, 0x38(%rdi)
movq %r8, 0x40(%rdi)
movq $0x1, 0x48(%rdi)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x50(%rdi)
movq %rdx, 0x58(%rdi)
cmpq %r15, 0xe0(%r13)
jae 0x183a8
movl $0x10, %edi
callq 0x7500
movq %rax, %rbp
addq $0x48, %r13
movq %r13, %rdi
callq 0x18c56
movl %eax, (%rbp)
xorl %eax, %eax
movq %rax, 0x8(%rbp)
movq %rax, (%rsp)
movq (%r14), %rsi
movq %rbp, (%r14)
testq %rsi, %rsi
je 0x18387
movq %r14, %rdi
callq 0x18286
movq (%rsp), %rsi
testq %rsi, %rsi
je 0x18398
movq %rsp, %rdi
callq 0x18286
movq (%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1fecc
jmp 0x183bb
testq %r15, %r15
je 0x183bb
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x14fa6
leaq 0x2eafe(%rip), %rax     # 0x46ec0
lock
incq 0x80(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movl $0x10, %esi
movq %rbp, %rdi
callq 0x7510
jmp 0x183f0
jmp 0x183ed
movq %rax, %r15
movq (%r14), %rsi
testq %rsi, %rsi
je 0x18400
movq %r14, %rdi
callq 0x18286
movq $0x0, (%r14)
movq %rbx, %rdi
callq 0x96e2
movq %r15, %rdi
callq 0x79b0
nop