// File: /workspace/github_c_makefile_star2_O0/zuocheng-liu[P]ae-memcached/src/memcached.c
// Function: stats_handler
int32_t stats_handler(char *command, int argc, char ** argv) {
    AE_NOTUSED(command); 
    AE_NOTUSED(argc); 
    conn *c = (conn*)argv;
    rel_time_t now = current_time;
    char temp[1024];
    pid_t pid = getpid();
    char *pos = temp;
    struct rusage usage;

    getrusage(RUSAGE_SELF, &usage);

    pos += sprintf(pos, "STAT pid %u\r\n", pid);
    pos += sprintf(pos, "STAT uptime %u\r\n", now);
    pos += sprintf(pos, "STAT time %ld\r\n", now + stats.started);
    pos += sprintf(pos, "STAT version " VERSION "\r\n");
    pos += sprintf(pos, "STAT pointer_size %ld\r\n", 8 * sizeof(void*));
    pos += sprintf(pos, "STAT rusage_user %ld.%06ld\r\n", usage.ru_utime.tv_sec, usage.ru_utime.tv_usec);
    pos += sprintf(pos, "STAT rusage_system %ld.%06ld\r\n", usage.ru_stime.tv_sec, usage.ru_stime.tv_usec);
    pos += sprintf(pos, "STAT curr_items %u\r\n", stats.curr_items);
    pos += sprintf(pos, "STAT total_items %u\r\n", stats.total_items);
    pos += sprintf(pos, "STAT bytes %llu\r\n", stats.curr_bytes);
    pos += sprintf(pos, "STAT curr_connections %u\r\n", stats.curr_conns - 1); /* ignore listening conn */
    pos += sprintf(pos, "STAT total_connections %u\r\n", stats.total_conns);
    pos += sprintf(pos, "STAT connection_structures %u\r\n", stats.conn_structs);
    pos += sprintf(pos, "STAT cmd_get %llu\r\n", stats.get_cmds);
    pos += sprintf(pos, "STAT cmd_set %llu\r\n", stats.set_cmds);
    pos += sprintf(pos, "STAT get_hits %llu\r\n", stats.get_hits);
    pos += sprintf(pos, "STAT get_misses %llu\r\n", stats.get_misses);
    pos += sprintf(pos, "STAT bytes_read %llu\r\n", stats.bytes_read);
    pos += sprintf(pos, "STAT bytes_written %llu\r\n", stats.bytes_written);
    pos += sprintf(pos, "STAT limit_maxbytes %llu\r\n", (unsigned long long) settings.maxbytes);
    pos += sprintf(pos, "END");
    out_string(c, temp);
    return COMMAND_OK;
}

// Assembly:
subq $0x4c8, %rsp            # imm = 0x4C8
movq %rdi, 0x4c0(%rsp)
movl %esi, 0x4bc(%rsp)
movq %rdx, 0x4b0(%rsp)
movq 0x4b0(%rsp), %rax
movq %rax, 0x4a8(%rsp)
leaq 0x951b(%rip), %rax      # 0x11350
movl (%rax), %eax
movl %eax, 0x4a4(%rsp)
callq 0x20f0
movl %eax, 0x9c(%rsp)
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
xorl %edi, %edi
movq %rsp, %rsi
callq 0x23c0
movq 0x90(%rsp), %rdi
movl 0x9c(%rsp), %edx
leaq 0x4660(%rip), %rsi      # 0xc4da
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
movl 0x4a4(%rsp), %edx
leaq 0x4639(%rip), %rsi      # 0xc4e8
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
movl 0x4a4(%rsp), %eax
movl %eax, %edx
leaq 0x940a(%rip), %rax      # 0x112f0
addq 0x40(%rax), %rdx
leaq 0x4608(%rip), %rsi      # 0xc4f9
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x45ea(%rip), %rsi      # 0xc509
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x45d1(%rip), %rsi      # 0xc51e
movl $0x40, %edx
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
movq (%rsp), %rdx
movq 0x8(%rsp), %rcx
leaq 0x45ad(%rip), %rsi      # 0xc536
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
leaq 0x4592(%rip), %rsi      # 0xc553
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x9301(%rip), %rax      # 0x112f0
movl (%rax), %edx
leaq 0x457a(%rip), %rsi      # 0xc572
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x92ca(%rip), %rax      # 0x112f0
movl 0x4(%rax), %edx
leaq 0x4557(%rip), %rsi      # 0xc587
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x9292(%rip), %rax      # 0x112f0
movq 0x8(%rax), %rdx
leaq 0x4534(%rip), %rsi      # 0xc59d
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x9259(%rip), %rax      # 0x112f0
movl 0x10(%rax), %edx
subl $0x1, %edx
leaq 0x450b(%rip), %rsi      # 0xc5af
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x921e(%rip), %rax      # 0x112f0
movl 0x14(%rax), %edx
leaq 0x44ee(%rip), %rsi      # 0xc5ca
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x91e6(%rip), %rax      # 0x112f0
movl 0x18(%rax), %edx
leaq 0x44d2(%rip), %rsi      # 0xc5e6
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x91ae(%rip), %rax      # 0x112f0
movq 0x20(%rax), %rdx
leaq 0x44b9(%rip), %rsi      # 0xc606
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x9175(%rip), %rax      # 0x112f0
movq 0x28(%rax), %rdx
leaq 0x4494(%rip), %rsi      # 0xc61a
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x913c(%rip), %rax      # 0x112f0
movq 0x30(%rax), %rdx
leaq 0x446f(%rip), %rsi      # 0xc62e
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x9103(%rip), %rax      # 0x112f0
movq 0x38(%rax), %rdx
leaq 0x444b(%rip), %rsi      # 0xc643
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x90ca(%rip), %rax      # 0x112f0
movq 0x48(%rax), %rdx
leaq 0x4429(%rip), %rsi      # 0xc65a
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x9091(%rip), %rax      # 0x112f0
movq 0x50(%rax), %rdx
leaq 0x4407(%rip), %rsi      # 0xc671
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x9000(%rip), %rax      # 0x11298
movq (%rax), %rdx
leaq 0x43e9(%rip), %rsi      # 0xc68b
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x44c9(%rip), %rsi      # 0xc799
movb $0x0, %al
callq 0x2420
movl %eax, %ecx
movq 0x90(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
movq 0x4a8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x4fc0
xorl %eax, %eax
addq $0x4c8, %rsp            # imm = 0x4C8
retq
nop