// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
jne 0x87d65
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xbb200(%rip), %rsi     # 0x142f3d
callq 0x26300
cmpl $0x0, %eax
jne 0x87d65
callq 0x87cc0
movq -0x8(%rbp), %rdi
leaq 0xf0ee9(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
jmp 0x87f5b
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
jne 0x87db0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xc135d(%rip), %rsi     # 0x1490e3
callq 0x26300
cmpl $0x0, %eax
jne 0x87db0
movq -0x8(%rbp), %rdi
leaq 0xf043d(%rip), %rax     # 0x1781d8
movq 0x3f8(%rax), %rax
movq 0x28(%rax), %rsi
callq 0x43780
jmp 0x87f59
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
je 0x87dc8
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
jne 0x87f47
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xaf906(%rip), %rsi     # 0x1376e5
callq 0x26300
cmpl $0x0, %eax
jne 0x87f47
movq $0xa, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
jne 0x87e2e
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
leaq -0x10(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x49f20
cmpl $0x0, %eax
je 0x87e2e
jmp 0x87f5b
leaq 0xf03a3(%rip), %rax     # 0x1781d8
movq 0x3f8(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x27320
movq -0x8(%rbp), %rdi
callq 0x432a0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x45(%rbp)
je 0x87e83
leaq -0x28(%rbp), %rdi
callq 0x27380
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
setne %al
movb %al, -0x45(%rbp)
movb -0x45(%rbp), %al
testb $0x1, %al
jne 0x87e8f
jmp 0x87f34
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x437f0
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x43780
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x43780
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x43780
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movslq 0x8(%rax), %rsi
callq 0x437f0
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x87f23
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movq (%rax), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x43630
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x87ef4
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x87e52
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x43310
jmp 0x87f57
movq -0x8(%rbp), %rdi
leaq 0xbb77f(%rip), %rsi     # 0x1436d1
callq 0x42f90
jmp 0x87f59
jmp 0x87f5b
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)