// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/server.c
// Function: call
void call(client *c, int flags) {
    long long dirty, start, duration;
    int client_old_flags = c->flags;

    /* Sent the command to clients in MONITOR mode, only if the commands are
     * not generated from reading an AOF. */
    if (listLength(server.monitors) &&
        !server.loading &&
        !(c->cmd->flags & (CMD_SKIP_MONITOR|CMD_ADMIN)))
    {
        replicationFeedMonitors(c,server.monitors,c->db->id,c->argv,c->argc);
    }

    /* Initialization: clear the flags that must be set by the command on
     * demand, and initialize the array for additional commands propagation. */
    c->flags &= ~(CLIENT_FORCE_AOF|CLIENT_FORCE_REPL|CLIENT_PREVENT_PROP);
    redisOpArrayInit(&server.also_propagate);

    /* Call the command. */
    dirty = server.dirty;
    start = ustime();
    c->cmd->proc(c);
    duration = ustime()-start;
    dirty = server.dirty-dirty;
    if (dirty < 0) dirty = 0;

    /* When EVAL is called loading the AOF we don't want commands called
     * from Lua to go into the slowlog or to populate statistics. */
    if (server.loading && c->flags & CLIENT_LUA)
        flags &= ~(CMD_CALL_SLOWLOG | CMD_CALL_STATS);

    /* If the caller is Lua, we want to force the EVAL caller to propagate
     * the script if the command flag or client flag are forcing the
     * propagation. */
    if (c->flags & CLIENT_LUA && server.lua_caller) {
        if (c->flags & CLIENT_FORCE_REPL)
            server.lua_caller->flags |= CLIENT_FORCE_REPL;
        if (c->flags & CLIENT_FORCE_AOF)
            server.lua_caller->flags |= CLIENT_FORCE_AOF;
    }

    /* Log the command into the Slow log if needed, and populate the
     * per-command statistics that we show in INFO commandstats. */
    if (flags & CMD_CALL_SLOWLOG && c->cmd->proc != execCommand) {
        char *latency_event = (c->cmd->flags & CMD_FAST) ?
                              "fast-command" : "command";
        latencyAddSampleIfNeeded(latency_event,duration/1000);
        slowlogPushEntryIfNeeded(c->argv,c->argc,duration);
    }
    if (flags & CMD_CALL_STATS) {
        c->lastcmd->microseconds += duration;
        c->lastcmd->calls++;
    }

    /* Propagate the command into the AOF and replication link */
    if (flags & CMD_CALL_PROPAGATE &&
        (c->flags & CLIENT_PREVENT_PROP) != CLIENT_PREVENT_PROP)
    {
        int propagate_flags = PROPAGATE_NONE;

        /* Check if the command operated changes in the data set. If so
         * set for replication / AOF propagation. */
        if (dirty) propagate_flags |= (PROPAGATE_AOF|PROPAGATE_REPL);

        /* If the client forced AOF / replication of the command, set
         * the flags regardless of the command effects on the data set. */
        if (c->flags & CLIENT_FORCE_REPL) propagate_flags |= PROPAGATE_REPL;
        if (c->flags & CLIENT_FORCE_AOF) propagate_flags |= PROPAGATE_AOF;

        /* However prevent AOF / replication propagation if the command
         * implementatino called preventCommandPropagation() or similar,
         * or if we don't have the call() flags to do so. */
        if (c->flags & CLIENT_PREVENT_REPL_PROP ||
            !(flags & CMD_CALL_PROPAGATE_REPL))
                propagate_flags &= ~PROPAGATE_REPL;
        if (c->flags & CLIENT_PREVENT_AOF_PROP ||
            !(flags & CMD_CALL_PROPAGATE_AOF))
                propagate_flags &= ~PROPAGATE_AOF;

        /* Call propagate() only if at least one of AOF / replication
         * propagation is needed. */
        if (propagate_flags != PROPAGATE_NONE)
            propagate(c->cmd,c->db->id,c->argv,c->argc,propagate_flags);
    }

    /* Restore the old replication flags, since call() can be executed
     * recursively. */
    c->flags &= ~(CLIENT_FORCE_AOF|CLIENT_FORCE_REPL|CLIENT_PREVENT_PROP);
    c->flags |= client_old_flags &
        (CLIENT_FORCE_AOF|CLIENT_FORCE_REPL|CLIENT_PREVENT_PROP);

    /* Handle the alsoPropagate() API to handle commands that want to propagate
     * multiple separated commands. Note that alsoPropagate() is not affected
     * by CLIENT_PREVENT_PROP flag. */
    if (server.also_propagate.numops) {
        int j;
        redisOp *rop;

        if (flags & CMD_CALL_PROPAGATE) {
            for (j = 0; j < server.also_propagate.numops; j++) {
                rop = &server.also_propagate.ops[j];
                int target = rop->target;
                /* Whatever the command wish is, we honor the call() flags. */
                if (!(flags&CMD_CALL_PROPAGATE_AOF)) target &= ~PROPAGATE_AOF;
                if (!(flags&CMD_CALL_PROPAGATE_REPL)) target &= ~PROPAGATE_REPL;
                if (target)
                    propagate(rop->cmd,rop->dbid,rop->argv,rop->argc,target);
            }
        }
        redisOpArrayFree(&server.also_propagate);
    }
    server.stat_numcommands++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
movl %eax, -0x2c(%rbp)
movq 0x14464d(%rip), %rax    # 0x1783c0
cmpq $0x0, 0x28(%rax)
je 0x33dc3
cmpl $0x0, 0x144773(%rip)    # 0x1784f4
jne 0x33dc3
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x20(%rax), %eax
andl $0x810, %eax            # imm = 0x810
cmpl $0x0, %eax
jne 0x33dc3
movq -0x8(%rbp), %rdi
movq 0x14461d(%rip), %rsi    # 0x1783c0
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
movq -0x8(%rbp), %rax
movl 0x98(%rax), %ecx
andl $0xffe73fff, %ecx       # imm = 0xFFE73FFF
movl %ecx, 0x98(%rax)
leaq 0x1443f8(%rip), %rdi    # 0x1781d8
addq $0x790, %rdi            # imm = 0x790
callq 0x339a0
movq 0x144b05(%rip), %rax    # 0x1788f8
movq %rax, -0x18(%rbp)
callq 0x2ff30
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
callq 0x2ff30
subq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq 0x144ad2(%rip), %rax    # 0x1788f8
subq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x33e3d
movq $0x0, -0x18(%rbp)
cmpl $0x0, 0x1446b0(%rip)    # 0x1784f4
je 0x33e63
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x33e63
movl -0xc(%rbp), %eax
andl $-0x4, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x33edd
cmpq $0x0, 0x144d31(%rip)    # 0x178bb0
je 0x33edd
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0x33eae
movq 0x144d14(%rip), %rax    # 0x178bb0
movl 0x98(%rax), %ecx
orl $0x8000, %ecx           # imm = 0x8000
movl %ecx, 0x98(%rax)
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x33edb
movq 0x144ce7(%rip), %rax    # 0x178bb0
movl 0x98(%rax), %ecx
orl $0x4000, %ecx           # imm = 0x4000
movl %ecx, 0x98(%rax)
jmp 0x33edd
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x33f7e
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
leaq 0x41d15(%rip), %rcx     # 0x75c10
cmpq %rcx, 0x8(%rax)
je 0x33f7e
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x20(%rax), %edx
andl $0x2000, %edx           # imm = 0x2000
leaq 0x1046fe(%rip), %rax    # 0x138617
leaq 0x1046ad(%rip), %rcx    # 0x1385cd
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, 0x144cbd(%rip)    # 0x178bf0
je 0x33f66
movq -0x28(%rbp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
cmpq 0x144ca6(%rip), %rax    # 0x178bf0
jl 0x33f66
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, %rsi
callq 0xa1210
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x38(%rax), %esi
movq -0x28(%rbp), %rdx
callq 0x87c00
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x33fb1
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
addq 0x40(%rax), %rcx
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq 0x48(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x48(%rax)
movl -0xc(%rbp), %eax
andl $0xc, %eax
cmpl $0x0, %eax
je 0x340ae
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x180000, %eax         # imm = 0x180000
cmpl $0x180000, %eax         # imm = 0x180000
je 0x340ae
movl $0x0, -0x3c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x33ff1
movl -0x3c(%rbp), %eax
orl $0x3, %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0x3400e
movl -0x3c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x3402b
movl -0x3c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x100000, %eax         # imm = 0x100000
cmpl $0x0, %eax
jne 0x3404a
movl -0xc(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x34053
movl -0x3c(%rbp), %eax
andl $-0x3, %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x80000, %eax          # imm = 0x80000
cmpl $0x0, %eax
jne 0x34072
movl -0xc(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x3407b
movl -0x3c(%rbp), %eax
andl $-0x2, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x340ac
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %esi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdx
movq -0x8(%rbp), %rax
movl 0x38(%rax), %ecx
movl -0x3c(%rbp), %r8d
callq 0x33b80
jmp 0x340ae
movq -0x8(%rbp), %rax
movl 0x98(%rax), %ecx
andl $0xffe73fff, %ecx       # imm = 0xFFE73FFF
movl %ecx, 0x98(%rax)
movl -0x2c(%rbp), %ecx
andl $0x18c000, %ecx         # imm = 0x18C000
movq -0x8(%rbp), %rax
orl 0x98(%rax), %ecx
movl %ecx, 0x98(%rax)
cmpl $0x0, 0x14488c(%rip)    # 0x178970
je 0x341a8
movl -0xc(%rbp), %eax
andl $0xc, %eax
cmpl $0x0, %eax
je 0x34195
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl 0x144867(%rip), %eax    # 0x178970
jge 0x34193
movq 0x144852(%rip), %rax    # 0x178968
movslq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x4c(%rbp)
movl -0xc(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x34143
movl -0x4c(%rbp), %eax
andl $-0x2, %eax
movl %eax, -0x4c(%rbp)
movl -0xc(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x34157
movl -0x4c(%rbp), %eax
andl $-0x3, %eax
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x34183
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x48(%rbp), %rax
movl 0xc(%rax), %esi
movq -0x48(%rbp), %rax
movq (%rax), %rdx
movq -0x48(%rbp), %rax
movl 0x8(%rax), %ecx
movl -0x4c(%rbp), %r8d
callq 0x33b80
jmp 0x34185
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x34100
jmp 0x34195
leaq 0x14403c(%rip), %rdi    # 0x1781d8
addq $0x790, %rdi            # imm = 0x790
callq 0x33a70
movq 0x1443b9(%rip), %rax    # 0x178568
addq $0x1, %rax
movq %rax, 0x1443ae(%rip)    # 0x178568
addq $0x50, %rsp
popq %rbp
retq