// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
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)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x4a6f0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x491b0
movq -0x8(%rbp), %rcx
movq 0x40(%rcx), %rcx
movq %rax, 0x18(%rcx)
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x5c347
movq -0x8(%rbp), %rdi
leaq 0x11c907(%rip), %rax    # 0x178c40
movq 0x20(%rax), %rsi
callq 0x42cc0
jmp 0x5c56b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x2, %edx
callq 0x490a0
cmpl $0x0, %eax
jne 0x5c37c
cmpq $0x0, -0x18(%rbp)
je 0x5c381
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x2, %edx
callq 0x490a0
cmpl $0x0, %eax
je 0x5c381
jmp 0x5c56b
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x5c3d7
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x5bb30
cmpl $0x0, %eax
je 0x5c3b6
leaq 0x11c894(%rip), %rax    # 0x178c40
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x5c3c5
leaq 0x11c883(%rip), %rax    # 0x178c40
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x42cc0
jmp 0x5c56b
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x5ba40
cmpl $0x0, %eax
jne 0x5c402
movq -0x8(%rbp), %rdi
leaq 0x11c84c(%rip), %rax    # 0x178c40
movq 0x20(%rax), %rsi
callq 0x42cc0
jmp 0x5c56b
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x20, %edi
leaq 0xdb165(%rip), %rsi     # 0x13758a
callq 0x9ce20
movq -0x10(%rbp), %rdi
callq 0x5bf20
cmpq $0x0, %rax
jne 0x5c47a
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4ac10
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x4, %edi
leaq 0xdd023(%rip), %rsi     # 0x139498
callq 0x9ce20
cmpq $0x0, -0x18(%rbp)
jne 0x5c4ab
movq -0x20(%rbp), %rdi
callq 0x5b710
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x4a7d0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4aa60
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x4aa60
leaq 0x11bcf4(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0x11bce2(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x5b750
cmpl $0x0, %eax
je 0x5c557
leaq 0x11bcc2(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0x11bcb0(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x20, %edi
leaq 0xdb033(%rip), %rsi     # 0x137585
callq 0x9ce20
movq -0x8(%rbp), %rdi
leaq 0x11c6de(%rip), %rax    # 0x178c40
movq 0x28(%rax), %rsi
callq 0x42cc0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)