// 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>>::private_insert(double, int)
SkipListNode* private_insert(double score, KeyType key) 
    {
        SkipListNode *update[SKIPLIST_MAXLEVEL], *x;
        unsigned int rank[SKIPLIST_MAXLEVEL];
        int i, level;

        x = mHeader;
        for (i = mLevel-1; i >= 0; i--) {
            /* store rank that is crossed to reach the insert position */
            rank[i] = i == (mLevel-1) ? 0 : rank[i+1];
            while (x->mLevel[i].mForward && x->mLevel[i].mForward->mScore < score) {
                rank[i] += x->mLevel[i].mSpan;
                x = x->mLevel[i].mForward;
            }
            update[i] = x;
        }
        /* For skiplist self, 'key' stands
         * we assume the key is not already inside, since we allow duplicated
         * scores, and the re-insertion of score and redis object should never
         * happen since the caller of zslInsert() should test in the hash table
         * if the element is already inside or not. */
        level = randomlevel();
        if (level > mLevel) {
            for (i = mLevel; i < level; i++) {
                rank[i] = 0;
                update[i] = mHeader;
                update[i]->mLevel[i].mSpan = mLength;
            }
            mLevel = level;
        }
        x = new SkipListNode(level, score, key);
        for (i = 0; i < level; i++) {
            x->mLevel[i].mForward = update[i]->mLevel[i].mForward;
            update[i]->mLevel[i].mForward = x;
    
            /* update span covered by update[i] as x is
             * inserted here */
            x->mLevel[i].mSpan = update[i]->mLevel[i].mSpan - (rank[0] - rank[i]);
            update[i]->mLevel[i].mSpan = (rank[0] - rank[i]) + 1;
        }
    
        /* increment span for untouched levels */
        for (i = level; i < mLevel; i++) {
            update[i]->mLevel[i].mSpan++;
        }

        x->mBackward = (update[0] == mHeader) ? NULL : update[0];
        if (x->mLevel[0].mForward)
            x->mLevel[0].mForward->mBackward = x;
        else
            mTail = x;
        mLength++;
        return x;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %esi, %r14d
movq %rdi, %rbx
movslq 0x18(%rdi), %rax
testq %rax, %rax
jle 0x2037
movq (%rbx), %rcx
movq %rax, %rsi
movq %rsi, %rdx
xorl %edi, %edi
cmpq %rax, %rsi
je 0x1ff4
movl -0xd0(%rbp,%rdx,4), %edi
leaq -0x1(%rdx), %rsi
movq 0x20(%rcx), %r9
movq %rsi, %r8
shlq $0x4, %r8
movq (%r9,%r8), %r10
testq %r10, %r10
je 0x2022
ucomisd 0x8(%r10), %xmm0
jbe 0x2022
addl 0x8(%r9,%r8), %edi
movq %r10, %rcx
movq 0x20(%r10), %r9
jmp 0x2003
movl %edi, -0xd0(%rbp,%rsi,4)
movq %rcx, -0x1d0(%rbp,%rsi,8)
cmpq $0x1, %rdx
jg 0x1fe3
movsd %xmm0, -0x48(%rbp)
xorl %r13d, %r13d
callq 0x1080
incq %r13
testl $0xc000, %eax           # imm = 0xC000
je 0x203f
cmpl $0x20, %r13d
movl $0x20, %r15d
cmovbl %r13d, %r15d
movslq 0x18(%rbx), %r12
cmpl %r12d, %r15d
jle 0x20d4
movl %r14d, -0x2c(%rbp)
movq (%rbx), %r14
movq %rbx, -0x40(%rbp)
movl 0x10(%rbx), %ebx
movq 0x20(%r14), %rax
movq %rax, -0x38(%rbp)
leaq -0xd0(,%r12,4), %rdi
addq %rbp, %rdi
movl %r12d, %eax
notl %eax
addl %r15d, %eax
leaq 0x4(,%rax,4), %rdx
xorl %esi, %esi
callq 0x10a0
movl %r15d, %eax
movq %r12, %rcx
shlq $0x4, %rcx
movq -0x38(%rbp), %rdx
addq %rdx, %rcx
addq $0x8, %rcx
movq %r14, -0x1d0(%rbp,%r12,8)
movl %ebx, (%rcx)
incq %r12
addq $0x10, %rcx
cmpq %rax, %r12
jl 0x20b2
movq -0x40(%rbp), %rbx
movl %r15d, 0x18(%rbx)
movl -0x2c(%rbp), %r14d
movl $0x28, %edi
callq 0x1130
movq %rax, %r12
movq %rax, %rdi
movl %r15d, %esi
movsd -0x48(%rbp), %xmm0
movl %r14d, %edx
callq 0x22da
movq 0x20(%r12), %rax
movl -0xd0(%rbp), %ecx
leal 0x1(%rcx), %edx
cmpq $0x20, %r13
movl $0x20, %esi
cmovbq %r13, %rsi
shll $0x2, %esi
xorl %edi, %edi
movq -0x1d0(%rbp,%rdi,2), %r8
movq 0x20(%r8), %r8
movq (%r8,%rdi,4), %r9
movq %r9, (%rax,%rdi,4)
movq %r12, (%r8,%rdi,4)
movl 0x8(%r8,%rdi,4), %r9d
movl -0xd0(%rbp,%rdi), %r10d
subl %ecx, %r9d
addl %r10d, %r9d
movl %r9d, 0x8(%rax,%rdi,4)
movl %edx, %r9d
subl %r10d, %r9d
movl %r9d, 0x8(%r8,%rdi,4)
addq $0x4, %rdi
cmpq %rdi, %rsi
jne 0x2114
movslq 0x18(%rbx), %rcx
cmpl %ecx, %r15d
jge 0x218f
cmpq $0x20, %r13
movl $0x20, %edx
cmovbq %r13, %rdx
movl %edx, %esi
shll $0x4, %esi
movq -0x1d0(%rbp,%rdx,8), %rdi
movq 0x20(%rdi), %rdi
incl 0x8(%rdi,%rsi)
incq %rdx
addq $0x10, %rsi
cmpq %rcx, %rdx
jl 0x2173
movq -0x1d0(%rbp), %rcx
xorl %edx, %edx
cmpq (%rbx), %rcx
cmovneq %rcx, %rdx
movq %rdx, 0x18(%r12)
movq (%rax), %rax
leaq 0x8(%rbx), %rcx
leaq 0x18(%rax), %rdx
testq %rax, %rax
cmoveq %rcx, %rdx
movq %r12, (%rdx)
incq 0x10(%rbx)
movq %r12, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r12, %rdi
callq 0x1110
movq %rbx, %rdi
callq 0x11b0
nop