// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xbe772(%rip), %rbp     # 0x1018a8
cmpl $0x0, 0x99c(%rbp)
je 0x4315c
leaq 0x7df46(%rip), %rsi     # 0xc108c
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3cc06
movq 0x10(%rbx), %r14
movq 0x40(%rbx), %rax
movl 0x30(%r14), %r13d
movq 0x10(%rax), %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x415ca
cmpl $-0x1, %eax
sete %al
movq (%r15), %r15
movslq %r15d, %rcx
cmpq %r15, %rcx
setne %cl
orb %al, %cl
je 0x431b4
leaq 0xbf17a(%rip), %rax     # 0x102310
movq 0x90(%rax), %rsi
movq %rbx, %rdi
callq 0x3c854
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r15, %r15
js 0x4318f
cmpl %r15d, 0x610(%rbp)
jle 0x4318f
movq 0x28(%rbp), %rax
shlq $0x6, %r15
addq %rax, %r15
movq %r15, 0x10(%rbx)
movq %r15, %r12
testl %r13d, %r13d
js 0x431f3
movq %r15, %r12
cmpl %r13d, 0x610(%rbp)
jle 0x431f3
shlq $0x6, %r13
addq %r13, %rax
movq %rax, 0x10(%rbx)
movq %rax, %r12
cmpq %r15, %r14
je 0x4326b
movq 0x40(%rbx), %rax
movq 0x8(%rax), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x41a1e
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x4195c
testq %rax, %rax
je 0x4325b
movq %rax, %r12
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x4302f
movq %rax, 0x8(%rsp)
movq 0x40(%rbx), %rax
movq 0x8(%rax), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x41a1e
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x4195c
testq %rax, %rax
je 0x4327e
leaq 0xbf0ae(%rip), %rax     # 0x102310
movq 0x20(%rax), %rsi
jmp 0x4319d
leaq 0xbf09e(%rip), %rax     # 0x102310
movq 0x88(%rax), %rsi
jmp 0x4319d
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x41b77
movq 0x8(%rsp), %rdx
cmpq $-0x1, %rdx
je 0x432ac
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x430b0
movq %r12, %rdi
callq 0x407a8
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq 0x41e5f
incq 0x720(%rbp)
leaq 0xbf03e(%rip), %rax     # 0x102310
movq 0x28(%rax), %rsi
jmp 0x4319d