// File: /workspace/github_cpp_makefile_star2_O1/helayzhang[P]sorted_set/./sorted_set.hh
// Function: SortedSet<int, std::tr1::hash<int>, std::equal_to<int>>::zrange_withscores_generic(long, long, bool, std::vector<std::pair<int, double>, std::allocator<std::pair<int, double>>>&)
void zrange_withscores_generic(long start, long end, bool reverse, KeyScoreVecType &result) {
        result.clear();

        /* Sanitize indexes. */
        long llen = length();
        if (start < 0) start = llen+start;
        if (end < 0) end = llen+end;
        if (start < 0) start = 0;

        /* Invariant: start >= 0, so this test will be true when end < 0.
         * The range is empty when start > end or start >= length. */
        if (start > end || start >= llen) {
            return;
        }
        if (end >= llen) end = llen-1;
        unsigned long rangelen = (end-start)+1;

        SkipListNode *ln;
        /* Check if starting point is trivial, before doing log(N) lookup. */
        if (reverse) {
            ln = mTail;
            if (start > 0)
                ln = get_element_by_rank(llen-start);
        } else {
            ln = mHeader->mLevel[0].mForward;
            if (start > 0)
                ln = get_element_by_rank(start+1);
        }

        while(rangelen--) {
            assert(ln != NULL);
            result.push_back(std::make_pair(ln->mKey, ln->mScore));
            ln = reverse ? ln->mBackward : ln->mLevel[0].mForward;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movl %ecx, %r14d
movq (%r8), %rax
cmpq %rax, 0x8(%r8)
je 0x267c
movq %rax, 0x8(%rbx)
movq 0x10(%rdi), %rcx
movq %rsi, %r8
sarq $0x3f, %r8
andq %rcx, %r8
addq %rsi, %r8
movq %rdx, %rsi
sarq $0x3f, %rsi
andq %rcx, %rsi
addq %rdx, %rsi
xorl %eax, %eax
testq %r8, %r8
cmovgq %r8, %rax
cmpq %rsi, %rax
setg %r9b
movq %rcx, %rdx
subq %rax, %rdx
setle %r10b
orb %r9b, %r10b
jne 0x27eb
leaq -0x1(%rcx), %r12
cmpq %rcx, %rsi
cmovlq %rsi, %r12
movq %r12, %rcx
subq %rax, %rcx
testb %r14b, %r14b
je 0x2727
testq %r8, %r8
jle 0x277c
movq (%rdi), %r13
movslq 0x18(%rdi), %rsi
xorl %edi, %edi
testq %rsi, %rsi
jle 0x2777
decq %rsi
movq %rsi, %r8
shlq $0x4, %r8
movq %r13, %r9
movq %rdi, %r10
movq %r10, %rdi
movq %r9, %r13
movq 0x20(%r9), %r10
movq (%r10,%r8), %r9
testq %r9, %r9
je 0x2720
addq %r8, %r10
movl 0x8(%r10), %r10d
addq %rdi, %r10
cmpq %rdx, %r10
jbe 0x26fe
cmpq %rdx, %rdi
jne 0x26e5
jmp 0x2789
movq (%rdi), %r13
testq %r8, %r8
jle 0x2782
leaq 0x1(%rax), %rdx
movslq 0x18(%rdi), %rsi
xorl %edi, %edi
testq %rsi, %rsi
jle 0x2777
decq %rsi
movq %rsi, %r8
shlq $0x4, %r8
movq %r13, %r9
movq %rdi, %r10
movq %r10, %rdi
movq %r9, %r13
movq 0x20(%r9), %r10
movq (%r10,%r8), %r9
testq %r9, %r9
je 0x2770
addq %r8, %r10
movl 0x8(%r10), %r10d
addq %rdi, %r10
cmpq %rdx, %r10
jbe 0x274e
cmpq %rdx, %rdi
jne 0x2739
jmp 0x2789
xorl %r13d, %r13d
jmp 0x2789
movq 0x8(%rdi), %r13
jmp 0x2789
movq 0x20(%r13), %rdx
movq (%rdx), %r13
cmpq $-0x1, %rcx
je 0x27eb
notq %r12
addq %rax, %r12
leaq -0x38(%rbp), %r15
testq %r13, %r13
je 0x27fa
movl 0x10(%r13), %eax
movsd 0x8(%r13), %xmm0
movl %eax, -0x38(%rbp)
movsd %xmm0, -0x30(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x27c8
movups -0x38(%rbp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x27d3
movq %rbx, %rdi
movq %r15, %rdx
callq 0x281a
testb %r14b, %r14b
je 0x27de
addq $0x18, %r13
jmp 0x27e2
movq 0x20(%r13), %r13
movq (%r13), %r13
incq %r12
jne 0x2799
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x851(%rip), %rdi       # 0x3052
leaq 0x855(%rip), %rsi       # 0x305d
leaq 0x85e(%rip), %rcx       # 0x306d
movl $0x1b7, %edx            # imm = 0x1B7
callq 0x10c0
nop