// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0x116cc7(%rip), %rax    # 0x178c40
movq 0x20(%rax), %rdx
callq 0x4a780
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x61fa3
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x3, %edx
callq 0x490a0
cmpl $0x0, %eax
je 0x61fa8
jmp 0x62275
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x5, %eax
jne 0x62067
movl $0x2, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x62062
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x60970
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x62052
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x60a90
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x600c0
cmpl $0x0, %eax
jne 0x62050
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x4ac10
movl $0x1, -0x20(%rbp)
jmp 0x62062
jmp 0x62052
jmp 0x62054
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x61fc4
jmp 0x621eb
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x7, %eax
jne 0x621c7
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movl $0x2, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x621c5
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x2dcb0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x621b5
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movsd -0x48(%rbp), %xmm0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x5e800
cmpl $0x0, %eax
je 0x6210d
jmp 0x62144
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xdbd30(%rip), %rdx     # 0x13de58
leaq 0xdbaf3(%rip), %rcx     # 0x13dc22
movl $0x5a5, %r8d            # imm = 0x5A5
callq 0x78360
movl $0x1, %edi
callq 0x263c0
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x2de50
movq -0x38(%rbp), %rax
movq (%rax), %rdi
callq 0x30420
cmpl $0x0, %eax
je 0x6217d
movq -0x38(%rbp), %rax
movq (%rax), %rdi
callq 0x2d3e0
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
addq 0x48(%rcx), %rax
cmpq $0x0, %rax
jne 0x621b3
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x4ac10
movl $0x1, -0x20(%rbp)
jmp 0x621c5
jmp 0x621b5
jmp 0x621b7
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x6208f
jmp 0x621e9
leaq 0xd951c(%rip), %rdi     # 0x13b6ea
leaq 0xdba4d(%rip), %rsi     # 0x13dc22
movl $0x5b2, %edx            # imm = 0x5B2
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
jmp 0x621eb
cmpl $0x0, -0x1c(%rbp)
je 0x62268
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x80, %edi
leaq 0xd5401(%rip), %rsi     # 0x13760d
callq 0x9ce20
cmpl $0x0, -0x20(%rbp)
je 0x62237
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x4, %edi
leaq 0xd7266(%rip), %rsi     # 0x139498
callq 0x9ce20
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x4aa60
movslq -0x1c(%rbp), %rcx
leaq 0x115f85(%rip), %rax    # 0x1781d8
addq 0x720(%rax), %rcx
leaq 0x115f77(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
movq -0x8(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x43780
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)