// File: cybozu[P]yrmcds/src/memcache/handler.cpp
// Function: yrmcds::memcache::handler::dump_stats()
void handler::dump_stats() {
    using logger = cybozu::logger;

    if( m_is_slave ) {
        logger::info() << "memcache replication stats: "
                       << g_stats.repl_created << " created, "
                       << g_stats.repl_updated << " updated, "
                       << g_stats.repl_removed << " removed.";
        return;
    }

    // master
    std::uint64_t ops = 0;
    for( auto& v: g_stats.text_ops ) {
        ops += v.load(relaxed);
    }
    for( auto& v: g_stats.bin_ops ) {
        ops += v.load(relaxed);
    }
    logger::info() << "memcache master: "
                   << m_slaves.size() << " slaves, "
                   << g_stats.objects.load(relaxed) << " objects, "
                   << g_stats.curr_connections.load(relaxed) << " clients, "
                   << ops << " total ops.";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x100(%rbp)
testb $0x1, 0x38(%rax)
je 0x382d8
leaq -0x78(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x22390
movq -0x110(%rbp), %rdi
leaq 0x433e7(%rip), %rsi     # 0x7b5d9
callq 0x34030
movq %rax, -0x108(%rbp)
jmp 0x38200
movq -0x108(%rbp), %rdi
leaq 0x77df2(%rip), %rsi     # 0xb0000
addq $0x68, %rsi
callq 0x24e10
movq %rax, -0x118(%rbp)
jmp 0x38220
movq -0x118(%rbp), %rdi
leaq 0x433c8(%rip), %rsi     # 0x7b5f6
callq 0x2cd60
movq %rax, -0x120(%rbp)
jmp 0x3823c
movq -0x120(%rbp), %rdi
leaq 0x77db6(%rip), %rsi     # 0xb0000
addq $0x70, %rsi
callq 0x24e10
movq %rax, -0x128(%rbp)
jmp 0x3825c
movq -0x128(%rbp), %rdi
leaq 0x43397(%rip), %rsi     # 0x7b601
callq 0x2cd60
movq %rax, -0x130(%rbp)
jmp 0x38278
movq -0x130(%rbp), %rdi
leaq 0x77d7a(%rip), %rsi     # 0xb0000
addq $0x78, %rsi
callq 0x24e10
movq %rax, -0x138(%rbp)
jmp 0x38298
movq -0x138(%rbp), %rdi
leaq 0x43366(%rip), %rsi     # 0x7b60c
callq 0x22600
jmp 0x382ad
leaq -0x78(%rbp), %rdi
callq 0xa770
jmp 0x38724
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x78(%rbp), %rdi
callq 0xa770
jmp 0x38748
movq $0x0, -0x90(%rbp)
leaq 0x77d16(%rip), %rax     # 0xb0000
addq $0x140, %rax            # imm = 0x140
movq %rax, -0x98(%rbp)
leaq 0x77d02(%rip), %rax     # 0xb0000
addq $0x140, %rax            # imm = 0x140
movq %rax, -0xa0(%rbp)
leaq 0x77cee(%rip), %rax     # 0xb0000
addq $0x140, %rax            # imm = 0x140
addq $0xb8, %rax
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rax
cmpq -0xa8(%rbp), %rax
je 0x383ea
movq -0xa0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x148(%rbp)
movl -0x24(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x104e0
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x13c(%rbp)
decl %eax
subl $0x2, %eax
jb 0x383a3
jmp 0x38386
movl -0x13c(%rbp), %eax
subl $0x5, %eax
je 0x383b3
jmp 0x38393
movq -0x148(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x383c1
movq -0x148(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x383c1
movq -0x148(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq -0x90(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xa0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xa0(%rbp)
jmp 0x38325
leaq 0x77c0f(%rip), %rax     # 0xb0000
addq $0x1f8, %rax            # imm = 0x1F8
movq %rax, -0xb8(%rbp)
leaq 0x77bfb(%rip), %rax     # 0xb0000
addq $0x1f8, %rax            # imm = 0x1F8
movq %rax, -0xc0(%rbp)
leaq 0x77be7(%rip), %rax     # 0xb0000
addq $0x1f8, %rax            # imm = 0x1F8
addq $0x290, %rax            # imm = 0x290
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
je 0x384f1
movq -0xc0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x158(%rbp)
movl -0x3c(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x104e0
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x14c(%rbp)
decl %eax
subl $0x2, %eax
jb 0x384aa
jmp 0x3848d
movl -0x14c(%rbp), %eax
subl $0x5, %eax
je 0x384ba
jmp 0x3849a
movq -0x158(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x384c8
movq -0x158(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x384c8
movq -0x158(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq -0x90(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xc0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xc0(%rbp)
jmp 0x3842c
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x22390
movq -0x168(%rbp), %rdi
leaq 0x43104(%rip), %rsi     # 0x7b616
callq 0x3a5a0
movq %rax, -0x160(%rbp)
jmp 0x38520
movq -0x100(%rbp), %rdi
addq $0x78, %rdi
callq 0x3a5e0
movq -0x160(%rbp), %rdi
movq %rax, -0xe8(%rbp)
leaq -0xe8(%rbp), %rsi
callq 0x24e10
movq %rax, -0x170(%rbp)
jmp 0x38553
movq -0x170(%rbp), %rdi
leaq 0x430c7(%rip), %rsi     # 0x7b628
callq 0x22600
movq %rax, -0x178(%rbp)
jmp 0x3856f
leaq 0x77a8a(%rip), %rax     # 0xb0000
movq %rax, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x188(%rbp)
movl -0xc(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x104e0
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x17c(%rbp)
decl %eax
subl $0x2, %eax
jb 0x385c9
jmp 0x385ae
movl -0x17c(%rbp), %eax
subl $0x5, %eax
je 0x385d7
jmp 0x385bb
movq -0x188(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x385e3
movq -0x188(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x385e3
movq -0x188(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x178(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, -0xec(%rbp)
leaq -0xec(%rbp), %rsi
callq 0x24620
movq %rax, -0x190(%rbp)
jmp 0x38608
movq -0x190(%rbp), %rdi
leaq 0x42844(%rip), %rsi     # 0x7ae5a
callq 0x2cd60
movq %rax, -0x198(%rbp)
jmp 0x38624
leaq 0x779d5(%rip), %rax     # 0xb0000
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movl -0x54(%rbp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x104e0
movl %eax, -0x58(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x19c(%rbp)
decl %eax
subl $0x2, %eax
jb 0x38686
jmp 0x38669
movl -0x19c(%rbp), %eax
subl $0x5, %eax
je 0x38696
jmp 0x38676
movq -0x1a8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x386a4
movq -0x1a8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x386a4
movq -0x1a8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x198(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0xf8(%rbp), %rsi
callq 0x24e10
movq %rax, -0x1b0(%rbp)
jmp 0x386cb
movq -0x1b0(%rbp), %rdi
leaq 0x4278c(%rip), %rsi     # 0x7ae65
callq 0x2cd60
movq %rax, -0x1b8(%rbp)
jmp 0x386e7
movq -0x1b8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x24e10
movq %rax, -0x1c0(%rbp)
jmp 0x38703
movq -0x1c0(%rbp), %rdi
leaq 0x4275f(%rip), %rsi     # 0x7ae70
callq 0x225a0
jmp 0x38718
leaq -0xe0(%rbp), %rdi
callq 0xa770
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0xa770
movq -0x80(%rbp), %rdi
callq 0x8bc0
nopw %cs:(%rax,%rax)