// File: 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
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq (%rax), %rcx
movq %rcx, -0x128(%rbp)
movl 0x18(%rax), %eax
subl $0x1, %eax
movl %eax, -0x1b4(%rbp)
cmpl $0x0, -0x1b4(%rbp)
jl 0x349b
movq -0x1d0(%rbp), %rcx
movl -0x1b4(%rbp), %eax
movl 0x18(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3386
xorl %eax, %eax
movl %eax, -0x1d4(%rbp)
jmp 0x339e
movl -0x1b4(%rbp), %eax
addl $0x1, %eax
cltq
movl -0x1b0(%rbp,%rax,4), %eax
movl %eax, -0x1d4(%rbp)
movl -0x1d4(%rbp), %ecx
movslq -0x1b4(%rbp), %rax
movl %ecx, -0x1b0(%rbp,%rax,4)
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x1b4(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, -0x1d5(%rbp)
je 0x340c
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1b4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movsd 0x8(%rax), %xmm1
movsd -0x10(%rbp), %xmm0
ucomisd %xmm1, %xmm0
seta %al
movb %al, -0x1d5(%rbp)
movb -0x1d5(%rbp), %al
testb $0x1, %al
jne 0x3418
jmp 0x3471
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1b4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movslq -0x1b4(%rbp), %rax
addl -0x1b0(%rbp,%rax,4), %ecx
movl %ecx, -0x1b0(%rbp,%rax,4)
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1b4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x128(%rbp)
jmp 0x33b2
movq -0x128(%rbp), %rcx
movslq -0x1b4(%rbp), %rax
movq %rcx, -0x120(%rbp,%rax,8)
movl -0x1b4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1b4(%rbp)
jmp 0x3358
movq -0x1d0(%rbp), %rdi
callq 0x3cd0
movq -0x1d0(%rbp), %rcx
movl %eax, -0x1b8(%rbp)
movl -0x1b8(%rbp), %eax
cmpl 0x18(%rcx), %eax
jle 0x3557
movq -0x1d0(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x1b4(%rbp)
movl -0x1b4(%rbp), %eax
cmpl -0x1b8(%rbp), %eax
jge 0x3547
movq -0x1d0(%rbp), %rax
movslq -0x1b4(%rbp), %rcx
movl $0x0, -0x1b0(%rbp,%rcx,4)
movq (%rax), %rdx
movslq -0x1b4(%rbp), %rcx
movq %rdx, -0x120(%rbp,%rcx,8)
movq 0x10(%rax), %rax
movl %eax, %ecx
movslq -0x1b4(%rbp), %rax
movq -0x120(%rbp,%rax,8), %rax
movq 0x20(%rax), %rax
movslq -0x1b4(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x1b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1b4(%rbp)
jmp 0x34d3
movq -0x1d0(%rbp), %rax
movl -0x1b8(%rbp), %ecx
movl %ecx, 0x18(%rax)
movl $0x28, %edi
callq 0x1100
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1e0(%rbp)
movl -0x1b8(%rbp), %esi
movsd -0x10(%rbp), %xmm0
movl -0x14(%rbp), %edx
callq 0x3d30
jmp 0x3583
movq -0x1e0(%rbp), %rax
movq %rax, -0x128(%rbp)
movl $0x0, -0x1b4(%rbp)
movl -0x1b4(%rbp), %eax
cmpl -0x1b8(%rbp), %eax
jge 0x36e0
movslq -0x1b4(%rbp), %rax
movq -0x120(%rbp,%rax,8), %rax
movq 0x20(%rax), %rax
movslq -0x1b4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1b4(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x128(%rbp), %rcx
movslq -0x1b4(%rbp), %rax
movq -0x120(%rbp,%rax,8), %rax
movq 0x20(%rax), %rax
movslq -0x1b4(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movslq -0x1b4(%rbp), %rax
movq -0x120(%rbp,%rax,8), %rax
movq 0x20(%rax), %rax
movslq -0x1b4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movl -0x1b0(%rbp), %eax
movslq -0x1b4(%rbp), %rdx
subl -0x1b0(%rbp,%rdx,4), %eax
subl %eax, %ecx
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1b4(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x1b0(%rbp), %ecx
movslq -0x1b4(%rbp), %rax
subl -0x1b0(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movslq -0x1b4(%rbp), %rax
movq -0x120(%rbp,%rax,8), %rax
movq 0x20(%rax), %rax
movslq -0x1b4(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x1b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1b4(%rbp)
jmp 0x359b
movq -0x1e0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c0(%rbp)
movl %eax, -0x1c4(%rbp)
callq 0x10e0
jmp 0x37d8
movl -0x1b8(%rbp), %eax
movl %eax, -0x1b4(%rbp)
movq -0x1d0(%rbp), %rcx
movl -0x1b4(%rbp), %eax
cmpl 0x18(%rcx), %eax
jge 0x3739
movslq -0x1b4(%rbp), %rax
movq -0x120(%rbp,%rax,8), %rax
movq 0x20(%rax), %rax
movslq -0x1b4(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movl -0x1b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1b4(%rbp)
jmp 0x36ec
movq -0x1d0(%rbp), %rcx
movq -0x120(%rbp), %rax
cmpq (%rcx), %rax
jne 0x3757
xorl %eax, %eax
movq %rax, -0x1e8(%rbp)
jmp 0x3765
movq -0x120(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq -0x1e8(%rbp), %rcx
movq -0x128(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, (%rax)
je 0x37a3
movq -0x128(%rbp), %rcx
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rax
movq (%rax), %rax
movq %rcx, 0x18(%rax)
jmp 0x37b5
movq -0x1d0(%rbp), %rax
movq -0x128(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x1d0(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x128(%rbp), %rax
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq -0x1c0(%rbp), %rdi
callq 0x1170
nopw %cs:(%rax,%rax)
nop