// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/db.c
// Function: moveCommand
void moveCommand(client *c) {
    robj *o;
    redisDb *src, *dst;
    int srcid;
    long long dbid, expire;

    if (server.cluster_enabled) {
        addReplyError(c,"MOVE is not allowed in cluster mode");
        return;
    }

    /* Obtain source and target DB pointers */
    src = c->db;
    srcid = c->db->id;

    if (getLongLongFromObject(c->argv[2],&dbid) == C_ERR ||
        dbid < INT_MIN || dbid > INT_MAX ||
        selectDb(c,dbid) == C_ERR)
    {
        addReply(c,shared.outofrangeerr);
        return;
    }
    dst = c->db;
    selectDb(c,srcid); /* Back to the source DB */

    /* If the user is moving using as target the same
     * DB as the source DB it is probably an error. */
    if (src == dst) {
        addReply(c,shared.sameobjecterr);
        return;
    }

    /* Check if the element exists and get a reference */
    o = lookupKeyWrite(c->db,c->argv[1]);
    if (!o) {
        addReply(c,shared.czero);
        return;
    }
    expire = getExpire(c->db,c->argv[1]);

    /* Return zero if the key already exists in the target DB */
    if (lookupKeyWrite(dst,c->argv[1]) != NULL) {
        addReply(c,shared.czero);
        return;
    }
    dbAdd(dst,c->argv[1],o);
    if (expire != -1) setExpire(dst,c->argv[1],expire);
    incrRefCount(o);

    /* OK! key moved, free the entry in the source DB */
    dbDelete(src,c->argv[1]);
    server.dirty++;
    addReply(c,shared.cone);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0xc02cd(%rip), %rbp     # 0x106858
cmpl $0x0, 0x98c(%rbp)
je 0x465b1
leaq 0x7da8d(%rip), %rsi     # 0xc4028
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3ffcb
movq 0x10(%rbx), %r14
movq 0x40(%rbx), %rax
movl 0x30(%r14), %r12d
movq 0x10(%rax), %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x44a53
cmpl $-0x1, %eax
sete %cl
movq (%r15), %rax
movslq %eax, %rdx
cmpq %rax, %rdx
setne %dl
orb %cl, %dl
je 0x46609
leaq 0xc0cc5(%rip), %rax     # 0x1072b0
movq 0x90(%rax), %rsi
movq %rbx, %rdi
callq 0x3fc19
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %rax, %rax
js 0x465e4
cmpl %eax, 0x600(%rbp)
jle 0x465e4
movl %eax, %r15d
shlq $0x6, %r15
addq 0x28(%rbp), %r15
movq %r15, 0x10(%rbx)
testl %r12d, %r12d
js 0x4663f
cmpl %r12d, 0x600(%rbp)
jle 0x4663f
shlq $0x6, %r12
addq 0x28(%rbp), %r12
movq %r12, 0x10(%rbx)
cmpq %r15, %r14
je 0x466bb
movq 0x10(%rbx), %r12
movq 0x40(%rbx), %rax
movq 0x8(%rax), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x44eae
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x44dec
testq %rax, %rax
je 0x466ab
movq %rax, %r12
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x46484
movq %rax, 0x8(%rsp)
movq 0x40(%rbx), %rax
movq 0x8(%rax), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x44eae
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x44dec
testq %rax, %rax
je 0x466ce
leaq 0xc0bfe(%rip), %rax     # 0x1072b0
movq 0x20(%rax), %rsi
jmp 0x465f2
leaq 0xc0bee(%rip), %rax     # 0x1072b0
movq 0x88(%rax), %rsi
jmp 0x465f2
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x45007
movq 0x8(%rsp), %rdx
cmpq $-0x1, %rdx
je 0x466fc
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x46505
movq %r12, %rdi
callq 0x43c0c
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq 0x452f3
incq 0x710(%rbp)
leaq 0xc0b8e(%rip), %rax     # 0x1072b0
movq 0x28(%rax), %rsi
jmp 0x465f2