// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x38(%rax)
jne 0x2f7e9
movq -0x8(%rbp), %rdi
movq 0x148a77(%rip), %rax    # 0x178208
movq 0x28(%rax), %rsi
movq 0x148a6c(%rip), %rax    # 0x178208
addq 0x48(%rax), %rsi
callq 0x437f0
movq 0x148a5c(%rip), %rdi    # 0x178208
callq 0x2e400
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x2f7db
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x35370
jmp 0x2f7b5
movq -0x10(%rbp), %rdi
callq 0x2e600
jmp 0x2fa14
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x11b454(%rip), %rsi    # 0x14ac54
callq 0x26300
cmpl $0x0, %eax
jne 0x2f877
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
subl $0x2, %eax
movslq %eax, %rsi
callq 0x437f0
movl $0x2, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x2f872
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq 0x1489c6(%rip), %rdi    # 0x178208
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rsi
callq 0x2e280
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x35370
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2f827
jmp 0x2fa12
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x1171ab(%rip), %rsi    # 0x146a39
callq 0x26300
cmpl $0x0, %eax
jne 0x2f8c6
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
jne 0x2f8c6
movq -0x8(%rbp), %rdi
movq 0x14895b(%rip), %rax    # 0x178208
movq 0x28(%rax), %rsi
movq 0x148950(%rip), %rax    # 0x178208
addq 0x48(%rax), %rsi
callq 0x43780
jmp 0x2fa10
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x108fbd(%rip), %rsi    # 0x13889a
callq 0x26300
cmpl $0x0, %eax
jne 0x2f9fc
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
jl 0x2f9fc
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x33b00
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x2f930
movq -0x8(%rbp), %rdi
leaq 0x108f7e(%rip), %rsi    # 0x1388a2
movb $0x0, %al
callq 0x42fd0
jmp 0x2fa14
movq -0x28(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jle 0x2f94f
movq -0x28(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
movl 0x38(%rcx), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jne 0x2f966
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
subl $0x2, %eax
movq -0x28(%rbp), %rdx
xorl %ecx, %ecx
subl 0x10(%rdx), %ecx
cmpl %ecx, %eax
jge 0x2f97b
movq -0x8(%rbp), %rdi
leaq 0x108f4b(%rip), %rsi    # 0x1388bc
callq 0x42f90
jmp 0x2fa14
jmp 0x2f97d
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rsi
addq $0x10, %rsi
movq -0x8(%rbp), %rax
movl 0x38(%rax), %edx
subl $0x2, %edx
leaq -0x34(%rbp), %rcx
callq 0x4cf00
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x437f0
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x2f9f1
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x30(%rbp), %rcx
movslq -0x38(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x43630
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2f9b8
movq -0x30(%rbp), %rdi
callq 0x4cf70
jmp 0x2fa0e
movq -0x8(%rbp), %rdi
leaq 0x108ee7(%rip), %rsi    # 0x1388ee
callq 0x42f90
jmp 0x2fa14
jmp 0x2fa10
jmp 0x2fa12
jmp 0x2fa14
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)