// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl 0x98(%rdi), %r13d
movq 0xcb82c(%rip), %rsi     # 0xf9a90
cmpq $0x0, 0x28(%rsi)
movl %r13d, %eax
je 0x2e2a9
cmpl $0x0, 0xcb94f(%rip)     # 0xf9bc4
movl %r13d, %eax
jne 0x2e2a9
movq 0x48(%rbx), %rax
movzwl 0x20(%rax), %ecx
movl %r13d, %eax
testw $0x810, %cx             # imm = 0x810
jne 0x2e2a9
movq 0x10(%rbx), %rax
movl 0x30(%rax), %edx
movq 0x40(%rbx), %rcx
movl 0x38(%rbx), %r8d
movq %rbx, %rdi
callq 0x3d1ad
movl 0x98(%rbx), %eax
andl $0xffe73fff, %eax       # imm = 0xFFE73FFF
movl %eax, 0x98(%rbx)
andq $0x0, 0xcbd7c(%rip)     # 0xfa038
andl $0x0, 0xcbd7d(%rip)     # 0xfa040
movq 0xcbcfe(%rip), %rax     # 0xf9fc8
movq %rax, (%rsp)
callq 0x2b88b
movq %rax, %r15
movq 0x48(%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
callq 0x2b88b
movq %rax, %r14
movl 0x98(%rbx), %eax
movl %ebp, %r12d
andl $-0x4, %r12d
btl $0x8, %eax
cmovael %ebp, %r12d
cmpl $0x0, 0xcb8c0(%rip)     # 0xf9bc4
cmovel %ebp, %r12d
movq 0xcbcb9(%rip), %rbp     # 0xf9fc8
movl %eax, %edx
shrl $0x8, %edx
movq 0xcbf65(%rip), %rcx     # 0xfa280
testq %rcx, %rcx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x2e34a
testw %ax, %ax
jns 0x2e33d
orb $-0x80, 0x99(%rcx)
movl 0x98(%rbx), %eax
btl $0xe, %eax
jae 0x2e34a
orb $0x40, 0x99(%rcx)
subq %r15, %r14
testb $0x1, %r12b
je 0x2e3af
movq 0x48(%rbx), %rax
movq 0x8(%rax), %rcx
cmpq 0xc6bae(%rip), %rcx     # 0xf4f10
je 0x2e3af
testb $0x20, 0x21(%rax)
leaq 0x81228(%rip), %rax     # 0xaf597
leaq 0x811d7(%rip), %rdi     # 0xaf54d
cmoveq %rax, %rdi
movq 0xcbf3f(%rip), %rcx     # 0xfa2c0
testq %rcx, %rcx
je 0x2e3a0
movl $0x3e8, %esi            # imm = 0x3E8
movq %r14, %rax
cqto
idivq %rsi
cmpq %rcx, %rax
jl 0x2e3a0
movq %rax, %rsi
callq 0x71e85
movq 0x40(%rbx), %rdi
movl 0x38(%rbx), %esi
movq %r14, %rdx
callq 0x621aa
testb $0x2, %r12b
je 0x2e3d5
movq 0x50(%rbx), %rax
movdqu 0x40(%rax), %xmm0
movq %r14, %xmm1
shufpd $0x2, 0x80024(%rip), %xmm1 # xmm1 = xmm1[0],mem[1]
paddq %xmm0, %xmm1
movdqu %xmm1, 0x40(%rax)
testb $0xc, %r12b
sete %cl
movl 0x98(%rbx), %eax
movl %eax, %edx
notl %edx
testl $0x180000, %edx         # imm = 0x180000
sete %dl
orb %cl, %dl
jne 0x2e457
movl %eax, %ecx
shrl $0xe, %ecx
andl $0x3, %ecx
cmpq (%rsp), %rbp
pushq $0x3
popq %r8
cmovlel %ecx, %r8d
movl %r8d, %ecx
andl $0x1, %ecx
testl $0x100000, %eax         # imm = 0x100000
cmovnel %ecx, %r8d
testb $0x8, %r12b
cmovel %ecx, %r8d
movl %r8d, %ecx
andl $-0x2, %ecx
testl $0x80000, %eax          # imm = 0x80000
cmovnel %ecx, %r8d
testb $0x4, %r12b
cmovel %ecx, %r8d
testl %r8d, %r8d
je 0x2e457
movq 0x48(%rbx), %rdi
movq 0x10(%rbx), %rax
movl 0x30(%rax), %esi
movq 0x40(%rbx), %rdx
movl 0x38(%rbx), %ecx
callq 0x2e12f
movl 0x98(%rbx), %eax
andl $0xffe73fff, %eax       # imm = 0xFFE73FFF
andl $0x18c000, %r13d        # imm = 0x18C000
orl %eax, %r13d
movl %r13d, 0x98(%rbx)
movl 0xcbbcd(%rip), %eax     # 0xfa040
testl %eax, %eax
je 0x2e4e7
testb $0xc, %r12b
je 0x2e4db
pushq $0x18
popq %rbx
xorl %r14d, %r14d
movslq %eax, %rcx
cmpq %rcx, %r14
jge 0x2e4db
movq 0xcbba6(%rip), %rcx     # 0xfa038
movl -0x8(%rcx,%rbx), %edx
movl %edx, %esi
andl $-0x2, %esi
testb $0x4, %r12b
cmovnel %edx, %esi
movl %esi, %r8d
andl $-0x3, %r8d
testb $0x8, %r12b
cmovnel %esi, %r8d
testl %r8d, %r8d
je 0x2e4d2
movq (%rcx,%rbx), %rdi
movl -0xc(%rcx,%rbx), %esi
movq -0x18(%rcx,%rbx), %rdx
movl -0x10(%rcx,%rbx), %ecx
callq 0x2e12f
movl 0xcbb6e(%rip), %eax     # 0xfa040
incq %r14
addq $0x20, %rbx
jmp 0x2e483
leaq 0xcbb56(%rip), %rdi     # 0xfa038
callq 0x2e0a6
incq 0xcb74a(%rip)           # 0xf9c38
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq