LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/object.cpp
// Function: yrmcds::memcache::object::append(char const*, unsigned long)
void object::append(const char* p, std::size_t len) {
    ++ m_cas;
    m_gc_old = 0;
    if( len == 0 ) return;

    std::size_t new_size = m_length + len;
    if( new_size > g_config.heap_data_limit() ) {
        if( m_file.get() == nullptr ) {
            m_file = std::unique_ptr<tempfile>(new tempfile);
            if( m_length > 0 )
                m_file->write(m_data.data(), m_length);
            m_data.reset();
            m_file->write(p, len);
        } else {
            m_file->write(p, len);
        }
    } else {
        m_data.append(p, len);
    }
    m_length = new_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
incq 0x48(%rdi)
andl $0x0, 0x50(%rdi)
testq %rdx, %rdx
je 0x164d4
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rbp
addq %rdx, %rbp
leaq 0x2576e(%rip), %rax     # 0x3bbc0
cmpq 0xe0(%rax), %rbp
jbe 0x164c2
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
jne 0x164b5
pushq $0x10
popq %rdi
callq 0x7510
movq %rax, %r12
movq %rax, %rdi
callq 0x16922
leaq 0x30(%rbx), %rdi
movq %rsp, %r13
andq $0x0, (%r13)
movq %r12, %rsi
callq 0x16a0e
movq %r13, %rdi
callq 0x160f8
movq (%rbx), %rdx
testq %rdx, %rdx
je 0x164a8
movq 0x8(%rbx), %rsi
movq 0x30(%rbx), %rdi
callq 0x1b8ac
leaq 0x8(%rbx), %rdi
callq 0xfa4a
movq 0x30(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1b8ac
jmp 0x164d1
leaq 0x8(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x130c0
movq %rbp, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r12, %rdi
callq 0x7520
movq %rbx, %rdi
callq 0x7990
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/object.cpp
// Function: yrmcds::memcache::object::prepend(char const*, unsigned long)
void object::prepend(const char* p, std::size_t len) {
    ++ m_cas;
    m_gc_old = 0;
    if( len == 0 ) return;

    std::size_t new_size = m_length + len;
    if( new_size > g_config.heap_data_limit() ) {
        if( m_file.get() == nullptr ) {
            m_file = std::unique_ptr<tempfile>(new tempfile);
            m_file->write(p, len);
            if( m_length > 0 )
                m_file->write(m_data.data(), m_length);
            m_data.reset();
        } else {
            cybozu::dynbuf buf(new_size);
            buf.append(p, len);
            m_file->read_contents(buf);
            m_file->clear();
            m_file->write(buf.data(), new_size);
        }
    } else {
        cybozu::dynbuf buf(new_size);
        buf.append(p, len);
        buf.append(m_data.data(), m_length);
        m_data.swap(buf);
    }
    m_length = new_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
incq 0x48(%rdi)
andl $0x0, 0x50(%rdi)
testq %rdx, %rdx
je 0x16671
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq (%rdi), %r14
addq %rdx, %r14
leaq 0x25691(%rip), %rax     # 0x3bbc0
cmpq 0xe0(%rax), %r14
jbe 0x1659a
leaq 0x30(%rbx), %r13
cmpq $0x0, 0x30(%rbx)
je 0x165a9
movq %r14, %rdi
callq 0xefe4
movq %rsp, %rdi
movq %rax, (%rdi)
movq %r14, 0x8(%rdi)
movq %r14, 0x10(%rdi)
movb $0x0, 0x18(%rdi)
andq $0x0, 0x20(%rdi)
movq %r12, %rsi
movq %r15, %rdx
callq 0x130c0
movq (%r13), %rdi
movq %rsp, %rsi
callq 0x1b948
movq (%r13), %rdi
callq 0x1b8f8
movq (%r13), %rdi
movq (%rsp), %rsi
movq %r14, %rdx
callq 0x1b8ac
movq %rsp, %rdi
jmp 0x16669
testq %r14, %r14
je 0x16605
movq %r14, %rdi
callq 0xefe4
jmp 0x16607
pushq $0x10
popq %rdi
callq 0x7510
movq %rax, %rbp
movq %rax, %rdi
callq 0x16922
movq %rsp, %rax
andq $0x0, (%rax)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x16a0e
movq %rsp, %rdi
callq 0x160f8
movq 0x30(%rbx), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1b8ac
movq (%rbx), %rdx
testq %rdx, %rdx
je 0x165fa
movq 0x8(%rbx), %rsi
movq 0x30(%rbx), %rdi
callq 0x1b8ac
leaq 0x8(%rbx), %rdi
callq 0xfa4a
jmp 0x1666e
xorl %eax, %eax
movq %rsp, %rdi
movq %rax, (%rdi)
movq %r14, 0x8(%rdi)
movq %r14, 0x10(%rdi)
movb $0x0, 0x18(%rdi)
andq $0x0, 0x20(%rdi)
movq %r12, %rsi
movq %r15, %rdx
callq 0x130c0
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
movq %rsp, %rdi
callq 0x130c0
movq 0x8(%rbx), %rax
movq %rsp, %rdi
movq (%rdi), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, (%rdi)
movq 0x18(%rbx), %rax
movq 0x10(%rdi), %rcx
movq %rcx, 0x18(%rbx)
movq %rax, 0x10(%rdi)
movq 0x28(%rbx), %rax
movq 0x20(%rdi), %rcx
movq %rcx, 0x28(%rbx)
movq %rax, 0x20(%rdi)
callq 0x8dac
movq %r14, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %rbp, %rdi
callq 0x7520
jmp 0x1669d
jmp 0x16692
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8dac
movq %rbx, %rdi
callq 0x7990
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/object.cpp
// Function: yrmcds::memcache::object::incr(unsigned long)
std::uint64_t object::incr(std::uint64_t n) {
    if( m_file.get() != nullptr )
        throw not_a_number{};
    std::uint64_t u64_value;
    try {
        u64_value = to_uint64(m_data.data(), m_length);
    } catch( const std::logic_error& ) {
        throw not_a_number{};
    }
    u64_value += n;
    char s_value[24]; // uint64 can be as large as 20 byte decimal string.
    m_length = ::snprintf(s_value, sizeof(s_value),
                          "%llu", (unsigned long long)u64_value);
    m_data.reset();
    m_data.append(s_value, m_length);
    ++ m_cas;
    m_gc_old = 0;
    return u64_value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpq $0x0, 0x30(%rdi)
jne 0x16720
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x8(%rdi), %rdi
callq 0x167b4
movq %rax, %r14
leaq 0x8(%rbx), %r12
addq %r15, %r14
leaq 0x10e66(%rip), %rdx     # 0x27541
movq %rsp, %r15
pushq $0x18
popq %rsi
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x78a0
cltq
movq %rax, (%rbx)
movq %r12, %rdi
callq 0xfa4a
movq (%rbx), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x130c0
incq 0x48(%rbx)
andl $0x0, 0x50(%rbx)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %r14
movq %rax, %rdi
callq 0x16940
leaq 0x241ce(%rip), %rsi     # 0x3a908
movq 0x2483f(%rip), %rdx     # 0x3af80
movq %r14, %rdi
callq 0x7950
movq %rax, %rbx
movq %r14, %rdi
callq 0x7390
jmp 0x167a4
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x167a4
movq %rbx, %rdi
callq 0x71a0
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %r14
movq %rax, %rdi
callq 0x16940
leaq 0x24188(%rip), %rsi     # 0x3a908
movq 0x247f9(%rip), %rdx     # 0x3af80
movq %r14, %rdi
callq 0x7950
movq %rax, %rbx
jmp 0x1679f
movq %rax, %rbx
movq %r14, %rdi
callq 0x7390
callq 0x78e0
movq %rbx, %rdi
callq 0x7990
movq %rax, %rdi
callq 0x870a
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/object.cpp
// Function: (anonymous namespace)::to_uint64(char const*, unsigned long)
std::uint64_t to_uint64(const char* p, std::size_t len) {
    unsigned long long ull = std::stoull( std::string(p, len) );
    if( ull > std::numeric_limits<std::uint64_t>::max() )
        throw std::out_of_range("out of range for uint64");
    return static_cast<std::uint64_t>(ull);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rax
leaq 0x10(%rsp), %rcx
movq %rcx, -0x10(%rcx)
leaq (%rsi,%rdi), %rdx
movq %rsp, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8e92
pushq $0xa
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xd921
movq %rax, %rbx
movq %rsp, %rdi
callq 0x71d0
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x71d0
movq %rbx, %rdi
callq 0x7990
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/object.cpp
// Function: yrmcds::memcache::object::decr(unsigned long)
std::uint64_t object::decr(std::uint64_t n) {
    if( m_file.get() != nullptr )
        throw not_a_number{};
    std::uint64_t u64_value;
    try {
        u64_value = to_uint64(m_data.data(), m_length);
    } catch( const std::logic_error& ) {
        throw not_a_number{};
    }
    u64_value = (u64_value < n) ? 0 : (u64_value - n);
    char s_value[24]; // uint64 can be as large as 20 byte decimal string.
    m_length = ::snprintf(s_value, sizeof(s_value),
                          "%llu", (unsigned long long)u64_value);
    m_data.reset();
    m_data.append(s_value, m_length);
    ++ m_cas;
    m_gc_old = 0;
    return u64_value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpq $0x0, 0x30(%rdi)
jne 0x1688d
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x8(%rdi), %rdi
callq 0x167b4
leaq 0x8(%rbx), %r15
subq %r14, %rax
movl $0x0, %r14d
cmovaeq %rax, %r14
leaq 0x10cf9(%rip), %rdx     # 0x27541
movq %rsp, %r12
pushq $0x18
popq %rsi
movq %r12, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x78a0
cltq
movq %rax, (%rbx)
movq %r15, %rdi
callq 0xfa4a
movq (%rbx), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x130c0
incq 0x48(%rbx)
andl $0x0, 0x50(%rbx)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %r14
movq %rax, %rdi
callq 0x16940
leaq 0x24061(%rip), %rsi     # 0x3a908
movq 0x246d2(%rip), %rdx     # 0x3af80
movq %r14, %rdi
callq 0x7950
movq %rax, %rbx
movq %r14, %rdi
callq 0x7390
jmp 0x16911
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x16911
movq %rbx, %rdi
callq 0x71a0
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %r14
movq %rax, %rdi
callq 0x16940
leaq 0x2401b(%rip), %rsi     # 0x3a908
movq 0x2468c(%rip), %rdx     # 0x3af80
movq %r14, %rdi
callq 0x7950
movq %rax, %rbx
jmp 0x1690c
movq %rax, %rbx
movq %r14, %rdi
callq 0x7390
callq 0x78e0
movq %rbx, %rdi
callq 0x7990
movq %rax, %rdi
callq 0x870a
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/../tempfile.hpp
// Function: yrmcds::mkstemp_wrap(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
inline int mkstemp_wrap(const std::string& tempdir) {
    std::string tmpl = tempdir + "/XXXXXX\0";
    int fd = ::mkostemp(&(tmpl[0]), O_CLOEXEC);
    if( fd == -1 )
        cybozu::throw_unix_error(errno, "mkstemp");
    ::unlink(tmpl.data());
    return fd;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rsi
leaq 0x10c09(%rip), %rdx     # 0x27576
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x169d5
movq (%rbx), %rdi
movl $0x80000, %esi          # imm = 0x80000
callq 0x7180
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x169ad
leaq 0x8(%rsp), %r14
movq (%r14), %rdi
callq 0x71f0
movq %r14, %rdi
callq 0x71d0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
callq 0x7030
movl (%rax), %edi
leaq 0x10b8b(%rip), %rsi     # 0x27546
callq 0x8513
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x71d0
movq %rbx, %rdi
callq 0x7990
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/sockets.cpp
// Function: yrmcds::memcache::memcache_socket::~memcache_socket()
memcache_socket::~memcache_socket() {
    // the destructor is the safe place to release remaining locks.
    for( auto& ref: m_locks ) {
        m_hash.apply(ref.get(),
                     [](const cybozu::hash_key&, object& obj) -> bool {
                         obj.unlock(true);
                         return true;
                     }, nullptr);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
leaq 0x23d3a(%rip), %rax     # 0x3a958
movq %rax, (%rdi)
leaq 0x1a0(%rdi), %rax
movq %rax, 0x8(%rsp)
movq 0x1a0(%rdi), %r13
movq 0x1a8(%rdi), %rbp
leaq 0x1fbc(%rip), %r14      # 0x18bfe
leaq 0x10(%rsp), %r15
leaq 0x30(%rsp), %r12
cmpq %rbp, %r13
je 0x16ca0
movq 0x110(%rbx), %rdi
movq (%r13), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x1f83(%rip), %rax      # 0x18bee
movq %rax, 0x28(%rsp)
movq %r14, 0x20(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq %r15, %rdx
movq %r12, %rcx
callq 0x1a96a
movq %r12, %rdi
callq 0x8d90
movq %r15, %rdi
callq 0x8d90
addq $0x8, %r13
jmp 0x16c4c
movq 0x8(%rsp), %rdi
callq 0x1b162
leaq 0x180(%rbx), %rdi
callq 0x8d90
leaq 0x160(%rbx), %rdi
callq 0x8d90
leaq 0x148(%rbx), %rdi
callq 0x15606
leaq 0x118(%rbx), %rdi
callq 0x8dac
movq %rbx, %rdi
callq 0x12ee2
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x870a
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/sockets.cpp
// Function: yrmcds::memcache::memcache_socket::on_readable(int)
bool memcache_socket::on_readable(int) {
    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;
    }

    // copy the current list of slaves
    m_slaves = m_slaves_origin;

    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 0x16d82
movq 0x108(%rbx), %rdi
callq 0x12d8a
testq %rax, %rax
je 0x16d82
movq %rax, %r14
movq 0x140(%rbx), %rsi
leaq 0x148(%rbx), %rdi
callq 0x1a98a
movb $0x1, 0x100(%rbx)
addq $0x160, %rbx            # imm = 0x160
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x12db4
movq %r14, %rdi
movq %r15, %rsi
callq 0x12d9a
movq %rsp, %rdi
callq 0x8d90
jmp 0x16d96
movq 0x8(%rbx), %rdi
addq $0x40, %rdi
addq $0x50, %rbx
movq %rbx, %rsi
callq 0x9f96
movb $0x1, %al
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8d90
movq %rbx, %rdi
callq 0x7990
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/sockets.cpp
// Function: yrmcds::memcache::repl_client_socket::on_readable(int)
bool repl_client_socket::on_readable(int fd) {
    // This function is executed in the same thread as the function that sends
    // heartbeats. If this function takes a very long time, no heartbeats will
    // be sent, and this process will be judged dead by the master. To prevent
    // this misjudgment, set an upper limit on the number of iterations.
    static const size_t MAX_ITER = 50;

    size_t n_iter = 0;
    while( true ) {
        char* p = m_recvbuf.prepare(MAX_RECVSIZE);
        ssize_t n = ::recv(fd, p, MAX_RECVSIZE, 0);
        if( n == -1 ) {
            if( errno == EAGAIN || errno == EWOULDBLOCK )
                break;
            if( errno == EINTR )
                continue;
            if( errno == ECONNRESET ) {
                cybozu::logger::warning() << "The connection to master has been reset.";
                m_reactor->quit();
                return invalidate();
            }
            cybozu::throw_unix_error(errno, "recv");
        }
        if( n == 0 ) {
            cybozu::logger::info() << "The connection to master has been closed.";
            m_reactor->quit();
            return invalidate();
        }
        m_recvbuf.consume(n);

        std::size_t c = repl_recv(m_recvbuf.data(), m_recvbuf.size(), m_hash);
        m_recvbuf.erase(c);

        n_iter++;
        if (n_iter >= MAX_ITER) {
            m_reactor->add_readable(*this);
            return true;
        }
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x108(%rdi), %r14
xorl %r15d, %r15d
movl $0x200000, %esi         # imm = 0x200000
movq %r14, %rdi
callq 0x13420
movl $0x200000, %edx         # imm = 0x200000
movl %ebp, %edi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x7140
cmpq $-0x1, %rax
jne 0x1886b
callq 0x7030
movl (%rax), %edi
cmpl $0x4, %edi
je 0x18839
jmp 0x188c2
testq %rax, %rax
je 0x188ea
addq 0x128(%rbx), %rax
movq %rax, 0x128(%rbx)
movq 0x100(%rbx), %rdx
movq 0x108(%rbx), %rdi
movq %rax, %rsi
callq 0x2540a
movq %r14, %rdi
movq %rax, %rsi
callq 0x13244
leaq 0x1(%r15), %rax
cmpq $0x31, %r15
movq %rax, %r15
jb 0x18839
movq 0x8(%rbx), %rdi
addq $0x40, %rdi
addq $0x50, %rbx
movq %rbx, %rsi
callq 0x9f96
jmp 0x18922
cmpl $0xb, %edi
je 0x18922
cmpl $0x68, %edi
jne 0x1892f
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xd0b4
leaq 0xfacf(%rip), %rsi      # 0x283af
movq %r14, %rdi
callq 0x1ac7e
jmp 0x18906
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xec96
leaq 0xfada(%rip), %rsi      # 0x283d8
movq %r14, %rdi
callq 0x1ac96
leaq 0x8(%rsp), %rdi
callq 0x86e4
movq 0x8(%rbx), %rax
movb $0x0, 0x4(%rax)
movq %rbx, %rdi
callq 0xf07a
jmp 0x18924
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe8b4(%rip), %rsi      # 0x271ea
callq 0x8513
jmp 0x1893d
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x86e4
movq %rbx, %rdi
callq 0x7990
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/sockets.hpp
// Function: yrmcds::memcache::memcache_socket::unlock_all()
void unlock_all() {
        for( auto& ref: m_locks ) {
            m_hash.apply(ref.get(),
                         [](const cybozu::hash_key&, object& obj) -> bool {
                             obj.unlock(false);
                             return true;
                         }, nullptr);
        }
        m_locks.clear();
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x1a0(%rdi), %r12
movq 0x1a8(%rdi), %r13
leaq 0x3c8(%rip), %rbp       # 0x1ae62
movq %rsp, %r14
leaq 0x20(%rsp), %r15
cmpq %r13, %r12
je 0x1aaf5
movq 0x110(%rbx), %rdi
movq (%r12), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x392(%rip), %rax       # 0x1ae52
movq %rax, 0x18(%rsp)
movq %rbp, 0x10(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq %r14, %rdx
movq %r15, %rcx
callq 0x1a96a
movq %r15, %rdi
callq 0x8d90
movq %r14, %rdi
callq 0x8d90
addq $0x8, %r12
jmp 0x1aaa2
movq 0x1a0(%rbx), %rax
cmpq %rax, 0x1a8(%rbx)
je 0x1ab0c
movq %rax, 0x1a8(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x8d90
movq %rsp, %rdi
callq 0x8d90
movq %rbx, %rdi
callq 0x7990
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/memcache.hpp
// Function: yrmcds::memcache::text_request::next_key(std::tuple<char const*, unsigned long> const&)
static item next_key(const item& prev) noexcept {
        const char* b;
        std::size_t len;
        std::tie(b, len) = prev;

        b += len;
        while( *b == '\x20' ) ++b;
        const char* e = (const char*)::rawmemchr(b, '\x0d');
        if( b == e ) return eos;

        const char* key_end = (const char*)std::memchr(b, '\x20', e-b);
        if( key_end == nullptr ) key_end = e;
        return item(b, key_end-b);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leaq (%rax,%rcx), %r12
decq %r12
movq %r12, %r14
incq %r12
cmpb $0x20, 0x1(%r14)
leaq 0x1(%r14), %r14
je 0x1abf6
pushq $0xd
popq %rsi
movq %r14, %rdi
callq 0x7650
cmpq %rax, %r14
je 0x1ac3b
movq %rax, %r15
movq %rax, %rdx
subq %r12, %rdx
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x7560
testq %rax, %rax
cmoveq %r15, %rax
subq %r12, %rax
movq %rax, (%rbx)
movq %r14, 0x8(%rbx)
jmp 0x1ac41
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/object.hpp
// Function: yrmcds::memcache::object::unlock(bool)
void unlock(bool force = false) {
        if( ! force && ! locked_by_self() ) {
            cybozu::dump_stack();
            std::ostringstream os;
            os << "object::unlock bug (m_lock=" << m_lock
               << ", g_context=" << g_context
               << ", unlocked thread=" << m_unlocker
               << ", this thread=" << std::this_thread::get_id();
            throw std::logic_error(os.str());
        }
        m_unlocker = std::this_thread::get_id();
        m_lock = -1;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, %rbx
testl %esi, %esi
jne 0x1ae98
movq %rbx, %rdi
callq 0x1afb4
testb %al, %al
je 0x1aeb1
callq 0x7480
movq %rax, 0x58(%rbx)
orl $-0x1, 0x54(%rbx)
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %rbp
retq
callq 0xb30b
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x7700
leaq 0xd538(%rip), %rsi      # 0x28402
movq %r14, %rdi
callq 0x7500
movl 0x54(%rbx), %esi
movq %rax, %rdi
callq 0x7970
leaq 0xd53a(%rip), %rsi      # 0x2841e
movq %rax, %rdi
callq 0x7500
movq %rax, %r14
callq 0x16a37
movl (%rax), %esi
movq %r14, %rdi
callq 0x7970
leaq 0xd526(%rip), %rsi      # 0x2842b
movq %rax, %rdi
callq 0x7500
movq 0x58(%rbx), %rsi
movq %rax, %rdi
callq 0xfaab
leaq 0xd51e(%rip), %rsi      # 0x2843e
movq %rax, %rdi
callq 0x7500
movq %rax, %rbx
callq 0x7480
movq %rbx, %rdi
movq %rax, %rsi
callq 0xfaab
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %rbx
leaq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x7870
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x7800
xorl %ebp, %ebp
movq 0x20052(%rip), %rsi     # 0x3afc0
movq 0x20013(%rip), %rdx     # 0x3af88
movq %rbx, %rdi
callq 0x7950
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x71d0
testb %bpl, %bpl
jne 0x1af94
jmp 0x1afa1
movq %rax, %r14
movq %rbx, %rdi
callq 0x7390
jmp 0x1afa1
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x70b0
movq %r14, %rdi
callq 0x7990
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/object.hpp
// Function: yrmcds::memcache::object::data(cybozu::dynbuf&) const
const cybozu::dynbuf& data(cybozu::dynbuf& buf) const {
        m_gc_old = 0;
        if( m_file.get() == nullptr ) return m_data;
        buf.reset();
        m_file->read_contents(buf);
        return buf;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
andl $0x0, 0x50(%rdi)
cmpq $0x0, 0x30(%rdi)
je 0x1b3b1
movq %rsi, %rbx
movq %rsi, %rdi
callq 0xfa4a
movq 0x30(%r14), %rdi
movq %rbx, %rsi
callq 0x1b948
jmp 0x1b3b8
addq $0x8, %r14
movq %r14, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/sockets.hpp
// Function: yrmcds::memcache::memcache_socket::remove_lock(cybozu::hash_key const&)
void remove_lock(const cybozu::hash_key& k) {
        for( auto it = m_locks.begin(); it != m_locks.end(); ++it ) {
            if( it->get() == k ) {
                m_locks.erase(it);
                return;
            }
        }
        cybozu::dump_stack();
        throw std::logic_error("<memcache_socket::remove_lock> bug");
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x1a0(%rdi), %r14
movq 0x1a0(%rdi), %r15
cmpq 0x1a8(%r12), %r15
je 0x1b5a3
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x13638
testb %al, %al
jne 0x1b58d
addq $0x8, %r15
jmp 0x1b56e
movq %r14, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1b5ec
callq 0xb30b
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %rbx
leaq 0xcf9e(%rip), %rsi      # 0x28558
movq %rax, %rdi
callq 0x77a0
movq 0x1f9f7(%rip), %rsi     # 0x3afc0
movq 0x1f9b8(%rip), %rdx     # 0x3af88
movq %rbx, %rdi
callq 0x7950
movq %rax, %r14
movq %rbx, %rdi
callq 0x7390
movq %r14, %rdi
callq 0x7990
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/./cybozu/hash_map.hpp
// Function: cybozu::hash_map<yrmcds::memcache::object>::bucket::remove_if(cybozu::hash_key const&, std::function<bool (cybozu::hash_key const&, yrmcds::memcache::object&)> const&)
bool remove_if(const hash_key& key,
                       const std::function<bool(const hash_key&, T&)>& pred) {
            lock_guard g(m_lock);
            for( item** p = &m_objects; *p != nullptr; p = &((*p)->next) ) {
                item* to_delete = *p;
                if( to_delete->key == key ) {
                    if( pred(key, to_delete->object) ) {
                        *p = to_delete->next;
                        delete to_delete;
                    }
                    return true;
                }
            }
            return false;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
callq 0x8b5e
leaq 0x28(%rbx), %r13
movl $0x90, %ebp
movq (%r13), %r14
testq %r14, %r14
je 0x1b69c
movq %r14, %rdi
movq %r15, %rsi
callq 0x13638
testb %al, %al
jne 0x1b669
movq (%r13), %r13
addq %rbp, %r13
jmp 0x1b648
leaq 0x30(%r14), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x1b0f4
testb %al, %al
je 0x1b69c
movq 0x90(%r14), %rax
movq %rax, (%r13)
movq %r14, %rdi
callq 0x160c8
movl $0x98, %esi
movq %r14, %rdi
callq 0x7520
testq %r14, %r14
setne %bpl
movq %rbx, %rdi
callq 0x73e0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x73e0
movq %r14, %rdi
callq 0x7990
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/stats.cpp
// Function: yrmcds::memcache::statistics::reset()
void statistics::reset() noexcept {
    objects = 0;
    objects_under_1k = 0;
    objects_under_4k = 0;
    objects_under_16k = 0;
    objects_under_64k = 0;
    objects_under_256k = 0;
    objects_under_1m = 0;
    objects_under_4m = 0;
    objects_huge = 0;

    /* bucket statistics.  Updated at every GC. */
    used_memory = 0;
    conflicts = 0;

    /* GC statistics. Updated at every GC, of course. */
    gc_count = 0;
    oldest_age = 0;
    largest_object_size = 0;
    last_expirations = 0;
    last_evictions = 0;
    total_evictions = 0;
    last_gc_elapsed = 0;
    total_gc_elapsed = 0;

    /* Replication statistics - non atomic. */
    repl_created = 0;
    repl_updated = 0;
    repl_removed = 0;

    /* Realtime staticstics. */
    total_objects = 0;
    flush_time = 0;
    curr_connections = 0;
    total_connections = 0;
    for( auto& v: text_ops )
        v = 0;
    for( auto& v: bin_ops )
        v = 0;
    get_hits = 0;
    get_misses = 0;
    cas_hits = 0;
    cas_misses = 0;
    cas_badval = 0;
}

// Assembly:
xorl %eax, %eax
xorl %ecx, %ecx
xchgl %ecx, (%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0x4(%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0x8(%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0xc(%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0x10(%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0x14(%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0x18(%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0x1c(%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0x20(%rdi)
xorl %ecx, %ecx
xchgq %rcx, 0x28(%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0x30(%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0x34(%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0x38(%rdi)
xorl %ecx, %ecx
xchgq %rcx, 0x40(%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0x48(%rdi)
xorl %ecx, %ecx
xchgl %ecx, 0x4c(%rdi)
xorl %ecx, %ecx
xchgq %rcx, 0x50(%rdi)
xorl %ecx, %ecx
xchgq %rcx, 0x58(%rdi)
xorl %ecx, %ecx
xchgq %rcx, 0x60(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rdi)
andq $0x0, 0x78(%rdi)
xorl %ecx, %ecx
xchgq %rcx, 0x80(%rdi)
xorl %ecx, %ecx
xchgq %rcx, 0xc0(%rdi)
xorl %ecx, %ecx
xchgq %rcx, 0x100(%rdi)
xchgq %rax, 0x108(%rdi)
movq $-0xb8, %rax
testq %rax, %rax
je 0x1b85f
xorl %ecx, %ecx
xchgq %rcx, 0x1f8(%rdi,%rax)
addq $0x8, %rax
jmp 0x1b84a
movq $-0x290, %rax           # imm = 0xFD70
testq %rax, %rax
je 0x1b87b
xorl %ecx, %ecx
xchgq %rcx, 0x488(%rdi,%rax)
addq $0x8, %rax
jmp 0x1b866
xorl %eax, %eax
xchgq %rax, 0x488(%rdi)
xorl %eax, %eax
xchgq %rax, 0x490(%rdi)
xorl %eax, %eax
xchgq %rax, 0x498(%rdi)
xorl %eax, %eax
xchgq %rax, 0x4a0(%rdi)
xorl %eax, %eax
xchgq %rax, 0x4a8(%rdi)
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/tempfile.cpp
// Function: yrmcds::tempfile::write(char const*, unsigned long)
void tempfile::write(const char* p, std::size_t len) {
    while( len != 0 ) {
        ssize_t n = ::write(m_fd, p, len);
        if( n == -1 )
            cybozu::throw_unix_error(errno, "write");
        p += n;
        len -= n;
        m_length += n;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rbx, %rbx
je 0x1b8df
movl (%r15), %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x7150
cmpq $-0x1, %rax
je 0x1b8e5
addq %rax, %r14
subq %rax, %rbx
addq %rax, 0x8(%r15)
jmp 0x1b8ba
popq %rbx
popq %r14
popq %r15
retq
callq 0x7030
movl (%rax), %edi
leaq 0xa997(%rip), %rsi      # 0x2628a
callq 0x8513
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/tempfile.cpp
// Function: yrmcds::tempfile::clear()
void tempfile::clear() {
    if( lseek(m_fd, 0, SEEK_SET) == (off_t)-1 )
        cybozu::throw_unix_error(errno, "lseek");
    if( ftruncate(m_fd, 0) == -1 )
        cybozu::throw_unix_error(errno, "ftruncate");
    m_length = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7a10
cmpq $-0x1, %rax
je 0x1b922
movl (%rbx), %edi
xorl %esi, %esi
callq 0x7740
cmpl $-0x1, %eax
je 0x1b935
andq $0x0, 0x8(%rbx)
popq %rbx
retq
callq 0x7030
movl (%rax), %edi
leaq 0xcca3(%rip), %rsi      # 0x285d3
callq 0x8513
callq 0x7030
movl (%rax), %edi
leaq 0xcc96(%rip), %rsi      # 0x285d9
callq 0x8513
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/tempfile.cpp
// Function: yrmcds::tempfile::read_contents(cybozu::dynbuf&) const
void tempfile::read_contents(cybozu::dynbuf& buf) const {
    char* p = buf.prepare(m_length);

    std::size_t to_read = m_length;
    while( to_read != 0 ) {
        ssize_t n = pread(m_fd, p, to_read, m_length - to_read);
        if( n == -1 )
            cybozu::throw_unix_error(errno, "pread");
        if( n == 0 )
            throw std::runtime_error("<tempfile::read_contents> unexpected EOF.");
        p += n;
        to_read -= n;
        buf.consume(n);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rsi
movq %rbx, %rdi
callq 0x13420
movq %rax, %r15
movq 0x8(%r14), %r12
testq %r12, %r12
je 0x1b99a
movl (%r14), %edi
movq 0x8(%r14), %rcx
subq %r12, %rcx
movq %r15, %rsi
movq %r12, %rdx
callq 0x7600
testq %rax, %rax
je 0x1b9a6
cmpq $-0x1, %rax
je 0x1b9d6
addq %rax, %r15
subq %rax, %r12
addq %rax, 0x20(%rbx)
jmp 0x1b969
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %rbx
leaq 0xcc31(%rip), %rsi      # 0x285e9
movq %rax, %rdi
callq 0x7190
movq 0x1f629(%rip), %rsi     # 0x3aff0
movq 0x1f5a2(%rip), %rdx     # 0x3af70
movq %rbx, %rdi
callq 0x7950
callq 0x7030
movl (%rax), %edi
leaq 0xcbff(%rip), %rsi      # 0x285e3
callq 0x8513
movq %rax, %r14
movq %rbx, %rdi
callq 0x7390
movq %r14, %rdi
callq 0x7990
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/cybozu/hash_map.cpp
// Function: cybozu::nearest_prime(unsigned int)
unsigned int nearest_prime(unsigned int n) noexcept {
    static_assert( sizeof(n) >= 4, "Too small unsigned int." );
    if( n == 2 ) return 2;
    for( unsigned int i = n|1; ; i += 2 ) {
        bool prime = true;
        unsigned int r = (unsigned int)std::rint( std::sqrt((double)i) );
        for( unsigned int j = 3; j <= r; j += 2 ) {
            if( (i % j) == 0 ) {
                prime = false;
                break;
            }
        }
        if( prime ) return i;
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jne 0x1ba10
pushq $0x2
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl %edi, %ebx
orl $0x1, %ebx
pushq $0x3
popq %rbp
movl %ebx, %eax
cvtsi2sd %rax, %xmm0
sqrtsd %xmm0, %xmm0
callq 0x7780
cvttsd2si %xmm0, %rcx
movl %ebp, %esi
cmpl %ecx, %esi
ja 0x1ba07
movl %ebx, %eax
xorl %edx, %edx
divl %esi
addl $0x2, %esi
testl %edx, %edx
jne 0x1ba2f
addl $0x2, %ebx
jmp 0x1ba18
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/cybozu/tcp.cpp
// Function: cybozu::tcp_socket::free_buffers()
void tcp_socket::free_buffers() {
    lock_guard g(m_lock);
    for( auto& t: m_pending ) {
        char* p;
        std::tie(p, std::ignore, std::ignore) = t;
        FREE(p);
    }
    m_pending.clear();
    for( char* p: m_free_buffers ) {
        FREE(p);
    }
    m_free_buffers.clear();
    m_tmpbuf.clear();
    m_tmpbuf.shrink_to_fit();
    m_shutdown = true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xa8(%rdi), %rsi
movq %rsp, %rdi
callq 0x159c8
movq 0x70(%rbx), %r14
movq 0x78(%rbx), %r15
cmpq %r15, %r14
je 0x1bfc7
movq 0x10(%r14), %rdi
callq 0x75b0
addq $0x18, %r14
jmp 0x1bfb3
movq 0x70(%rbx), %rax
cmpq %rax, 0x78(%rbx)
je 0x1bfd5
movq %rax, 0x78(%rbx)
movq 0x58(%rbx), %r14
movq 0x60(%rbx), %r15
cmpq %r15, %r14
je 0x1bff0
movq (%r14), %rdi
callq 0x75b0
addq $0x8, %r14
jmp 0x1bfdd
movq 0x58(%rbx), %rax
cmpq %rax, 0x60(%rbx)
je 0x1bffe
movq %rax, 0x60(%rbx)
leaq 0x88(%rbx), %rdi
movq 0x88(%rbx), %rax
cmpq %rax, 0x90(%rbx)
je 0x1c01c
movq %rax, 0x90(%rbx)
callq 0x1d326
movb $0x1, 0xa0(%rbx)
movq %rsp, %rdi
callq 0x15a16
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/cybozu/tcp.hpp
// Function: cybozu::tcp_socket::can_send(unsigned long) const
bool can_send(std::size_t len) const {
        if( m_shutdown ) return true; // in fact, fail
        if( ! m_tmpbuf.empty() ) return false;
        if( m_pending.empty() ) return true;
        return capacity() >= len;
    }

// Assembly:
movb $0x1, %al
cmpb $0x0, 0xa0(%rdi)
jne 0x1cfc7
movq 0x88(%rdi), %rcx
cmpq 0x90(%rdi), %rcx
je 0x1cfc8
xorl %eax, %eax
retq
movq 0x70(%rdi), %rcx
cmpq 0x78(%rdi), %rcx
je 0x1cfc7
pushq %rbx
movq %rsi, %rbx
callq 0x1cffc
cmpq %rbx, %rax
setae %al
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/counter/counter.cpp
// Function: yrmcds::counter::response::error(yrmcds::counter::status)
void response::error(counter::status status) {
    switch( status ) {
    case counter::status::NotFound:
        send_error(status, STATUS_NOT_FOUND,
                   sizeof(STATUS_NOT_FOUND) - 1);
        break;
    case counter::status::Invalid:
        send_error(status, STATUS_INVALID,
                   sizeof(STATUS_INVALID) - 1);
        break;
    case counter::status::ResourceNotAvailable:
        send_error(status, STATUS_RESOURCE_NOT_AVAILABLE,
                   sizeof(STATUS_RESOURCE_NOT_AVAILABLE) - 1);
        break;
    case counter::status::NotAcquired:
        send_error(status, STATUS_NOT_ACQUIRED,
                   sizeof(STATUS_NOT_ACQUIRED) - 1);
        break;
    case counter::status::UnknownCommand:
        send_error(status, STATUS_UNKNOWN_COMMAND,
                   sizeof(STATUS_UNKNOWN_COMMAND) - 1);
        break;
    case counter::status::OutOfMemory:
        send_error(status, STATUS_OUT_OF_MEMORY,
                   sizeof(STATUS_OUT_OF_MEMORY) - 1);
        break;
    default:
        cybozu::dump_stack();
        throw std::logic_error("<counter::response::error> invalid status: " +
                               std::to_string((std::uint8_t)status));
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
cmpl $0x82, %esi
je 0x1d927
movl %esi, %ebp
cmpl $0x4, %esi
je 0x1d8f1
cmpl $0x21, %ebp
je 0x1d8ff
cmpl $0x22, %ebp
je 0x1d90d
cmpl $0x81, %ebp
je 0x1d8e0
cmpl $0x1, %ebp
jne 0x1d938
leaq 0xaf87(%rip), %rdx      # 0x28860
pushq $0x1
popq %rsi
pushq $0x9
jmp 0x1d919
leaq 0xafd9(%rip), %rdx      # 0x288c0
pushq $0xf
popq %rcx
movl $0x81, %esi
jmp 0x1d91a
leaq 0xaf78(%rip), %rdx      # 0x28870
pushq $0x4
popq %rsi
pushq $0x11
jmp 0x1d919
leaq 0xaf8a(%rip), %rdx      # 0x28890
pushq $0x21
popq %rsi
pushq $0x16
jmp 0x1d919
leaq 0xaf93(%rip), %rdx      # 0x288a7
pushq $0x22
popq %rsi
pushq $0xc
popq %rcx
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x1d9c8
leaq 0xafa2(%rip), %rdx      # 0x288d0
pushq $0xb
popq %rcx
movl $0x82, %esi
jmp 0x1d91a
callq 0xb30b
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %rbx
movzbl %bpl, %esi
movq %rsp, %rdi
callq 0xd28d
leaq 0xaf81(%rip), %rsi      # 0x288dc
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x8abf
movb $0x1, %bpl
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x7800
xorl %ebp, %ebp
movq 0x1d63f(%rip), %rsi     # 0x3afc0
movq 0x1d600(%rip), %rdx     # 0x3af88
movq %rbx, %rdi
callq 0x7950
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x71d0
jmp 0x1d9a5
movq %rax, %r14
movb $0x1, %bpl
movq %rsp, %rdi
callq 0x71d0
testb %bpl, %bpl
jne 0x1d9b7
jmp 0x1d9bf
movq %rax, %r14
movq %rbx, %rdi
callq 0x7390
movq %r14, %rdi
callq 0x7990
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/counter/counter.cpp
// Function: yrmcds::counter::response::send_error(yrmcds::counter::status, char const*, unsigned long)
void response::send_error(counter::status status, const char* message,
                          std::size_t length) {
    char header[HEADER_SIZE];
    fill_header(header, status, length);
    cybozu::tcp_socket::iovec iov[] = {
        {header, HEADER_SIZE},
        {message, length},
    };
    m_socket.sendv(iov, 2, true);
}

// Assembly:
subq $0x38, %rsp
leaq 0x4(%rsp), %rax
movb $-0x6f, (%rax)
movq 0x8(%rdi), %r8
movb 0x8(%r8), %r9b
movb %r9b, 0x1(%rax)
movb %sil, 0x2(%rax)
movb $0x0, 0x3(%rax)
movl %ecx, %esi
bswapl %esi
movl %esi, 0x4(%rax)
movq 0x10(%r8), %rsi
movl (%rsi), %esi
movl %esi, 0x8(%rax)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq $0xc, 0x8(%rsi)
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq (%rdi), %rdi
pushq $0x2
popq %rdx
pushq $0x1
popq %rcx
callq 0x1e020
addq $0x38, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/counter/counter.cpp
// Function: yrmcds::counter::response::get(unsigned int)
void response::get(std::uint32_t consumption) {
    char header[HEADER_SIZE];
    char body[4];
    fill_header(header, counter::status::OK, sizeof(body));
    cybozu::hton(consumption, body);
    cybozu::tcp_socket::iovec iov[] = {
        {header, HEADER_SIZE},
        {body, sizeof(body)},
    };
    m_socket.sendv(iov, 2, true);
}

// Assembly:
subq $0x38, %rsp
leaq 0x4(%rsp), %rax
movb $-0x6f, (%rax)
movq 0x8(%rdi), %rcx
movb 0x8(%rcx), %dl
movb %dl, 0x1(%rax)
andw $0x0, 0x2(%rax)
movl $0x4000000, 0x4(%rax)   # imm = 0x4000000
movq 0x10(%rcx), %rcx
movl (%rcx), %ecx
movl %ecx, 0x8(%rax)
bswapl %esi
movq %rsp, %rcx
movl %esi, (%rcx)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq $0xc, 0x8(%rsi)
movq %rcx, 0x10(%rsi)
movq $0x4, 0x18(%rsi)
movq (%rdi), %rdi
pushq $0x2
popq %rdx
pushq $0x1
popq %rcx
callq 0x1e020
addq $0x38, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/counter/counter.cpp
// Function: yrmcds::counter::response::dump(char const*, unsigned short, unsigned int, unsigned int)
void response::dump(const char* name, std::uint16_t name_len,
                    std::uint32_t consumption, std::uint32_t max_conumption) {
    char header[HEADER_SIZE];
    char body[10];
    fill_header(header, counter::status::OK, sizeof(body) + name_len);
    cybozu::hton(consumption, body);
    cybozu::hton(max_conumption, body + 4);
    cybozu::hton(name_len, body + 8);
    cybozu::tcp_socket::iovec iov[] = {
        {header, HEADER_SIZE},
        {body, sizeof(body)},
        {name, name_len},
    };
    m_socket.sendv(iov, 3, false);
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movl %edx, %r9d
movl %edx, %eax
addl $0xa, %eax
leaq 0x14(%rsp), %r10
movb $-0x6f, (%r10)
movq 0x8(%rdi), %r11
movb 0x8(%r11), %bl
movb %bl, 0x1(%r10)
andw $0x0, 0x2(%r10)
bswapl %eax
movl %eax, 0x4(%r10)
movq 0x10(%r11), %rax
movl (%rax), %eax
movl %eax, 0x8(%r10)
bswapl %ecx
leaq 0x8(%rsp), %r11
movl %ecx, (%r11)
bswapl %r8d
movl %r8d, 0x4(%r11)
rolw $0x8, %dx
movw %dx, 0x8(%r11)
leaq 0x20(%rsp), %rax
movq %r10, (%rax)
movq $0xc, 0x8(%rax)
movq %r11, 0x10(%rax)
movq $0xa, 0x18(%rax)
movq %rsi, 0x20(%rax)
movq %r9, 0x28(%rax)
movq (%rdi), %rdi
pushq $0x3
popq %rdx
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x1e020
addq $0x50, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/counter/counter.cpp
// Function: (anonymous namespace)::add_stat(std::vector<char, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void add_stat(std::vector<char>& body, const std::string& name,
              const std::string& value) {
    char buffer[4];
    cybozu::hton((uint16_t)name.size(), buffer);
    cybozu::hton((uint16_t)value.size(), buffer + 2);
    body.insert(body.end(), buffer, buffer + 4);
    body.insert(body.end(), name.begin(), name.end());
    body.insert(body.end(), value.begin(), value.end());
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movzwl 0x8(%rsi), %eax
rolw $0x8, %ax
movq %rdi, %r14
leaq 0x10(%rsp), %rcx
movw %ax, -0x4(%rcx)
movzwl 0x8(%rdx), %eax
rolw $0x8, %ax
movw %ax, -0x2(%rcx)
movq 0x8(%rdi), %rsi
leaq 0xc(%rsp), %rdx
callq 0x1e1c8
movq 0x8(%r14), %rsi
movq (%r15), %rdx
movq 0x8(%r15), %rcx
addq %rdx, %rcx
movq %r14, %rdi
callq 0x1e1e8
movq 0x8(%r14), %rsi
movq (%rbx), %rdx
movq 0x8(%rbx), %rcx
addq %rdx, %rcx
movq %r14, %rdi
callq 0x1e1e8
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/./cybozu/tcp.hpp
// Function: cybozu::tcp_socket::sendv(cybozu::tcp_socket::iovec const*, int, bool)::'lambda'(int)::operator()(int) const
bool sendv(const iovec* iov, int iovcnt, bool flush=false) {
        return with_fd([=](int fd) -> bool {
            if( iovcnt >= MAX_IOVCNT )
                throw std::logic_error("<tcp_socket::sendv> too many iovec.");
            lock_guard g(m_lock);
            if( ! _sendv(fd, iov, iovcnt, g) )
                return false;
            if( flush && empty() )
                _flush(fd);
            return true;
        });
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpl $0x14, (%rdi)
jge 0x1e136
movl %esi, %ebx
movq %rdi, %r15
movq 0x8(%rdi), %r14
leaq 0xa8(%r14), %rsi
movq %rsp, %r12
movq %r12, %rdi
callq 0x159c8
movq 0x10(%r15), %rdx
movl (%r15), %ecx
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %r8
callq 0x1c2f4
movl %eax, %ebp
testb %al, %al
je 0x1e11f
cmpb $0x1, 0x18(%r15)
jne 0x1e11f
movq 0x70(%r14), %rax
cmpq 0x78(%r14), %rax
jne 0x1e11f
movq 0x90(%r14), %rax
cmpq %rax, 0x88(%r14)
jne 0x1e11f
movq %r14, %rdi
movl %ebx, %esi
callq 0x159de
movq %rsp, %rdi
callq 0x15a16
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %rbx
leaq 0xa87b(%rip), %rsi      # 0x289c3
movq %rax, %rdi
callq 0x77a0
movq 0x1ce69(%rip), %rsi     # 0x3afc0
movq 0x1ce2a(%rip), %rdx     # 0x3af88
movq %rbx, %rdi
callq 0x7950
movq %rax, %r14
movq %rbx, %rdi
callq 0x7390
jmp 0x1e17e
movq %rax, %r14
movq %rsp, %rdi
callq 0x15a16
movq %r14, %rdi
callq 0x7990
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/counter/gc.cpp
// Function: yrmcds::counter::gc_thread::run()
void gc_thread::run() {
    using namespace std::chrono;
    auto t1 = steady_clock::now();

    gc();
    g_stats.objects.store(m_objects, std::memory_order_relaxed);
    g_stats.used_memory.store(m_used_memory, std::memory_order_relaxed);
    g_stats.conflicts.store(m_conflicts, std::memory_order_relaxed);
    g_stats.gc_count.fetch_add(1, std::memory_order_relaxed);

    auto t2 = steady_clock::now();
    std::uint64_t us = (std::uint64_t)duration_cast<microseconds>(t2-t1).count();
    g_stats.last_gc_elapsed.store(us, std::memory_order_relaxed);
    g_stats.total_gc_elapsed.fetch_add(us, std::memory_order_relaxed);

    cybozu::logger::debug() << "Semaphore GC end: elapsed=" << us
                            << "us, survived=" << m_objects;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0x76e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x1e696
movl 0x18(%rbx), %eax
leaq 0x1d712(%rip), %r15     # 0x3bd00
movl %eax, (%r15)
movq 0x20(%rbx), %rax
movq %rax, 0x8(%r15)
movl 0x1c(%rbx), %eax
movl %eax, 0x10(%r15)
lock
incl 0x14(%r15)
callq 0x76e0
subq %r14, %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, 0x8(%rsp)
movq %rax, 0x18(%r15)
lock
addq %rax, 0x20(%r15)
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x9360
leaq 0xa490(%rip), %rsi      # 0x28ac9
movq %r14, %rdi
callq 0x1e78a
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0xf538
leaq 0xa48f(%rip), %rsi      # 0x28ae4
movq %rax, %rdi
callq 0x15362
addq $0x18, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0xf382
leaq 0x10(%rsp), %rdi
callq 0x86e4
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x86e4
movq %rbx, %rdi
callq 0x7990
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/counter/gc.cpp
// Function: yrmcds::counter::gc_thread::gc()
void gc_thread::gc() {
    auto pred = [this](const cybozu::hash_key& k, object& obj) -> bool {
        if( obj.deletable() )
            return true;
        ++m_objects;
        ++m_objects_in_bucket;
        if( m_objects_in_bucket == 2 )
            ++m_conflicts;
        m_used_memory += sizeof(cybozu::hash_key) + k.length() + sizeof(object);
        return false;
    };

    for( auto it = m_hash.begin(); it != m_hash.end(); ++it ) {
        m_objects_in_bucket = 0;
        it->gc(pred);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movq 0x8(%rax), %r14
leaq 0x67(%rip), %r12        # 0x1e71c
leaq 0xa8(%rip), %r13        # 0x1e764
movq %rsp, %r15
cmpq 0x10(%rax), %r14
je 0x1e6fa
andl $0x0, 0x28(%rbx)
andq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movq %r12, 0x18(%rsp)
movq %r13, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1e7a2
movq %r15, %rdi
callq 0x8d90
addq $0x30, %r14
movq 0x10(%rbx), %rax
jmp 0x1e6bf
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8d90
movq %rbx, %rdi
callq 0x7990
nop
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/./cybozu/hash_map.hpp
// Function: cybozu::hash_map<yrmcds::counter::object>::bucket::gc(std::function<bool (cybozu::hash_key const&, yrmcds::counter::object&)> const&)
void gc(const std::function<bool(const hash_key&, T&)>& pred) {
            lock_guard g(m_lock);
            for( item** p = &m_objects; *p != nullptr; ) {
                item* to_delete = *p;
                if( pred(to_delete->key, to_delete->object) ) {
                    *p = to_delete->next;
                    delete to_delete;
                } else {
                    p = &(to_delete->next);
                }
            }
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x8b5e
leaq 0x28(%rbx), %r13
pushq $0x48
popq %r15
movq (%r13), %r12
testq %r12, %r12
je 0x1e802
leaq 0x30(%r12), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x13666
testb %al, %al
je 0x1e7f9
movq 0x40(%r12), %rax
movq %rax, (%r13)
movq %r12, %rdi
callq 0x11e84
movq %r12, %rdi
movq %r15, %rsi
callq 0x7520
jmp 0x1e7be
addq $0x40, %r12
movq %r12, %r13
jmp 0x1e7be
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x73e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x73e0
movq %r14, %rdi
callq 0x7990
// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/object.hpp
// Function: yrmcds::memcache::object::survive(std::vector<yrmcds::memcache::file_flusher, std::allocator<yrmcds::memcache::file_flusher>>&) const
void survive(std::vector<file_flusher>& flushers) const {
        ++ m_gc_old;
        if( m_gc_old != FLUSH_AGE || m_file.get() == nullptr )
            return;

        int new_fd = ::dup(m_file->fileno());
        if( new_fd == -1 ) {
            cybozu::logger::warning() << "Failed to dup a file descriptor";
            return;
        }
        flushers.emplace_back(new_fd);
    }

// Assembly:
pushq %rbx
subq $0x20, %rsp
movl 0x50(%rdi), %eax
incl %eax
movl %eax, 0x50(%rdi)
cmpl $0xa, %eax
jne 0x1eff7
movq 0x30(%rdi), %rax
testq %rax, %rax
je 0x1eff7
movq %rsi, %rbx
movl (%rax), %edi
callq 0x7820
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x1efd1
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x1f012
jmp 0x1eff7
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0xd0b4
leaq 0x9bc0(%rip), %rsi      # 0x28ba5
movq %rbx, %rdi
callq 0x1d0c4
leaq 0x10(%rsp), %rdi
callq 0x86e4
addq $0x20, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x86e4
movq %rbx, %rdi
callq 0x7990