// File: /workspace/github_cpp_makefile_star2_O3/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 0x261a
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 0x2789
leaq -0x1(%rcx), %r12
cmpq %rcx, %rsi
cmovbq %rsi, %r12
movq %r12, %rcx
subq %rax, %rcx
testb %r14b, %r14b
je 0x26c5
testq %r8, %r8
jle 0x271a
movq (%rdi), %r13
movslq 0x18(%rdi), %rsi
xorl %edi, %edi
testq %rsi, %rsi
jle 0x2715
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 0x26be
addq %r8, %r10
movl 0x8(%r10), %r10d
addq %rdi, %r10
cmpq %rdx, %r10
jbe 0x269c
cmpq %rdx, %rdi
jne 0x2683
jmp 0x2727
movq (%rdi), %r13
testq %r8, %r8
jle 0x2720
leaq 0x1(%rax), %rdx
movslq 0x18(%rdi), %rsi
xorl %edi, %edi
testq %rsi, %rsi
jle 0x2715
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 0x270e
addq %r8, %r10
movl 0x8(%r10), %r10d
addq %rdi, %r10
cmpq %rdx, %r10
jbe 0x26ec
cmpq %rdx, %rdi
jne 0x26d7
jmp 0x2727
xorl %r13d, %r13d
jmp 0x2727
movq 0x8(%rdi), %r13
jmp 0x2727
movq 0x20(%r13), %rdx
movq (%rdx), %r13
cmpq $-0x1, %rcx
je 0x2789
notq %r12
addq %rax, %r12
leaq -0x38(%rbp), %r15
testq %r13, %r13
je 0x2798
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 0x2766
movups -0x38(%rbp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x2771
movq %rbx, %rdi
movq %r15, %rdx
callq 0x27b8
testb %r14b, %r14b
je 0x277c
addq $0x18, %r13
jmp 0x2780
movq 0x20(%r13), %r13
movq (%r13), %r13
incq %r12
jne 0x2737
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8b3(%rip), %rdi       # 0x3052
leaq 0x8b7(%rip), %rsi       # 0x305d
leaq 0x8c0(%rip), %rcx       # 0x306d
movl $0x1b7, %edx            # imm = 0x1B7
callq 0x10c0
nop