// File: /workspace/github_cpp_makefile_star2_O1/JenTus[P]TCEM/src_TCEM/allocator.cc
// Function: Cide::allocator::mni(long long)
double allocator::mni(int64 rcSampleSize){
        clock_t begin = clock();

        std::vector<std::vector<int>> graph; // the graph is created from graphT
        std::vector<std::vector<int>> graphPairs; // for each pair, store common nodes
        std::vector<int> graphPairsDegree(n*n, 0); //
        std::vector<std::vector<int>> graphTPairs; // transpose of the graph, for node i, store the pairs that cover i
        graphPairs.reserve(n*n);
        graphTPairs.reserve(n);
        graph.reserve(n);
        for (int i = 0; i < n; ++i) {
           graph.emplace_back(vector<int>());
           graphTPairs.emplace_back(vector<int>());
        }

        for (int k1 = 0; k1 < n*n; ++k1) {
            graphPairs.emplace_back(vector<int>());
        }

        //create graph
        for (int j = 0; j < n; ++j) {
            for (int i = 0; i < graphT[j].size(); ++i) {
               graph[graphT[j][i]].push_back(j);
            }
        }
        //for test

        for (int i1 = 0; i1 < n; ++i1) {
           graph[i1].push_back(i1);
        }

        //create graphPairs
        for (int k = 0; k < n; ++k) {
            for (int i = 0; i < n; ++i) {
                if(i == k)
                    continue;
                std::vector<int> tmpv;
                tmpv = intersection(graph[k], graph[i]);
                graphPairs[k*n + i].insert(graphPairs[k*n +i].begin(), tmpv.begin(), tmpv.end());
                graphPairsDegree[k*n + i] = graphPairs[k*n + i].size(); //degree

                for (int j = 0; j < graphPairs[k*n + i].size(); ++j) {
                    graphTPairs[graphPairs[k*n + i][j]].push_back(k*n + i);
                }
            }
        }

        int bestPairID, bestRedNodeID, bestBlueNodeID;
        std::vector<int> isValidRed = std::vector<int>(n,tao);
        std::vector<int> isValidBlue = std::vector<int>(n,1);
        std::vector<bool> isCovered = std::vector<bool>(n, false);
        seedSet.clear();
        seedScores.clear();
        double totalExpScore = 0;
        std::set<int> rednodes;
        std::set<int> bluenodes;
        int flag_red = 0;

        while ((int)seedSet.size() < k_b) {
            double tempsum = accumulate(graphPairsDegree.begin(), graphPairsDegree.end(), 0.01);
            if(tempsum < 1){
                break;
            }

            bestPairID = std::distance(graphPairsDegree.begin(), std::max_element(graphPairsDegree.begin(), graphPairsDegree.end()));
            //cout << "bestPairID is " << bestPairID   <<endl;
            bestRedNodeID = (int) bestPairID / n;
            rednodes.insert(bestRedNodeID);
            bestBlueNodeID = (int) bestPairID % n;
            bluenodes.insert(bestBlueNodeID);

            //cout << "sum of pairwise common neighbors is " << accumulate(graphPairsDegree.begin(), graphPairsDegree.end(), 0) << endl;

            if (isValidRed[bestRedNodeID] == 0 || isValidBlue[bestBlueNodeID] == 0) {
                graphPairsDegree[bestPairID] = 0;
                continue;
            }

            seedSet.push_back(bestPairID); // store
            seedScores.push_back(graphPairsDegree[bestPairID]); // store score, dividing later

            // make update
            isValidRed[bestRedNodeID] -= 1;
            isValidRed[bestBlueNodeID] = 0;
            isValidBlue[bestBlueNodeID] = 0;
            isValidBlue[bestRedNodeID] = 0;

            if(isValidRed[bestRedNodeID] <= 0){
                for (int i = 0; i < n; ++i) {
                    graphPairsDegree[bestRedNodeID*n + i] = 0;
                }
            }

            for (int i = 0; i < n; ++i) {
                graphPairsDegree[i*n + bestBlueNodeID]  = 0;
                graphPairsDegree[i*n + bestRedNodeID]  = 0;
                graphPairsDegree[bestBlueNodeID*n + i] = 0;
            }

            // if red nodes reaches k_r
            if(rednodes.size() == k_r && flag_red == 0){
                for (int i = 0; i < n; ++i) {
                    if(rednodes.count(i) == 0){
                        isValidRed[i] = 0;
                        for (int j = 0; j < n; ++j) {
                            graphPairsDegree[i*n + j] = 0;
                        }
                    }
                }
                flag_red = 1;
            }

            // update the ExpScore of the pairs whose marginal gain change due to the best pair selection
            int tmpsize = graphPairs[bestPairID].size();
            for (int j = 0; j < tmpsize; j++) {
                int nodeid = graphPairs[bestPairID][j];
                if(isCovered[nodeid] == false){ // ensure not to repeatedly --
                    int ttmpsize = graphTPairs[nodeid].size();
                    for (int z = 0; z < ttmpsize; z++) {
                        int pairID = graphTPairs[nodeid][z];
                        if (graphPairsDegree[pairID] != 0) {
                            graphPairsDegree[pairID]--;
                        }
                    }
                    isCovered[nodeid] = true;
                }
            }
        } // end of while k loop

        for (int i1 = 0; i1 < seedScores.size(); ++i1) {
            totalExpScore += seedScores[i1];
        }

        int covercount = 0;
        for (int l = 0; l < isCovered.size(); ++l) {
            if(isCovered[l])
                covercount ++;
        }

        cout << "number of common covered neighbor is: " << totalExpScore << " cover is " << covercount << endl;

        // get the score on rr sets
        clock_t end = clock();
        totalDuration = double(end - begin) / CLOCKS_PER_SEC + duration_common; // in seconds
        totalMemory = getCurrentMemoryUsage(); // in MB


        int redbluecount = 0;

        vector<int> s1(rednodes.begin(), rednodes.end());
        vector<int> s2(bluenodes.begin(), bluenodes.end());
        sort(s1.begin(), s1.end());
        sort(s2.begin(), s2.end());


        for (int i = 0; i < rcSampleSize; ++i) {
            vector<int> RedList = rcList->at(0)->hyperGT[i];
            vector<int> BlueList = rcList->at(1)->hyperGT[i];

            sort(RedList.begin(), RedList.end());
            sort(BlueList.begin(), BlueList.end());

            if(intersection_size(s1, RedList) >= 1){
                if(intersection_size(s2, BlueList) >= 1){
                    redbluecount +=1;
                }
            }
        }

        float totalscore = (float) redbluecount / (float) rcSampleSize;

//
        cout << "Total score of mni is " << totalscore*n << endl;

        std::ostringstream streamObj1;
        streamObj1 << std::fixed << std::setprecision(2)<<totalscore*n << "(" << totalExpScore << ")";

        writeInMasterOutputFile("MNI", totalDuration,  totalMemory, streamObj1.str(), rednodes, bluenodes);

        return totalscore*n;

    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3b8, %rsp            # imm = 0x3B8
movq %rsi, 0x28(%rsp)
movq %rdi, %rbx
callq 0x31d0
movq %rax, 0x148(%rsp)
xorl %eax, %eax
movq %rax, 0xa0(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
movq %rax, 0x60(%rsp)
movapd %xmm0, 0x50(%rsp)
movl 0x68(%rbx), %esi
imull %esi, %esi
leaq 0x1c0(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x38(%rsp), %rdi
leaq 0x118(%rsp), %rcx
callq 0xad32
xorpd %xmm0, %xmm0
movapd %xmm0, 0xd0(%rsp)
movq $0x0, 0xe0(%rsp)
movl 0x68(%rbx), %esi
imull %esi, %esi
leaq 0x50(%rsp), %rdi
callq 0xb130
movslq 0x68(%rbx), %rsi
leaq 0xd0(%rsp), %rdi
callq 0xb130
movslq 0x68(%rbx), %rsi
leaq 0x90(%rsp), %rdi
callq 0xb130
cmpl $0x0, 0x68(%rbx)
jle 0x76f0
xorl %ebp, %ebp
leaq 0x90(%rsp), %r15
leaq 0x1c0(%rsp), %r12
leaq 0xd0(%rsp), %r13
xorpd %xmm0, %xmm0
movapd %xmm0, 0x1c0(%rsp)
movq $0x0, 0x1d0(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xab56
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0x76b3
callq 0x32c0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x1c0(%rsp)
movq $0x0, 0x1d0(%rsp)
movq %r13, %rdi
movq %r12, %rsi
callq 0xab56
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0x76e9
callq 0x32c0
incl %ebp
cmpl 0x68(%rbx), %ebp
jl 0x767d
cmpl $0x0, 0x68(%rbx)
je 0x7747
xorl %ebp, %ebp
leaq 0x50(%rsp), %r15
leaq 0x1c0(%rsp), %r12
xorpd %xmm0, %xmm0
movapd %xmm0, 0x1c0(%rsp)
movq $0x0, 0x1d0(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xab56
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0x773b
callq 0x32c0
incl %ebp
movl 0x68(%rbx), %eax
imull %eax, %eax
cmpl %eax, %ebp
jb 0x7705
movl $0x0, 0x1c0(%rsp)
cmpl $0x0, 0x68(%rbx)
jle 0x77f3
leaq 0x10be5(%rip), %r14     # 0x18348
leaq 0x1c0(%rsp), %r15
movslq 0x1c0(%rsp), %rax
movq (%r14), %rdx
leaq (%rax,%rax,2), %rsi
movq (%rdx,%rsi,8), %rcx
cmpq %rcx, 0x8(%rdx,%rsi,8)
je 0x77e1
xorl %r12d, %r12d
movslq (%rcx,%r12,4), %rcx
movq 0x90(%rsp), %rdx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x77b2
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x77ba
movq %r15, %rdx
callq 0xbdaa
incq %r12
movslq 0x1c0(%rsp), %rax
movq (%r14), %rdx
leaq (%rax,%rax,2), %rsi
movq (%rdx,%rsi,8), %rcx
movq 0x8(%rdx,%rsi,8), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
ja 0x7788
incl %eax
movl %eax, 0x1c0(%rsp)
cmpl 0x68(%rbx), %eax
jl 0x776b
movl $0x0, 0x1c0(%rsp)
cmpl $0x0, 0x68(%rbx)
jle 0x7854
xorl %eax, %eax
leaq 0x1c0(%rsp), %r15
movslq %eax, %rcx
movq 0x90(%rsp), %rdx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x7837
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x783f
movq %r15, %rdx
callq 0xbdaa
movl 0x1c0(%rsp), %eax
incl %eax
movl %eax, 0x1c0(%rsp)
cmpl 0x68(%rbx), %eax
jl 0x780e
movl 0x68(%rbx), %eax
testl %eax, %eax
jle 0x79c2
xorl %r14d, %r14d
leaq 0x1c0(%rsp), %r15
cmpl $0x0, 0x68(%rbx)
jle 0x79b2
leaq (%r14,%r14,2), %rax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
cmpq %r14, %rbp
je 0x79a2
movq 0x90(%rsp), %rax
movq 0x18(%rsp), %rcx
leaq (%rax,%rcx,8), %rsi
leaq (,%rbp,2), %rcx
addq %rbp, %rcx
leaq (%rax,%rcx,8), %rdx
movq %r15, %rdi
callq 0xdcaf
movq 0x1c0(%rsp), %r12
movq 0x1c8(%rsp), %rcx
movl 0x68(%rbx), %eax
imull %r14d, %eax
addl %ebp, %eax
cltq
movq 0x50(%rsp), %rdx
leaq (%rax,%rax,2), %rax
leaq (%rdx,%rax,8), %rdi
movq (%rdi), %rsi
movq %r12, %rdx
callq 0xc91c
movl 0x68(%rbx), %eax
imull %r14d, %eax
addl %ebp, %eax
cltq
movq 0x50(%rsp), %rcx
leaq (%rax,%rax,2), %rdx
movq 0x8(%rcx,%rdx,8), %rsi
subq (%rcx,%rdx,8), %rsi
shrq $0x2, %rsi
movq 0x38(%rsp), %rcx
movl %esi, (%rcx,%rax,4)
movl 0x68(%rbx), %eax
imull %r14d, %eax
addl %ebp, %eax
movslq %eax, %rcx
movq 0x50(%rsp), %rdx
leaq (%rcx,%rcx,2), %rsi
movq (%rdx,%rsi,8), %rcx
cmpq %rcx, 0x8(%rdx,%rsi,8)
je 0x7995
xorl %r13d, %r13d
movslq (%rcx,%r13,4), %rcx
movq 0xd0(%rsp), %rdx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %rdi
movl %eax, 0x1c0(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x7960
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x7968
movq %r15, %rdx
callq 0xcb08
incq %r13
movl 0x68(%rbx), %eax
imull %r14d, %eax
addl %ebp, %eax
movslq %eax, %rcx
movq 0x50(%rsp), %rdx
leaq (%rcx,%rcx,2), %rsi
movq (%rdx,%rsi,8), %rcx
movq 0x8(%rdx,%rsi,8), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %r13, %rdx
ja 0x792f
testq %r12, %r12
je 0x79a2
movq %r12, %rdi
callq 0x32c0
incq %rbp
movslq 0x68(%rbx), %rax
cmpq %rax, %rbp
jl 0x787f
incq %r14
movslq 0x68(%rbx), %rax
cmpq %rax, %r14
jl 0x786a
movslq %eax, %rsi
leaq 0x80(%rbx), %rdx
leaq 0x178(%rsp), %rdi
leaq 0x1c0(%rsp), %rcx
callq 0xad32
movslq 0x68(%rbx), %rsi
leaq 0x1c0(%rsp), %rdx
movl $0x1, (%rdx)
leaq 0x160(%rsp), %rdi
leaq 0x118(%rsp), %rcx
callq 0xad32
movslq 0x68(%rbx), %rsi
leaq 0x1c0(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x68(%rsp), %rdi
leaq 0x118(%rsp), %rcx
callq 0xaea6
movq 0xa8(%rbx), %rax
cmpq %rax, 0xb0(%rbx)
je 0x7a40
movq %rax, 0xb0(%rbx)
movq 0xc0(%rbx), %rax
cmpq %rax, 0xc8(%rbx)
je 0x7a57
movq %rax, 0xc8(%rbx)
leaq 0xa8(%rbx), %rax
movq %rax, 0x158(%rsp)
leaq 0xc0(%rbx), %rax
movq %rax, 0x150(%rsp)
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
leaq 0x120(%rsp), %r14
xorl %r12d, %r12d
movl %r12d, (%r14)
movq %r12, 0x8(%r14)
movq %r14, 0x10(%r14)
movq %r14, 0x18(%r14)
movq %r12, 0x20(%r14)
leaq 0x198(%rsp), %rax
movl %r12d, (%rax)
movq %r12, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %r12, 0x20(%rax)
leaq 0x118(%rsp), %r13
leaq 0xc(%rsp), %rbp
movl $0x0, 0x34(%rsp)
movq 0xb0(%rbx), %rax
subq 0xa8(%rbx), %rax
shrq $0x2, %rax
cmpl %eax, 0x7c(%rbx)
jle 0x7f13
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rdx
cmpq %rdx, %rcx
je 0x7b27
movsd 0xa679(%rip), %xmm0     # 0x12178
movq %rcx, %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%rax), %xmm1
addsd %xmm1, %xmm0
addq $0x4, %rax
cmpq %rdx, %rax
jne 0x7b02
movsd 0xa632(%rip), %xmm1     # 0x12150
ucomisd %xmm0, %xmm1
seta %al
jmp 0x7b29
movb $0x1, %al
testb %al, %al
jne 0x7f0b
movb %al, 0xb(%rsp)
cmpq %rdx, %rcx
sete %al
leaq 0x4(%rcx), %rsi
cmpq %rdx, %rsi
sete %dil
orb %al, %dil
movq %rcx, %rax
jne 0x7b6b
movq %rcx, %rdi
movl (%rdi), %r8d
movq %rsi, %rax
cmpl (%rsi), %r8d
jl 0x7b5f
movq %rdi, %rax
addq $0x4, %rsi
movq %rax, %rdi
cmpq %rdx, %rsi
jne 0x7b51
subq %rcx, %rax
shrq $0x2, %rax
movl %eax, 0x10(%rsp)
cltd
idivl 0x68(%rbx)
movl %eax, 0xc(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0xbfa4
movl 0x10(%rsp), %eax
cltd
idivl 0x68(%rbx)
movl %edx, 0x14(%rsp)
leaq 0x190(%rsp), %rdi
leaq 0x14(%rsp), %rsi
callq 0xbfa4
movslq 0xc(%rsp), %rax
movq 0x178(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
je 0x7bf0
movslq 0x14(%rsp), %rax
movq 0x160(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
je 0x7bf0
movq 0xb0(%rbx), %rsi
cmpq 0xb8(%rbx), %rsi
je 0x7c06
movl 0x10(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xb0(%rbx)
jmp 0x7c18
movslq 0x10(%rsp), %rax
movq 0x38(%rsp), %rcx
movl $0x0, (%rcx,%rax,4)
jmp 0x7f07
movq 0x158(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0xbdaa
movslq 0x10(%rsp), %rax
movq 0x38(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2sdl (%rcx,%rax,4), %xmm0
movsd %xmm0, 0x1c0(%rsp)
movq 0xc8(%rbx), %rsi
cmpq 0xd0(%rbx), %rsi
je 0x7c54
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xc8(%rbx)
jmp 0x7c69
movq 0x150(%rsp), %rdi
leaq 0x1c0(%rsp), %rdx
callq 0xcbdc
movslq 0xc(%rsp), %rcx
movq 0x178(%rsp), %rax
decl (%rax,%rcx,4)
movslq 0x14(%rsp), %rcx
movl %r12d, (%rax,%rcx,4)
movslq 0x14(%rsp), %rcx
movq 0x160(%rsp), %rdx
movl %r12d, (%rdx,%rcx,4)
movslq 0xc(%rsp), %rcx
movl %r12d, (%rdx,%rcx,4)
movslq 0xc(%rsp), %rcx
cmpl %r12d, (%rax,%rcx,4)
jg 0x7cd5
movl 0x68(%rbx), %edx
testl %edx, %edx
jle 0x7cd5
movq 0x38(%rsp), %rcx
xorl %esi, %esi
movslq 0xc(%rsp), %rdi
movslq %edx, %rdx
imulq %rdi, %rdx
addq %rsi, %rdx
movl $0x0, (%rcx,%rdx,4)
movl 0x68(%rbx), %edx
incq %rsi
cmpl %edx, %esi
jl 0x7cb5
movl 0x68(%rbx), %esi
testl %esi, %esi
jle 0x7d2a
movq 0x38(%rsp), %rcx
xorl %edx, %edx
imull %edx, %esi
movslq 0x14(%rsp), %rdi
movslq %esi, %rsi
addq %rdi, %rsi
movl %r12d, (%rcx,%rsi,4)
movslq 0x68(%rbx), %rsi
movslq %edx, %rdi
imulq %rsi, %rdi
movslq 0xc(%rsp), %rsi
addq %rdi, %rsi
movl %r12d, (%rcx,%rsi,4)
movslq 0x14(%rsp), %rsi
movslq 0x68(%rbx), %rdi
imulq %rsi, %rdi
addq %rdx, %rdi
movl %r12d, (%rcx,%rdi,4)
movl 0x68(%rbx), %esi
incq %rdx
cmpl %esi, %edx
jl 0x7ce3
movslq 0x78(%rbx), %rcx
cmpq %rcx, 0x140(%rsp)
sete %cl
cmpl $0x0, 0x34(%rsp)
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x7dea
movl $0x1, 0x34(%rsp)
cmpl $0x0, 0x68(%rbx)
jle 0x7dea
movq 0x128(%rsp), %rcx
movq 0x38(%rsp), %rdx
xorl %esi, %esi
movq %r14, %rdi
testq %rcx, %rcx
je 0x7d97
movq %rcx, %r8
movq %r14, %rdi
movslq 0x20(%r8), %r9
xorl %r10d, %r10d
cmpq %r9, %rsi
setg %r10b
cmovleq %r8, %rdi
movq 0x10(%r8,%r10,8), %r8
testq %r8, %r8
jne 0x7d7b
movq %r14, %r8
cmpq %r14, %rdi
je 0x7dad
movslq 0x20(%rdi), %r8
cmpq %r8, %rsi
cmovlq %r14, %rdi
movq %rdi, %r8
cmpq %r14, %r8
jne 0x7dde
movl $0x0, (%rax,%rsi,4)
movl 0x68(%rbx), %edi
testl %edi, %edi
jle 0x7dde
xorl %r8d, %r8d
imull %esi, %edi
movslq %edi, %rdi
addq %r8, %rdi
movl $0x0, (%rdx,%rdi,4)
movl 0x68(%rbx), %edi
incq %r8
cmpl %edi, %r8d
jl 0x7dc3
incq %rsi
movslq 0x68(%rbx), %rdi
cmpq %rdi, %rsi
jl 0x7d6d
movslq 0x10(%rsp), %rcx
movq 0x50(%rsp), %rax
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rax,%rcx,8), %rdx
subq (%rax,%rcx,8), %rdx
shrq $0x2, %rdx
testl %edx, %edx
jle 0x7f07
movq 0x68(%rsp), %rsi
movq 0xd0(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movq 0x38(%rsp), %r8
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %r9d, %r9d
movq %rdx, 0x18(%rsp)
movslq 0x10(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rcx
movslq (%rcx,%r9,4), %rcx
leaq 0x3f(%rcx), %rdi
testq %rcx, %rcx
cmovnsq %rcx, %rdi
sarq $0x6, %rdi
leaq 0x3f(%r15), %r11
andq %rcx, %r11
xorl %r10d, %r10d
cmpq %r15, %r11
setbe %r10b
movl $0x1, %r11d
shlq %cl, %r11
leaq (%rsi,%rdi,8), %r14
movq -0x8(%r14,%r10,8), %rbp
btq %rcx, %rbp
jb 0x7ee3
movq %rax, %rdx
movq %rsi, %rax
movq %r15, %rsi
leaq (%rcx,%rcx,2), %rdi
movq 0x20(%rsp), %r15
movq (%r15,%rdi,8), %rcx
movq 0x8(%r15,%rdi,8), %r15
subq %rcx, %r15
shrq $0x2, %r15
testl %r15d, %r15d
jle 0x7ec6
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
movslq (%rcx,%r13,4), %r12
movl (%r8,%r12,4), %edi
testl %edi, %edi
je 0x7ebe
decl %edi
movl %edi, (%r8,%r12,4)
incq %r13
cmpq %r13, %r15
jne 0x7eac
leaq -0x8(,%r10,8), %rcx
orq %rbp, %r11
movq %r11, (%r14,%rcx)
movq %rsi, %r15
movq %rax, %rsi
movq %rdx, %rax
movq 0x18(%rsp), %rdx
incq %r9
cmpq %rdx, %r9
jne 0x7e32
leaq 0x120(%rsp), %r14
xorl %r12d, %r12d
leaq 0x118(%rsp), %r13
leaq 0xc(%rsp), %rbp
movb 0xb(%rsp), %al
testb %al, %al
je 0x7acd
movq 0xc0(%rbx), %rax
movq 0xc8(%rbx), %rcx
subq %rax, %rcx
je 0x7f47
sarq $0x3, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
addsd (%rax,%rdx,8), %xmm0
incq %rdx
cmpq %rdx, %rcx
jne 0x7f38
jmp 0x7f4b
xorpd %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x68(%rsp), %rax
movq 0x78(%rsp), %rcx
movl 0x80(%rsp), %edx
subq %rax, %rcx
shlq $0x3, %rcx
addq %rdx, %rcx
je 0x7f8e
xorl %edx, %edx
xorl %ebp, %ebp
movq %rdx, %rsi
shrq $0x6, %rsi
movq (%rax,%rsi,8), %rsi
btq %rdx, %rsi
adcl $0x0, %ebp
incq %rdx
cmpq %rdx, %rcx
ja 0x7f72
jmp 0x7f90
xorl %ebp, %ebp
movq 0x10041(%rip), %rdi     # 0x17fd8
leaq 0xa3cd(%rip), %rsi      # 0x1236b
movl $0x26, %edx
callq 0x3340
movq 0x10029(%rip), %rdi     # 0x17fd8
movsd 0x20(%rsp), %xmm0
callq 0x3500
movq %rax, %r15
leaq 0xa2c8(%rip), %rsi      # 0x1228c
movl $0xa, %edx
movq %rax, %rdi
callq 0x3340
movq %r15, %rdi
movl %ebp, %esi
callq 0x3580
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31e0
callq 0x31d0
subq 0x148(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0xa14e(%rip), %xmm0     # 0x12170
addsd 0x8(%rbx), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xb70(%rbx)
callq 0xd4f4
movss %xmm0, 0xb74(%rbx)
movq 0x130(%rsp), %rsi
leaq 0x100(%rsp), %rdi
leaq 0x1c0(%rsp), %rcx
movq %r14, %rdx
callq 0xaf0e
movq 0x1a8(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
leaq 0x1c0(%rsp), %rcx
leaq 0x198(%rsp), %rdx
callq 0xaf0e
movq 0x100(%rsp), %r15
movq 0x108(%rsp), %r12
cmpq %r12, %r15
je 0x80c7
movq %r12, %rax
subq %r15, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xc229
movq %r15, %rdi
movq %r12, %rsi
callq 0xc30c
movq 0xe8(%rsp), %r15
movq 0xf0(%rsp), %r12
cmpq %r12, %r15
je 0x8109
movq %r12, %rax
subq %r15, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xc229
movq %r15, %rdi
movq %r12, %rsi
callq 0xc30c
cmpq $0x0, 0x28(%rsp)
jle 0x8320
xorl %r14d, %r14d
leaq 0xb0(%rsp), %r12
xorl %r15d, %r15d
movq 0xae8(%rbx), %rcx
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
je 0x8648
movq (%rax), %rax
leaq (%r14,%r14,2), %r13
shlq $0x3, %r13
movq 0x18(%rax), %rsi
addq %r13, %rsi
leaq 0x1c0(%rsp), %rdi
callq 0xaf48
movq 0xae8(%rbx), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0x865a
movq 0x8(%rax), %rax
addq 0x18(%rax), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xaf48
movq 0x1c0(%rsp), %r13
movq 0x1c8(%rsp), %rbp
cmpq %rbp, %r13
je 0x81ca
movq %rbp, %rax
subq %r13, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r13, %rdi
movq %rbp, %rsi
callq 0xc229
movq %r13, %rdi
movq %rbp, %rsi
callq 0xc30c
movq 0xb0(%rsp), %r13
movq 0xb8(%rsp), %rbp
cmpq %rbp, %r13
je 0x820c
movq %rbp, %rax
subq %r13, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r13, %rdi
movq %rbp, %rsi
callq 0xc229
movq %r13, %rdi
movq %rbp, %rsi
callq 0xc30c
movq 0x100(%rsp), %rax
movq 0x108(%rsp), %rcx
movq 0x1c0(%rsp), %rdx
movq 0x1c8(%rsp), %rsi
cmpq %rcx, %rax
setne %dil
cmpq %rsi, %rdx
setne %r8b
andb %dil, %r8b
cmpb $0x1, %r8b
jne 0x82e7
xorl %edi, %edi
movl (%rax), %r8d
movl (%rdx), %r9d
cmpl %r9d, %r8d
jge 0x825a
addq $0x4, %rax
jmp 0x8267
jg 0x8263
incq %rdi
addq $0x4, %rax
addq $0x4, %rdx
cmpq %rcx, %rax
je 0x8271
cmpq %rsi, %rdx
jne 0x8249
testq %rdi, %rdi
je 0x82e7
movq 0xe8(%rsp), %rax
movq 0xf0(%rsp), %rcx
movq 0xb0(%rsp), %rdx
movq 0xb8(%rsp), %rsi
cmpq %rcx, %rax
setne %dil
cmpq %rsi, %rdx
setne %r9b
andb %dil, %r9b
xorl %r8d, %r8d
cmpb $0x1, %r9b
jne 0x82e4
xorl %edi, %edi
movl (%rax), %r8d
movl (%rdx), %r9d
cmpl %r9d, %r8d
jge 0x82c3
addq $0x4, %rax
jmp 0x82d0
jg 0x82cc
incq %rdi
addq $0x4, %rax
addq $0x4, %rdx
cmpq %rcx, %rax
je 0x82da
cmpq %rsi, %rdx
jne 0x82b2
xorl %r8d, %r8d
testq %rdi, %rdi
setne %r8b
addl %r8d, %r15d
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x82f9
callq 0x32c0
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0x830b
callq 0x32c0
incq %r14
cmpq 0x28(%rsp), %r14
jne 0x8123
cvtsi2ss %r15d, %xmm0
jmp 0x8323
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
movq 0xfca8(%rip), %rdi      # 0x17fd8
leaq 0xa05b(%rip), %rsi      # 0x12392
movl $0x16, %edx
callq 0x3340
xorps %xmm0, %xmm0
cvtsi2ssq 0x28(%rsp), %xmm0
cvtsi2ssl 0x68(%rbx), %xmm1
movss 0x18(%rsp), %xmm2
divss %xmm0, %xmm2
movss %xmm2, 0x18(%rsp)
mulss %xmm2, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movq 0xfc66(%rip), %rdi      # 0x17fd8
callq 0x3500
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31e0
leaq 0x1c0(%rsp), %rdi
callq 0x3410
leaq 0x1c0(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rcx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl 0x1d8(%rsp,%rcx), %edx
orl $0x4, %edx
movl %edx, 0x1d8(%rsp,%rcx)
movq -0x18(%rax), %rax
movq $0x2, 0x1c8(%rsp,%rax)
xorps %xmm0, %xmm0
cvtsi2ssl 0x68(%rbx), %xmm0
mulss 0x18(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x3500
movq %rax, %r14
leaq 0x9ecd(%rip), %rsi      # 0x122d1
movl $0x1, %edx
movq %rax, %rdi
callq 0x3340
movq %r14, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x3500
leaq 0xa3db(%rip), %rsi      # 0x12801
movl $0x1, %edx
movq %rax, %rdi
callq 0x3340
leaq 0xc0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x9f63(%rip), %rsi      # 0x123a9
leaq 0x9f5f(%rip), %rdx      # 0x123ac
leaq 0xb0(%rsp), %rdi
callq 0xb452
movss 0xb70(%rbx), %xmm0
movss %xmm0, 0x20(%rsp)
movss 0xb74(%rbx), %xmm0
movss %xmm0, 0x28(%rsp)
leaq 0x1c8(%rsp), %rsi
leaq 0x338(%rsp), %rdi
callq 0x34f0
leaq 0x388(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xb4e2
leaq 0x358(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0xb4e2
leaq 0xb0(%rsp), %rsi
leaq 0x338(%rsp), %rdx
leaq 0x388(%rsp), %rcx
leaq 0x358(%rsp), %r8
movq %rbx, %rdi
movss 0x20(%rsp), %xmm0
movss 0x28(%rsp), %xmm1
callq 0xa536
leaq 0x358(%rsp), %rdi
callq 0xb6b0
leaq 0x388(%rsp), %rdi
callq 0xb6b0
leaq 0x348(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8519
callq 0x32c0
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0x852b
callq 0x32c0
movl 0x68(%rbx), %ebx
movq 0xfa9b(%rip), %rsi      # 0x17fd0
leaq 0x1c0(%rsp), %rdi
callq 0x3170
leaq 0x230(%rsp), %rdi
callq 0x30e0
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x8561
callq 0x32c0
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x8573
callq 0x32c0
leaq 0x190(%rsp), %rdi
callq 0xb6b0
leaq 0x118(%rsp), %rdi
callq 0xb6b0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x85bb
callq 0x32c0
xorl %eax, %eax
movq %rax, 0x68(%rsp)
movl %eax, 0x70(%rsp)
movq %rax, 0x78(%rsp)
movl %eax, 0x80(%rsp)
movq %rax, 0x88(%rsp)
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x85cd
callq 0x32c0
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0x85df
callq 0x32c0
leaq 0xd0(%rsp), %rdi
callq 0xacf2
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x85fb
callq 0x32c0
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
movss 0x18(%rsp), %xmm1
mulss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x50(%rsp), %rdi
callq 0xacf2
leaq 0x90(%rsp), %rdi
callq 0xacf2
movsd 0x18(%rsp), %xmm0
addq $0x3b8, %rsp            # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9f48(%rip), %rdi      # 0x12597
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3490
leaq 0x9f36(%rip), %rdi      # 0x12597
movl $0x1, %esi
xorl %eax, %eax
callq 0x3490
movq %rax, %rbx
leaq 0x358(%rsp), %rdi
callq 0xb6b0
jmp 0x8682
movq %rax, %rbx
leaq 0x388(%rsp), %rdi
callq 0xb6b0
jmp 0x8694
movq %rax, %rbx
leaq 0x348(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x86af
callq 0x32c0
jmp 0x86af
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0x86fc
callq 0x32c0
jmp 0x86fc
jmp 0x86f9
jmp 0x8736
movq %rax, %rbx
jmp 0x8788
jmp 0x8728
jmp 0x8728
movq %rax, %rbx
jmp 0x87e2
movq %rax, %rbx
jmp 0x87f4
jmp 0x8803
movq %rax, %rbx
jmp 0x883e
jmp 0x8728
jmp 0x8736
jmp 0x8803
movq %rax, %rbx
movq 0xf8cd(%rip), %rsi      # 0x17fd0
leaq 0x1c0(%rsp), %rdi
callq 0x3170
leaq 0x230(%rsp), %rdi
callq 0x30e0
jmp 0x8776
jmp 0x8736
jmp 0x8728
jmp 0x8803
movq %rax, %rbx
jmp 0x879a
jmp 0x8736
jmp 0x8731
movq %rax, %rbx
jmp 0x8764
movq %rax, %rbx
jmp 0x8776
jmp 0x873f
jmp 0x873f
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
jmp 0x87fc
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x8764
callq 0x32c0
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0x8776
callq 0x32c0
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x8788
callq 0x32c0
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x879a
callq 0x32c0
leaq 0x190(%rsp), %rdi
callq 0xb6b0
leaq 0x118(%rsp), %rdi
callq 0xb6b0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x87e2
callq 0x32c0
xorl %eax, %eax
movq %rax, 0x68(%rsp)
movl %eax, 0x70(%rsp)
movq %rax, 0x78(%rsp)
movl %eax, 0x80(%rsp)
movq %rax, 0x88(%rsp)
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x87f4
callq 0x32c0
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
jne 0x881d
jmp 0x8822
movq %rax, %rbx
jmp 0x8822
movq %rax, %rbx
xorl %r12d, %r12d
jmp 0x8815
jmp 0x8812
movq %rax, %rbx
testq %r12, %r12
je 0x8822
movq %r12, %rdi
callq 0x32c0
leaq 0xd0(%rsp), %rdi
callq 0xacf2
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x883e
callq 0x32c0
leaq 0x50(%rsp), %rdi
callq 0xacf2
leaq 0x90(%rsp), %rdi
callq 0xacf2
movq %rbx, %rdi
callq 0x35c0
nop