// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/server.c
// Function: processCommand
int processCommand(client *c) {
    /* The QUIT command is handled separately. Normal command procs will
     * go through checking for replication and QUIT will cause trouble
     * when FORCE_REPLICATION is enabled and would be implemented in
     * a regular command proc. */
    if (!strcasecmp(c->argv[0]->ptr,"quit")) {
        addReply(c,shared.ok);
        c->flags |= CLIENT_CLOSE_AFTER_REPLY;
        return C_ERR;
    }

    /* Now lookup the command and check ASAP about trivial error conditions
     * such as wrong arity, bad command name and so forth. */
    c->cmd = c->lastcmd = lookupCommand(c->argv[0]->ptr);
    if (!c->cmd) {
        addReplyErrorFormat(c,"unknown command '%s'",
            (char*)c->argv[0]->ptr);
        return C_OK;
    } else if ((c->cmd->arity > 0 && c->cmd->arity != c->argc) ||
               (c->argc < -c->cmd->arity)) {
        addReplyErrorFormat(c,"wrong number of arguments for '%s' command",
            c->cmd->name);
        return C_OK;
    }

    /* Check if the user is authenticated */
    if (server.requirepass && !c->authenticated && c->cmd->proc != authCommand)
    {
        addReply(c,shared.noautherr);
        return C_OK;
    }

    /* Handle the maxmemory directive. */
    if (server.maxmemory) {
        if (getMemoryWarningLevel() && c->cmd->flags & CMD_DENYOOM) {
            addReply(c, shared.oomerr);
            return C_OK;
        }
    }

    /* Don't accept write commands if there are problems persisting on disk
     * and if this is a master instance. */
    if ((server.stop_writes_on_bgsave_err &&
        server.saveparamslen > 0 &&
        server.lastbgsave_status == C_ERR) &&
        (c->cmd->flags & CMD_WRITE ||
         c->cmd->proc == pingCommand))
    {
        addReply(c, shared.bgsaveerr);
        return C_OK;
    }

    /* Only allow SUBSCRIBE and UNSUBSCRIBE in the context of Pub/Sub */
    if (c->flags & CLIENT_PUBSUB &&
        c->cmd->proc != pingCommand &&
        c->cmd->proc != subscribeCommand &&
        c->cmd->proc != isubscribeCommand &&
        c->cmd->proc != unsubscribeCommand) {
        addReplyError(c,"only SUBSCRIBE / ISUBSCRIBE / UNSUBSCRIBE / QUIT allowed in this context");
        return C_OK;
    }

    /* Loading DB? Return an error if the command has not the
     * CMD_LOADING flag. */
    if (server.loading && !(c->cmd->flags & CMD_LOADING)) {
        addReply(c, shared.loadingerr);
        return C_OK;
    }

    call(c,CMD_CALL_FULL);
    return C_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq (%rax), %rax
movq 0x8(%rax), %r14
leaq 0x3719c(%rip), %rsi     # 0x530fd
movq %r14, %rdi
callq 0x12090
testl %eax, %eax
je 0x1bfab
movq 0x5313c(%rip), %rdi     # 0x6f0b0
movq %r14, %rsi
callq 0x18dfb
movq %rax, 0x40(%rbx)
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x1bfcb
movl 0x10(%rax), %ecx
movl 0x28(%rbx), %edx
testl %ecx, %ecx
jle 0x1bf99
cmpl %edx, %ecx
movl %ecx, %edx
jne 0x1bf9f
negl %ecx
cmpl %ecx, %edx
jge 0x1bfee
movq (%rax), %rdx
leaq 0x3716e(%rip), %rsi     # 0x53117
jmp 0x1bfdd
movq 0x537ee(%rip), %rsi     # 0x6f7a0
movq %rbx, %rdi
callq 0x21c5a
orb $0x40, 0x88(%rbx)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x1c12d
movq 0x30(%rbx), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdx
leaq 0x37125(%rip), %rsi     # 0x53102
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0x22033
jmp 0x1c12d
cmpq $0x0, 0x530da(%rip)     # 0x6f0d0
je 0x1c005
cmpl $0x0, 0x8c(%rbx)
je 0x1c102
cmpq $0x0, 0x5368b(%rip)     # 0x6f698
je 0x1c053
callq 0x1fd86
movq %rax, %rcx
movq 0x5367a(%rip), %rax     # 0x6f698
shrq $0x2, %rax
movabsq $0x28f5c28f5c28f5c3, %rdx # imm = 0x28F5C28F5C28F5C3
mulq %rdx
shrq $0x2, %rdx
imulq $0x5f, %rdx, %rax
cmpq %rax, %rcx
ja 0x1c045
imulq $0x4b, %rdx, %rax
cmpq %rax, %rcx
jbe 0x1c053
movq 0x38(%rbx), %rax
testb $0x4, 0x20(%rax)
jne 0x1c11c
cmpl $0x0, 0x5372e(%rip)     # 0x6f788
je 0x1c085
cmpl $0x0, 0x536e5(%rip)     # 0x6f748
jle 0x1c085
cmpl $-0x1, 0x53718(%rip)    # 0x6f784
jne 0x1c085
movq 0x38(%rbx), %rax
testb $0x1, 0x20(%rax)
jne 0x1c0aa
leaq -0x2901(%rip), %rcx     # 0x1977e
cmpq %rcx, 0x8(%rax)
je 0x1c0aa
testb $0x4, 0x8a(%rbx)
jne 0x1c0c2
cmpl $0x0, 0x53313(%rip)     # 0x6f3a8
je 0x1c0b3
movq 0x38(%rbx), %rax
testb $0x2, 0x21(%rax)
jne 0x1c0b3
movq 0x53790(%rip), %rsi     # 0x6f838
jmp 0x1c123
movq 0x53797(%rip), %rsi     # 0x6f848
jmp 0x1c123
movq %rbx, %rdi
movl $0x3, %esi
callq 0x1be2d
jmp 0x1c12b
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rax
cmpq 0x51eef(%rip), %rax     # 0x6dfc0
je 0x1c08e
cmpq 0x51eae(%rip), %rax     # 0x6df88
je 0x1c08e
leaq -0x2965(%rip), %rcx     # 0x1977e
cmpq %rcx, %rax
je 0x1c08e
cmpq 0x51ea9(%rip), %rax     # 0x6df98
je 0x1c08e
leaq 0x3704a(%rip), %rsi     # 0x53142
movq %rbx, %rdi
callq 0x2200c
jmp 0x1c12b
leaq -0x29ed(%rip), %rcx     # 0x1971c
cmpq %rcx, 0x8(%rax)
je 0x1c005
movq 0x5374e(%rip), %rsi     # 0x6f868
jmp 0x1c123
movq 0x5375d(%rip), %rsi     # 0x6f880
movq %rbx, %rdi
callq 0x21c5a
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq