LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x3d479
testl %eax, %eax
je 0x3d581
movq (%r14), %rax
movslq 0x18(%r14), %rcx
testq %rcx, %rcx
jle 0x3d553
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 0x3d54d
movsd 0x8(%rdi), %xmm0
xorl %r8d, %r8d
xorl %r9d, %r9d
ucomisd (%rbx), %xmm0
seta %r8b
setae %r9b
cmpl $0x0, 0x10(%rbx)
cmovel %r9d, %r8d
cmpb $0x1, %r8b
jne 0x3d51b
cmpq $0x1, %rdx
jg 0x3d50b
movq 0x18(%rax), %rcx
testq %rcx, %rcx
je 0x3d58b
movsd 0x8(%rbx), %xmm0
xorl %edx, %edx
xorl %eax, %eax
ucomisd 0x8(%rcx), %xmm0
seta %dl
setae %al
cmpl $0x0, 0x14(%rbx)
cmovel %eax, %edx
xorl %eax, %eax
testb %dl, %dl
cmovneq %rcx, %rax
jmp 0x3d583
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5bc2d(%rip), %rdi     # 0x991bf
leaq 0x5bc1d(%rip), %rsi     # 0x991b6
movl $0x1da, %edx            # imm = 0x1DA
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/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 0x3d479
testl %eax, %eax
je 0x3d648
movq (%r14), %rcx
movslq 0x18(%r14), %rax
testq %rax, %rax
jle 0x3d61f
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 0x3d619
movsd 0x8(%rdi), %xmm0
cmpl $0x0, 0x14(%rbx)
je 0x3d607
movsd 0x8(%rbx), %xmm1
ucomisd %xmm0, %xmm1
seta %r8b
jmp 0x3d614
movsd 0x8(%rbx), %xmm1
ucomisd %xmm0, %xmm1
setae %r8b
testb %r8b, %r8b
jne 0x3d5e0
cmpq $0x1, %rdx
jg 0x3d5d0
testq %rcx, %rcx
je 0x3d652
movsd 0x8(%rcx), %xmm0
xorl %edx, %edx
xorl %eax, %eax
ucomisd (%rbx), %xmm0
seta %dl
setae %al
cmpl $0x0, 0x10(%rbx)
cmovel %eax, %edx
xorl %eax, %eax
testb %dl, %dl
cmovneq %rcx, %rax
jmp 0x3d64a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5bb66(%rip), %rdi     # 0x991bf
leaq 0x5bb56(%rip), %rsi     # 0x991b6
movl $0x201, %edx            # imm = 0x201
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslDeleteRangeByScore
unsigned long zslDeleteRangeByScore(zskiplist *zsl, zrangespec *range, dict *dict) {
    zskiplistNode *update[ZSKIPLIST_MAXLEVEL], *x;
    unsigned long removed = 0;
    int i;

    // 记录所有和被删除节点（们）有关的节点
    // T_wrost = O(N) , T_avg = O(log N)
    x = zsl->header;
    for (i = zsl->level-1; i >= 0; i--) {
        while (x->level[i].forward && (range->minex ?
            x->level[i].forward->score <= range->min :
            x->level[i].forward->score < range->min))
                x = x->level[i].forward;
        update[i] = x;
    }

    /* Current node is the last with score < or <= min. */
    // 定位到给定范围开始的第一个节点
    x = x->level[0].forward;

    /* Delete nodes while in range. */
    // 删除范围中的所有节点
    // T = O(N)
    while (x &&
           (range->maxex ? x->score < range->max : x->score <= range->max))
    {
        // 记录下个节点的指针
        zskiplistNode *next = x->level[0].forward;
        zslDeleteNode(zsl,x,update);
        dictDelete(dict,x->obj);
        zslFreeNode(x);
        removed++;
        x = next;
    }
    return removed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
movslq 0x18(%rdi), %rcx
testq %rcx, %rcx
jle 0x3d6e7
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 0x3d6dd
movsd (%r14), %xmm0
xorl %r8d, %r8d
xorl %r9d, %r9d
ucomisd 0x8(%rdi), %xmm0
setae %r8b
seta %r9b
cmpl $0x0, 0x10(%r14)
cmovel %r9d, %r8d
testb %r8b, %r8b
jne 0x3d6aa
movq %rax, (%rsp,%rcx,8)
cmpq $0x1, %rdx
jg 0x3d69a
movq 0x18(%rax), %rbp
xorl %r12d, %r12d
testq %rbp, %rbp
je 0x3d759
cmpl $0x0, 0x14(%r14)
movsd 0x8(%rbp), %xmm0
je 0x3d70e
movsd 0x8(%r14), %xmm1
ucomisd %xmm0, %xmm1
seta %al
jmp 0x3d71b
movsd 0x8(%r14), %xmm1
ucomisd %xmm0, %xmm1
setae %al
testb %al, %al
je 0x3d759
movq 0x18(%rbp), %r13
movq %r15, %rdi
movq %rbp, %rsi
movq %rsp, %rdx
callq 0x3d2e5
movq (%rbp), %rsi
movq %rbx, %rdi
callq 0x225d3
movq (%rbp), %rdi
callq 0x30834
movq %rbp, %rdi
callq 0x2984b
incq %r12
movq %r13, %rbp
testq %r13, %r13
jne 0x3d6f3
movq %r12, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslDeleteRangeByLex
unsigned long zslDeleteRangeByLex(zskiplist *zsl, zlexrangespec *range, dict *dict) {
    zskiplistNode *update[ZSKIPLIST_MAXLEVEL], *x;
    unsigned long removed = 0;
    int i;


    x = zsl->header;
    for (i = zsl->level-1; i >= 0; i--) {
        while (x->level[i].forward &&
            !zslLexValueGteMin(x->level[i].forward->obj,range))
                x = x->level[i].forward;
        update[i] = x;
    }

    /* Current node is the last with score < or <= min. */
    x = x->level[0].forward;

    /* Delete nodes while in range. */
    while (x && zslLexValueLteMax(x->obj,range)) {
        zskiplistNode *next = x->level[0].forward;

        // 从跳跃表中删除当前节点
        zslDeleteNode(zsl,x,update);
        // 从字典中删除当前节点
        dictDelete(dict,x->obj);
        // 释放当前跳跃表节点的结构
        zslFreeNode(x);

        // 增加删除计数器
        removed++;

        // 继续处理下个节点
        x = next;
    }

    // 返回被删除节点的数量
    return removed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, 0x8(%rsp)
movq %rsi, %r14
movq (%rdi), %r12
movq %rdi, (%rsp)
movslq 0x18(%rdi), %rbp
testq %rbp, %rbp
jle 0x3d7f4
movq %rbp, %rbx
decq %rbp
movq %rbp, %r13
shlq $0x4, %r13
movq 0x18(%r12,%r13), %rax
testq %rax, %rax
je 0x3d7e9
movq (%rax), %rdi
movq %r14, %rsi
callq 0x3d868
testl %eax, %eax
jne 0x3d7e9
leaq (%r12,%r13), %r15
addq $0x18, %r15
movq (%r15), %r12
movq 0x18(%r12,%r13), %rax
testq %rax, %rax
je 0x3d7e9
leaq (%r12,%r13), %r15
addq $0x18, %r15
movq (%rax), %rdi
movq %r14, %rsi
callq 0x3d868
testl %eax, %eax
je 0x3d7c5
movq %r12, 0x10(%rsp,%rbp,8)
cmpq $0x1, %rbx
jg 0x3d797
movq 0x18(%r12), %rbp
xorl %r12d, %r12d
testq %rbp, %rbp
je 0x3d853
leaq 0x10(%rsp), %r13
movq (%rbp), %rdi
movq %r14, %rsi
callq 0x3d886
testl %eax, %eax
je 0x3d853
movq 0x18(%rbp), %rbx
movq (%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x3d2e5
movq (%rbp), %rsi
movq 0x8(%rsp), %rdi
callq 0x225d3
movq (%rbp), %rdi
callq 0x30834
movq %rbp, %rdi
callq 0x2984b
incq %r12
movq %rbx, %rbp
testq %rbx, %rbx
jne 0x3d806
movq %r12, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslDeleteRangeByRank
unsigned long zslDeleteRangeByRank(zskiplist *zsl, unsigned int start, unsigned int end, dict *dict) {
    zskiplistNode *update[ZSKIPLIST_MAXLEVEL], *x;
    unsigned long traversed = 0, removed = 0;
    int i;

    // 沿着前进指针移动到指定排位的起始位置，并记录所有沿途指针
    // T_wrost = O(N) , T_avg = O(log N)
    x = zsl->header;
    for (i = zsl->level-1; i >= 0; i--) {
        while (x->level[i].forward && (traversed + x->level[i].span) < start) {
            traversed += x->level[i].span;
            x = x->level[i].forward;
        }
        update[i] = x;
    }

    // 移动到排位的起始的第一个节点
    traversed++;
    x = x->level[0].forward;
    // 删除所有在给定排位范围内的节点
    // T = O(N)
    while (x && traversed <= end) {

        // 记录下一节点的指针
        zskiplistNode *next = x->level[0].forward;

        // 从跳跃表中删除节点
        zslDeleteNode(zsl,x,update);
        // 从字典中删除节点
        dictDelete(dict,x->obj);
        // 释放节点结构
        zslFreeNode(x);

        // 为删除计数器增一
        removed++;

        // 为排位计数器增一
        traversed++;

        // 处理下个节点
        x = next;
    }

    // 返回被删除节点的数量
    return removed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rcx, 0x8(%rsp)
movq %rdi, %r14
movq (%rdi), %rax
movslq 0x18(%rdi), %rcx
testq %rcx, %rcx
jle 0x3d916
movl %esi, %esi
xorl %r13d, %r13d
movq %rcx, %rdi
decq %rcx
movq %rcx, %r8
shlq $0x4, %r8
movq %r13, %r10
movq %rax, %r9
movq %r9, %rax
movq %r10, %r13
movq 0x18(%r9,%r8), %r9
testq %r9, %r9
je 0x3d909
leaq (%rax,%r8), %r10
addq $0x18, %r10
movl 0x8(%r10), %r10d
addq %r13, %r10
cmpq %rsi, %r10
jb 0x3d8e5
movq %rax, 0x10(%rsp,%rcx,8)
cmpq $0x1, %rdi
jg 0x3d8d2
jmp 0x3d919
xorl %r13d, %r13d
movq 0x18(%rax), %rbp
xorl %eax, %eax
testq %rbp, %rbp
je 0x3d97b
movl %edx, %ebx
cmpq %rbx, %r13
jae 0x3d97b
incq %r13
xorl %r15d, %r15d
movq %rbp, %r12
movq 0x18(%rbp), %rbp
movq %r14, %rdi
movq %r12, %rsi
leaq 0x10(%rsp), %rdx
callq 0x3d2e5
movq (%r12), %rsi
movq 0x8(%rsp), %rdi
callq 0x225d3
movq (%r12), %rdi
callq 0x30834
movq %r12, %rdi
callq 0x2984b
leaq 0x1(%r15), %rax
testq %rbp, %rbp
je 0x3d97b
addq %r13, %r15
cmpq %rbx, %r15
movq %rax, %r15
jb 0x3d931
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslGetRank
unsigned long zslGetRank(zskiplist *zsl, double score, robj *o) {
    zskiplistNode *x;
    unsigned long rank = 0;
    int i;

    // 遍历整个跳跃表
    x = zsl->header;
    for (i = zsl->level-1; i >= 0; i--) {

        // 遍历节点并对比元素
        while (x->level[i].forward &&
            (x->level[i].forward->score < score ||
                // 比对分值
                (x->level[i].forward->score == score &&
                // 比对成员对象
                compareStringObjects(x->level[i].forward->obj,o) <= 0))) {

            // 累积跨越的节点数量
            rank += x->level[i].span;

            // 沿着前进指针遍历跳跃表
            x = x->level[i].forward;
        }

        /* x might be equal to zsl->header, so test if obj is non-NULL */
        // 必须确保不仅分值相等，而且成员对象也要相等
        // T = O(N)
        if (x->obj && equalStringObjects(x->obj,o)) {
            return rank;
        }
    }

    // 没找到
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movslq 0x18(%rdi), %r15
testq %r15, %r15
jle 0x3da44
movq %rsi, %rbx
movq (%rdi), %r12
xorl %r14d, %r14d
movsd %xmm0, 0x8(%rsp)
leaq -0x1(%r15), %rbp
movq %rbp, 0x10(%rsp)
shlq $0x4, %rbp
movq 0x18(%r12,%rbp), %rax
testq %rax, %rax
je 0x3da1a
leaq (%r12,%rbp), %r13
addq $0x18, %r13
movsd 0x8(%rax), %xmm1
ucomisd %xmm1, %xmm0
ja 0x3d9fe
ucomisd %xmm0, %xmm1
jne 0x3da1a
jp 0x3da1a
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x30c21
movsd 0x8(%rsp), %xmm0
testl %eax, %eax
jg 0x3da1a
movl 0x8(%r13), %eax
addq %rax, %r14
movq (%r13), %r12
leaq (%r12,%rbp), %r13
addq $0x18, %r13
movq (%r13), %rax
testq %rax, %rax
jne 0x3d9d6
movq (%r12), %rdi
testq %rdi, %rdi
je 0x3da35
movq %rbx, %rsi
callq 0x30c35
movsd 0x8(%rsp), %xmm0
testl %eax, %eax
jne 0x3da47
cmpq $0x1, %r15
movq 0x10(%rsp), %r15
jg 0x3d9b7
xorl %r14d, %r14d
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslGetElementByRank
zskiplistNode* zslGetElementByRank(zskiplist *zsl, unsigned long rank) {
    zskiplistNode *x;
    unsigned long traversed = 0;
    int i;

    // T_wrost = O(N), T_avg = O(log N)
    x = zsl->header;
    for (i = zsl->level-1; i >= 0; i--) {

        // 遍历跳跃表并累积越过的节点数量
        while (x->level[i].forward && (traversed + x->level[i].span) <= rank)
        {
            traversed += x->level[i].span;
            x = x->level[i].forward;
        }

        // 如果越过的节点数量已经等于 rank
        // 那么说明已经到达要找的节点
        if (traversed == rank) {
            return x;
        }

    }

    // 没找到目标节点
    return NULL;
}

// Assembly:
movq (%rdi), %rax
movslq 0x18(%rdi), %rcx
xorl %edx, %edx
testq %rcx, %rcx
jle 0x3daa1
decq %rcx
movq %rcx, %rdi
shlq $0x4, %rdi
movq %rax, %r8
movq %rdx, %r9
movq %r9, %rdx
movq %r8, %rax
movq 0x18(%r8,%rdi), %r8
testq %r8, %r8
je 0x3da9b
leaq (%rax,%rdi), %r9
addq $0x18, %r9
movl 0x8(%r9), %r9d
addq %rdx, %r9
cmpq %rsi, %r9
jbe 0x3da77
cmpq %rsi, %rdx
jne 0x3da62
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3dae9
cmpl $0x28, %ecx
je 0x3dafb
cmpl $0x2b, %ecx
jne 0x3db40
cmpb $0x0, 0x1(%rdi)
jne 0x3db40
movl $0x0, (%rdx)
leaq 0x8cd2a(%rip), %rax     # 0xca800
movq 0x158(%rax), %rcx
movq %rcx, (%rbx)
movq 0x158(%rax), %rdi
jmp 0x3db39
cmpl $0x2d, %ecx
je 0x3db15
cmpl $0x5b, %ecx
jne 0x3db40
movl $0x0, (%rdx)
jmp 0x3db01
movl $0x1, (%rdx)
movslq -0x8(%rdi), %rsi
incq %rdi
decq %rsi
callq 0x303b7
movq %rax, (%rbx)
jmp 0x3db3e
cmpb $0x0, 0x1(%rdi)
jne 0x3db40
movl $0x0, (%rdx)
leaq 0x8ccd8(%rip), %rax     # 0xca800
movq 0x150(%rax), %rcx
movq %rcx, (%rbx)
movq 0x150(%rax), %rdi
callq 0x3041b
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslIsInLexRange
int zslIsInLexRange(zskiplist *zsl, zlexrangespec *range) {
    zskiplistNode *x;

    /* Test for ranges that will always be empty. */
    if (compareStringObjectsForLexRange(range->min,range->max) > 1 ||
            (compareStringObjects(range->min,range->max) == 0 &&
            (range->minex || range->maxex)))
        return 0;
    x = zsl->tail;
    if (x == NULL || !zslLexValueGteMin(x->obj,range))
        return 0;
    x = zsl->header->level[0].forward;
    if (x == NULL || !zslLexValueLteMax(x->obj,range))
        return 0;
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
callq 0x3db58
cmpl $0x1, %eax
jg 0x3dc0b
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0x30c21
testl %eax, %eax
je 0x3dbff
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x3dc0b
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x3d868
testl %eax, %eax
je 0x3dc0b
movq (%r14), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x3dc0b
movq (%rax), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3d886
cmpl $0x0, 0x10(%rbx)
jne 0x3dc0b
cmpl $0x0, 0x14(%rbx)
je 0x3dbc9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslFirstInLexRange
zskiplistNode *zslFirstInLexRange(zskiplist *zsl, zlexrangespec *range) {
    zskiplistNode *x;
    int i;

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

    x = zsl->header;
    for (i = zsl->level-1; i >= 0; i--) {
        /* Go forward while *OUT* of range. */
        while (x->level[i].forward &&
            !zslLexValueGteMin(x->level[i].forward->obj,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. */
    if (!zslLexValueLteMax(x->obj,range)) return NULL;
    return x;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3db9e
testl %eax, %eax
je 0x3dcb8
movq (%r14), %r15
movslq 0x18(%r14), %r14
testq %r14, %r14
jle 0x3dc98
movq %r14, %r12
decq %r14
movq %r14, %r13
shlq $0x4, %r13
movq 0x18(%r15,%r13), %rax
testq %rax, %rax
je 0x3dc92
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x3d868
testl %eax, %eax
jne 0x3dc92
leaq (%r15,%r13), %rbp
addq $0x18, %rbp
movq (%rbp), %r15
movq 0x18(%r15,%r13), %rax
testq %rax, %rax
je 0x3dc92
leaq (%r15,%r13), %rbp
addq $0x18, %rbp
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x3d868
testl %eax, %eax
je 0x3dc6d
cmpq $0x1, %r12
jg 0x3dc3f
movq 0x18(%r15), %r14
testq %r14, %r14
je 0x3dcc9
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3d886
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovneq %r14, %rax
jmp 0x3dcba
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5b4ef(%rip), %rdi     # 0x991bf
leaq 0x5b4df(%rip), %rsi     # 0x991b6
movl $0x3b7, %edx            # imm = 0x3B7
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zslLastInLexRange
zskiplistNode *zslLastInLexRange(zskiplist *zsl, zlexrangespec *range) {
    zskiplistNode *x;
    int i;

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

    x = zsl->header;
    for (i = zsl->level-1; i >= 0; i--) {
        /* Go forward while *IN* range. */
        while (x->level[i].forward &&
            zslLexValueLteMax(x->level[i].forward->obj,range))
                x = x->level[i].forward;
    }

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

    /* Check if score >= min. */
    if (!zslLexValueGteMin(x->obj,range)) return NULL;
    return x;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3db9e
testl %eax, %eax
je 0x3dd8a
movq (%r14), %r15
movslq 0x18(%r14), %r14
testq %r14, %r14
jle 0x3dd6e
movq %r14, %r12
decq %r14
movq %r14, %r13
shlq $0x4, %r13
movq 0x18(%r15,%r13), %rax
testq %rax, %rax
je 0x3dd68
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x3d886
testl %eax, %eax
je 0x3dd68
leaq (%r15,%r13), %rbp
addq $0x18, %rbp
movq (%rbp), %r15
movq 0x18(%r15,%r13), %rax
testq %rax, %rax
je 0x3dd68
leaq (%r15,%r13), %rbp
addq $0x18, %rbp
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x3d886
testl %eax, %eax
jne 0x3dd43
cmpq $0x1, %r12
jg 0x3dd15
testq %r15, %r15
je 0x3dd9b
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x3d868
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovneq %r15, %rax
jmp 0x3dd8c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5b41d(%rip), %rdi     # 0x991bf
leaq 0x5b40d(%rip), %rsi     # 0x991b6
movl $0x3d0, %edx            # imm = 0x3D0
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/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 0x3de25
leaq 0x18(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0x2c351
testl %eax, %eax
je 0x3de3a
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x3de13
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 0x3de1a
cvtsi2sdq 0x10(%rsp), %xmm0
addq $0xa8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5b6d0(%rip), %rdi     # 0x994fc
leaq 0x5b383(%rip), %rsi     # 0x991b6
movl $0x3e5, %edx            # imm = 0x3E5
jmp 0x3de4d
leaq 0x5b388(%rip), %rdi     # 0x991c9
leaq 0x5b36e(%rip), %rsi     # 0x991b6
movl $0x3e7, %edx            # imm = 0x3E7
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/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 0x3dea1
leaq 0x10(%rsp), %rsi
leaq 0x4(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0x2c351
testl %eax, %eax
je 0x3deb6
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3de92
movl 0x4(%rsp), %esi
callq 0x303b7
jmp 0x3de9c
movq 0x8(%rsp), %rdi
callq 0x303c6
addq $0x18, %rsp
retq
leaq 0x5b654(%rip), %rdi     # 0x994fc
leaq 0x5b307(%rip), %rsi     # 0x991b6
movl $0x3fe, %edx            # imm = 0x3FE
jmp 0x3dec9
leaq 0x5b30c(%rip), %rdi     # 0x991c9
leaq 0x5b2f2(%rip), %rsi     # 0x991b6
movl $0x3ff, %edx            # imm = 0x3FF
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlCompareElements
int zzlCompareElements(unsigned char *eptr, unsigned char *cstr, unsigned int clen) {
    unsigned char *vstr;
    unsigned int vlen;
    long long vlong;
    unsigned char vbuf[32];
    int minlen, cmp;

    // 取出节点中的字符串值，以及它的长度
    redisAssert(ziplistGet(eptr,&vstr,&vlen,&vlong));
    if (vstr == NULL) {
        /* Store string representation of long long in buf. */
        vlen = ll2string((char*)vbuf,sizeof(vbuf),vlong);
        vstr = vbuf;
    }

    // 对比
    minlen = (vlen < clen) ? vlen : clen;
    cmp = memcmp(vstr,cstr,minlen);
    if (cmp == 0) return vlen-clen;
    return cmp;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movl %edx, %ebp
movq %rsi, %rbx
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x18(%rsp), %rcx
callq 0x2c351
testl %eax, %eax
je 0x3df51
cmpq $0x0, 0x10(%rsp)
jne 0x3df25
movq 0x18(%rsp), %rdx
leaq 0x20(%rsp), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x2fe12
movl %eax, 0xc(%rsp)
movq %r14, 0x10(%rsp)
movl 0xc(%rsp), %eax
movl %eax, %r14d
subl %ebp, %r14d
cmovbl %eax, %ebp
movq 0x10(%rsp), %rdi
movslq %ebp, %rdx
movq %rbx, %rsi
callq 0x1f940
testl %eax, %eax
cmovel %r14d, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x5b295(%rip), %rdi     # 0x991ed
leaq 0x5b257(%rip), %rsi     # 0x991b6
movl $0x418, %edx            # imm = 0x418
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/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 0x3dfe2
movq %rdx, %rbx
movq %rsi, %r14
movq (%rdx), %rsi
testq %rsi, %rsi
je 0x3dfe2
movq %rdi, %r12
callq 0x2c2b3
movq %rax, %r15
testq %rax, %rax
je 0x3dfce
movq %r12, %rdi
movq %r15, %rsi
callq 0x2c2b3
testq %rax, %rax
jne 0x3dfd0
leaq 0x5b270(%rip), %rdi     # 0x99230
leaq 0x5b1ef(%rip), %rsi     # 0x991b6
movl $0x43e, %edx            # imm = 0x43E
jmp 0x3dff5
xorl %eax, %eax
movq %r15, (%r14)
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x5b228(%rip), %rdi     # 0x99211
leaq 0x5b1c6(%rip), %rsi     # 0x991b6
movl $0x437, %edx            # imm = 0x437
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlPrev
void zzlPrev(unsigned char *zl, unsigned char **eptr, unsigned char **sptr) {
    unsigned char *_eptr, *_sptr;
    redisAssert(*eptr != NULL && *sptr != NULL);

    _sptr = ziplistPrev(zl,*eptr);
    if (_sptr != NULL) {
        _eptr = ziplistPrev(zl,_sptr);
        redisAssert(_eptr != NULL);
    } else {
        /* No previous entry. */
        _eptr = NULL;
    }

    *eptr = _eptr;
    *sptr = _sptr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq (%rsi), %rsi
testq %rsi, %rsi
je 0x3e069
movq %rdx, %rbx
cmpq $0x0, (%rdx)
je 0x3e069
movq %rdi, %r12
callq 0x2c2d9
movq %rax, %r15
testq %rax, %rax
je 0x3e055
movq %r12, %rdi
movq %r15, %rsi
callq 0x2c2d9
testq %rax, %rax
jne 0x3e057
leaq 0x5b1f7(%rip), %rdi     # 0x9923e
leaq 0x5b168(%rip), %rsi     # 0x991b6
movl $0x458, %edx            # imm = 0x458
jmp 0x3e07c
xorl %eax, %eax
movq %rax, (%r14)
movq %r15, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x5b1a1(%rip), %rdi     # 0x99211
leaq 0x5b13f(%rip), %rsi     # 0x991b6
movl $0x453, %edx            # imm = 0x453
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlIsInRange
int zzlIsInRange(unsigned char *zl, zrangespec *range) {
    unsigned char *p;
    double score;

    /* Test for ranges that will always be empty. */
    if (range->min > range->max ||
            (range->min == range->max && (range->minex || range->maxex)))
        return 0;

    // 取出 ziplist 中的最大分值，并和 range 的最大值对比
    p = ziplistIndex(zl,-1); /* Last score. */
    if (p == NULL) return 0; /* Empty sorted set */
    score = zzlGetScore(p);
    if (!zslValueGteMin(score,range))
        return 0;

    // 取出 ziplist 中的最小值，并和 range 的最小值进行对比
    p = ziplistIndex(zl,1); /* First score. */
    redisAssert(p != NULL);
    score = zzlGetScore(p);
    if (!zslValueLteMax(score,range))
        return 0;

    // ziplist 有至少一个节点符合范围
    return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movsd (%rsi), %xmm0
xorl %ebp, %ebp
ucomisd 0x8(%rsi), %xmm0
ja 0x3e120
movq %rsi, %rbx
movq %rdi, %r14
jne 0x3e0b6
jp 0x3e0b6
cmpl $0x0, 0x10(%rbx)
jne 0x3e120
cmpl $0x0, 0x14(%rbx)
jne 0x3e120
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x2bff5
testq %rax, %rax
je 0x3e120
movq %rax, %rdi
callq 0x3ddbd
xorl %eax, %eax
xorl %ecx, %ecx
ucomisd (%rbx), %xmm0
seta %al
setae %cl
cmpl $0x0, 0x10(%rbx)
cmovel %ecx, %eax
cmpb $0x1, %al
jne 0x3e120
movq %r14, %rdi
movl $0x1, %esi
callq 0x2bff5
testq %rax, %rax
je 0x3e127
movq %rax, %rdi
callq 0x3ddbd
movsd 0x8(%rbx), %xmm1
xorl %eax, %eax
xorl %ecx, %ecx
ucomisd %xmm0, %xmm1
seta %al
setae %cl
cmpl $0x0, 0x14(%rbx)
cmovel %ecx, %eax
movzbl %al, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x5b11e(%rip), %rdi     # 0x9924c
leaq 0x5b081(%rip), %rsi     # 0x991b6
movl $0x47a, %edx            # imm = 0x47A
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq %rdi, %r12
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x2bff5
movq %rax, %r15
movq %r12, %rdi
movq %r14, %rsi
callq 0x3e08b
testl %eax, %eax
sete %al
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x3e1ef
xorl %ebx, %ebx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2c2b3
testq %rax, %rax
je 0x3e1fc
movq %rax, %r13
movq %rax, %rdi
callq 0x3ddbd
xorl %eax, %eax
xorl %ecx, %ecx
ucomisd (%r14), %xmm0
seta %al
setae %cl
cmpl $0x0, 0x10(%r14)
cmovel %ecx, %eax
cmpb $0x1, %al
je 0x3e1cb
movq %r12, %rdi
movq %r13, %rsi
callq 0x2c2b3
movq %rax, %r15
testq %rax, %rax
jne 0x3e180
jmp 0x3e1ef
movsd 0x8(%r14), %xmm1
xorl %eax, %eax
xorl %ecx, %ecx
ucomisd %xmm0, %xmm1
seta %al
setae %cl
cmpl $0x0, 0x14(%r14)
cmovel %ecx, %eax
xorl %ebx, %ebx
testb %al, %al
cmovneq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x5b2f9(%rip), %rdi     # 0x994fc
leaq 0x5afac(%rip), %rsi     # 0x991b6
movl $0x498, %edx            # imm = 0x498
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x2bff5
movq %rax, %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3e08b
testl %eax, %eax
sete %al
testq %r15, %r15
sete %cl
xorl %r12d, %r12d
orb %al, %cl
jne 0x3e2e7
movq %r14, %rdi
movq %r15, %rsi
callq 0x2c2b3
testq %rax, %rax
je 0x3e2f6
movq %rax, %rdi
callq 0x3ddbd
cmpl $0x0, 0x14(%rbx)
je 0x3e28a
movsd 0x8(%rbx), %xmm1
ucomisd %xmm0, %xmm1
seta %al
jmp 0x3e296
movsd 0x8(%rbx), %xmm1
ucomisd %xmm0, %xmm1
setae %al
testb %al, %al
jne 0x3e2c9
movq %r14, %rdi
movq %r15, %rsi
callq 0x2c2d9
testq %rax, %rax
je 0x3e2bf
movq %r14, %rdi
movq %rax, %rsi
callq 0x2c2d9
movq %rax, %r15
testq %rax, %rax
jne 0x3e2c2
jmp 0x3e30b
xorl %r15d, %r15d
testq %r15, %r15
jne 0x3e25a
jmp 0x3e2e7
xorl %eax, %eax
xorl %ecx, %ecx
ucomisd (%rbx), %xmm0
seta %al
setae %cl
cmpl $0x0, 0x10(%rbx)
cmovel %ecx, %eax
xorl %r12d, %r12d
testb %al, %al
cmovneq %r15, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x5b1ff(%rip), %rdi     # 0x994fc
leaq 0x5aeb2(%rip), %rsi     # 0x991b6
movl $0x4be, %edx            # imm = 0x4BE
jmp 0x3e31e
leaq 0x5af44(%rip), %rdi     # 0x99256
leaq 0x5ae9d(%rip), %rsi     # 0x991b6
movl $0x4cd, %edx            # imm = 0x4CD
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlIsInLexRange
int zzlIsInLexRange(unsigned char *zl, zlexrangespec *range) {
    unsigned char *p;

    /* Test for ranges that will always be empty. */
    if (compareStringObjectsForLexRange(range->min,range->max) > 1 ||
            (compareStringObjects(range->min,range->max) == 0 &&
            (range->minex || range->maxex)))
        return 0;

    p = ziplistIndex(zl,-2); /* Last element. */
    if (p == NULL) return 0;
    if (!zzlLexValueGteMin(p,range))
        return 0;

    p = ziplistIndex(zl,0); /* First element. */
    redisAssert(p != NULL);
    if (!zzlLexValueLteMax(p,range))
        return 0;

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
callq 0x3db58
cmpl $0x1, %eax
jg 0x3e3d4
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0x30c21
testl %eax, %eax
je 0x3e3c8
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x2bff5
testq %rax, %rax
je 0x3e3d4
movq %rax, %rdi
callq 0x3de5c
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3d868
movl %eax, %ebp
movq %r15, %rdi
callq 0x30834
testl %ebp, %ebp
je 0x3e3d4
movq %r14, %rdi
xorl %esi, %esi
callq 0x2bff5
testq %rax, %rax
je 0x3e3e1
movq %rax, %rdi
callq 0x3de5c
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3d886
movl %eax, %ebx
movq %r14, %rdi
callq 0x30834
movl %ebx, %eax
jmp 0x3e3d6
cmpl $0x0, 0x10(%rbx)
jne 0x3e3d4
cmpl $0x0, 0x14(%rbx)
je 0x3e35f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5ae64(%rip), %rdi     # 0x9924c
leaq 0x5adc7(%rip), %rsi     # 0x991b6
movl $0x4f4, %edx            # imm = 0x4F4
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlFirstInLexRange
unsigned char *zzlFirstInLexRange(unsigned char *zl, zlexrangespec *range) {
    unsigned char *eptr = ziplistIndex(zl,0), *sptr;

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

    while (eptr != NULL) {
        if (zzlLexValueGteMin(eptr,range)) {
            /* Check if score <= max. */
            if (zzlLexValueLteMax(eptr,range))
                return eptr;
            return NULL;
        }

        /* Move to next element. */
        sptr = ziplistNext(zl,eptr); /* This element score. Skip it. */
        redisAssert(sptr != NULL);
        eptr = ziplistNext(zl,sptr); /* Next element. */
    }

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x2bff5
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x3e32d
testl %eax, %eax
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
jne 0x3e4ad
xorl %ebx, %ebx
movq %r12, %rdi
callq 0x3de5c
movq %rax, %r13
movq %rax, %rdi
movq %r14, %rsi
callq 0x3d868
movl %eax, %ebp
movq %r13, %rdi
callq 0x30834
testl %ebp, %ebp
jne 0x3e485
movq %r15, %rdi
movq %r12, %rsi
callq 0x2c2b3
testq %rax, %rax
je 0x3e4bf
movq %r15, %rdi
movq %rax, %rsi
callq 0x2c2b3
movq %rax, %r12
testq %rax, %rax
jne 0x3e43c
jmp 0x3e4ad
movq %r12, %rdi
callq 0x3de5c
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x3d886
movl %eax, %ebp
movq %rbx, %rdi
callq 0x30834
xorl %ebx, %ebx
testl %ebp, %ebp
cmovneq %r12, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5b036(%rip), %rdi     # 0x994fc
leaq 0x5ace9(%rip), %rsi     # 0x991b6
movl $0x50d, %edx            # imm = 0x50D
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlLastInLexRange
unsigned char *zzlLastInLexRange(unsigned char *zl, zlexrangespec *range) {
    unsigned char *eptr = ziplistIndex(zl,-2), *sptr;

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

    while (eptr != NULL) {
        if (zzlLexValueLteMax(eptr,range)) {
            /* Check if score >= min. */
            // 找到最后一个符合范围的值
            // 返回它的指针
            if (zzlLexValueGteMin(eptr,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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x2bff5
movq %rax, %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3e32d
testl %eax, %eax
sete %al
testq %r15, %r15
sete %cl
xorl %r12d, %r12d
orb %al, %cl
jne 0x3e598
movq %r15, %rdi
callq 0x3de5c
movq %rax, %r13
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3d886
movl %eax, %ebp
movq %r13, %rdi
callq 0x30834
testl %ebp, %ebp
jne 0x3e56f
movq %r14, %rdi
movq %r15, %rsi
callq 0x2c2d9
testq %rax, %rax
je 0x3e565
movq %r14, %rdi
movq %rax, %rsi
callq 0x2c2d9
movq %rax, %r15
testq %rax, %rax
jne 0x3e568
jmp 0x3e5aa
xorl %r15d, %r15d
testq %r15, %r15
jne 0x3e51c
jmp 0x3e598
movq %r15, %rdi
callq 0x3de5c
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3d868
movl %eax, %ebx
movq %r14, %rdi
callq 0x30834
xorl %r12d, %r12d
testl %ebx, %ebx
cmovneq %r15, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5aca5(%rip), %rdi     # 0x99256
leaq 0x5abfe(%rip), %rsi     # 0x991b6
movl $0x52a, %edx            # imm = 0x52A
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlFind
unsigned char *zzlFind(unsigned char *zl, robj *ele, double *score) {

    // 定位到首个元素
    unsigned char *eptr = ziplistIndex(zl,0), *sptr;

    // 解码成员
    ele = getDecodedObject(ele);

    // 遍历整个 ziplist ，查找元素（确认成员存在，并且取出它的分值）
    while (eptr != NULL) {
        // 指向分值
        sptr = ziplistNext(zl,eptr);
        redisAssertWithInfo(NULL,ele,sptr != NULL);

        // 比对成员
        if (ziplistCompare(eptr,ele->ptr,sdslen(ele->ptr))) {
            /* Matching element, pull out score. */
            // 成员匹配，取出分值
            if (score != NULL) *score = zzlGetScore(sptr);
            decrRefCount(ele);
            return eptr;
        }

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

    decrRefCount(ele);
    
    // 没有找到
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x2bff5
movq %rax, %r13
movq %rbx, %rdi
callq 0x30ac3
movq %rax, %rbx
testq %r13, %r13
je 0x3e64e
movq %r13, %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x2c2b3
testq %rax, %rax
je 0x3e663
movq %rax, %r13
movq 0x8(%rbx), %rsi
movl -0x8(%rsi), %edx
movq %r14, %rdi
callq 0x2c64f
testl %eax, %eax
jne 0x3e63c
movq %r12, %rdi
movq %r13, %rsi
callq 0x2c2b3
movq %rax, %r14
testq %rax, %rax
jne 0x3e5fe
xorl %r14d, %r14d
jmp 0x3e64e
testq %r15, %r15
je 0x3e64e
movq %r13, %rdi
callq 0x3ddbd
movsd %xmm0, (%r15)
movq %rbx, %rdi
callq 0x30834
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x5ae92(%rip), %rdx     # 0x994fc
leaq 0x5ab45(%rip), %rcx     # 0x991b6
xorl %edi, %edi
movq %rbx, %rsi
movl $0x543, %r8d            # imm = 0x543
callq 0x4d872
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/t_zset.c
// Function: zzlDelete
unsigned char *zzlDelete(unsigned char *zl, unsigned char *eptr) {
    unsigned char *p = eptr;

    /* TODO: add function to ziplist API to delete N elements from offset. */
    zl = ziplistDelete(zl,&p);
    zl = ziplistDelete(zl,&p);
    return zl;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rbx
movq %rsi, (%rbx)
movq %rbx, %rsi
callq 0x2c46e
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2c46e
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3e77b
movq %rsi, %r15
movq %rdi, %r14
movq %rsp, %rdi
movl $0x80, %esi
callq 0x2ffdd
movl %eax, %ebp
testq %r15, %r15
je 0x3e72a
movq %r15, %r12
subq %r14, %r12
movq 0x8(%rbx), %rdx
movl -0x8(%rdx), %ecx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2c469
movq %rax, %r14
addq %rax, %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x2c2b3
testq %rax, %rax
je 0x3e760
movq %rsp, %rdx
movq %r14, %rdi
movq %rax, %rsi
movl %ebp, %ecx
callq 0x2c469
jmp 0x3e750
movq 0x8(%rbx), %rsi
movl -0x8(%rsi), %edx
movq %r14, %rdi
movl $0x1, %ecx
callq 0x2bc04
movq %rsp, %rsi
movq %rax, %rdi
movl %ebp, %edx
movl $0x1, %ecx
callq 0x2bc04
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5ab2b(%rip), %rdx     # 0x99292
leaq 0x5aa48(%rip), %rcx     # 0x991b6
xorl %edi, %edi
movq %rbx, %rsi
movl $0x588, %r8d            # imm = 0x588
jmp 0x3e794
leaq 0x5aafa(%rip), %rdx     # 0x9927c
leaq 0x5aa2d(%rip), %rcx     # 0x991b6
xorl %edi, %edi
movq %rbx, %rsi
movl $0x573, %r8d            # imm = 0x573
callq 0x4d872
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
xorl %esi, %esi
callq 0x2bff5
movq %rax, %r15
movq %rbx, %rdi
callq 0x30ac3
movq %rax, %rbx
testq %r15, %r15
sete %bpl
je 0x3e841
movq %r14, %rdi
movq %r15, %rsi
callq 0x2c2b3
testq %rax, %rax
je 0x3e875
movq %rax, %r12
movq %rax, %rdi
callq 0x3ddbd
ucomisd 0x8(%rsp), %xmm0
ja 0x3e82a
jne 0x3e817
jp 0x3e817
movq 0x8(%rbx), %rsi
movl -0x8(%rsi), %edx
movq %r15, %rdi
callq 0x3ded8
testl %eax, %eax
jg 0x3e82a
movq %r14, %rdi
movq %r12, %rsi
callq 0x2c2b3
movq %rax, %r15
testq %rax, %rax
jmp 0x3e7d3
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movsd 0x8(%rsp), %xmm0
callq 0x3e6b1
movq %rax, %r14
testb $0x1, %bpl
je 0x3e85d
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movsd 0x8(%rsp), %xmm0
callq 0x3e6b1
movq %rax, %r14
movq %rbx, %rdi
callq 0x30834
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5ac80(%rip), %rdx     # 0x994fc
leaq 0x5a933(%rip), %rcx     # 0x991b6
xorl %edi, %edi
movq %rbx, %rsi
movl $0x5a7, %r8d            # imm = 0x5A7
callq 0x4d872
movl $0x1, %edi
callq 0x1f3b0