// File: /workspace/github_cpp_makefile_star2_O1/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 0x2328d(%rip), %rdi     # 0x46bc0
callq 0x1232b
testb %al, %al
je 0x23b8f
callq 0x76d0
movq %rax, %r14
movq %rbx, %rdi
callq 0x23bea
movq 0x30(%rbx), %rax
cmpq 0x38(%rbx), %rax
je 0x239de
leaq 0x23133(%rip), %rax     # 0x46a98
movl (%rax), %eax
xorl %esi, %esi
cmpl $0x2, %eax
setge %sil
leaq 0x110a2(%rip), %rdx     # 0x34a19
movq %rsp, %r15
movq %r15, %rdi
callq 0x9718
cmpb $0x1, (%r15)
jne 0x2399e
movq 0x8(%rsp), %rdi
leaq 0x1322b(%rip), %rsi     # 0x36bbf
movl $0x22, %edx
callq 0x7580
cmpb $0x1, (%rsp)
jne 0x239ba
movq 0x38(%rbx), %rsi
subq 0x30(%rbx), %rsi
sarq $0x3, %rsi
movq 0x8(%rsp), %rdi
callq 0x7330
cmpb $0x1, (%rsp)
jne 0x239d6
movq 0x8(%rsp), %rdi
leaq 0x13216(%rip), %rsi     # 0x36be2
movl $0xe, %edx
callq 0x7580
movq %rsp, %rdi
callq 0x8f94
movl 0x48(%rbx), %eax
leaq 0x234d8(%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)
movl 0x8c(%rbx), %eax
lock
addq %rax, 0x50(%r15)
callq 0x76d0
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 0x22ffa(%rip), %rax     # 0x46a98
movl (%rax), %eax
xorl %esi, %esi
cmpl $0x3, %eax
setge %sil
leaq 0x10797(%rip), %rdx     # 0x34247
movq %rsp, %r15
movq %r15, %rdi
callq 0x9718
cmpb $0x1, (%r15)
jne 0x23ad7
movq 0x8(%rsp), %rdi
leaq 0x13086(%rip), %rsi     # 0x36b53
movl $0x10, %edx
callq 0x7580
cmpb $0x1, (%rsp)
jne 0x23aea
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x7330
cmpb $0x1, (%rsp)
jne 0x23b06
movq 0x8(%rsp), %rdi
leaq 0x130f5(%rip), %rsi     # 0x36bf1
movl $0xc, %edx
callq 0x7580
cmpb $0x1, (%rsp)
jne 0x23b1c
movq 0x8(%rsp), %rdi
movl 0x88(%rbx), %esi
callq 0x7330
cmpb $0x1, (%rsp)
jne 0x23b38
movq 0x8(%rsp), %rdi
leaq 0x130d0(%rip), %rsi     # 0x36bfe
movl $0xa, %edx
callq 0x7580
cmpb $0x1, (%rsp)
jne 0x23b4e
movq 0x8(%rsp), %rdi
movl 0x8c(%rbx), %esi
callq 0x7330
cmpb $0x1, (%rsp)
jne 0x23b6a
movq 0x8(%rsp), %rdi
leaq 0x13006(%rip), %rsi     # 0x36b66
movl $0xb, %edx
callq 0x7580
cmpb $0x1, (%rsp)
jne 0x23b7d
movq 0x8(%rsp), %rdi
movl 0x48(%rbx), %esi
callq 0x7330
movq %rsp, %rdi
callq 0x8f94
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x22f02(%rip), %rax     # 0x46a98
movl (%rax), %esi
notl %esi
shrl $0x1f, %esi
leaq 0x10622(%rip), %rdx     # 0x341c6
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x9718
leaq 0x12fe2(%rip), %rsi     # 0x36b98
movq %rbx, %rdi
callq 0x240c8
movq %rsp, %rdi
callq 0x8f94
movl $0x2, %edi
callq 0x72d0
jmp 0x23bd6
jmp 0x23bd6
jmp 0x23bd6
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8f94
movq %rbx, %rdi
callq 0x79b0
nop