// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x513b5
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cvtsi2sd %rax, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x51466
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x5141c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x1, %rdi
leaq -0x28(%rbp), %rsi
callq 0x1fc60
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x51403
movq -0x20(%rbp), %rax
movsd (%rax), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x51403
jmp 0x5140f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x51548
movq -0x20(%rbp), %rax
movl $0x1, 0x10(%rax)
jmp 0x51464
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1fc60
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x51456
movq -0x20(%rbp), %rax
movsd (%rax), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x51456
jmp 0x51462
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x51548
jmp 0x51464
jmp 0x51466
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x51492
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cvtsi2sd %rax, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x8(%rax)
jmp 0x51541
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x514f8
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x1, %rdi
leaq -0x28(%rbp), %rsi
callq 0x1fc60
movq -0x20(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x514e2
movq -0x20(%rbp), %rax
movsd 0x8(%rax), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x514e2
jmp 0x514eb
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x51548
movq -0x20(%rbp), %rax
movl $0x1, 0x14(%rax)
jmp 0x5153f
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1fc60
movq -0x20(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x51534
movq -0x20(%rbp), %rax
movsd 0x8(%rax), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x51534
jmp 0x5153d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x51548
jmp 0x5153f
jmp 0x51541
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)