// File: /workspace/github_c_makefile_star2_O3/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
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl 0x98(%rdi), %r12d
movq 0xcebb5(%rip), %rsi     # 0x101a90
cmpq $0x0, 0x28(%rsi)
movl %r12d, %eax
je 0x32f21
cmpl $0x0, 0xcecd8(%rip)     # 0x101bc4
movl %r12d, %eax
jne 0x32f21
movq 0x48(%rbx), %rax
movzwl 0x20(%rax), %ecx
movl %r12d, %eax
testl $0x810, %ecx            # imm = 0x810
jne 0x32f21
movq 0x10(%rbx), %rax
movl 0x30(%rax), %edx
movq 0x40(%rbx), %rcx
movl 0x38(%rbx), %r8d
movq %rbx, %rdi
callq 0x44409
movl 0x98(%rbx), %eax
andl $0xffe73fff, %eax       # imm = 0xFFE73FFF
movl %eax, 0x98(%rbx)
movq $0x0, 0xcf101(%rip) # 0x102038
movl $0x0, 0xcf0ff(%rip)     # 0x102040
movq 0xcf080(%rip), %rax     # 0x101fc8
movq %rax, (%rsp)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x26300
movq (%r14), %r15
movq 0x8(%r14), %r13
movq 0x48(%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x26300
movq (%r14), %rax
subq %r15, %rax
movq 0x8(%r14), %r14
subq %r13, %r14
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
movl 0x98(%rbx), %ecx
movl %ebp, %r15d
andl $-0x4, %r15d
btl $0x8, %ecx
cmovael %ebp, %r15d
cmpl $0x0, 0xcec19(%rip)     # 0x101bc4
cmovel %ebp, %r15d
movq 0xcf012(%rip), %rbp     # 0x101fc8
movl %ecx, %esi
shrl $0x8, %esi
movq 0xcf2be(%rip), %rdx     # 0x102280
testq %rdx, %rdx
setne %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0x32ff1
testw %cx, %cx
jns 0x32fe4
orb $-0x80, 0x99(%rdx)
movl 0x98(%rbx), %ecx
btl $0xe, %ecx
jae 0x32ff1
orb $0x40, 0x99(%rdx)
addq %rax, %r14
testb $0x1, %r15b
je 0x33067
movq 0x48(%rbx), %rax
movq 0x8(%rax), %rcx
cmpq 0xc9f07(%rip), %rcx     # 0xfcf10
je 0x33067
testb $0x20, 0x21(%rax)
leaq 0x8a691(%rip), %rax     # 0xbd6a7
leaq 0x8a640(%rip), %rdi     # 0xbd65d
cmoveq %rax, %rdi
movq 0xcf298(%rip), %rcx     # 0x1022c0
testq %rcx, %rcx
je 0x33058
movabsq $0x20c49ba5e353f7cf, %rdx # imm = 0x20C49BA5E353F7CF
movq %r14, %rax
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
cmpq %rcx, %rdx
jl 0x33058
movq %rdx, %rsi
callq 0x7eb75
movq 0x40(%rbx), %rdi
movl 0x38(%rbx), %esi
movq %r14, %rdx
callq 0x6d3ba
testb $0x2, %r15b
je 0x3308d
movq 0x50(%rbx), %rax
movdqu 0x40(%rax), %xmm0
movq %r14, %xmm1
shufpd $0x2, 0x88fdc(%rip), %xmm1 # xmm1 = xmm1[0],mem[1]
paddq %xmm0, %xmm1
movdqu %xmm1, 0x40(%rax)
testb $0xc, %r15b
setne %cl
movl 0x98(%rbx), %eax
movl %eax, %edx
notl %edx
testl $0x180000, %edx         # imm = 0x180000
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x33114
movl %eax, %ecx
shrl $0xe, %ecx
andl $0x3, %ecx
cmpq (%rsp), %rbp
movl $0x3, %r8d
cmovlel %ecx, %r8d
movl %r8d, %ecx
andl $0x1, %ecx
testl $0x100000, %eax         # imm = 0x100000
cmovnel %ecx, %r8d
testb $0x8, %r15b
cmovel %ecx, %r8d
movl %r8d, %ecx
andl $-0x2, %ecx
testl $0x80000, %eax          # imm = 0x80000
cmovnel %ecx, %r8d
testb $0x4, %r15b
cmovel %ecx, %r8d
testl %r8d, %r8d
je 0x33114
movq 0x48(%rbx), %rdi
movq 0x10(%rbx), %rax
movl 0x30(%rax), %esi
movq 0x40(%rbx), %rdx
movl 0x38(%rbx), %ecx
callq 0x32d75
movl 0x98(%rbx), %eax
andl $0xffe73fff, %eax       # imm = 0xFFE73FFF
andl $0x18c000, %r12d        # imm = 0x18C000
orl %eax, %r12d
movl %r12d, 0x98(%rbx)
movl 0xcef10(%rip), %eax     # 0x102040
testl %eax, %eax
je 0x331b9
testb $0xc, %r15b
sete %cl
testl %eax, %eax
setle %dl
orb %cl, %dl
jne 0x331ad
movl $0x18, %ebx
movq 0xceee4(%rip), %rcx     # 0x102038
xorl %r14d, %r14d
movl -0x8(%rcx,%rbx), %edx
movl %edx, %esi
andl $-0x2, %esi
testb $0x4, %r15b
cmovnel %edx, %esi
movl %esi, %r8d
andl $-0x3, %r8d
testb $0x8, %r15b
cmovnel %esi, %r8d
testl %r8d, %r8d
je 0x3319e
movq (%rcx,%rbx), %rdi
movl -0xc(%rcx,%rbx), %esi
movq -0x18(%rcx,%rbx), %rdx
movl -0x10(%rcx,%rbx), %ecx
callq 0x32d75
movq 0xceea0(%rip), %rcx     # 0x102038
movl 0xceea2(%rip), %eax     # 0x102040
incq %r14
movslq %eax, %rdx
addq $0x20, %rbx
cmpq %rdx, %r14
jl 0x33157
leaq 0xcee84(%rip), %rdi     # 0x102038
callq 0x32cd8
incq 0xcea78(%rip)           # 0x101c38
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq