// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/t_zset.c
// Function: zremCommand
void zremCommand(client *c) {
    robj *key = c->argv[1];
    robj *zobj;
    int deleted = 0, keyremoved = 0, j;

    if ((zobj = lookupKeyWriteOrReply(c,key,shared.czero)) == NULL ||
        checkType(c,zobj,OBJ_ZSET)) return;

    if (zobj->encoding == OBJ_ENCODING_ZIPLIST) {
        unsigned char *eptr;

        for (j = 2; j < c->argc; j++) {
            if ((eptr = zzlFind(zobj->ptr,c->argv[j],NULL)) != NULL) {
                deleted++;
                zobj->ptr = zzlDelete(zobj->ptr,eptr);
                if (zzlLength(zobj->ptr) == 0) {
                    dbDelete(c->db,key);
                    keyremoved = 1;
                    break;
                }
            }
        }
    } else if (zobj->encoding == OBJ_ENCODING_SKIPLIST) {
        zset *zs = zobj->ptr;
        dictEntry *de;
        double score;

        for (j = 2; j < c->argc; j++) {
            de = dictFind(zs->dict,c->argv[j]);
            if (de != NULL) {
                deleted++;

                /* Delete from the skiplist */
                score = *(double*)dictGetVal(de);
                serverAssertWithInfo(c,c->argv[j],zslDelete(zs->zsl,score,c->argv[j]));

                /* Delete from the hash table */
                dictDelete(zs->dict,c->argv[j]);
                if (htNeedsResize(zs->dict)) dictResize(zs->dict);
                if (dictSize(zs->dict) == 0) {
                    dbDelete(c->db,key);
                    keyremoved = 1;
                    break;
                }
            }
        }
    } else {
        serverPanic("Unknown sorted set encoding");
    }

    if (deleted) {
        notifyKeyspaceEvent(NOTIFY_ZSET,"zrem",key,c->db->id);
        if (keyremoved)
            notifyKeyspaceEvent(NOTIFY_GENERIC,"del",key,c->db->id);
        signalModifiedKey(c->db,key);
        server.dirty += deleted;
    }
    addReplyLongLong(c,deleted);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x8(%rax), %r14
leaq 0xafd7b(%rip), %rax     # 0x102310
movq 0x20(%rax), %rdx
movq %r14, %rsi
callq 0x41b2b
testq %rax, %rax
je 0x52764
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
movl $0x3, %edx
callq 0x40d47
testl %eax, %eax
jne 0x52764
movl (%r12), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x7, %eax
je 0x52651
cmpl $0x5, %eax
jne 0x527a1
xorl %r15d, %r15d
cmpl $0x3, 0x38(%rbx)
jl 0x52759
movl $0x2, %ebp
movq %rsp, %r13
movq 0x8(%r12), %rdi
movq 0x40(%rbx), %rax
movq (%rax,%rbp,8), %rsi
xorl %edx, %edx
callq 0x51551
testq %rax, %rax
je 0x52640
incl %r15d
movq 0x8(%r12), %rdi
movq %rax, (%rsp)
movq %r13, %rsi
callq 0x3b88c
movq %rax, %rdi
movq %r13, %rsi
callq 0x3b88c
movq %rax, 0x8(%r12)
movq %rax, %rdi
callq 0x3bb78
cmpl $0x1, %eax
jbe 0x526e9
incq %rbp
movslq 0x38(%rbx), %rax
cmpq %rax, %rbp
jl 0x525f2
jmp 0x526e4
xorl %r15d, %r15d
cmpl $0x3, 0x38(%rbx)
jl 0x52759
movq 0x8(%r12), %r13
movl $0x2, %r12d
movq (%r13), %rdi
movq 0x40(%rbx), %rax
movq (%rax,%r12,8), %rsi
callq 0x2ebca
testq %rax, %rax
je 0x526d8
movq 0x8(%rax), %rax
movsd (%rax), %xmm0
movq 0x8(%r13), %rdi
movq 0x40(%rbx), %rax
movq (%rax,%r12,8), %rsi
callq 0x501e2
testl %eax, %eax
je 0x52773
movq (%r13), %rdi
movq 0x40(%rbx), %rax
movq (%rax,%r12,8), %rsi
callq 0x2ecb5
movq (%r13), %rdi
callq 0x30340
testl %eax, %eax
je 0x526c7
movq (%r13), %rdi
callq 0x2e6d1
incl %r15d
movq (%r13), %rax
movq 0x28(%rax), %rcx
addq 0x48(%rax), %rcx
je 0x526e9
incq %r12
movslq 0x38(%rbx), %rax
cmpq %rax, %r12
jl 0x52669
movb $0x1, %bpl
jmp 0x526f7
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x41e5f
xorl %ebp, %ebp
testl %r15d, %r15d
je 0x52756
movq 0x10(%rbx), %rax
movl 0x30(%rax), %ecx
leaq 0x69f93(%rip), %rsi     # 0xbc69d
movl $0x80, %edi
movq %r14, %rdx
callq 0x7c665
testb %bpl, %bpl
jne 0x52737
movq 0x10(%rbx), %rax
movl 0x30(%rax), %ecx
leaq 0x6bdfe(%rip), %rsi     # 0xbe528
movl $0x4, %edi
movq %r14, %rdx
callq 0x7c665
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x41d90
movslq %r15d, %r15
leaq 0xaf15b(%rip), %rax     # 0x1018a8
addq %r15, 0x720(%rax)
jmp 0x52759
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3d23f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x40(%rbx), %rax
movq (%rax,%r12,8), %rsi
leaq 0x7118a(%rip), %rdx     # 0xc390c
leaq 0x70f4d(%rip), %rcx     # 0xc36d6
movq %rbx, %rdi
movl $0x5a5, %r8d            # imm = 0x5A5
callq 0x627c3
movl $0x1, %edi
callq 0x263c0
leaq 0x6e51e(%rip), %rdi     # 0xc0cc6
leaq 0x70f27(%rip), %rsi     # 0xc36d6
movl $0x5b2, %edx            # imm = 0x5B2
callq 0x619b4
jmp 0x52797