// File: cybozu[P]yrmcds/src/counter/counter.cpp
// Function: yrmcds::counter::response::stats()
void response::stats() {
    const statistics& s = g_stats;
    std::vector<char> body;
    add_stat_atomic(body, "objects", s.objects);
    add_stat_atomic(body, "total_objects", s.total_objects);
    add_stat_atomic(body, "used_memory", s.used_memory);
    add_stat_atomic(body, "conflicts", s.conflicts);
    add_stat_atomic(body, "gc_count", s.gc_count);
    add_stat_atomic(body, "last_gc_elapsed", s.last_gc_elapsed);
    add_stat_atomic(body, "total_gc_elapsed", s.total_gc_elapsed);
    add_stat_atomic(body, "curr_connections", s.curr_connections);
    add_stat_atomic(body, "total_connections", s.total_connections);
    add_stat_op(body, "command:noop", counter::command::Noop);
    add_stat_op(body, "command:get", counter::command::Get);
    add_stat_op(body, "command:acquire", counter::command::Acquire);
    add_stat_op(body, "command:release", counter::command::Release);
    add_stat_op(body, "command:stats", counter::command::Stats);
    add_stat_op(body, "command:dump", counter::command::Dump);

    char header[HEADER_SIZE];
    fill_header(header, counter::status::OK, body.size());
    cybozu::tcp_socket::iovec iov[] = {
        {header, HEADER_SIZE},
        {body.data(), body.size()},
    };
    m_socket.sendv(iov, 2, true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2d0(%rbp)
leaq 0x539ff(%rip), %rax     # 0xafe40
movq %rax, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x33ca0
leaq -0x49(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x8bd0
movq -0x2c8(%rbp), %rdx
leaq 0x208f2(%rip), %rsi     # 0x7cd5e
leaq -0x48(%rbp), %rdi
callq 0xa160
jmp 0x5c477
leaq 0x539c2(%rip), %rdx     # 0xafe40
leaq -0x28(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x5cdd0
jmp 0x5c48d
leaq -0x48(%rbp), %rdi
callq 0x83f0
leaq -0x49(%rbp), %rdi
callq 0x86a0
leaq -0x81(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x8bd0
movq -0x2d8(%rbp), %rdx
leaq 0x20898(%rip), %rsi     # 0x7cd58
leaq -0x80(%rbp), %rdi
callq 0xa160
jmp 0x5c4cb
leaq 0x5396e(%rip), %rdx     # 0xafe40
addq $0x40, %rdx
leaq -0x28(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x5ceb0
jmp 0x5c4e5
leaq -0x80(%rbp), %rdi
callq 0x83f0
leaq -0x81(%rbp), %rdi
callq 0x86a0
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x8bd0
movq -0x2e0(%rbp), %rdx
leaq 0x2084b(%rip), %rsi     # 0x7cd66
leaq -0xa8(%rbp), %rdi
callq 0xa160
jmp 0x5c529
leaq 0x53910(%rip), %rdx     # 0xafe40
addq $0x8, %rdx
leaq -0x28(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x5ceb0
jmp 0x5c546
leaq -0xa8(%rbp), %rdi
callq 0x83f0
leaq -0xa9(%rbp), %rdi
callq 0x86a0
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x8bd0
movq -0x2e8(%rbp), %rdx
leaq 0x216d4(%rip), %rsi     # 0x7dc53
leaq -0xd0(%rbp), %rdi
callq 0xa160
jmp 0x5c58d
leaq 0x538ac(%rip), %rdx     # 0xafe40
addq $0x10, %rdx
leaq -0x28(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x5cdd0
jmp 0x5c5aa
leaq -0xd0(%rbp), %rdi
callq 0x83f0
leaq -0xd1(%rbp), %rdi
callq 0x86a0
leaq -0xf9(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x8bd0
movq -0x2f0(%rbp), %rdx
leaq 0x2078f(%rip), %rsi     # 0x7cd72
leaq -0xf8(%rbp), %rdi
callq 0xa160
jmp 0x5c5f1
leaq 0x53848(%rip), %rdx     # 0xafe40
addq $0x14, %rdx
leaq -0x28(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x5cdd0
jmp 0x5c60e
leaq -0xf8(%rbp), %rdi
callq 0x83f0
leaq -0xf9(%rbp), %rdi
callq 0x86a0
leaq -0x121(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x8bd0
movq -0x2f8(%rbp), %rdx
leaq 0x20734(%rip), %rsi     # 0x7cd7b
leaq -0x120(%rbp), %rdi
callq 0xa160
jmp 0x5c655
leaq 0x537e4(%rip), %rdx     # 0xafe40
addq $0x18, %rdx
leaq -0x28(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x5ceb0
jmp 0x5c672
leaq -0x120(%rbp), %rdi
callq 0x83f0
leaq -0x121(%rbp), %rdi
callq 0x86a0
leaq -0x149(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x8bd0
movq -0x300(%rbp), %rdx
leaq 0x206e0(%rip), %rsi     # 0x7cd8b
leaq -0x148(%rbp), %rdi
callq 0xa160
jmp 0x5c6b9
leaq 0x53780(%rip), %rdx     # 0xafe40
addq $0x20, %rdx
leaq -0x28(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x5ceb0
jmp 0x5c6d6
leaq -0x148(%rbp), %rdi
callq 0x83f0
leaq -0x149(%rbp), %rdi
callq 0x86a0
leaq -0x171(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x8bd0
movq -0x308(%rbp), %rdx
leaq 0x2068d(%rip), %rsi     # 0x7cd9c
leaq -0x170(%rbp), %rdi
callq 0xa160
jmp 0x5c71d
leaq 0x5371c(%rip), %rdx     # 0xafe40
subq $-0x80, %rdx
leaq -0x28(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x5ceb0
jmp 0x5c73a
leaq -0x170(%rbp), %rdi
callq 0x83f0
leaq -0x171(%rbp), %rdi
callq 0x86a0
leaq -0x199(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x8bd0
movq -0x310(%rbp), %rdx
leaq 0x2063a(%rip), %rsi     # 0x7cdad
leaq -0x198(%rbp), %rdi
callq 0xa160
jmp 0x5c781
leaq 0x536b8(%rip), %rdx     # 0xafe40
addq $0x88, %rdx
leaq -0x28(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x5ceb0
jmp 0x5c7a1
leaq -0x198(%rbp), %rdi
callq 0x83f0
leaq -0x199(%rbp), %rdi
callq 0x86a0
leaq -0x1c1(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x8bd0
movq -0x318(%rbp), %rdx
leaq 0x205e5(%rip), %rsi     # 0x7cdbf
leaq -0x1c0(%rbp), %rdi
callq 0xa160
jmp 0x5c7e8
leaq -0x28(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
xorl %edx, %edx
callq 0x5cf90
jmp 0x5c7fc
leaq -0x1c0(%rbp), %rdi
callq 0x83f0
leaq -0x1c1(%rbp), %rdi
callq 0x86a0
leaq -0x1e9(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x8bd0
movq -0x320(%rbp), %rdx
leaq 0x20597(%rip), %rsi     # 0x7cdcc
leaq -0x1e8(%rbp), %rdi
callq 0xa160
jmp 0x5c843
leaq -0x28(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
movl $0x1, %edx
callq 0x5cf90
jmp 0x5c85a
leaq -0x1e8(%rbp), %rdi
callq 0x83f0
leaq -0x1e9(%rbp), %rdi
callq 0x86a0
leaq -0x211(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x8bd0
movq -0x328(%rbp), %rdx
leaq 0x20545(%rip), %rsi     # 0x7cdd8
leaq -0x210(%rbp), %rdi
callq 0xa160
jmp 0x5c8a1
leaq -0x28(%rbp), %rdi
leaq -0x210(%rbp), %rsi
movl $0x2, %edx
callq 0x5cf90
jmp 0x5c8b8
leaq -0x210(%rbp), %rdi
callq 0x83f0
leaq -0x211(%rbp), %rdi
callq 0x86a0
leaq -0x239(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x8bd0
movq -0x330(%rbp), %rdx
leaq 0x204f7(%rip), %rsi     # 0x7cde8
leaq -0x238(%rbp), %rdi
callq 0xa160
jmp 0x5c8ff
leaq -0x28(%rbp), %rdi
leaq -0x238(%rbp), %rsi
movl $0x3, %edx
callq 0x5cf90
jmp 0x5c916
leaq -0x238(%rbp), %rdi
callq 0x83f0
leaq -0x239(%rbp), %rdi
callq 0x86a0
leaq -0x261(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x8bd0
movq -0x338(%rbp), %rdx
leaq 0x204a9(%rip), %rsi     # 0x7cdf8
leaq -0x260(%rbp), %rdi
callq 0xa160
jmp 0x5c95d
leaq -0x28(%rbp), %rdi
leaq -0x260(%rbp), %rsi
movl $0x10, %edx
callq 0x5cf90
jmp 0x5c974
leaq -0x260(%rbp), %rdi
callq 0x83f0
leaq -0x261(%rbp), %rdi
callq 0x86a0
leaq -0x289(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x8bd0
movq -0x340(%rbp), %rdx
leaq 0x20459(%rip), %rsi     # 0x7ce06
leaq -0x288(%rbp), %rdi
callq 0xa160
jmp 0x5c9bb
leaq -0x28(%rbp), %rdi
leaq -0x288(%rbp), %rsi
movl $0x11, %edx
callq 0x5cf90
jmp 0x5c9d2
leaq -0x288(%rbp), %rdi
callq 0x83f0
leaq -0x289(%rbp), %rdi
callq 0x86a0
leaq -0x28(%rbp), %rdi
callq 0x34c00
movq -0x2d0(%rbp), %rdi
movl %eax, %ecx
leaq -0x295(%rbp), %rsi
xorl %edx, %edx
callq 0x5d3e0
jmp 0x5ca0c
leaq -0x295(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq $0xc, -0x2b8(%rbp)
leaq -0x28(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x34be0
movq -0x348(%rbp), %rdi
movq %rax, -0x2b0(%rbp)
callq 0x34c00
movq %rax, %rcx
movq -0x2d0(%rbp), %rax
movq %rcx, -0x2a8(%rbp)
movq (%rax), %rdi
leaq -0x2c0(%rbp), %rsi
movl $0x2, %edx
movl $0x1, %ecx
callq 0x5d4a0
jmp 0x5ca74
leaq -0x28(%rbp), %rdi
callq 0x2ed10
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5caa9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x83f0
leaq -0x49(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cada
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x83f0
leaq -0x81(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cb11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x83f0
leaq -0xa9(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cb48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x83f0
leaq -0xd1(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cb7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x83f0
leaq -0xf9(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cbb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x83f0
leaq -0x121(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cbed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x83f0
leaq -0x149(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cc24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x83f0
leaq -0x171(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cc5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x83f0
leaq -0x199(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cc92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x83f0
leaq -0x1c1(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5ccc9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x83f0
leaq -0x1e9(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cd00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x83f0
leaq -0x211(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cd37
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x83f0
leaq -0x239(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cd6b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x83f0
leaq -0x261(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5cd9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x83f0
leaq -0x289(%rbp), %rdi
callq 0x86a0
jmp 0x5cdb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2ed10
movq -0x58(%rbp), %rdi
callq 0x8bc0
nopl (%rax,%rax)