// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/t_list.c
// Function: rpoplpushCommand
void rpoplpushCommand(client *c) {
    robj *sobj, *value;
    if ((sobj = lookupKeyWriteOrReply(c,c->argv[1],shared.nullbulk)) == NULL ||
        checkType(c,sobj,OBJ_LIST)) return;

    if (listTypeLength(sobj) == 0) {
        /* This may only happen after loading very old RDB files. Recent
         * versions of Redis delete keys of empty lists. */
        addReply(c,shared.nullbulk);
    } else {
        robj *dobj = lookupKeyWrite(c->db,c->argv[2]);
        robj *touchedkey = c->argv[1];

        if (dobj && checkType(c,dobj,OBJ_LIST)) return;
        value = listTypePop(sobj,LIST_TAIL);
        /* We saved touched key, and protect it, since rpoplpushHandlePush
         * may change the client command argument vector (it does not
         * currently). */
        incrRefCount(touchedkey);
        rpoplpushHandlePush(c,c->argv[2],dobj,value);

        /* listTypePop returns an object with its refcount incremented */
        decrRefCount(value);

        /* Delete the source list when it is empty */
        notifyKeyspaceEvent(NOTIFY_LIST,"rpop",touchedkey,c->db->id);
        if (listTypeLength(sobj) == 0) {
            dbDelete(c->db,touchedkey);
            notifyKeyspaceEvent(NOTIFY_GENERIC,"del",
                                touchedkey,c->db->id);
        }
        signalModifiedKey(c->db,touchedkey);
        decrRefCount(touchedkey);
        server.dirty++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0x11e31d(%rip), %rax    # 0x178c40
movq 0x50(%rax), %rdx
callq 0x4a780
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x5a94d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x490a0
cmpl $0x0, %eax
je 0x5a952
jmp 0x5aaa5
movq -0x10(%rbp), %rdi
callq 0x59140
cmpq $0x0, %rax
jne 0x5a97a
movq -0x8(%rbp), %rdi
leaq 0x11e2d4(%rip), %rax    # 0x178c40
movq 0x50(%rax), %rsi
callq 0x42cc0
jmp 0x5aaa5
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x4a6f0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x5a9ca
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x490a0
cmpl $0x0, %eax
je 0x5a9ca
jmp 0x5aaa5
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x59090
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rdi
callq 0x487b0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x5a840
movq -0x18(%rbp), %rdi
callq 0x48f70
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x10, %edi
leaq 0xdcb1f(%rip), %rsi     # 0x137545
callq 0x9ce20
movq -0x10(%rbp), %rdi
callq 0x59140
cmpq $0x0, %rax
jne 0x5aa6b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x4ac10
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x4, %edi
leaq 0xdea32(%rip), %rsi     # 0x139498
callq 0x9ce20
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x4aa60
movq -0x28(%rbp), %rdi
callq 0x48f70
leaq 0x11d74c(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0x11d73a(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)