// File: /workspace/github_cpp_makefile_star2_O3/JenTus[P]TCEM/src_TCEM/allocator.cc
// Function: Cide::allocator::rcGreedy(long long, bool)
double allocator::rcGreedy(int64 rcSampleSize, bool extraResults) {
        // For initialization the k_r and k_b, to delete later.

        double totalExpScore = 0;
        std::vector<double> ExpScore(n*n, 0); // use to store hyper_degreepairs

        int bestPairID = -1, bestRedNodeID = -1, bestBlueNodeID = -1;
        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>(rcSampleSize, false);
        std::set<int> rednodes;
        std::set<int> bluenodes;

        int flag_red = 0;

        clock_t begin = clock();

        for (int i = 0; i < n; i++){
            for (int j = 0; j < n; j++){
                if (i != j){
                    ExpScore[i*n + j] = hyper_degreepairs[i*n + j];
                }
            }
        }

        seedSet.clear();
        seedScores.clear(); // seedScores should be cleared as well.

        while ((int)seedSet.size() < k_b) {

            double tempsum = accumulate(ExpScore.begin(), ExpScore.end(), 0.01);
            if(tempsum < 1){
                break;
            }
            // here I use the vector to store the results, but can use the priority queue.
            //bestPairID = std::max_element(ExpScore.begin(), ExpScore.end()) - ExpScore.begin();
            bestPairID = std::distance(ExpScore.begin(), std::max_element(ExpScore.begin(), ExpScore.end()));
            //cout << "bestPairID is " << bestPairID   <<endl;
            bestRedNodeID = (int) bestPairID / n;
            rednodes.insert(bestRedNodeID);
            bestBlueNodeID = (int) bestPairID % n;
            bluenodes.insert(bestBlueNodeID);

            // if can not select, then just pop out
            if (isValidRed[bestRedNodeID] == 0 || isValidBlue[bestBlueNodeID] == 0) {
                ExpScore[bestPairID] = 0;
                continue;
            }

            // push
            seedSet.push_back(bestPairID); // store
            //cout << "ExpScore is " << ExpScore[bestPairID] << "rc sample size is " <<rcSampleSize << "n is " << n << endl;
            seedScores.push_back(ExpScore[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) {
                   ExpScore[bestRedNodeID*n + i] = 0;
                }
            }

            for (int i = 0; i < n; ++i) {
               ExpScore[i*n + bestBlueNodeID]  = 0;
               ExpScore[i*n + bestRedNodeID]  = 0;
               ExpScore[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) {
                           ExpScore[i*n + j] = 0;
                        }
                    }
                }
                flag_red = 1;
            }

//            cout << "sum of Expscore is " << accumulate(ExpScore.begin(), ExpScore.end(), 0) << endl;

            // update the ExpScore of the pairs whose marginal gain change due to the best pair selection
            int tmpsize = hyperGpairs[bestPairID].size();
            for (int j = 0; j < tmpsize; j++) {
                int rcID = hyperGpairs[bestPairID][j]; // get the rcID
                if(isCovered[rcID] == false){ // ensure not to repeatedly --
                    int ttmpsize = hyperGTpairs[rcID].size();
                    for (int z = 0; z < ttmpsize; z++) {
                        int pairID = hyperGTpairs[rcID][z];
                        if (ExpScore[pairID] != 0) {
                            ExpScore[pairID]--;
                        }
                    }
                    isCovered[rcID] = 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++;
        }


        ///////////// produce the additional results here
        ////////////  Remember should write the f function results not the g function result.
        if(extraResults) {

        cout << "totalExpScore is: " << totalExpScore << " cover is " << covercount << " sample size is " << rcSampleSize << endl;

            clock_t end = clock();

            //cout << "total tdem time taken (in seconds) " << totalDuration << " total memory (in mb) " << totalMemory << endl;
            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;
                    }
                }
            }

            totalDuration = double(end - begin) / CLOCKS_PER_SEC + duration_common; // in seconds
            totalMemory = getCurrentMemoryUsage(); // in MB

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

            cout << "Total score of Greedy is " << totalscore*n << "  g result is " << totalExpScore / (float) rcSampleSize *n  << endl;

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

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

        } // end of extra results
        
        return totalExpScore / (double)rcSampleSize;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x358, %rsp            # imm = 0x358
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x68(%rdi), %esi
imull %esi, %esi
leaq 0x1e0(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rcx
callq 0xab26
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x4(%rsp)
movl %eax, 0x14(%rsp)
movl %eax, 0x10(%rsp)
movslq 0x68(%rbx), %rsi
leaq 0x80(%rbx), %rdx
leaq 0xf0(%rsp), %rdi
leaq 0x1e0(%rsp), %rcx
callq 0xacd0
movslq 0x68(%rbx), %rsi
leaq 0x1e0(%rsp), %rdx
movl $0x1, (%rdx)
leaq 0xd8(%rsp), %rdi
leaq 0x68(%rsp), %rcx
callq 0xacd0
movl %ebp, (%rsp)
leaq 0x1e0(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x108(%rsp), %rdi
leaq 0x68(%rsp), %rcx
movq %r14, %rsi
callq 0xae4c
leaq 0x70(%rsp), %rcx
xorl %eax, %eax
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x138(%rsp), %r12
movl %eax, (%r12)
movq %rax, 0x8(%r12)
movq %r12, 0x10(%r12)
movq %r12, 0x18(%r12)
movq %rax, 0x20(%r12)
callq 0x31d0
movq %rax, 0xc8(%rsp)
movslq 0x68(%rbx), %rax
testq %rax, %rax
jle 0x94b5
leaq (,%rax,8), %rcx
xorl %edx, %edx
xorl %esi, %esi
movq 0x28(%rsp), %rdi
addq %rdx, %rdi
movq 0xb58(%rbx), %r8
addq %rdx, %r8
xorl %r9d, %r9d
cmpq %r9, %rsi
je 0x94a2
movsd (%r8,%r9,8), %xmm0
movsd %xmm0, (%rdi,%r9,8)
incq %r9
cmpq %r9, %rax
jne 0x9491
incq %rsi
addq %rcx, %rdx
cmpq %rax, %rsi
jne 0x947c
movq 0xa8(%rbx), %rax
cmpq %rax, 0xb0(%rbx)
je 0x94cc
movq %rax, 0xb0(%rbx)
movq 0xc0(%rbx), %rax
cmpq %rax, 0xc8(%rbx)
je 0x94e3
movq %rax, 0xc8(%rbx)
cmpl $0x0, 0x7c(%rbx)
movq %rbx, 0x8(%rsp)
jle 0x9995
leaq 0xa8(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0xc0(%rbx), %rax
movq %rax, 0xd0(%rsp)
movabsq $-0x8000000000000000, %r12 # imm = 0x8000000000000000
movl $0x0, 0x18(%rsp)
movq %r14, 0x40(%rsp)
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %rdx
cmpq %rdx, %rcx
je 0x9959
movsd 0x8c39(%rip), %xmm0     # 0x12178
movq %rcx, %rax
addsd (%rax), %xmm0
addq $0x8, %rax
cmpq %rdx, %rax
jne 0x9542
movsd 0x8bf9(%rip), %xmm1     # 0x12150
ucomisd %xmm0, %xmm1
ja 0x9959
leaq 0x8(%rcx), %rsi
movq %rcx, %rax
cmpq %rdx, %rsi
je 0x9591
movsd (%rcx), %xmm0
movq %rcx, %rax
movsd (%rsi), %xmm1
ucomisd %xmm0, %xmm1
cmovaq %rsi, %rax
maxsd %xmm0, %xmm1
addq $0x8, %rsi
movapd %xmm1, %xmm0
cmpq %rdx, %rsi
jne 0x9574
subq %rcx, %rax
shrq $0x3, %rax
movl %eax, 0x4(%rsp)
cltd
idivl 0x68(%rbx)
movl %eax, 0x14(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x14(%rsp), %rsi
callq 0xbf5a
movl 0x4(%rsp), %eax
cltd
idivl 0x68(%rbx)
movl %edx, 0x10(%rsp)
leaq 0x130(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xbf5a
movslq 0x14(%rsp), %rax
movq 0xf0(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
je 0x961a
movslq 0x10(%rsp), %rax
movq 0xd8(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
je 0x961a
movq 0xb0(%rbx), %rsi
cmpq 0xb8(%rbx), %rsi
je 0x9631
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xb0(%rbx)
jmp 0x9644
movslq 0x4(%rsp), %rax
movq 0x28(%rsp), %rcx
movq $0x0, (%rcx,%rax,8)
jmp 0x993e
movq 0x20(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0xbd60
movl 0x4(%rsp), %eax
movslq %eax, %rdx
shlq $0x3, %rdx
addq 0x28(%rsp), %rdx
movq 0xc8(%rbx), %rsi
cmpq 0xd0(%rbx), %rsi
je 0x9675
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xc8(%rbx)
jmp 0x9682
movq 0xd0(%rsp), %rdi
callq 0xc068
movslq 0x14(%rsp), %rax
movq %rbx, %rdx
movq 0xf0(%rsp), %rbx
decl (%rbx,%rax,4)
movslq 0x10(%rsp), %rax
xorl %esi, %esi
movl %esi, (%rbx,%rax,4)
movslq 0x10(%rsp), %rax
movq 0xd8(%rsp), %rcx
movl %esi, (%rcx,%rax,4)
movslq 0x14(%rsp), %rax
movl %esi, (%rcx,%rax,4)
movslq 0x14(%rsp), %r14
movl 0x68(%rdx), %ebp
cmpl %esi, (%rbx,%r14,4)
jle 0x96d1
testl %ebp, %ebp
jg 0x96fa
movb $0x1, %al
xorpd %xmm1, %xmm1
jmp 0x9737
testl %ebp, %ebp
jle 0x9817
movl %ebp, %eax
imull %r14d, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
addq 0x28(%rsp), %rdi
leaq (,%rbp,8), %rdx
xorl %esi, %esi
callq 0x3180
movslq %ebp, %rax
movslq 0x10(%rsp), %rcx
movq 0x28(%rsp), %rdx
imulq %rcx, %rax
leaq (%rdx,%rax,8), %rsi
leaq (,%rbp,8), %rdi
xorl %r8d, %r8d
xorpd %xmm1, %xmm1
xorl %eax, %eax
movq %rax, (%rdx,%rcx,8)
movq %rax, (%rdx,%r14,8)
movq %rax, (%rsi,%r8,8)
incq %r8
addq %rdi, %rdx
cmpq %r8, %rbp
jne 0x971e
movq 0x8(%rsp), %rsi
movslq 0x78(%rsi), %rcx
cmpq %rcx, 0x90(%rsp)
setne %cl
movl 0x18(%rsp), %edi
testl %edi, %edi
setne %dl
orb %cl, %dl
orb %dl, %al
testb %dl, %dl
movl $0x1, %ecx
cmovel %ecx, %edi
testb %al, %al
jne 0x983f
movq 0x78(%rsp), %r15
movq 0x28(%rsp), %r13
xorl %r14d, %r14d
testq %r15, %r15
je 0x97c2
movq %r15, %rdi
leaq 0x70(%rsp), %rsi
movq %rsi, %rax
movq %rdi, %rcx
movslq 0x20(%rdi), %rdx
xorl %edi, %edi
cmpq %rdx, %r14
setg %dil
movq %rcx, %rsi
cmovgq %rax, %rsi
movq 0x10(%rcx,%rdi,8), %rdi
testq %rdi, %rdi
jne 0x9784
leaq 0x70(%rsp), %rdi
cmpq %rdi, %rsi
je 0x97c2
cmpq %rdx, %r14
cmovgq %rax, %rcx
movslq 0x20(%rcx), %rax
cmpq %rax, %r14
jge 0x97fc
movl $0x0, (%rbx,%r14,4)
movq 0x8(%rsp), %rax
movslq 0x68(%rax), %rbp
testq %rbp, %rbp
jle 0x97fc
movq %r14, %rax
imulq %rbp, %rax
leaq (,%rax,8), %rdi
addq %r13, %rdi
movq %rbp, %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x3180
xorpd %xmm1, %xmm1
incq %r14
movslq %ebp, %rax
cmpq %rax, %r14
jl 0x9777
movl $0x1, %edi
movq 0x8(%rsp), %rsi
jmp 0x983f
movq 0x8(%rsp), %rsi
movslq 0x78(%rsi), %rax
movl 0x18(%rsp), %edi
testl %edi, %edi
movl %edi, %ecx
movl $0x1, %edx
cmovel %edx, %ecx
cmpq %rax, 0x90(%rsp)
cmovel %ecx, %edi
xorpd %xmm1, %xmm1
movl %edi, 0x18(%rsp)
movslq 0x4(%rsp), %rax
movq 0xb40(%rsi), %rcx
leaq (%rax,%rax,2), %rdx
movq (%rcx,%rdx,8), %rax
movq 0x8(%rcx,%rdx,8), %rdx
subq %rax, %rdx
shrq $0x2, %rdx
testl %edx, %edx
movq %rsi, %rbx
jle 0x9939
movq 0x108(%rsp), %rsi
movq 0xb28(%rbx), %rdi
movq 0x28(%rsp), %r8
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %r9d, %r9d
movslq (%rax,%r9,4), %rcx
leal 0x3f(%rcx), %ebx
testq %rcx, %rcx
cmovnsl %ecx, %ebx
sarl $0x6, %ebx
leaq 0x3f(%r12), %r11
andq %rcx, %r11
xorl %r10d, %r10d
cmpq %r12, %r11
setbe %r10b
movl $0x1, %r11d
shlq %cl, %r11
movslq %ebx, %rbx
leaq (%rsi,%rbx,8), %rbx
movq -0x8(%rbx,%r10,8), %r14
btq %rcx, %r14
jb 0x9921
leaq (%rcx,%rcx,2), %r15
movq (%rdi,%r15,8), %rcx
movq 0x8(%rdi,%r15,8), %r13
subq %rcx, %r13
shrq $0x2, %r13
testl %r13d, %r13d
jle 0x9912
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
movslq (%rcx,%rbp,4), %r15
movsd (%r8,%r15,8), %xmm0
ucomisd %xmm1, %xmm0
jne 0x98fc
jnp 0x990a
addsd 0x888c(%rip), %xmm0     # 0x12190
movsd %xmm0, (%r8,%r15,8)
incq %rbp
cmpq %rbp, %r13
jne 0x98ea
leaq -0x8(,%r10,8), %rcx
orq %r14, %r11
movq %r11, (%rbx,%rcx)
incq %r9
cmpq %rdx, %r9
jne 0x988b
movq 0x40(%rsp), %r14
movq 0x8(%rsp), %rbx
jmp 0x993e
movq 0x40(%rsp), %r14
movq 0xb0(%rbx), %rax
subq 0xa8(%rbx), %rax
shrq $0x2, %rax
cmpl %eax, 0x7c(%rbx)
jg 0x9524
movq 0xc0(%rbx), %rax
movq 0xc8(%rbx), %rcx
subq %rax, %rcx
je 0x999b
sarq $0x3, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
leaq 0x138(%rsp), %r12
addsd (%rax,%rdx,8), %xmm0
incq %rdx
cmpq %rdx, %rcx
jne 0x9986
jmp 0x99a7
xorpd %xmm0, %xmm0
jmp 0x99a7
xorpd %xmm0, %xmm0
leaq 0x138(%rsp), %r12
movsd %xmm0, 0x18(%rsp)
movq 0x108(%rsp), %rax
movq 0x118(%rsp), %rcx
movl 0x120(%rsp), %edx
subq %rax, %rcx
shlq $0x3, %rcx
addq %rdx, %rcx
je 0x99ee
xorl %edx, %edx
xorl %ebp, %ebp
movl %edx, %esi
shrl $0x6, %esi
movq (%rax,%rsi,8), %rsi
btq %rdx, %rsi
adcl $0x0, %ebp
incq %rdx
cmpq %rdx, %rcx
ja 0x99d4
jmp 0x99f0
xorl %ebp, %ebp
cmpb $0x0, (%rsp)
je 0xa051
movq 0xe5d7(%rip), %rdi      # 0x17fd8
leaq 0x8869(%rip), %rsi      # 0x12271
movl $0x12, %edx
callq 0x3340
movq 0xe5bf(%rip), %rdi      # 0x17fd8
movsd 0x18(%rsp), %xmm0
callq 0x3500
movq %rax, %r15
leaq 0x8856(%rip), %rsi      # 0x12284
movl $0xa, %edx
movq %rax, %rdi
callq 0x3340
movq %r15, %rdi
movl %ebp, %esi
callq 0x3580
movq %rax, %r15
leaq 0x8840(%rip), %rsi      # 0x1228f
movl $0x10, %edx
movq %rax, %rdi
callq 0x3340
movq %r15, %rdi
movq %r14, %rsi
callq 0x3100
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
movq %rax, %r15
movq 0x80(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
leaq 0x1e0(%rsp), %rcx
leaq 0x70(%rsp), %rdx
callq 0xaeb4
movq %r15, 0x20(%rsp)
movq 0x148(%rsp), %rsi
leaq 0x98(%rsp), %rdi
leaq 0x1e0(%rsp), %rcx
movq %r12, %rdx
callq 0xaeb4
movq 0xb0(%rsp), %r12
movq 0xb8(%rsp), %r13
cmpq %r13, %r12
je 0x9b22
movq %r13, %rax
subq %r12, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0xc1e6
movq %r12, %rdi
movq %r13, %rsi
callq 0xc2c9
movq 0x98(%rsp), %r12
movq 0xa0(%rsp), %r13
cmpq %r13, %r12
je 0x9b64
movq %r13, %rax
subq %r12, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0xc1e6
movq %r12, %rdi
movq %r13, %rsi
callq 0xc2c9
testq %r14, %r14
jle 0x9d82
xorl %ebx, %ebx
leaq 0x1e0(%rsp), %r12
leaq 0x48(%rsp), %r13
movl $0x0, (%rsp)
movq 0x8(%rsp), %rax
movq 0xae8(%rax), %rcx
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
je 0xa0d1
movq (%rax), %rax
leaq (%rbx,%rbx,2), %rbp
shlq $0x3, %rbp
movq 0x18(%rax), %rsi
addq %rbp, %rsi
movq %r12, %rdi
callq 0xaeee
movq 0x8(%rsp), %rax
movq 0xae8(%rax), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0xa0e3
movq 0x8(%rax), %rax
addq 0x18(%rax), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0xaeee
movq 0x1e0(%rsp), %rbp
movq 0x1e8(%rsp), %r15
cmpq %r15, %rbp
je 0x9c2f
movq %r15, %rax
subq %rbp, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbp, %rdi
movq %r15, %rsi
callq 0xc1e6
movq %rbp, %rdi
movq %r15, %rsi
callq 0xc2c9
movq 0x48(%rsp), %r15
movq 0x50(%rsp), %rbp
cmpq %rbp, %r15
je 0x9c6b
movq %rbp, %rax
subq %r15, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %rbp, %rsi
callq 0xc1e6
movq %r15, %rdi
movq %rbp, %rsi
callq 0xc2c9
movq 0xb0(%rsp), %rax
movq 0xb8(%rsp), %rcx
movq 0x1e0(%rsp), %rdi
movq 0x1e8(%rsp), %rdx
cmpq %rcx, %rax
setne %sil
cmpq %rdx, %rdi
setne %r8b
andb %sil, %r8b
cmpb $0x1, %r8b
jne 0x9d41
xorl %esi, %esi
movq %rdi, %r8
movl (%rax), %r9d
movl (%r8), %r10d
cmpl %r10d, %r9d
jge 0x9cbc
addq $0x4, %rax
jmp 0x9cc9
jg 0x9cc5
incq %rsi
addq $0x4, %rax
addq $0x4, %r8
cmpq %rcx, %rax
je 0x9cd3
cmpq %rdx, %r8
jne 0x9cab
movq 0x48(%rsp), %rax
testq %rsi, %rsi
je 0x9d46
movq 0x98(%rsp), %rcx
movq 0xa0(%rsp), %rdx
movq 0x50(%rsp), %rsi
cmpq %rdx, %rcx
setne %r8b
cmpq %rsi, %rax
setne %r9b
andb %r8b, %r9b
cmpb $0x1, %r9b
jne 0x9d46
xorl %r8d, %r8d
movq %rax, %r9
movl (%rcx), %r10d
movl (%r9), %r11d
cmpl %r11d, %r10d
jge 0x9d20
addq $0x4, %rcx
jmp 0x9d2d
jg 0x9d29
incq %r8
addq $0x4, %rcx
addq $0x4, %r9
cmpq %rdx, %rcx
je 0x9d37
cmpq %rsi, %r9
jne 0x9d0f
testq %r8, %r8
je 0x9d46
incl (%rsp)
jmp 0x9d46
movq 0x48(%rsp), %rax
testq %rax, %rax
je 0x9d5b
movq %rax, %rdi
callq 0x32c0
movq 0x1e0(%rsp), %rdi
testq %rdi, %rdi
je 0x9d65
callq 0x32c0
incq %rbx
cmpq %r14, %rbx
jne 0x9b83
cvtsi2ssl (%rsp), %xmm0
movss %xmm0, (%rsp)
movq 0x8(%rsp), %rbx
jmp 0x9d8b
xorpd %xmm0, %xmm0
movss %xmm0, (%rsp)
movq 0x20(%rsp), %rax
subq 0xc8(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x83c8(%rip), %xmm0     # 0x12170
addsd 0x8(%rbx), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xb70(%rbx)
callq 0xd418
movss %xmm0, 0xb74(%rbx)
movq 0xe20b(%rip), %rdi      # 0x17fd8
leaq 0x84cc(%rip), %rsi      # 0x122a0
movl $0x19, %edx
callq 0x3340
cvtsi2ss %r14, %xmm2
xorps %xmm0, %xmm0
cvtsi2ssl 0x68(%rbx), %xmm0
movss (%rsp), %xmm1
movss %xmm2, 0x8(%rsp)
divss %xmm2, %xmm1
movss %xmm1, (%rsp)
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movq 0xe1ca(%rip), %rdi      # 0x17fd8
callq 0x3500
movq %rax, %r15
leaq 0x849d(%rip), %rsi      # 0x122ba
movl $0xe, %edx
movq %rax, %rdi
callq 0x3340
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
divsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sdl 0x68(%rbx), %xmm0
movsd %xmm1, 0x8(%rsp)
mulsd %xmm1, %xmm0
movq %r15, %rdi
callq 0x3500
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
leaq 0x1e0(%rsp), %rdi
callq 0x3410
leaq 0x1e0(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rcx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl 0x1f8(%rsp,%rcx), %edx
orl $0x4, %edx
movl %edx, 0x1f8(%rsp,%rcx)
movq -0x18(%rax), %rax
movq $0x2, 0x1e8(%rsp,%rax)
xorps %xmm0, %xmm0
cvtsi2ssl 0x68(%rbx), %xmm0
movss (%rsp), %xmm1
mulss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
callq 0x3500
movq %rax, %r15
leaq 0x83df(%rip), %rsi      # 0x122c9
movl $0x1, %edx
movq %rax, %rdi
callq 0x3340
xorps %xmm1, %xmm1
cvtsi2sdl 0x68(%rbx), %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movq %r15, %rdi
callq 0x3500
leaq 0x88e9(%rip), %rsi      # 0x12801
movl $0x1, %edx
movq %rax, %rdi
callq 0x3340
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x8396(%rip), %rsi      # 0x122cb
leaq 0x8395(%rip), %rdx      # 0x122d1
leaq 0x48(%rsp), %rdi
callq 0xb3fa
movss 0xb70(%rbx), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xb74(%rbx), %xmm0
movss %xmm0, (%rsp)
leaq 0x1e8(%rsp), %rsi
leaq 0x160(%rsp), %rdi
callq 0x34f0
leaq 0x1b0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xb490
leaq 0x180(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0xb490
leaq 0x48(%rsp), %rsi
leaq 0x160(%rsp), %rdx
leaq 0x1b0(%rsp), %rcx
leaq 0x180(%rsp), %r8
movq %rbx, %rdi
movss 0x8(%rsp), %xmm0
movss (%rsp), %xmm1
callq 0xa4c4
leaq 0x180(%rsp), %rdi
callq 0xb65e
leaq 0x1b0(%rsp), %rdi
callq 0xb65e
leaq 0x170(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9ffd
callq 0x32c0
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0xa00c
callq 0x32c0
movq 0xdfbd(%rip), %rsi      # 0x17fd0
leaq 0x1e0(%rsp), %rdi
callq 0x3170
leaq 0x250(%rsp), %rdi
callq 0x30e0
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0xa03f
callq 0x32c0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xa051
callq 0x32c0
leaq 0x130(%rsp), %rdi
callq 0xb65e
leaq 0x68(%rsp), %rdi
callq 0xb65e
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0xa07a
callq 0x32c0
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0xa08c
callq 0x32c0
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0xa09e
callq 0x32c0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xa0ad
callq 0x32c0
xorps %xmm1, %xmm1
cvtsi2sd %r14, %xmm1
movsd 0x18(%rsp), %xmm0
divsd %xmm1, %xmm0
addq $0x358, %rsp            # imm = 0x358
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x84b7(%rip), %rdi      # 0x1258f
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3490
leaq 0x84a5(%rip), %rdi      # 0x1258f
movl $0x1, %esi
xorl %eax, %eax
callq 0x3490
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0xb65e
jmp 0xa10b
movq %rax, %rbx
leaq 0x1b0(%rsp), %rdi
callq 0xb65e
jmp 0xa11d
movq %rax, %rbx
leaq 0x170(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa138
callq 0x32c0
jmp 0xa138
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0xa174
callq 0x32c0
jmp 0xa174
jmp 0xa171
jmp 0xa1a4
movq %rax, %rbx
jmp 0xa1e4
jmp 0xa1a9
movq %rax, %rbx
jmp 0xa21f
movq %rax, %rbx
jmp 0xa231
movq %rax, %rbx
jmp 0xa243
jmp 0xa1a4
movq %rax, %rbx
movq 0xde55(%rip), %rsi      # 0x17fd0
leaq 0x1e0(%rsp), %rdi
callq 0x3170
leaq 0x250(%rsp), %rdi
callq 0x30e0
jmp 0xa1d2
jmp 0xa1a4
jmp 0xa1a9
jmp 0xa1a4
jmp 0xa19f
movq %rax, %rbx
jmp 0xa1c0
movq %rax, %rbx
jmp 0xa1d2
movq %rax, %rbx
jmp 0xa1f6
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0xa1c0
callq 0x32c0
movq 0x1e0(%rsp), %rdi
testq %rdi, %rdi
je 0xa1d2
callq 0x32c0
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0xa1e4
callq 0x32c0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xa1f6
callq 0x32c0
leaq 0x130(%rsp), %rdi
callq 0xb65e
leaq 0x68(%rsp), %rdi
callq 0xb65e
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0xa21f
callq 0x32c0
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0xa231
callq 0x32c0
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0xa243
callq 0x32c0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0xa252
callq 0x32c0
movq %rbx, %rdi
callq 0x35c0