// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/t_set.c
// Function: smoveCommand
void smoveCommand(client *c) {
    robj *srcset, *dstset, *ele;
    srcset = lookupKeyWrite(c->db,c->argv[1]);
    dstset = lookupKeyWrite(c->db,c->argv[2]);
    ele = c->argv[3] = tryObjectEncoding(c->argv[3]);

    /* If the source key does not exist return 0 */
    if (srcset == NULL) {
        addReply(c,shared.czero);
        return;
    }

    /* If the source key has the wrong type, or the destination key
     * is set and has the wrong type, return with an error. */
    if (checkType(c,srcset,OBJ_SET) ||
        (dstset && checkType(c,dstset,OBJ_SET))) return;

    /* If srcset and dstset are equal, SMOVE is a no-op */
    if (srcset == dstset) {
        addReply(c,setTypeIsMember(srcset,ele) ? shared.cone : shared.czero);
        return;
    }

    /* If the element cannot be removed from the src set, return 0. */
    if (!setTypeRemove(srcset,ele)) {
        addReply(c,shared.czero);
        return;
    }
    notifyKeyspaceEvent(NOTIFY_SET,"srem",c->argv[1],c->db->id);

    /* Remove the src set from the database when empty */
    if (setTypeSize(srcset) == 0) {
        dbDelete(c->db,c->argv[1]);
        notifyKeyspaceEvent(NOTIFY_GENERIC,"del",c->argv[1],c->db->id);
    }

    /* Create the destination set when it doesn't exist */
    if (!dstset) {
        dstset = setTypeCreate(ele);
        dbAdd(c->db,c->argv[2],dstset);
    }

    signalModifiedKey(c->db,c->argv[1]);
    signalModifiedKey(c->db,c->argv[2]);
    server.dirty++;

    /* An extra key has changed when ele was successfully added to dstset */
    if (setTypeAdd(dstset,ele)) {
        server.dirty++;
        notifyKeyspaceEvent(NOTIFY_SET,"sadd",c->argv[2],c->db->id);
    }
    addReply(c,shared.cone);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x41ad6
movq %rax, %r12
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
callq 0x41ad6
movq %rax, %r15
movq 0x40(%rbx), %rax
movq 0x18(%rax), %rdi
callq 0x40e09
movq %rax, %r14
movq 0x40(%rbx), %rax
movq %r14, 0x18(%rax)
testq %r12, %r12
je 0x4e9e1
movq %rbx, %rdi
movq %r12, %rsi
movl $0x2, %edx
callq 0x40d47
testl %eax, %eax
je 0x4e8b5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
testq %r15, %r15
je 0x4e8ce
movq %rbx, %rdi
movq %r15, %rsi
movl $0x2, %edx
callq 0x40d47
testl %eax, %eax
jne 0x4e8a9
cmpq %r15, %r12
je 0x4e9ff
movq %r12, %rdi
movq %r14, %rsi
callq 0x4e287
testl %eax, %eax
je 0x4e9e1
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x6dd1a(%rip), %rsi     # 0xbc61a
movl $0x20, %edi
callq 0x7c665
movq %r12, %rdi
callq 0x4e5b5
testq %rax, %rax
jne 0x4e948
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x41e5f
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x6fbea(%rip), %rsi     # 0xbe528
movl $0x4, %edi
callq 0x7c665
testq %r15, %r15
jne 0x4e96c
movq %r14, %rdi
callq 0x4e03c
movq %rax, %r15
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
movq %r15, %rdx
callq 0x41b77
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x41d90
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
callq 0x41d90
leaq 0xb2f13(%rip), %r12     # 0x1018a8
incq 0x720(%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x4e054
testl %eax, %eax
je 0x4e9d4
incq 0x720(%r12)
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x10(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x6dc4b(%rip), %rsi     # 0xbc615
movl $0x20, %edi
callq 0x7c665
leaq 0xb3935(%rip), %rax     # 0x102310
movq 0x28(%rax), %rsi
jmp 0x4e9ec
leaq 0xb3928(%rip), %rax     # 0x102310
movq 0x20(%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3c854
movq %r12, %rdi
movq %r14, %rsi
callq 0x4e335
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leaq 0xb38f8(%rip), %rax     # 0x102310
movq 0x20(%rax,%rcx,8), %rsi
jmp 0x4e9ec