// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0x44f66
movq %rax, %r12
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
callq 0x44f66
movq %rax, %r15
movq 0x40(%rbx), %rax
movq 0x18(%rax), %rdi
callq 0x4426d
movq %rax, %r14
movq 0x40(%rbx), %rax
movq %r14, 0x18(%rax)
testq %r12, %r12
je 0x52114
movq %rbx, %rdi
movq %r12, %rsi
movl $0x2, %edx
callq 0x441ab
testl %eax, %eax
je 0x51fe8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
testq %r15, %r15
je 0x52001
movq %rbx, %rdi
movq %r15, %rsi
movl $0x2, %edx
callq 0x441ab
testl %eax, %eax
jne 0x51fdc
cmpq %r15, %r12
je 0x52132
movq %r12, %rdi
movq %r14, %rsi
callq 0x519c8
testl %eax, %eax
je 0x52114
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x6d597(%rip), %rsi     # 0xbf5ca
movl $0x20, %edi
callq 0x800c9
movq %r12, %rdi
callq 0x51cf6
testq %rax, %rax
jne 0x5207b
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x452f3
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x6f445(%rip), %rsi     # 0xc14b6
movl $0x4, %edi
callq 0x800c9
testq %r15, %r15
jne 0x5209f
movq %r14, %rdi
callq 0x51778
movq %rax, %r15
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
movq %r15, %rdx
callq 0x45007
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x45220
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
callq 0x45220
leaq 0xb4790(%rip), %r12     # 0x106858
incq 0x710(%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x51790
testl %eax, %eax
je 0x52107
incq 0x710(%r12)
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x10(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x6d4c8(%rip), %rsi     # 0xbf5c5
movl $0x20, %edi
callq 0x800c9
leaq 0xb51a2(%rip), %rax     # 0x1072b0
movq 0x28(%rax), %rsi
jmp 0x5211f
leaq 0xb5195(%rip), %rax     # 0x1072b0
movq 0x20(%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3fc19
movq %r12, %rdi
movq %r14, %rsi
callq 0x51a76
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leaq 0xb5165(%rip), %rax     # 0x1072b0
movq 0x20(%rax,%rcx,8), %rsi
jmp 0x5211f