// File: JenTus[P]TCEM/src_TCEM/allocator.cc
// Function: Cide::allocator::compareGivenNodes(long long)
double allocator::compareGivenNodes(int64 rcSampleSize) {


        clock_t begin = clock();

        float totalscore = 0;
        int bestNodeID;
        seedSet.clear();
        seedScores.clear();


        int redbluecount = 0;

        sort(comparered.begin(), comparered.end());
        sort(compareblue.begin(), compareblue.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(comparered, RedList) >= 1){
                if(intersection_size(compareblue, BlueList) >= 1){
                    redbluecount +=1;
                }
            }
        }

        //cout << " redBluecount is " << redbluecount << endl;
        totalscore = (float) redbluecount / (float) rcSampleSize;
        // end of extra results
        clock_t end = clock();
        totalDuration = double(end - begin) / CLOCKS_PER_SEC + duration_common; // in seconds
        totalMemory = getCurrentMemoryUsage(); // in MB


        cout << "Total score of BalanceExposure is " << totalscore*n << endl;
        std::ostringstream streamObj1;
        streamObj1 << std::fixed << std::setprecision(2)<<totalscore*n;

        set<int> setcomparered(comparered.begin(), comparered.end());
        set<int> setcompareblue(compareblue.begin(), compareblue.end());

        writeInMasterOutputFile("BalanceExposure", totalDuration,  totalMemory, streamObj1.str(), setcomparered, setcompareblue);
        return totalscore;
    }

// Assembly:
subq $0x3d8, %rsp            # imm = 0x3D8
movq %rdi, 0x3d0(%rsp)
movq %rsi, 0x3c8(%rsp)
movq 0x3d0(%rsp), %rax
movq %rax, 0x70(%rsp)
callq 0x4230
movq 0x70(%rsp), %rdi
movq %rax, 0x3c0(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x3bc(%rsp)
addq $0xa8, %rdi
callq 0xe300
movq 0x70(%rsp), %rdi
addq $0xc0, %rdi
callq 0xe320
movq 0x70(%rsp), %rdi
movl $0x0, 0x3b4(%rsp)
addq $0xf0, %rdi
callq 0xe890
movq 0x70(%rsp), %rdi
movq %rax, 0x3a8(%rsp)
addq $0xf0, %rdi
callq 0xe8c0
movq %rax, 0x3a0(%rsp)
movq 0x3a8(%rsp), %rdi
movq 0x3a0(%rsp), %rsi
callq 0xe850
movq 0x70(%rsp), %rdi
addq $0x108, %rdi            # imm = 0x108
callq 0xe890
movq 0x70(%rsp), %rdi
movq %rax, 0x398(%rsp)
addq $0x108, %rdi            # imm = 0x108
callq 0xe8c0
movq %rax, 0x390(%rsp)
movq 0x398(%rsp), %rdi
movq 0x390(%rsp), %rsi
callq 0xe850
movl $0x0, 0x38c(%rsp)
movslq 0x38c(%rsp), %rax
cmpq 0x3c8(%rsp), %rax
jge 0xaf36
movq 0x70(%rsp), %rax
movq 0xae8(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe0d0
movq (%rax), %rdi
addq $0x18, %rdi
movslq 0x38c(%rsp), %rsi
callq 0xe110
movq %rax, %rsi
leaq 0x370(%rsp), %rdi
callq 0xe8f0
movq 0x70(%rsp), %rax
movq 0xae8(%rax), %rdi
movl $0x1, %esi
callq 0xe0d0
movq %rax, 0x68(%rsp)
jmp 0xad9f
movq 0x68(%rsp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
movslq 0x38c(%rsp), %rsi
callq 0xe110
movq %rax, %rsi
leaq 0x358(%rsp), %rdi
callq 0xe8f0
jmp 0xadca
leaq 0x370(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0xe890
movq 0x60(%rsp), %rdi
movq %rax, 0x340(%rsp)
callq 0xe8c0
movq %rax, 0x338(%rsp)
movq 0x340(%rsp), %rdi
movq 0x338(%rsp), %rsi
callq 0xe850
jmp 0xae0d
leaq 0x358(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xe890
movq 0x58(%rsp), %rdi
movq %rax, 0x330(%rsp)
callq 0xe8c0
movq %rax, 0x328(%rsp)
movq 0x330(%rsp), %rdi
movq 0x328(%rsp), %rsi
callq 0xe850
jmp 0xae50
movq 0x70(%rsp), %rdi
addq $0xf0, %rdi
leaq 0x370(%rsp), %rsi
callq 0xe9f0
movq %rax, 0x50(%rsp)
jmp 0xae70
movq 0x50(%rsp), %rax
cmpq $0x1, %rax
jb 0xaef4
movq 0x70(%rsp), %rdi
addq $0x108, %rdi            # imm = 0x108
leaq 0x358(%rsp), %rsi
callq 0xe9f0
movq %rax, 0x48(%rsp)
jmp 0xae9b
movq 0x48(%rsp), %rax
cmpq $0x1, %rax
jb 0xaef2
movl 0x3b4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3b4(%rsp)
jmp 0xaef2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xaf24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
leaq 0x358(%rsp), %rdi
callq 0xdbe0
jmp 0xaf24
jmp 0xaef4
leaq 0x358(%rsp), %rdi
callq 0xdbe0
leaq 0x370(%rsp), %rdi
callq 0xdbe0
movl 0x38c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38c(%rsp)
jmp 0xad33
leaq 0x370(%rsp), %rdi
callq 0xdbe0
jmp 0xb364
cvtsi2ssl 0x3b4(%rsp), %xmm0
cvtsi2ssq 0x3c8(%rsp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x3bc(%rsp)
callq 0x4230
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x320(%rsp)
movq 0x320(%rsp), %rcx
movq 0x3c0(%rsp), %rdx
subq %rdx, %rcx
cvtsi2sd %rcx, %xmm0
movsd 0x1916d(%rip), %xmm1    # 0x240f8
divsd %xmm1, %xmm0
movsd 0x8(%rax), %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xb70(%rax)
callq 0x1be40
movq 0x70(%rsp), %rax
movss %xmm0, 0xb74(%rax)
movq 0x2401b(%rip), %rdi     # 0x2efd8
leaq 0x19324(%rip), %rsi     # 0x242e8
callq 0x4370
movq %rax, %rdi
movq 0x70(%rsp), %rax
movss 0x3bc(%rsp), %xmm0
cvtsi2ssl 0x68(%rax), %xmm1
mulss %xmm1, %xmm0
callq 0x4270
movq %rax, %rdi
movq 0x23fd6(%rip), %rsi     # 0x2efc8
callq 0x43c0
leaq 0x1a8(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x44c0
movq 0x38(%rsp), %rdi
leaq 0x3a6b(%rip), %rsi      # 0xea80
callq 0x40f0
movq %rax, 0x40(%rsp)
jmp 0xb021
movl $0x2, %edi
callq 0xeaa0
movl %eax, 0x34(%rsp)
jmp 0xb031
movq 0x40(%rsp), %rdi
movl 0x34(%rsp), %eax
movl %eax, 0x1a4(%rsp)
movl 0x1a4(%rsp), %esi
callq 0x45a0
movq %rax, 0x28(%rsp)
jmp 0xb054
movq 0x28(%rsp), %rdi
movq 0x70(%rsp), %rax
movss 0x3bc(%rsp), %xmm0
cvtsi2ssl 0x68(%rax), %xmm1
mulss %xmm1, %xmm0
callq 0x4270
jmp 0xb077
movq 0x70(%rsp), %rdi
addq $0xf0, %rdi
movq %rdi, 0x20(%rsp)
callq 0xe890
movq 0x20(%rsp), %rdi
movq %rax, 0x168(%rsp)
callq 0xe8c0
movq %rax, 0x160(%rsp)
movq 0x168(%rsp), %rsi
movq 0x160(%rsp), %rdx
leaq 0x170(%rsp), %rdi
callq 0xec80
jmp 0xb0c6
movq 0x70(%rsp), %rdi
addq $0x108, %rdi            # imm = 0x108
movq %rdi, 0x18(%rsp)
callq 0xe890
movq 0x18(%rsp), %rdi
movq %rax, 0x128(%rsp)
callq 0xe8c0
movq %rax, 0x120(%rsp)
movq 0x128(%rsp), %rsi
movq 0x120(%rsp), %rdx
leaq 0x130(%rsp), %rdi
callq 0xec80
jmp 0xb115
leaq 0xff(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x4690
movq 0x10(%rsp), %rdx
leaq 0x191d8(%rip), %rsi     # 0x2430b
leaq 0x100(%rsp), %rdi
callq 0x44f0
jmp 0xb142
movq 0x70(%rsp), %rax
movss 0xb70(%rax), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xb74(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
leaq 0xd8(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x4390
jmp 0xb17a
leaq 0xa8(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0xeac0
jmp 0xb191
leaq 0x78(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0xeac0
jmp 0xb1a5
movss 0xc(%rsp), %xmm1
movss 0x8(%rsp), %xmm0
movq 0x70(%rsp), %rdi
leaq 0x100(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
leaq 0xa8(%rsp), %rcx
leaq 0x78(%rsp), %r8
callq 0xd380
jmp 0xb1da
leaq 0x78(%rsp), %rdi
callq 0xeaf0
leaq 0xa8(%rsp), %rdi
callq 0xeaf0
leaq 0xd8(%rsp), %rdi
callq 0x41f0
leaq 0x100(%rsp), %rdi
callq 0x41f0
leaq 0xff(%rsp), %rdi
callq 0x43e0
movss 0x3bc(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, (%rsp)
leaq 0x130(%rsp), %rdi
callq 0xeaf0
leaq 0x170(%rsp), %rdi
callq 0xeaf0
leaq 0x1a8(%rsp), %rdi
callq 0x40c0
movsd (%rsp), %xmm0
addq $0x3d8, %rsp            # imm = 0x3D8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xb357
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xb34a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xb330
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xb323
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xb316
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
jmp 0xb309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x350(%rsp)
movl %eax, 0x34c(%rsp)
leaq 0x78(%rsp), %rdi
callq 0xeaf0
leaq 0xa8(%rsp), %rdi
callq 0xeaf0
leaq 0xd8(%rsp), %rdi
callq 0x41f0
leaq 0x100(%rsp), %rdi
callq 0x41f0
leaq 0xff(%rsp), %rdi
callq 0x43e0
leaq 0x130(%rsp), %rdi
callq 0xeaf0
leaq 0x170(%rsp), %rdi
callq 0xeaf0
leaq 0x1a8(%rsp), %rdi
callq 0x40c0
movq 0x350(%rsp), %rdi
callq 0x4680
nopw %cs:(%rax,%rax)