// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/server.c
// Function: commandCommand
void commandCommand(client *c) {
    dictIterator *di;
    dictEntry *de;

    if (c->argc == 1) {
        addReplyMultiBulkLen(c, dictSize(server.commands));
        di = dictGetIterator(server.commands);
        while ((de = dictNext(di)) != NULL) {
            addReplyCommand(c, dictGetVal(de));
        }
        dictReleaseIterator(di);
    } else if (!strcasecmp(c->argv[1]->ptr, "info")) {
        int i;
        addReplyMultiBulkLen(c, c->argc-2);
        for (i = 2; i < c->argc; i++) {
            addReplyCommand(c, dictFetchValue(server.commands, c->argv[i]->ptr));
        }
    } else if (!strcasecmp(c->argv[1]->ptr, "count") && c->argc == 2) {
        addReplyLongLong(c, dictSize(server.commands));
    } else if (!strcasecmp(c->argv[1]->ptr,"getkeys") && c->argc >= 3) {
        struct redisCommand *cmd = lookupCommand(c->argv[2]->ptr);
        int *keys, numkeys, j;

        if (!cmd) {
            addReplyErrorFormat(c,"Invalid command specified");
            return;
        } else if ((cmd->arity > 0 && cmd->arity != c->argc-2) ||
                   ((c->argc-2) < -cmd->arity))
        {
            addReplyError(c,"Invalid number of arguments specified for command");
            return;
        }

        keys = getKeysFromCommand(cmd,c->argv+2,c->argc-2,&numkeys);
        addReplyMultiBulkLen(c,numkeys);
        for (j = 0; j < numkeys; j++) addReplyBulk(c,c->argv[keys[j]+2]);
        getKeysFreeResult(keys);
    } else {
        addReplyError(c, "Unknown subcommand or wrong number of arguments.");
        return;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x38(%rdi), %r14
cmpq $0x1, %r14
jne 0x2b370
movq 0xce5a2(%rip), %rax     # 0xf98d8
movq 0x48(%rax), %rsi
addq 0x28(%rax), %rsi
movq %rbx, %rdi
callq 0x370d9
movq 0xce58b(%rip), %rdi     # 0xf98d8
callq 0x2a99f
movq %rax, %r14
movq %r14, %rdi
callq 0x2a9d3
testq %rax, %rax
je 0x2b3cf
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x2f0f1
jmp 0x2b355
movq 0x40(%rbx), %r12
movq 0x8(%r12), %rax
movq 0x8(%rax), %r15
leaq 0x965b0(%rip), %rsi     # 0xc1934
movq %r15, %rdi
callq 0x262f0
testl %eax, %eax
je 0x2b3e2
leaq 0x925e2(%rip), %rsi     # 0xbd979
movq %r15, %rdi
callq 0x262f0
cmpl $0x2, %r14d
jne 0x2b42a
testl %eax, %eax
jne 0x2b42a
movq 0xce524(%rip), %rax     # 0xf98d8
movq 0x48(%rax), %rsi
addq 0x28(%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x370a6
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2aa94
addq $-0x2, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x370d9
pushq $0x2
popq %r14
movslq 0x38(%rbx), %rax
cmpq %rax, %r14
jge 0x2b513
movq 0xce4cf(%rip), %rdi     # 0xf98d8
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rax
movq 0x8(%rax), %rsi
callq 0x2a900
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2f0f1
incq %r14
jmp 0x2b3f5
leaq 0x843e9(%rip), %rsi     # 0xaf81a
movq %r15, %rdi
callq 0x262f0
cmpl $0x3, %r14d
jl 0x2b491
testl %eax, %eax
jne 0x2b491
movq 0x10(%r12), %rax
movq 0x8(%rax), %rdi
callq 0x2e0f6
testq %rax, %rax
je 0x2b4ab
movl 0x10(%rax), %ecx
testl %ecx, %ecx
setg %sil
movl 0x38(%rbx), %edx
addl $-0x2, %edx
cmpl %edx, %ecx
setne %dil
andb %sil, %dil
negl %ecx
cmpl %ecx, %edx
setl %cl
orb %dil, %cl
cmpb $0x1, %cl
jne 0x2b4be
leaq 0x843b8(%rip), %rsi     # 0xaf83c
movq %rbx, %rdi
callq 0x36b6f
jmp 0x2b513
leaq 0x843d6(%rip), %rsi     # 0xaf86e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x36b6f
leaq 0x84370(%rip), %rsi     # 0xaf822
movq %rbx, %rdi
xorl %eax, %eax
callq 0x36b96
jmp 0x2b513
movq 0x40(%rbx), %rsi
addq $0x10, %rsi
leaq 0x4(%rsp), %r15
movq %rax, %rdi
movq %r15, %rcx
callq 0x3c774
movq %rax, %r14
movslq (%r15), %rsi
movq %rbx, %rdi
callq 0x370d9
xorl %r15d, %r15d
movslq 0x4(%rsp), %rax
cmpq %rax, %r15
jge 0x2b50b
movq 0x40(%rbx), %rax
movslq (%r14,%r15,4), %rcx
movq 0x10(%rax,%rcx,8), %rsi
movq %rbx, %rdi
callq 0x36fd9
incq %r15
jmp 0x2b4e7
movq %r14, %rdi
callq 0x3c783
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq