// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/t_list.c
// Function: serveClientBlockedOnList
int serveClientBlockedOnList(client *receiver, robj *key, robj *dstkey, redisDb *db, robj *value, int where)
{
    robj *argv[3];

    if (dstkey == NULL) {
        /* Propagate the [LR]POP operation. */
        argv[0] = (where == LIST_HEAD) ? shared.lpop :
                                          shared.rpop;
        argv[1] = key;
        propagate((where == LIST_HEAD) ?
            server.lpopCommand : server.rpopCommand,
            db->id,argv,2,PROPAGATE_AOF|PROPAGATE_REPL);

        /* BRPOP/BLPOP */
        addReplyMultiBulkLen(receiver,2);
        addReplyBulk(receiver,key);
        addReplyBulk(receiver,value);
    } else {
        /* BRPOPLPUSH */
        robj *dstobj =
            lookupKeyWrite(receiver->db,dstkey);
        if (!(dstobj &&
             checkType(receiver,dstobj,OBJ_LIST)))
        {
            /* Propagate the RPOP operation. */
            argv[0] = shared.rpop;
            argv[1] = key;
            propagate(server.rpopCommand,
                db->id,argv,2,
                PROPAGATE_AOF|
                PROPAGATE_REPL);
            rpoplpushHandlePush(receiver,dstkey,dstobj,
                value);
            /* Propagate the LPUSH operation. */
            argv[0] = shared.lpush;
            argv[1] = dstkey;
            argv[2] = value;
            propagate(server.lpushCommand,
                db->id,argv,3,
                PROPAGATE_AOF|
                PROPAGATE_REPL);
        } else {
            /* BRPOPLPUSH failed because of wrong
             * destination type. */
            return C_ERR;
        }
    }
    return C_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x5af6f
cmpl $0x0, -0x34(%rbp)
jne 0x5aed5
leaq 0x11dd78(%rip), %rax    # 0x178c40
movq 0x138(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x5aee7
leaq 0x11dd64(%rip), %rax    # 0x178c40
movq 0x130(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x5af11
leaq 0x11d2d4(%rip), %rax    # 0x1781d8
movq 0x358(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x5af23
leaq 0x11d2c0(%rip), %rax    # 0x1781d8
movq 0x360(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x30(%rax), %esi
leaq -0x50(%rbp), %rdx
movl $0x2, %ecx
movl $0x3, %r8d
callq 0x33b80
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x437f0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x43630
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x43630
jmp 0x5b054
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x4a6f0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x5afa6
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl $0x1, %edx
callq 0x490a0
cmpl $0x0, %eax
jne 0x5b049
leaq 0x11dc93(%rip), %rax    # 0x178c40
movq 0x130(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq 0x11d211(%rip), %rax    # 0x1781d8
movq 0x360(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x30(%rax), %esi
leaq -0x50(%rbp), %rdx
movl $0x2, %ecx
movl $0x3, %r8d
callq 0x33b80
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x5a840
leaq 0x11dc3b(%rip), %rax    # 0x178c40
movq 0x140(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0x11d1b1(%rip), %rax    # 0x1781d8
movq 0x350(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x30(%rax), %esi
leaq -0x50(%rbp), %rdx
movl $0x3, %r8d
movl %r8d, %ecx
callq 0x33b80
jmp 0x5b052
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5b05b
jmp 0x5b054
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)