LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_set.c
// Function: spopCommand
void spopCommand(redisClient *c) {
    robj *set, *ele, *aux;
    int64_t llele;
    int encoding;

    // 取出集合
    if ((set = lookupKeyWriteOrReply(c,c->argv[1],shared.nullbulk)) == NULL ||
        checkType(c,set,REDIS_SET)) return;

    // 从集合中随机取出一个元素
    encoding = setTypeRandomElement(set,&ele,&llele);

    // 将被取出元素从集合中删除
    if (encoding == REDIS_ENCODING_INTSET) {
        ele = createStringObjectFromLongLong(llele);
        set->ptr = intsetRemove(set->ptr,llele,NULL);
    } else {
        incrRefCount(ele);
        setTypeRemove(set,ele);
    }

    // 发送事件通知
    notifyKeyspaceEvent(REDIS_NOTIFY_SET,"spop",c->argv[1],c->db->id);

    /* Replicate/AOF this command as an SREM operation */
    // 将这个命令当作 SREM 来传播，防止产生有害的随机性，导致数据不一致
    // （不同的服务器随机删除不同的元素）
    aux = createStringObject("SREM",4);
    rewriteClientCommandVector(c,3,aux,c->argv[1],ele);
    decrRefCount(ele);
    decrRefCount(aux);

    // 返回回复
    addReplyBulk(c,ele);

    // 如果集合已经为空，那么从数据库中删除它
    if (setTypeSize(set) == 0) {
        // 删除集合
        dbDelete(c->db,c->argv[1]);
        // 发送事件通知
        notifyKeyspaceEvent(REDIS_NOTIFY_GENERIC,"del",c->argv[1],c->db->id);
    }

    // 发送键修改信号
    signalModifiedKey(c->db,c->argv[1]);

    // 将数据库设为脏
    server.dirty++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rsi
leaq 0x8e6bf(%rip), %rax     # 0xca800
movq 0x50(%rax), %rdx
callq 0x317a6
testq %rax, %rax
je 0x3c28a
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x2, %edx
callq 0x30bbf
testl %eax, %eax
jne 0x3c28a
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x3bb89
cmpl $0x6, %eax
jne 0x3c1a9
movq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x3069e
movq %rax, %r15
movq 0x8(%r14), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x4f333
movq %rax, 0x8(%r14)
jmp 0x3c1c1
movq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x306f3
movq %r14, %rdi
movq %r15, %rsi
callq 0x3b90b
movq 0x8(%rbx), %rax
movq 0x38(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x5819d(%rip), %rsi     # 0x94374
movl $0x20, %edi
callq 0x60371
leaq 0x5cff0(%rip), %rdi     # 0x991d8
movl $0x4, %esi
callq 0x3068f
movq %rax, %r12
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rcx
movq %rbx, %rdi
movl $0x3, %esi
movq %r12, %rdx
movq %r15, %r8
xorl %eax, %eax
callq 0x2f870
movq %r15, %rdi
callq 0x30b0c
movq %r12, %rdi
callq 0x30b0c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2e204
movq %r14, %rdi
callq 0x3bbf6
testq %rax, %rax
jne 0x3c26b
movq 0x8(%rbx), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x31a36
movq 0x8(%rbx), %rax
movq 0x38(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x5827c(%rip), %rsi     # 0x944dd
movl $0x4, %edi
callq 0x60371
movq 0x8(%rbx), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x319b8
leaq 0x8dd25(%rip), %rax     # 0xc9fa8
incq 0x560(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_set.c
// Function: srandmemberCommand
void srandmemberCommand(redisClient *c) {
    robj *set, *ele;
    int64_t llele;
    int encoding;

    // 如果带有 count 参数，那么调用 srandmemberWithCountCommand 来处理
    if (c->argc == 3) {
        srandmemberWithCountCommand(c);
        return;

    // 参数错误
    } else if (c->argc > 3) {
        addReply(c,shared.syntaxerr);
        return;
    }

    // 随机取出单个元素就可以了

    // 取出集合对象
    if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.nullbulk)) == NULL ||
        checkType(c,set,REDIS_SET)) return;

    // 随机取出一个元素
    encoding = setTypeRandomElement(set,&ele,&llele);
    // 回复
    if (encoding == REDIS_ENCODING_INTSET) {
        addReplyBulkLongLong(c,llele);
    } else {
        addReplyBulk(c,ele);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x30(%rdi), %eax
cmpl $0x3, %eax
jne 0x3c9f3
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x3c296
jle 0x3ca12
leaq 0x8de04(%rip), %rax     # 0xca800
movq 0x80(%rax), %rsi
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x2d97c
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x8dddf(%rip), %rax     # 0xca800
movq 0x50(%rax), %rdx
movq %rbx, %rdi
callq 0x31745
testq %rax, %rax
je 0x3ca49
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x2, %edx
callq 0x30bbf
testl %eax, %eax
je 0x3ca51
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x3bb89
cmpl $0x6, %eax
jne 0x3ca7c
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x2e277
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x2e204
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_set.c
// Function: sscanCommand
void sscanCommand(redisClient *c) {
    robj *set;
    unsigned long cursor;

    if (parseScanCursorOrReply(c,c->argv[2],&cursor) == REDIS_ERR) return;
    if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.emptyscan)) == NULL ||
        checkType(c,set,REDIS_SET)) return;
    scanGenericCommand(c,set,cursor);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x10(%rax), %rsi
movq %rsp, %rdx
callq 0x32100
cmpl $-0x1, %eax
je 0x3cffa
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x8d840(%rip), %rax     # 0xca800
movq 0x148(%rax), %rdx
movq %rbx, %rdi
callq 0x31745
testq %rax, %rax
je 0x3cffa
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x2, %edx
callq 0x30bbf
testl %eax, %eax
jne 0x3cffa
movq (%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3217d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslFree
void zslFree(zskiplist *zsl) {

    zskiplistNode *node = zsl->header->level[0].forward, *next;

    // 释放表头
    zfree(zsl->header);

    // 释放表中所有节点
    // T = O(N)
    while(node) {

        next = node->level[0].forward;

        zslFreeNode(node);

        node = next;
    }
    
    // 释放跳跃表结构
    zfree(zsl);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x18(%rdi), %r14
callq 0x29af7
testq %r14, %r14
je 0x3d0df
movq (%r14), %rdi
movq 0x18(%r14), %r15
callq 0x30b0c
movq %r14, %rdi
callq 0x29af7
movq %r15, %r14
testq %r15, %r15
jne 0x3d0c3
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x29af7
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslDelete
int zslDelete(zskiplist *zsl, double score, robj *obj) {
    zskiplistNode *update[ZSKIPLIST_MAXLEVEL], *x;
    int i;

    // 遍历跳跃表，查找目标节点，并记录所有沿途节点
    // T_wrost = O(N^2), T_avg = O(N log N)
    x = zsl->header;
    for (i = zsl->level-1; i >= 0; i--) {

        // 遍历跳跃表的复杂度为 T_wrost = O(N), T_avg = O(log N)
        while (x->level[i].forward &&
            (x->level[i].forward->score < score ||
                // 比对分值
                (x->level[i].forward->score == score &&
                // 比对对象，T = O(N)
                compareStringObjects(x->level[i].forward->obj,obj) < 0)))

            // 沿着前进指针移动
            x = x->level[i].forward;

        // 记录沿途节点
        update[i] = x;
    }

    /* We may have multiple elements with the same score, what we need
     * is to find the element with both the right score and object. 
     *
     * 检查找到的元素 x ，只有在它的分值和对象都相同时，才将它删除。
     */
    x = x->level[0].forward;
    if (x && score == x->score && equalStringObjects(x->obj,obj)) {
        // T = O(1)
        zslDeleteNode(zsl, x, update);
        // T = O(1)
        zslFreeNode(x);
        return 1;
    } else {
        return 0; /* not found */
    }

    return 0; /* not found */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %r14
movq (%rdi), %r12
movq %rdi, (%rsp)
movslq 0x18(%rdi), %r15
testq %r15, %r15
jle 0x3d4a4
movsd %xmm0, 0x8(%rsp)
movq %r15, %r13
decq %r15
movq %r15, %rbp
shlq $0x4, %rbp
movq 0x18(%r12,%rbp), %rax
testq %rax, %rax
je 0x3d499
leaq (%r12,%rbp), %rbx
addq $0x18, %rbx
movsd 0x8(%rax), %xmm1
ucomisd %xmm1, %xmm0
ja 0x3d486
ucomisd %xmm0, %xmm1
jne 0x3d499
jp 0x3d499
movq (%rax), %rdi
movq %r14, %rsi
callq 0x30ef4
movsd 0x8(%rsp), %xmm0
testl %eax, %eax
jns 0x3d499
movq (%rbx), %rax
movq %rax, %r12
leaq (%rax,%rbp), %rbx
addq $0x18, %rbx
movq (%rbx), %rax
testq %rax, %rax
jne 0x3d45b
movq %r12, 0x10(%rsp,%r15,8)
cmpq $0x1, %r13
jg 0x3d43c
movq 0x18(%r12), %r15
xorl %ebp, %ebp
testq %r15, %r15
je 0x3d4f3
movsd 0x8(%r15), %xmm1
ucomisd %xmm0, %xmm1
jne 0x3d4f3
jp 0x3d4f3
movq (%r15), %rdi
movq %r14, %rsi
callq 0x30f08
testl %eax, %eax
je 0x3d4f3
leaq 0x10(%rsp), %rdx
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x3d36f
movq (%r15), %rdi
callq 0x30b0c
movq %r15, %rdi
callq 0x29af7
movl $0x1, %ebp
movl %ebp, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslFirstInRange
zskiplistNode *zslFirstInRange(zskiplist *zsl, zrangespec *range) {
    zskiplistNode *x;
    int i;

    /* If everything is out of range, return early. */
    if (!zslIsInRange(zsl,range)) return NULL;

    // 遍历跳跃表，查找符合范围 min 项的节点
    // T_wrost = O(N), T_avg = O(log N)
    x = zsl->header;
    for (i = zsl->level-1; i >= 0; i--) {
        /* Go forward while *OUT* of range. */
        while (x->level[i].forward &&
            !zslValueGteMin(x->level[i].forward->score,range))
                x = x->level[i].forward;
    }

    /* This is an inner range, so the next node cannot be NULL. */
    x = x->level[0].forward;
    redisAssert(x != NULL);

    /* Check if score <= max. */
    // 检查节点是否符合范围的 max 项
    // T = O(1)
    if (!zslValueLteMax(x->score,range)) return NULL;
    return x;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3d507
testl %eax, %eax
je 0x3d60e
movq (%r14), %rax
movslq 0x18(%r14), %rcx
testq %rcx, %rcx
jle 0x3d5e0
movq %rcx, %rdx
decq %rcx
movq %rcx, %rsi
shlq $0x4, %rsi
movq %rax, %rdi
movq %rdi, %rax
movq 0x18(%rdi,%rsi), %rdi
testq %rdi, %rdi
je 0x3d5da
movsd 0x8(%rdi), %xmm0
xorl %r8d, %r8d
xorl %r9d, %r9d
ucomisd (%rbx), %xmm0
setbe %r8b
setb %r9b
cmpl $0x0, 0x10(%rbx)
cmovel %r9d, %r8d
testb %r8b, %r8b
jne 0x3d5a9
cmpq $0x1, %rdx
jg 0x3d599
movq 0x18(%rax), %rcx
testq %rcx, %rcx
je 0x3d618
movsd 0x8(%rbx), %xmm0
xorl %edx, %edx
xorl %eax, %eax
ucomisd 0x8(%rcx), %xmm0
setbe %dl
setb %al
cmpl $0x0, 0x14(%rbx)
cmovel %eax, %edx
xorl %eax, %eax
testb %dl, %dl
cmoveq %rcx, %rax
jmp 0x3d610
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5bbe9(%rip), %rdi     # 0x99208
leaq 0x5bbd9(%rip), %rsi     # 0x991ff
movl $0x1da, %edx            # imm = 0x1DA
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslLastInRange
zskiplistNode *zslLastInRange(zskiplist *zsl, zrangespec *range) {
    zskiplistNode *x;
    int i;

    /* If everything is out of range, return early. */
    // 先确保跳跃表中至少有一个节点符合 range 指定的范围，
    // 否则直接失败
    // T = O(1)
    if (!zslIsInRange(zsl,range)) return NULL;

    // 遍历跳跃表，查找符合范围 max 项的节点
    // T_wrost = O(N), T_avg = O(log N)
    x = zsl->header;
    for (i = zsl->level-1; i >= 0; i--) {
        /* Go forward while *IN* range. */
        while (x->level[i].forward &&
            zslValueLteMax(x->level[i].forward->score,range))
                x = x->level[i].forward;
    }

    /* This is an inner range, so this node cannot be NULL. */
    redisAssert(x != NULL);

    /* Check if score >= min. */
    // 检查节点是否符合范围的 min 项
    // T = O(1)
    if (!zslValueGteMin(x->score,range)) return NULL;

    // 返回节点
    return x;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3d507
testl %eax, %eax
je 0x3d6a4
movq (%r14), %rcx
movslq 0x18(%r14), %rax
testq %rax, %rax
jle 0x3d6a8
movq %rax, %rdx
decq %rax
movq %rax, %rsi
shlq $0x4, %rsi
movq %rcx, %rdi
movq %rdi, %rcx
movq 0x18(%rdi,%rsi), %rdi
testq %rdi, %rdi
je 0x3d69c
movsd 0x8(%rbx), %xmm0
xorl %r8d, %r8d
xorl %r9d, %r9d
ucomisd 0x8(%rdi), %xmm0
setbe %r8b
setb %r9b
cmpl $0x0, 0x14(%rbx)
cmovel %r9d, %r8d
cmpb $0x1, %r8b
jne 0x3d669
cmpq $0x1, %rdx
jg 0x3d659
jmp 0x3d6ad
xorl %eax, %eax
jmp 0x3d6cf
testq %rcx, %rcx
je 0x3d6d7
movsd 0x8(%rcx), %xmm0
xorl %edx, %edx
xorl %eax, %eax
ucomisd (%rbx), %xmm0
setbe %dl
setb %al
cmpl $0x0, 0x10(%rbx)
cmovel %eax, %edx
xorl %eax, %eax
testb %dl, %dl
cmoveq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5bb2a(%rip), %rdi     # 0x99208
leaq 0x5bb1a(%rip), %rsi     # 0x991ff
movl $0x201, %edx            # imm = 0x201
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslParseLexRangeItem
int zslParseLexRangeItem(robj *item, robj **dest, int *ex) {
    char *c = item->ptr;

    switch(c[0]) {
    case '+':
        if (c[1] != '\0') return REDIS_ERR;
        *ex = 0;
        *dest = shared.maxstring;
        incrRefCount(shared.maxstring);
        return REDIS_OK;
    case '-':
        if (c[1] != '\0') return REDIS_ERR;
        *ex = 0;
        *dest = shared.minstring;
        incrRefCount(shared.minstring);
        return REDIS_OK;
    case '(':
        *ex = 1;
        *dest = createStringObject(c+1,sdslen(c)-1);
        return REDIS_OK;
    case '[':
        *ex = 0;
        *dest = createStringObject(c+1,sdslen(c)-1);
        return REDIS_OK;
    default:
        return REDIS_ERR;
    }
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movq 0x8(%rdi), %rdi
movzbl (%rdi), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x2c, %ecx
jg 0x3db65
cmpl $0x28, %ecx
je 0x3db77
cmpl $0x2b, %ecx
jne 0x3dbb5
cmpb $0x0, 0x1(%rdi)
jne 0x3dbb5
movl $0x0, (%rdx)
leaq 0x8cca4(%rip), %rax     # 0xca800
movq 0x158(%rax), %rdi
jmp 0x3dbab
cmpl $0x2d, %ecx
je 0x3db91
cmpl $0x5b, %ecx
jne 0x3dbb5
movl $0x0, (%rdx)
jmp 0x3db7d
movl $0x1, (%rdx)
movslq -0x8(%rdi), %rsi
incq %rdi
decq %rsi
callq 0x3068f
movq %rax, (%rbx)
jmp 0x3dbb3
cmpb $0x0, 0x1(%rdi)
jne 0x3dbb5
movl $0x0, (%rdx)
leaq 0x8cc5c(%rip), %rax     # 0xca800
movq 0x150(%rax), %rdi
movq %rdi, (%rbx)
callq 0x306f3
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlGetScore
double zzlGetScore(unsigned char *sptr) {
    unsigned char *vstr;
    unsigned int vlen;
    long long vlong;
    char buf[128];
    double score;

    redisAssert(sptr != NULL);
    // 取出节点值
    redisAssert(ziplistGet(sptr,&vstr,&vlen,&vlong));

    if (vstr) {
        // 字符串转 double
        memcpy(buf,vstr,vlen);
        buf[vlen] = '\0';
        score = strtod(buf,NULL);
    } else {
        // double 值
        score = vlong;
    }

    return score;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xa8, %rsp
testq %rdi, %rdi
je 0x3df41
leaq 0x18(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0x2c5f6
testl %eax, %eax
je 0x3df56
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x3df2f
movl 0xc(%rsp), %ebx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x1fbd0
movb $0x0, 0x20(%rsp,%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0x1fc40
jmp 0x3df36
cvtsi2sdq 0x10(%rsp), %xmm0
addq $0xa8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5b5fd(%rip), %rdi     # 0x99545
leaq 0x5b2b0(%rip), %rsi     # 0x991ff
movl $0x3e5, %edx            # imm = 0x3E5
jmp 0x3df69
leaq 0x5b2b5(%rip), %rdi     # 0x99212
leaq 0x5b29b(%rip), %rsi     # 0x991ff
movl $0x3e7, %edx            # imm = 0x3E7
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: ziplistGetObject
robj *ziplistGetObject(unsigned char *sptr) {
    unsigned char *vstr;
    unsigned int vlen;
    long long vlong;

    redisAssert(sptr != NULL);
    redisAssert(ziplistGet(sptr,&vstr,&vlen,&vlong));

    if (vstr) {
        return createStringObject((char*)vstr,vlen);
    } else {
        return createStringObjectFromLongLong(vlong);
    }
}

// Assembly:
subq $0x18, %rsp
testq %rdi, %rdi
je 0x3dfbd
leaq 0x10(%rsp), %rsi
leaq 0x4(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0x2c5f6
testl %eax, %eax
je 0x3dfd2
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3dfae
movl 0x4(%rsp), %esi
callq 0x3068f
jmp 0x3dfb8
movq 0x8(%rsp), %rdi
callq 0x3069e
addq $0x18, %rsp
retq
leaq 0x5b581(%rip), %rdi     # 0x99545
leaq 0x5b234(%rip), %rsi     # 0x991ff
movl $0x3fe, %edx            # imm = 0x3FE
jmp 0x3dfe5
leaq 0x5b239(%rip), %rdi     # 0x99212
leaq 0x5b21f(%rip), %rsi     # 0x991ff
movl $0x3ff, %edx            # imm = 0x3FF
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlNext
void zzlNext(unsigned char *zl, unsigned char **eptr, unsigned char **sptr) {
    unsigned char *_eptr, *_sptr;

    redisAssert(*eptr != NULL && *sptr != NULL);

    // 指向下个成员
    _eptr = ziplistNext(zl,*sptr);
    if (_eptr != NULL) {
        // 指向下个分值
        _sptr = ziplistNext(zl,_eptr);
        redisAssert(_sptr != NULL);
    } else {
        /* No next entry. */
        _sptr = NULL;
    }

    *eptr = _eptr;
    *sptr = _sptr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, (%rsi)
je 0x3e104
movq %rdx, %rbx
movq %rsi, %r14
movq (%rdx), %rsi
testq %rsi, %rsi
je 0x3e104
movq %rdi, %r12
callq 0x2c558
movq %rax, %r15
testq %rax, %rax
je 0x3e0f0
movq %r12, %rdi
movq %r15, %rsi
callq 0x2c558
testq %rax, %rax
jne 0x3e0f2
leaq 0x5b197(%rip), %rdi     # 0x99279
leaq 0x5b116(%rip), %rsi     # 0x991ff
movl $0x43e, %edx            # imm = 0x43E
jmp 0x3e117
xorl %eax, %eax
movq %r15, (%r14)
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x5b14f(%rip), %rdi     # 0x9925a
leaq 0x5b0ed(%rip), %rsi     # 0x991ff
movl $0x437, %edx            # imm = 0x437
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlFirstInRange
unsigned char *zzlFirstInRange(unsigned char *zl, zrangespec *range) {
    // 从表头开始遍历
    unsigned char *eptr = ziplistIndex(zl,0), *sptr;
    double score;

    /* If everything is out of range, return early. */
    if (!zzlIsInRange(zl,range)) return NULL;

    // 分值在 ziplist 中是从小到大排列的
    // 从表头向表尾遍历
    while (eptr != NULL) {
        sptr = ziplistNext(zl,eptr);
        redisAssert(sptr != NULL);

        score = zzlGetScore(sptr);
        if (zslValueGteMin(score,range)) {
            /* Check if score <= max. */
            // 遇上第一个符合范围的分值，
            // 返回它的节点指针
            if (zslValueLteMax(score,range))
                return eptr;
            return NULL;
        }

        /* Move to next element. */
        eptr = ziplistNext(zl,sptr);
    }

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r12
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x2c28b
movq %rax, %r14
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3e1ad
testl %eax, %eax
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x3e312
xorl %r15d, %r15d
movq %r12, %rdi
movq %r14, %rsi
callq 0x2c558
testq %rax, %rax
je 0x3e31f
movq %rax, %r13
movq %rax, %rdi
callq 0x3ded9
xorl %eax, %eax
xorl %ecx, %ecx
ucomisd (%rbx), %xmm0
setbe %al
setb %cl
cmpl $0x0, 0x10(%rbx)
cmovel %ecx, %eax
testb %al, %al
je 0x3e2ed
movq %r12, %rdi
movq %r13, %rsi
callq 0x2c558
movq %rax, %r14
testq %rax, %rax
jne 0x3e2a4
jmp 0x3e312
movsd 0x8(%rbx), %xmm1
xorl %eax, %eax
xorl %ecx, %ecx
ucomisd %xmm0, %xmm1
setbe %al
setb %cl
cmpl $0x0, 0x14(%rbx)
cmovel %ecx, %eax
xorl %ecx, %ecx
testb %al, %al
cmovneq %rcx, %r14
movq %r14, %r15
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x5b21f(%rip), %rdi     # 0x99545
leaq 0x5aed2(%rip), %rsi     # 0x991ff
movl $0x498, %edx            # imm = 0x498
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlLastInRange
unsigned char *zzlLastInRange(unsigned char *zl, zrangespec *range) {
    // 从表尾开始遍历
    unsigned char *eptr = ziplistIndex(zl,-2), *sptr;
    double score;

    /* If everything is out of range, return early. */
    if (!zzlIsInRange(zl,range)) return NULL;

    // 在有序的 ziplist 里从表尾到表头遍历
    while (eptr != NULL) {
        sptr = ziplistNext(zl,eptr);
        redisAssert(sptr != NULL);

        // 获取节点的 score 值
        score = zzlGetScore(sptr);
        if (zslValueLteMax(score,range)) {
            /* Check if score >= min. */
            if (zslValueGteMin(score,range))
                return eptr;
            return NULL;
        }

        /* Move to previous element by moving to the score of previous element.
         * When this returns NULL, we know there also is no element. */
        sptr = ziplistPrev(zl,eptr);
        if (sptr != NULL)
            redisAssert((eptr = ziplistPrev(zl,sptr)) != NULL);
        else
            eptr = NULL;
    }

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x2c28b
movq %rax, %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3e1ad
testl %eax, %eax
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
je 0x3e37a
xorl %ebx, %ebx
jmp 0x3e40d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2c558
testq %rax, %rax
je 0x3e416
movq %rax, %rdi
callq 0x3ded9
movsd 0x8(%r14), %xmm1
xorl %eax, %eax
xorl %ecx, %ecx
ucomisd %xmm0, %xmm1
setbe %al
setb %cl
cmpl $0x0, 0x14(%r14)
cmovel %ecx, %eax
testb %al, %al
je 0x3e3ee
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2c57e
testq %rax, %rax
je 0x3e373
movq %r15, %rdi
movq %rax, %rsi
callq 0x2c57e
movq %rax, %rbx
testq %rax, %rax
jne 0x3e37a
leaq 0x5aebf(%rip), %rdi     # 0x9929f
leaq 0x5ae18(%rip), %rsi     # 0x991ff
movl $0x4cd, %edx            # imm = 0x4CD
jmp 0x3e429
xorl %eax, %eax
xorl %ecx, %ecx
ucomisd (%r14), %xmm0
setbe %al
setb %cl
cmpl $0x0, 0x10(%r14)
cmovel %ecx, %eax
xorl %ecx, %ecx
testb %al, %al
cmovneq %rcx, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x5b128(%rip), %rdi     # 0x99545
leaq 0x5addb(%rip), %rsi     # 0x991ff
movl $0x4be, %edx            # imm = 0x4BE
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlInsertAt
unsigned char *zzlInsertAt(unsigned char *zl, unsigned char *eptr, robj *ele, double score) {
    unsigned char *sptr;
    char scorebuf[128];
    int scorelen;
    size_t offset;

    // 计算分值的字节长度
    redisAssertWithInfo(NULL,ele,sdsEncodedObject(ele));
    scorelen = d2string(scorebuf,sizeof(scorebuf),score);

    // 插入到表尾，或者空表
    if (eptr == NULL) {
        // | member-1 | score-1 | member-2 | score-2 | ... | member-N | score-N |
        // 先推入元素
        zl = ziplistPush(zl,ele->ptr,sdslen(ele->ptr),ZIPLIST_TAIL);
        // 后推入分值
        zl = ziplistPush(zl,(unsigned char*)scorebuf,scorelen,ZIPLIST_TAIL);

    // 插入到某个节点的前面
    } else {
        /* Keep offset relative to zl, as it might be re-allocated. */
        // 插入成员
        offset = eptr-zl;
        zl = ziplistInsert(zl,eptr,ele->ptr,sdslen(ele->ptr));
        eptr = zl+offset;

        /* Insert score after the element. */
        // 将分值插入在成员之后
        redisAssertWithInfo(NULL,ele,(sptr = ziplistNext(zl,eptr)) != NULL);
        zl = ziplistInsert(zl,sptr,(unsigned char*)scorebuf,scorelen);
    }

    return zl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdx, %rbx
movl (%rdx), %eax
shrl $0x4, %eax
testb $0x7, %al
jne 0x3e85f
movq %rsi, %r15
movq %rdi, %r14
movq %rsp, %rdi
movl $0x80, %esi
callq 0x302b1
movl %eax, %ebp
testq %r15, %r15
je 0x3e80e
movq %r15, %r12
subq %r14, %r12
movq 0x8(%rbx), %rdx
movl -0x8(%rdx), %ecx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2c70e
movq %rax, %r14
addq %rax, %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x2c558
testq %rax, %rax
je 0x3e844
movq %rsp, %rdx
movq %r14, %rdi
movq %rax, %rsi
movl %ebp, %ecx
callq 0x2c70e
jmp 0x3e834
movq 0x8(%rbx), %rsi
movl -0x8(%rsi), %edx
movq %r14, %rdi
movl $0x1, %ecx
callq 0x2be64
movq %rsp, %rsi
movq %rax, %rdi
movl %ebp, %edx
movl $0x1, %ecx
callq 0x2be64
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5aa90(%rip), %rdx     # 0x992db
leaq 0x5a9ad(%rip), %rcx     # 0x991ff
xorl %edi, %edi
movq %rbx, %rsi
movl $0x588, %r8d            # imm = 0x588
jmp 0x3e878
leaq 0x5aa5f(%rip), %rdx     # 0x992c5
leaq 0x5a992(%rip), %rcx     # 0x991ff
xorl %edi, %edi
movq %rbx, %rsi
movl $0x573, %r8d            # imm = 0x573
callq 0x4d277
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlInsert
unsigned char *zzlInsert(unsigned char *zl, robj *ele, double score) {

    // 指向 ziplist 第一个节点（也即是有序集的 member 域）
    unsigned char *eptr = ziplistIndex(zl,0), *sptr;
    double s;

    // 解码值
    ele = getDecodedObject(ele);

    // 遍历整个 ziplist
    while (eptr != NULL) {

        // 取出分值
        sptr = ziplistNext(zl,eptr);
        redisAssertWithInfo(NULL,ele,sptr != NULL);
        s = zzlGetScore(sptr);

        if (s > score) {
            /* First element with score larger than score for element to be
             * inserted. This means we should take its spot in the list to
             * maintain ordering. */
            // 遇到第一个 score 值比输入 score 大的节点
            // 将新节点插入在这个节点的前面，
            // 让节点在 ziplist 里根据 score 从小到大排列
            zl = zzlInsertAt(zl,eptr,ele,score);
            break;
        } else if (s == score) {
            /* Ensure lexicographical ordering for elements. */
            // 如果输入 score 和节点的 score 相同
            // 那么根据 member 的字符串位置来决定新节点的插入位置
            if (zzlCompareElements(eptr,ele->ptr,sdslen(ele->ptr)) > 0) {
                zl = zzlInsertAt(zl,eptr,ele,score);
                break;
            }
        }

        /* Move to next element. */
        // 输入 score 比节点的 score 值要大
        // 移动到下一个节点
        eptr = ziplistNext(zl,sptr);
    }

    /* Push on tail of list when it was not yet inserted. */
    if (eptr == NULL)
        zl = zzlInsertAt(zl,NULL,ele,score);

    decrRefCount(ele);
    return zl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
movq %rsi, %rbx
movq %rdi, %r14
xorl %esi, %esi
callq 0x2c28b
movq %rax, %r15
movq %rbx, %rdi
callq 0x30d93
movq %rax, %rbx
testq %r15, %r15
je 0x3e900
movq %r14, %rdi
movq %r15, %rsi
callq 0x2c558
testq %rax, %rax
je 0x3e934
movq %rax, %r12
movq %rax, %rdi
callq 0x3ded9
ucomisd (%rsp), %xmm0
ja 0x3e907
jne 0x3e8ed
jp 0x3e8ed
movq 0x8(%rbx), %rsi
movl -0x8(%rsi), %edx
movq %r15, %rdi
callq 0x3dff4
testl %eax, %eax
jg 0x3e907
movq %r14, %rdi
movq %r12, %rsi
callq 0x2c558
movq %rax, %r15
testq %rax, %rax
jne 0x3e8b4
movq %r14, %rdi
xorl %esi, %esi
jmp 0x3e90d
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movsd (%rsp), %xmm0
callq 0x3e795
movq %rax, %r14
movq %rbx, %rdi
callq 0x30b0c
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x5ac0a(%rip), %rdx     # 0x99545
leaq 0x5a8bd(%rip), %rcx     # 0x991ff
xorl %edi, %edi
movq %rbx, %rsi
movl $0x5a7, %r8d            # imm = 0x5A7
callq 0x4d277
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zsetLength
unsigned int zsetLength(robj *zobj) {

    int length = -1;

    if (zobj->encoding == REDIS_ENCODING_ZIPLIST) {
        length = zzlLength(zobj->ptr);

    } else if (zobj->encoding == REDIS_ENCODING_SKIPLIST) {
        length = ((zset*)zobj->ptr)->zsl->length;

    } else {
        redisPanic("Unknown sorted set encoding");
    }

    return length;
}

// Assembly:
pushq %rax
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x7, %eax
je 0x3eafd
cmpl $0x5, %eax
jne 0x3eb0a
movq 0x8(%rdi), %rdi
callq 0x2cc17
shrl %eax
jmp 0x3eb08
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rax
movl 0x10(%rax), %eax
popq %rcx
retq
leaq 0x588a2(%rip), %rdi     # 0x973b3
leaq 0x5a6e7(%rip), %rsi     # 0x991ff
movl $0x632, %edx            # imm = 0x632
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslParseRange
static int zslParseRange(robj *min, robj *max, zrangespec *spec) {
    char *eptr;

    // 默认为闭区间
    spec->minex = spec->maxex = 0;

    /* Parse the min-max interval. If one of the values is prefixed
     * by the "(" character, it's considered "open". For instance
     * ZRANGEBYSCORE zset (1.5 (2.5 will match min < x < max
     * ZRANGEBYSCORE zset 1.5 2.5 will instead match min <= x <= max */
    if (min->encoding == REDIS_ENCODING_INT) {
        // min 的值为整数，开区间
        spec->min = (long)min->ptr;
    } else {
        // min 对象为字符串，分析 min 的值并决定区间
        if (((char*)min->ptr)[0] == '(') {
            // T = O(N)
            spec->min = strtod((char*)min->ptr+1,&eptr);
            if (eptr[0] != '\0' || isnan(spec->min)) return REDIS_ERR;
            spec->minex = 1;
        } else {
            // T = O(N)
            spec->min = strtod((char*)min->ptr,&eptr);
            if (eptr[0] != '\0' || isnan(spec->min)) return REDIS_ERR;
        }
    }

    if (max->encoding == REDIS_ENCODING_INT) {
        // max 的值为整数，开区间
        spec->max = (long)max->ptr;
    } else {
        // max 对象为字符串，分析 max 的值并决定区间
        if (((char*)max->ptr)[0] == '(') {
            // T = O(N)
            spec->max = strtod((char*)max->ptr+1,&eptr);
            if (eptr[0] != '\0' || isnan(spec->max)) return REDIS_ERR;
            spec->maxex = 1;
        } else {
            // T = O(N)
            spec->max = strtod((char*)max->ptr,&eptr);
            if (eptr[0] != '\0' || isnan(spec->max)) return REDIS_ERR;
        }
    }

    return REDIS_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq $0x0, 0x10(%rdx)
movl $0xf0, %eax
andl (%rdi), %eax
movq 0x8(%rdi), %rdi
cmpl $0x10, %eax
jne 0x3f93f
cvtsi2sd %rdi, %xmm0
movsd %xmm0, (%rbx)
movl $0xf0, %eax
andl (%r14), %eax
movq 0x8(%r14), %rdi
cmpl $0x10, %eax
jne 0x3f974
xorps %xmm0, %xmm0
cvtsi2sd %rdi, %xmm0
movsd %xmm0, 0x8(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
cmpb $0x28, (%rdi)
jne 0x3f9aa
incq %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x1fc40
movsd %xmm0, (%rbx)
movq (%r15), %rax
cmpb $0x0, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x3f935
ucomisd %xmm0, %xmm0
jp 0x3f935
movl $0x1, 0x10(%rbx)
jmp 0x3f915
cmpb $0x28, (%rdi)
jne 0x3f9db
incq %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x1fc40
movsd %xmm0, 0x8(%rbx)
movq (%r14), %rax
cmpb $0x0, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x3f935
ucomisd %xmm0, %xmm0
jp 0x3f935
movl $0x1, 0x14(%rbx)
jmp 0x3f933
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x1fc40
movsd %xmm0, (%rbx)
movq (%r15), %rax
cmpb $0x0, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x3f935
ucomisd %xmm0, %xmm0
jnp 0x3f915
jmp 0x3f935
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x1fc40
movsd %xmm0, 0x8(%rbx)
movq (%r14), %rax
cmpb $0x0, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x3f935
ucomisd %xmm0, %xmm0
jnp 0x3f933
jmp 0x3f935
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslParseLexRange
static int zslParseLexRange(robj *min, robj *max, zlexrangespec *spec) {
    /* The range can't be valid if objects are integer encoded.
     * Every item must start with ( or [. */
    if (min->encoding == REDIS_ENCODING_INT ||
        max->encoding == REDIS_ENCODING_INT) return REDIS_ERR;

    spec->min = spec->max = NULL;
    if (zslParseLexRangeItem(min, &spec->min, &spec->minex) == REDIS_ERR ||
        zslParseLexRangeItem(max, &spec->max, &spec->maxex) == REDIS_ERR) {
        if (spec->min) decrRefCount(spec->min);
        if (spec->max) decrRefCount(spec->max);
        return REDIS_ERR;
    } else {
        return REDIS_OK;
    }
}

// Assembly:
movl $0xf0, %eax
movl (%rdi), %ecx
andl %eax, %ecx
cmpl $0x10, %ecx
jne 0x3fa21
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
andl (%rsi), %eax
cmpl $0x10, %eax
je 0x3fa80
movq %rdx, %rbx
leaq 0x8(%rdx), %r14
addq $0x10, %rdx
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rbx, %rsi
callq 0x3db2a
cmpl $-0x1, %eax
je 0x3fa66
leaq 0x14(%rbx), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3db2a
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x3fa85
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3fa73
callq 0x30b0c
movq (%r14), %rdi
testq %rdi, %rdi
je 0x3fa80
callq 0x30b0c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zuiInitIterator
void zuiInitIterator(zsetopsrc *op) {

    // 迭代对象为空，无动作
    if (op->subject == NULL)
        return;

    // 迭代集合
    if (op->type == REDIS_SET) {

        iterset *it = &op->iter.set;

        // 迭代 intset
        if (op->encoding == REDIS_ENCODING_INTSET) {
            it->is.is = op->subject->ptr;
            it->is.ii = 0;

        // 迭代字典
        } else if (op->encoding == REDIS_ENCODING_HT) {
            it->ht.dict = op->subject->ptr;
            it->ht.di = dictGetIterator(op->subject->ptr);
            it->ht.de = dictNext(it->ht.di);

        } else {
            redisPanic("Unknown set encoding");
        }

    // 迭代有序集合
    } else if (op->type == REDIS_ZSET) {

        iterzset *it = &op->iter.zset;

        // 迭代 ziplist
        if (op->encoding == REDIS_ENCODING_ZIPLIST) {
            it->zl.zl = op->subject->ptr;
            it->zl.eptr = ziplistIndex(it->zl.zl,0);
            if (it->zl.eptr != NULL) {
                it->zl.sptr = ziplistNext(it->zl.zl,it->zl.eptr);
                redisAssert(it->zl.sptr != NULL);
            }

        // 迭代跳跃表
        } else if (op->encoding == REDIS_ENCODING_SKIPLIST) {
            it->sl.zs = op->subject->ptr;
            it->sl.node = it->sl.zs->zsl->header->level[0].forward;

        } else {
            redisPanic("Unknown sorted set encoding");
        }

    // 未知对象类型
    } else {
        redisPanic("Unsupported type");
    }
}

// Assembly:
pushq %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x3fb7e
movq %rdi, %rbx
movl 0x8(%rdi), %ecx
cmpl $0x3, %ecx
je 0x3faf0
cmpl $0x2, %ecx
jne 0x3fb80
movl 0xc(%rbx), %ecx
cmpl $0x2, %ecx
je 0x3fb61
cmpl $0x6, %ecx
jne 0x3fbaa
movq 0x8(%rax), %rax
movq %rax, 0x18(%rbx)
movl $0x0, 0x20(%rbx)
jmp 0x3fb7e
movl 0xc(%rbx), %ecx
cmpl $0x7, %ecx
je 0x3fb48
cmpl $0x5, %ecx
jne 0x3fb95
movq 0x8(%rax), %rdi
movq %rdi, 0x18(%rbx)
xorl %esi, %esi
callq 0x2c28b
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x3fb7e
movq 0x18(%rbx), %rdi
movq %rax, %rsi
callq 0x2c558
movq %rax, 0x28(%rbx)
testq %rax, %rax
jne 0x3fb7e
leaq 0x598f7(%rip), %rdi     # 0x9942c
leaq 0x596c3(%rip), %rsi     # 0x991ff
movl $0x8e1, %edx            # imm = 0x8E1
callq 0x4ca32
jmp 0x3fbc2
movq 0x8(%rax), %rax
movq %rax, 0x18(%rbx)
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, 0x20(%rbx)
jmp 0x3fb7e
movq 0x8(%rax), %rdi
movq %rdi, 0x18(%rbx)
callq 0x22a71
movq %rax, 0x20(%rbx)
movq %rax, %rdi
callq 0x22acf
movq %rax, 0x28(%rbx)
popq %rbx
retq
leaq 0x598b9(%rip), %rdi     # 0x99440
leaq 0x59671(%rip), %rsi     # 0x991ff
movl $0x8ef, %edx            # imm = 0x8EF
jmp 0x3fbbd
leaq 0x57817(%rip), %rdi     # 0x973b3
leaq 0x5965c(%rip), %rsi     # 0x991ff
movl $0x8ea, %edx            # imm = 0x8EA
jmp 0x3fbbd
leaq 0x58f47(%rip), %rdi     # 0x98af8
leaq 0x59647(%rip), %rsi     # 0x991ff
movl $0x8d3, %edx            # imm = 0x8D3
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zuiClearIterator
void zuiClearIterator(zsetopsrc *op) {

    if (op->subject == NULL)
        return;

    if (op->type == REDIS_SET) {

        iterset *it = &op->iter.set;

        if (op->encoding == REDIS_ENCODING_INTSET) {
            REDIS_NOTUSED(it); /* skip */

        } else if (op->encoding == REDIS_ENCODING_HT) {
            dictReleaseIterator(it->ht.di);

        } else {
            redisPanic("Unknown set encoding");
        }

    } else if (op->type == REDIS_ZSET) {

        iterzset *it = &op->iter.zset;

        if (op->encoding == REDIS_ENCODING_ZIPLIST) {
            REDIS_NOTUSED(it); /* skip */

        } else if (op->encoding == REDIS_ENCODING_SKIPLIST) {
            REDIS_NOTUSED(it); /* skip */

        } else {
            redisPanic("Unknown sorted set encoding");
        }
    } else {
        redisPanic("Unsupported type");
    }
}

// Assembly:
pushq %rax
cmpq $0x0, (%rdi)
je 0x3fc02
movl 0x8(%rdi), %eax
cmpl $0x3, %eax
je 0x3fbf7
cmpl $0x2, %eax
jne 0x3fc04
movl 0xc(%rdi), %eax
cmpl $0x6, %eax
je 0x3fc02
cmpl $0x2, %eax
jne 0x3fc19
movq 0x20(%rdi), %rdi
popq %rax
jmp 0x22b86
movl 0xc(%rdi), %eax
orl $0x2, %eax
cmpl $0x7, %eax
jne 0x3fc2e
popq %rax
retq
leaq 0x59835(%rip), %rdi     # 0x99440
leaq 0x595ed(%rip), %rsi     # 0x991ff
movl $0x917, %edx            # imm = 0x917
jmp 0x3fc41
leaq 0x58ed8(%rip), %rdi     # 0x98af8
leaq 0x595d8(%rip), %rsi     # 0x991ff
movl $0x906, %edx            # imm = 0x906
jmp 0x3fc41
leaq 0x5777e(%rip), %rdi     # 0x973b3
leaq 0x595c3(%rip), %rsi     # 0x991ff
movl $0x914, %edx            # imm = 0x914
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zuiLength
int zuiLength(zsetopsrc *op) {

    if (op->subject == NULL)
        return 0;

    if (op->type == REDIS_SET) {
        if (op->encoding == REDIS_ENCODING_INTSET) {
            return intsetLen(op->subject->ptr);
        } else if (op->encoding == REDIS_ENCODING_HT) {
            dict *ht = op->subject->ptr;
            return dictSize(ht);
        } else {
            redisPanic("Unknown set encoding");
        }

    } else if (op->type == REDIS_ZSET) {

        if (op->encoding == REDIS_ENCODING_ZIPLIST) {
            return zzlLength(op->subject->ptr);
        } else if (op->encoding == REDIS_ENCODING_SKIPLIST) {
            zset *zs = op->subject->ptr;
            return zs->zsl->length;
        } else {
            redisPanic("Unknown sorted set encoding");
        }

    } else {
        redisPanic("Unsupported type");
    }
}

// Assembly:
pushq %rax
movq (%rdi), %rax
testq %rax, %rax
je 0x3fc7d
movl 0x8(%rdi), %ecx
cmpl $0x3, %ecx
je 0x3fc81
cmpl $0x2, %ecx
jne 0x3fcb4
movl 0xc(%rdi), %ecx
cmpl $0x2, %ecx
je 0x3fca8
cmpl $0x6, %ecx
jne 0x3fcde
movq 0x8(%rax), %rdi
popq %rax
jmp 0x4f4bf
xorl %eax, %eax
jmp 0x3fcb2
movl 0xc(%rdi), %ecx
cmpl $0x7, %ecx
je 0x3fc9b
cmpl $0x5, %ecx
jne 0x3fcc9
movq 0x8(%rax), %rdi
callq 0x2cc17
shrl %eax
jmp 0x3fcb2
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movl 0x10(%rax), %eax
jmp 0x3fcb2
movq 0x8(%rax), %rcx
movl 0x48(%rcx), %eax
addl 0x28(%rcx), %eax
popq %rcx
retq
leaq 0x59785(%rip), %rdi     # 0x99440
leaq 0x5953d(%rip), %rsi     # 0x991ff
movl $0x939, %edx            # imm = 0x939
jmp 0x3fcf1
leaq 0x576e3(%rip), %rdi     # 0x973b3
leaq 0x59528(%rip), %rsi     # 0x991ff
movl $0x935, %edx            # imm = 0x935
jmp 0x3fcf1
leaq 0x58e13(%rip), %rdi     # 0x98af8
leaq 0x59513(%rip), %rsi     # 0x991ff
movl $0x92a, %edx            # imm = 0x92A
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zuiLongLongFromValue
int zuiLongLongFromValue(zsetopval *val) {

    if (!(val->flags & OPVAL_DIRTY_LL)) {

        // 打开标识 DIRTY LL
        val->flags |= OPVAL_DIRTY_LL;

        // 从对象中取值
        if (val->ele != NULL) {
            // 从 INT 编码的字符串中取出整数
            if (val->ele->encoding == REDIS_ENCODING_INT) {
                val->ell = (long)val->ele->ptr;
                val->flags |= OPVAL_VALID_LL;
            // 从未编码的字符串中转换整数
            } else if (sdsEncodedObject(val->ele)) {
                if (string2ll(val->ele->ptr,sdslen(val->ele->ptr),&val->ell))
                    val->flags |= OPVAL_VALID_LL;

            } else {
                redisPanic("Unsupported element encoding");
            }

        // 从 ziplist 节点中取值
        } else if (val->estr != NULL) {
            // 将节点值（一个字符串）转换为整数
            if (string2ll((char*)val->estr,val->elen,&val->ell))
                val->flags |= OPVAL_VALID_LL;

        } else {
            /* The long long was already set, flag as valid. */
            // 总是打开 VALID LL 标识
            val->flags |= OPVAL_VALID_LL;
        }
    }

    // 检查 VALID LL 标识是否已打开
    return val->flags & OPVAL_VALID_LL;
}

// Assembly:
pushq %rbx
movl (%rdi), %eax
testb $0x2, %al
jne 0x3ff4a
movq %rdi, %rbx
movl %eax, %ecx
orl $0x2, %ecx
movl %ecx, (%rdi)
movq 0x28(%rdi), %rcx
testq %rcx, %rcx
je 0x3ff23
movl (%rcx), %edx
shrl $0x4, %edx
andl $0xf, %edx
je 0x3ff19
cmpl $0x8, %edx
je 0x3ff19
cmpl $0x1, %edx
jne 0x3ff4f
movq 0x8(%rcx), %rcx
movq %rcx, 0x40(%rbx)
jmp 0x3ff45
movq 0x8(%rcx), %rdi
movslq -0x8(%rdi), %rsi
jmp 0x3ff2f
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x3ff45
movl 0x38(%rbx), %esi
leaq 0x40(%rbx), %rdx
callq 0x30179
movl %eax, %ecx
movl (%rbx), %eax
testl %ecx, %ecx
je 0x3ff4a
orl $0x4, %eax
jmp 0x3ff48
orl $0x6, %eax
movl %eax, (%rbx)
andl $0x4, %eax
popq %rbx
retq
leaq 0x59535(%rip), %rdi     # 0x9948b
leaq 0x592a2(%rip), %rsi     # 0x991ff
movl $0x9b9, %edx            # imm = 0x9B9
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zuiObjectFromValue
robj *zuiObjectFromValue(zsetopval *val) {

    if (val->ele == NULL) {

        // 从 long long 值中创建对象
        if (val->estr != NULL) {
            val->ele = createStringObject((char*)val->estr,val->elen);
        } else {
            val->ele = createStringObjectFromLongLong(val->ell);
        }

        // 打开 ROBJ 标识
        val->flags |= OPVAL_DIRTY_ROBJ;
    }

    // 返回值对象
    return val->ele;
}

// Assembly:
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x3ff7b
retq
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x3ff92
movl 0x38(%rbx), %esi
callq 0x3068f
jmp 0x3ff9b
movq 0x40(%rbx), %rdi
callq 0x3069e
movq %rax, 0x28(%rbx)
orb $0x1, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zuiBufferFromValue
int zuiBufferFromValue(zsetopval *val) {

    if (val->estr == NULL) {
        if (val->ele != NULL) {
            if (val->ele->encoding == REDIS_ENCODING_INT) {
                val->elen = ll2string((char*)val->_buf,sizeof(val->_buf),(long)val->ele->ptr);
                val->estr = val->_buf;
            } else if (sdsEncodedObject(val->ele)) {
                val->elen = sdslen(val->ele->ptr);
                val->estr = val->ele->ptr;
            } else {
                redisPanic("Unsupported element encoding");
            }
        } else {
            val->elen = ll2string((char*)val->_buf,sizeof(val->_buf),val->ell);
            val->estr = val->_buf;
        }
    }

    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x30(%rdi)
jne 0x3ffff
movq %rdi, %rbx
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x3ffe3
movl (%rax), %ecx
shrl $0x4, %ecx
andl $0xf, %ecx
je 0x3ffd9
cmpl $0x8, %ecx
je 0x3ffd9
cmpl $0x1, %ecx
jne 0x4000c
leaq 0x4(%rbx), %r14
movq 0x8(%rax), %rdx
jmp 0x3ffeb
movq 0x8(%rax), %r14
movl -0x8(%r14), %eax
jmp 0x3fff8
leaq 0x4(%rbx), %r14
movq 0x40(%rbx), %rdx
movl $0x20, %esi
movq %r14, %rdi
callq 0x300c7
movl %eax, 0x38(%rbx)
movq %r14, 0x30(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x59478(%rip), %rdi     # 0x9948b
leaq 0x591e5(%rip), %rsi     # 0x991ff
movl $0x9f1, %edx            # imm = 0x9F1
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zcardCommand
void zcardCommand(redisClient *c) {
    robj *key = c->argv[1];
    robj *zobj;

    // 取出有序集合
    if ((zobj = lookupKeyReadOrReply(c,key,shared.czero)) == NULL ||
        checkType(c,zobj,REDIS_ZSET)) return;

    // 返回集合基数
    addReplyLongLong(c,zsetLength(zobj));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rsi
leaq 0x88b31(%rip), %rax     # 0xca800
movq 0x20(%rax), %rdx
callq 0x31745
testq %rax, %rax
je 0x41cf4
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x3, %edx
callq 0x30bbf
testl %eax, %eax
je 0x41cfc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x3eadd
movl %eax, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2e133
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zscoreCommand
void zscoreCommand(redisClient *c) {
    robj *key = c->argv[1];
    robj *zobj;
    double score;

    if ((zobj = lookupKeyReadOrReply(c,key,shared.nullbulk)) == NULL ||
        checkType(c,zobj,REDIS_ZSET)) return;

    // ziplist
    if (zobj->encoding == REDIS_ENCODING_ZIPLIST) {
        // 取出元素
        if (zzlFind(zobj->ptr,c->argv[2],&score) != NULL)
            // 回复分值
            addReplyDouble(c,score);
        else
            addReply(c,shared.nullbulk);

    // SKIPLIST
    } else if (zobj->encoding == REDIS_ENCODING_SKIPLIST) {
        zset *zs = zobj->ptr;
        dictEntry *de;

        c->argv[2] = tryObjectEncoding(c->argv[2]);
        // 直接从字典中取出并返回分值
        de = dictFind(zs->dict,c->argv[2]);
        if (de != NULL) {
            score = *(double*)dictGetVal(de);
            addReplyDouble(c,score);
        } else {
            addReply(c,shared.nullbulk);
        }

    } else {
        redisPanic("Unknown sorted set encoding");
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rsi
leaq 0x88ad0(%rip), %r15     # 0xca800
movq 0x50(%r15), %rdx
callq 0x31745
testq %rax, %rax
je 0x41d55
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x3, %edx
callq 0x30bbf
testl %eax, %eax
je 0x41d5f
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl (%r14), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x7, %eax
je 0x41da1
cmpl $0x5, %eax
jne 0x41e0e
movq 0x8(%r14), %rdi
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rsi
leaq 0x8(%rsp), %rdx
callq 0x3e6af
testq %rax, %rax
je 0x41dfd
movsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x2df9b
jmp 0x41d55
movq 0x8(%r14), %r14
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x30c49
movq 0x38(%rbx), %rcx
movq %rax, 0x10(%rcx)
movq (%r14), %rdi
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rsi
callq 0x226ac
testq %rax, %rax
je 0x41de8
movq 0x8(%rax), %rax
movsd (%rax), %xmm0
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2df9b
movq 0x50(%r15), %rsi
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2d97c
movq 0x50(%r15), %rsi
movq %rbx, %rdi
callq 0x2d97c
jmp 0x41d55
leaq 0x5559e(%rip), %rdi     # 0x973b3
leaq 0x573e3(%rip), %rsi     # 0x991ff
movl $0xe7e, %edx            # imm = 0xE7E
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zscanCommand
void zscanCommand(redisClient *c) {
    robj *o;
    unsigned long cursor;

    if (parseScanCursorOrReply(c,c->argv[2],&cursor) == REDIS_ERR) return;
    if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.emptyscan)) == NULL ||
        checkType(c,o,REDIS_ZSET)) return;
    scanGenericCommand(c,o,cursor);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x10(%rax), %rsi
movq %rsp, %rdx
callq 0x32100
cmpl $-0x1, %eax
je 0x42117
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x88723(%rip), %rax     # 0xca800
movq 0x148(%rax), %rdx
movq %rbx, %rdi
callq 0x31745
testq %rax, %rax
je 0x42117
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x3, %edx
callq 0x30bbf
testl %eax, %eax
jne 0x42117
movq (%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3217d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop