// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: renameGenericCommand
void renameGenericCommand(client *c, int nx) {
    robj *o;
    long long expire;
    int samekey = 0;

    /* When source and dest key is the same, no operation is performed,
     * if the key exists, however we still return an error on unexisting key. */
    if (sdscmp(c->argv[1]->ptr,c->argv[2]->ptr) == 0) samekey = 1;

    if ((o = lookupKeyWriteOrReply(c,c->argv[1],shared.nokeyerr)) == NULL)
        return;

    if (samekey) {
        addReply(c,nx ? shared.czero : shared.ok);
        return;
    }

    incrRefCount(o);
    expire = getExpire(c->db,c->argv[1]);
    if (lookupKeyWrite(c->db,c->argv[2]) != NULL) {
        if (nx) {
            decrRefCount(o);
            addReply(c,shared.czero);
            return;
        }
        /* Overwrite: delete the old key before creating the new one
         * with the same name. */
        dbDelete(c->db,c->argv[2]);
    }
    dbAdd(c->db,c->argv[2],o);
    if (expire != -1) setExpire(c->db,c->argv[2],expire);
    dbDelete(c->db,c->argv[1]);
    signalModifiedKey(c->db,c->argv[1]);
    signalModifiedKey(c->db,c->argv[2]);
    notifyKeyspaceEvent(NOTIFY_GENERIC,"rename_from",
        c->argv[1],c->db->id);
    notifyKeyspaceEvent(NOTIFY_GENERIC,"rename_to",
        c->argv[2],c->db->id);
    server.dirty++;
    addReply(c,nx ? shared.cone : shared.ok);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rax
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rsi
callq 0x37996
movl %eax, %r15d
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0xbf467(%rip), %r12     # 0x102310
movq 0x78(%r12), %rdx
movq %rbx, %rdi
callq 0x41b2b
testq %rax, %rax
je 0x42f21
testl %r15d, %r15d
je 0x42f30
movq %rax, %r14
movq %rax, %rdi
callq 0x407a8
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x4302f
movq %rax, (%rsp)
movq %r12, %r15
movq 0x10(%rbx), %r12
movq 0x40(%rbx), %rax
movq 0x10(%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 0x42f5a
testl %ebp, %ebp
je 0x42f49
movq %r14, %rdi
callq 0x40c8f
movq 0x20(%r15), %rsi
jmp 0x43019
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %ebp, %ebp
movl $0x8, %eax
movl $0x20, %ecx
cmoveq %rax, %rcx
movq (%r12,%rcx), %rsi
jmp 0x43019
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
callq 0x41e5f
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdx
callq 0x41b77
movq (%rsp), %rdx
cmpq $-0x1, %rdx
je 0x42f89
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
callq 0x430b0
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x41e5f
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x60fd1
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
callq 0x60fd1
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x7e0a4(%rip), %rsi     # 0xc1076
movl $0x4, %edi
callq 0x7c665
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x10(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x7e090(%rip), %rsi     # 0xc1082
movl $0x4, %edi
callq 0x7c665
leaq 0xbe8a5(%rip), %rax     # 0x1018a8
incq 0x720(%rax)
xorl %eax, %eax
testl %ebp, %ebp
setne %al
shll $0x5, %eax
movq 0x8(%r15,%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3c854