// File: /workspace/github_cpp_makefile_star2_O3/cybozu[P]yrmcds/src/memcache/gc.cpp
// Function: yrmcds::memcache::gc_thread::run()
void gc_thread::run() {
    if( ! cybozu::has_ip_address(g_config.vip()) ) {
        cybozu::logger::error() << "VIP has been lost.  Exiting quickly...";
        std::quick_exit(2);
    }

    using namespace std::chrono;
    auto t1 = steady_clock::now();
    gc();
    if( ! m_new_slaves.empty() )
        cybozu::logger::info() << "Initial replication completed for "
                               << m_new_slaves.size() << " new slave(s).";
    g_stats.objects.store(m_objects, std::memory_order_relaxed);
    g_stats.objects_under_1k.store(m_objects_under_1k, std::memory_order_relaxed);
    g_stats.objects_under_4k.store(m_objects_under_4k, std::memory_order_relaxed);
    g_stats.objects_under_16k.store(m_objects_under_16k, std::memory_order_relaxed);
    g_stats.objects_under_64k.store(m_objects_under_64k, std::memory_order_relaxed);
    g_stats.objects_under_256k.store(m_objects_under_256k, std::memory_order_relaxed);
    g_stats.objects_under_1m.store(m_objects_under_1m, std::memory_order_relaxed);
    g_stats.objects_under_4m.store(m_objects_under_4m, std::memory_order_relaxed);
    g_stats.objects_huge.store(m_objects_huge, 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);
    g_stats.oldest_age.store(m_oldest_age, std::memory_order_relaxed);
    g_stats.largest_object_size.store(m_largest_object_size, std::memory_order_relaxed);
    g_stats.last_expirations.store(m_last_expirations, std::memory_order_relaxed);
    g_stats.last_evictions.store(m_last_evictions, std::memory_order_relaxed);
    g_stats.total_evictions.fetch_add(m_last_evictions, std::memory_order_relaxed);

    auto t2 = steady_clock::now();
    std::uint64_t us = static_cast<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() << "GC end: elapsed=" << us
                            << "us, expired=" << m_last_expirations
                            << ", evicted=" << m_last_evictions
                            << ", survived=" << m_objects;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x23be1(%rip), %rdi     # 0x46bc0
callq 0x12363
testb %al, %al
je 0x23240
callq 0x76c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2329a
movq 0x30(%rbx), %rax
cmpq 0x38(%rbx), %rax
je 0x2308d
leaq 0x23a77(%rip), %rax     # 0x46a88
movl (%rax), %eax
xorl %esi, %esi
cmpl $0x2, %eax
setge %sil
leaq 0x11a3a(%rip), %rdx     # 0x34a5d
movq %rsp, %r15
movq %r15, %rdi
callq 0x96e6
movb (%r15), %al
cmpb $0x1, %al
jne 0x2304e
movq 0x8(%rsp), %rdi
leaq 0x13b6e(%rip), %rsi     # 0x36baf
movl $0x22, %edx
callq 0x7570
movb (%rsp), %al
testb $0x1, %al
je 0x2306b
movq 0x38(%rbx), %rsi
subq 0x30(%rbx), %rsi
sarq $0x3, %rsi
movq 0x8(%rsp), %rdi
callq 0x7330
movb (%rsp), %al
testb $0x1, %al
je 0x23085
movq 0x8(%rsp), %rdi
leaq 0x13b57(%rip), %rsi     # 0x36bd2
movl $0xe, %edx
callq 0x7570
movq %rsp, %rdi
callq 0x8f4e
movl 0x48(%rbx), %eax
leaq 0x23e29(%rip), %r15     # 0x46ec0
movl %eax, (%r15)
movl 0x4c(%rbx), %eax
movl %eax, 0x4(%r15)
movl 0x50(%rbx), %eax
movl %eax, 0x8(%r15)
movl 0x54(%rbx), %eax
movl %eax, 0xc(%r15)
movl 0x58(%rbx), %eax
movl %eax, 0x10(%r15)
movl 0x5c(%rbx), %eax
movl %eax, 0x14(%r15)
movl 0x60(%rbx), %eax
movl %eax, 0x18(%r15)
movl 0x64(%rbx), %eax
movl %eax, 0x1c(%r15)
movl 0x68(%rbx), %eax
movl %eax, 0x20(%r15)
movq 0x70(%rbx), %rax
movq %rax, 0x28(%r15)
movl 0x78(%rbx), %eax
movl %eax, 0x30(%r15)
lock
incl 0x34(%r15)
movl 0x7c(%rbx), %eax
movl %eax, 0x38(%r15)
movq 0x80(%rbx), %rax
movq %rax, 0x40(%r15)
movl 0x88(%rbx), %eax
movl %eax, 0x48(%r15)
movl 0x8c(%rbx), %eax
movl %eax, 0x4c(%r15)
lock
addq %rax, 0x50(%r15)
callq 0x76c0
subq %r14, %rax
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
imulq %rcx
movq %rdx, %r14
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %r14
addq %rax, %r14
movq %r14, 0x58(%r15)
lock
addq %r14, 0x60(%r15)
leaq 0x23941(%rip), %rax     # 0x46a88
movl (%rax), %eax
xorl %esi, %esi
cmpl $0x3, %eax
setge %sil
leaq 0x110ee(%rip), %rdx     # 0x34247
movq %rsp, %r15
movq %r15, %rdi
callq 0x96e6
movb (%r15), %al
cmpb $0x1, %al
jne 0x23184
movq 0x8(%rsp), %rdi
leaq 0x139cc(%rip), %rsi     # 0x36b43
movl $0x10, %edx
callq 0x7570
movb (%rsp), %al
testb $0x1, %al
je 0x23198
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x7330
movb (%rsp), %al
testb $0x1, %al
je 0x231b5
movq 0x8(%rsp), %rdi
leaq 0x13a39(%rip), %rsi     # 0x36be1
movl $0xc, %edx
callq 0x7570
movb (%rsp), %al
testb $0x1, %al
je 0x231cc
movq 0x8(%rsp), %rdi
movl 0x88(%rbx), %esi
callq 0x7330
movb (%rsp), %al
testb $0x1, %al
je 0x231e9
movq 0x8(%rsp), %rdi
leaq 0x13a12(%rip), %rsi     # 0x36bee
movl $0xa, %edx
callq 0x7570
movb (%rsp), %al
testb $0x1, %al
je 0x23200
movq 0x8(%rsp), %rdi
movl 0x8c(%rbx), %esi
callq 0x7330
movb (%rsp), %al
testb $0x1, %al
je 0x2321d
movq 0x8(%rsp), %rdi
leaq 0x13946(%rip), %rsi     # 0x36b56
movl $0xb, %edx
callq 0x7570
movb (%rsp), %al
testb $0x1, %al
je 0x2322e
movq 0x8(%rsp), %rdi
movl 0x48(%rbx), %esi
callq 0x7330
movq %rsp, %rdi
callq 0x8f4e
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x23841(%rip), %rax     # 0x46a88
movl (%rax), %esi
notl %esi
shrl $0x1f, %esi
leaq 0x10f71(%rip), %rdx     # 0x341c6
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x96e6
leaq 0x13921(%rip), %rsi     # 0x36b88
movq %rbx, %rdi
callq 0x23790
movq %rsp, %rdi
callq 0x8f4e
movl $0x2, %edi
callq 0x72d0
jmp 0x23287
jmp 0x23287
jmp 0x23287
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8f4e
movq %rbx, %rdi
callq 0x79a0