// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x8867b(%rip), %rsi     # 0xa40cd
callq 0x12070
cmpl $0x0, %eax
jne 0x1ba8b
movq -0x10(%rbp), %rdi
movq 0xa3d99(%rip), %rsi     # 0xbf800
callq 0x24050
movq -0x10(%rbp), %rax
movl 0x88(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0x88(%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1bd08
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdi
callq 0x1b650
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x1baea
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdx
leaq 0x885fb(%rip), %rsi     # 0xa40d2
movb $0x0, %al
callq 0x24360
movl $0x0, -0x4(%rbp)
jmp 0x1bd08
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
cmpl $0x0, 0x10(%rax)
jle 0x1bb0c
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl 0x10(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jne 0x1bb24
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movq -0x10(%rbp), %rcx
movq 0x38(%rcx), %rdx
xorl %ecx, %ecx
subl 0x10(%rdx), %ecx
cmpl %ecx, %eax
jge 0x1bb4d
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rdx
leaq 0x885ad(%rip), %rsi     # 0xa40e7
movb $0x0, %al
callq 0x24360
movl $0x0, -0x4(%rbp)
jmp 0x1bd08
jmp 0x1bb4f
cmpq $0x0, 0xa35d9(%rip)     # 0xbf130
je 0x1bb97
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8c(%rax)
jne 0x1bb97
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
leaq -0x37b5(%rip), %rcx     # 0x183c0
cmpq %rcx, 0x8(%rax)
je 0x1bb97
movq -0x10(%rbp), %rdi
movq 0xa3d42(%rip), %rsi     # 0xbf8c8
callq 0x24050
movl $0x0, -0x4(%rbp)
jmp 0x1bd08
cmpq $0x0, 0xa3b59(%rip)     # 0xbf6f8
je 0x1bbdc
callq 0x1bd20
cmpl $0x0, %eax
je 0x1bbda
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl 0x20(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1bbda
movq -0x10(%rbp), %rdi
movq 0xa3d17(%rip), %rsi     # 0xbf8e0
callq 0x24050
movl $0x0, -0x4(%rbp)
jmp 0x1bd08
jmp 0x1bbdc
cmpl $0x0, 0xa3c05(%rip)     # 0xbf7e8
je 0x1bc3b
cmpl $0x0, 0xa3bbc(%rip)     # 0xbf7a8
jle 0x1bc3b
cmpl $-0x1, 0xa3bef(%rip)    # 0xbf7e4
jne 0x1bc3b
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl 0x20(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1bc1f
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
leaq -0x37c9(%rip), %rcx     # 0x18450
cmpq %rcx, 0x8(%rax)
jne 0x1bc3b
movq -0x10(%rbp), %rdi
movq 0xa3c7e(%rip), %rsi     # 0xbf8a8
callq 0x24050
movl $0x0, -0x4(%rbp)
jmp 0x1bd08
movq -0x10(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
je 0x1bcbc
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
leaq -0x380e(%rip), %rcx     # 0x18450
cmpq %rcx, 0x8(%rax)
je 0x1bcbc
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
leaq 0x21f0d(%rip), %rcx     # 0x3db80
cmpq %rcx, 0x8(%rax)
je 0x1bcbc
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
leaq 0x21f68(%rip), %rcx     # 0x3dbf0
cmpq %rcx, 0x8(%rax)
je 0x1bcbc
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
leaq 0x21fe3(%rip), %rcx     # 0x3dc80
cmpq %rcx, 0x8(%rax)
je 0x1bcbc
movq -0x10(%rbp), %rdi
leaq 0x88464(%rip), %rsi     # 0xa4112
callq 0x24320
movl $0x0, -0x4(%rbp)
jmp 0x1bd08
cmpl $0x0, 0xa3745(%rip)     # 0xbf408
je 0x1bcf3
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl 0x20(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0x1bcf3
movq -0x10(%rbp), %rdi
movq 0xa3bb3(%rip), %rsi     # 0xbf898
callq 0x24050
movl $0x0, -0x4(%rbp)
jmp 0x1bd08
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x1b8d0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)