// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/multi.c
// Function: execCommand
void execCommand(client *c) {
    int j;
    robj **orig_argv;
    int orig_argc;
    struct redisCommand *orig_cmd;
    int must_propagate = 0; /* Need to propagate MULTI/EXEC to AOF / slaves? */

    if (!(c->flags & CLIENT_MULTI)) {
        addReplyError(c,"EXEC without MULTI");
        return;
    }

    /* Check if we need to abort the EXEC because:
     * 1) Some WATCHed key was touched.
     * 2) There was a previous error while queueing commands.
     * A failed EXEC in the first case returns a multi bulk nil object
     * (technically it is not an error but a special behavior), while
     * in the second an EXECABORT error is returned. */
    if (c->flags & (CLIENT_DIRTY_CAS|CLIENT_DIRTY_EXEC)) {
        addReply(c, c->flags & CLIENT_DIRTY_EXEC ? shared.execaborterr :
                                                  shared.nullmultibulk);
        discardTransaction(c);
        goto handle_monitor;
    }

    /* Exec all the queued commands */
    unwatchAllKeys(c); /* Unwatch ASAP otherwise we'll waste CPU cycles */
    orig_argv = c->argv;
    orig_argc = c->argc;
    orig_cmd = c->cmd;
    addReplyMultiBulkLen(c,c->mstate.count);
    for (j = 0; j < c->mstate.count; j++) {
        c->argc = c->mstate.commands[j].argc;
        c->argv = c->mstate.commands[j].argv;
        c->cmd = c->mstate.commands[j].cmd;

        /* Propagate a MULTI request once we encounter the first write op.
         * This way we'll deliver the MULTI/..../EXEC block as a whole and
         * both the AOF and the replication link will have the same consistency
         * and atomicity guarantees. */
        if (!must_propagate && !(c->cmd->flags & CMD_READONLY)) {
            execCommandPropagateMulti(c);
            must_propagate = 1;
        }

        call(c,CMD_CALL_FULL);

        /* Commands may alter argc/argv, restore mstate. */
        c->mstate.commands[j].argc = c->argc;
        c->mstate.commands[j].argv = c->argv;
        c->mstate.commands[j].cmd = c->cmd;
    }
    c->argv = orig_argv;
    c->argc = orig_argc;
    c->cmd = orig_cmd;
    discardTransaction(c);
    /* Make sure the EXEC command will be propagated as well if MULTI
     * was already propagated. */
    if (must_propagate) server.dirty++;

handle_monitor:
    /* Send EXEC to clients waiting data from MONITOR. We do it here
     * since the natural order of commands execution is actually:
     * MUTLI, EXEC, ... commands inside transaction ...
     * Instead EXEC is flagged as CMD_SKIP_MONITOR in the command
     * table, and we do it here with correct ordering. */
    if (listLength(server.monitors) && !server.loading)
        replicationFeedMonitors(c,server.monitors,c->db->id,c->argv,c->argc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x75c4a
movq -0x8(%rbp), %rdi
leaq 0xca5ec(%rip), %rsi     # 0x14022c
callq 0x42f90
jmp 0x75ec6
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x1020, %eax           # imm = 0x1020
cmpl $0x0, %eax
je 0x75cb8
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x75c8e
leaq 0x102fbf(%rip), %rax    # 0x178c40
movq 0xc8(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x75c9d
leaq 0x102fab(%rip), %rax    # 0x178c40
movq 0x58(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x42cc0
movq -0x8(%rbp), %rdi
callq 0x75930
jmp 0x75e6f
movq -0x8(%rbp), %rdi
callq 0x75980
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq 0x158(%rax), %rsi
callq 0x437f0
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x158(%rcx), %eax
jge 0x75e1c
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
cmpl $0x0, -0x2c(%rbp)
jne 0x75d9d
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x20(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x75d9d
movq -0x8(%rbp), %rdi
callq 0x75bb0
movl $0x1, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl $0xf, %esi
callq 0x33d50
movq -0x8(%rbp), %rax
movl 0x38(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movslq -0xc(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movslq -0xc(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movslq -0xc(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x75cfe
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rdi
callq 0x75930
cmpl $0x0, -0x2c(%rbp)
je 0x75e6d
leaq 0x102384(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0x102372(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
jmp 0x75e6f
leaq 0x102362(%rip), %rax    # 0x1781d8
movq 0x1e8(%rax), %rax
cmpq $0x0, 0x28(%rax)
je 0x75ec6
leaq 0x10234d(%rip), %rax    # 0x1781d8
cmpl $0x0, 0x31c(%rax)
jne 0x75ec6
movq -0x8(%rbp), %rdi
leaq 0x102339(%rip), %rax    # 0x1781d8
movq 0x1e8(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %edx
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x8(%rbp), %rax
movl 0x38(%rax), %r8d
callq 0x4e010
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)