// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x12bc05(%rip), %rax    # 0x1781d8
cmpl $0x0, 0x99c(%rax)
je 0x4c5f1
movq -0x8(%rbp), %rdi
leaq 0xef401(%rip), %rsi     # 0x13b9e8
callq 0x42f90
jmp 0x4c7c0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x49d70
cmpl $-0x1, %eax
je 0x4c64d
cmpq $-0x80000000, -0x30(%rbp) # imm = 0x80000000
jl 0x4c64d
cmpq $0x7fffffff, -0x30(%rbp) # imm = 0x7FFFFFFF
jg 0x4c64d
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %esi
callq 0x4aef0
cmpl $-0x1, %eax
jne 0x4c669
movq -0x8(%rbp), %rdi
leaq 0x12c5e8(%rip), %rax    # 0x178c40
movq 0x90(%rax), %rsi
callq 0x42cc0
jmp 0x4c7c0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x4aef0
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x4c6a7
movq -0x8(%rbp), %rdi
leaq 0x12c5aa(%rip), %rax    # 0x178c40
movq 0x88(%rax), %rsi
callq 0x42cc0
jmp 0x4c7c0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4a6f0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x4c6e4
movq -0x8(%rbp), %rdi
leaq 0x12c56a(%rip), %rax    # 0x178c40
movq 0x20(%rax), %rsi
callq 0x42cc0
jmp 0x4c7c0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4c430
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4a6f0
cmpq $0x0, %rax
je 0x4c735
movq -0x8(%rbp), %rdi
leaq 0x12c519(%rip), %rax    # 0x178c40
movq 0x20(%rax), %rsi
callq 0x42cc0
jmp 0x4c7c0
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rdx
callq 0x4a7d0
cmpq $-0x1, -0x38(%rbp)
je 0x4c76e
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x38(%rbp), %rdx
callq 0x4c4f0
movq -0x10(%rbp), %rdi
callq 0x487b0
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4ac10
leaq 0x12ba45(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0x12ba33(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
movq -0x8(%rbp), %rdi
leaq 0x12c489(%rip), %rax    # 0x178c40
movq 0x28(%rax), %rsi
callq 0x42cc0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)