// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/slowlog.c
// Function: slowlogCommand
void slowlogCommand(client *c) {
    if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"reset")) {
        slowlogReset();
        addReply(c,shared.ok);
    } else if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"len")) {
        addReplyLongLong(c,listLength(server.slowlog));
    } else if ((c->argc == 2 || c->argc == 3) &&
               !strcasecmp(c->argv[1]->ptr,"get"))
    {
        long count = 10, sent = 0;
        listIter li;
        void *totentries;
        listNode *ln;
        slowlogEntry *se;

        if (c->argc == 3 &&
            getLongFromObjectOrReply(c,c->argv[2],&count,NULL) != C_OK)
            return;

        listRewind(server.slowlog,&li);
        totentries = addDeferredMultiBulkLength(c);
        while(count-- && (ln = listNext(&li))) {
            int j;

            se = ln->value;
            addReplyMultiBulkLen(c,4);
            addReplyLongLong(c,se->id);
            addReplyLongLong(c,se->time);
            addReplyLongLong(c,se->duration);
            addReplyMultiBulkLen(c,se->argc);
            for (j = 0; j < se->argc; j++)
                addReplyBulk(c,se->argv[j]);
            sent++;
        }
        setDeferredMultiBulkLength(c,totentries,sent);
    } else {
        addReplyError(c,
            "Unknown SLOWLOG subcommand or wrong # of args. Try GET, RESET, LEN.");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0x38(%rdi), %ebp
cmpl $0x2, %ebp
jne 0x6229e
movq 0x40(%rbx), %r15
movq 0x8(%r15), %rax
movq 0x8(%rax), %r14
leaq 0x57c51(%rip), %rsi     # 0xb9ea4
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x622e4
leaq 0x5dc9a(%rip), %rsi     # 0xbff04
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
jne 0x622b4
leaq 0x9762b(%rip), %rax     # 0xf98a8
movq 0x3f8(%rax), %rax
movq 0x28(%rax), %rsi
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x370a6
movl %ebp, %eax
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0x622c7
movq 0x40(%rbx), %r15
movq 0x8(%r15), %rax
movq 0x8(%rax), %r14
leaq 0x4c3aa(%rip), %rsi     # 0xae665
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x6230a
leaq 0x58363(%rip), %rsi     # 0xba631
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36b6f
callq 0x62204
leaq 0x98020(%rip), %rax     # 0xfa310
movq 0x8(%rax), %rsi
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36987
movq $0xa, 0x8(%rsp)
cmpl $0x3, %ebp
jne 0x62333
movq 0x10(%r15), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x3ab5e
testl %eax, %eax
jne 0x623ec
leaq 0x9756e(%rip), %rax     # 0xf98a8
movq 0x3f8(%rax), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x2702c
movq %rbx, %rdi
callq 0x36dad
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
pushq $0x4
popq %r13
subq $0x1, 0x8(%rsp)
jb 0x623dc
movq %r14, %rdi
callq 0x27046
testq %rax, %rax
je 0x623dc
movq 0x10(%rax), %rbp
movq %rbx, %rdi
movq %r13, %rsi
callq 0x370d9
movq 0x10(%rbp), %rsi
movq %rbx, %rdi
callq 0x370a6
movq 0x20(%rbp), %rsi
movq %rbx, %rdi
callq 0x370a6
movq 0x18(%rbp), %rsi
movq %rbx, %rdi
callq 0x370a6
movslq 0x8(%rbp), %rsi
movq %rbx, %rdi
callq 0x370d9
xorl %r15d, %r15d
movslq 0x8(%rbp), %rax
cmpq %rax, %r15
jge 0x623d7
movq (%rbp), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x36fd9
incq %r15
jmp 0x623b9
incq %r12
jmp 0x62362
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x36de9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop