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

        clock_t begin = clock();

        priority_queue<pair<int, double>, vector<pair<int, double>>, CompareBySecond> heap;

        float totalscore = 0;
        int bestNodeID;
//
//
        for (int i = 0; i < n; i++) {
            double val = (double) nodeDegree[i];
            std::pair<int, double> pairVal(std::make_pair(i, val));
            heap.push(pairVal);
        }

        seedSet.clear();
        seedScores.clear();
        set<int> rednodes;
        set<int> bluenodes;
        int testt;


        while ((int) seedSet.size() < k_r) {
            pair<int, double> pairVal = heap.top();
            heap.pop();
            bestNodeID = pairVal.first;
            seedSet.push_back(bestNodeID);
            rednodes.insert(bestNodeID);
        }


        while ((int) seedSet.size() < k_r + k_b) {
            pair<int, double> pairVal = heap.top();
            heap.pop();
            bestNodeID = pairVal.first;
            seedSet.push_back(bestNodeID);
            bluenodes.insert(bestNodeID);
        }

        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;
                }
            }
        }

        //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 degree one is " << totalscore*n << endl;

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

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

        return totalscore;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movq %rsi, %r14
movq %rdi, %rbx
callq 0x31d0
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
cmpl $0x0, 0x68(%rbx)
jle 0x6508
xorl %r13d, %r13d
leaq 0x70(%rsp), %r15
leaq 0x170(%rsp), %r12
movq 0xd8(%rbx), %rax
movsd (%rax,%r13,8), %xmm0
movl %r13d, 0x170(%rsp)
movsd %xmm0, 0x178(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xaf6e
incq %r13
movslq 0x68(%rbx), %rax
cmpq %rax, %r13
jl 0x64d3
movq 0xa8(%rbx), %rax
cmpq %rax, 0xb0(%rbx)
je 0x651f
movq %rax, 0xb0(%rbx)
movq %r14, 0x18(%rsp)
movq 0xc0(%rbx), %rax
cmpq %rax, 0xc8(%rbx)
je 0x653b
movq %rax, 0xc8(%rbx)
leaq 0xa8(%rbx), %rbp
leaq 0xc8(%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 0x98(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x70(%rsp), %r15
leaq 0xc(%rsp), %r12
leaq 0xc0(%rsp), %r13
movq 0xb0(%rbx), %rax
subq 0xa8(%rbx), %rax
shrq $0x2, %rax
cmpl %eax, 0x78(%rbx)
jle 0x65ee
movq 0x70(%rsp), %rax
movl (%rax), %r14d
movq %r15, %rdi
callq 0xb008
movl %r14d, 0xc(%rsp)
movq 0xb0(%rbx), %rsi
cmpq 0xb8(%rbx), %rsi
je 0x65d6
movl %r14d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xb0(%rbx)
jmp 0x65e1
movq %rbp, %rdi
movq %r12, %rdx
callq 0xbd60
movq %r13, %rdi
movq %r12, %rsi
callq 0xbf5a
jmp 0x658a
leaq 0x70(%rsp), %r15
leaq 0xc(%rsp), %r12
leaq 0x90(%rsp), %r13
movq 0xb0(%rbx), %rax
subq 0xa8(%rbx), %rax
shrq $0x2, %rax
movl 0x7c(%rbx), %ecx
addl 0x78(%rbx), %ecx
cmpl %eax, %ecx
jle 0x6669
movq 0x70(%rsp), %rax
movl (%rax), %r14d
movq %r15, %rdi
callq 0xb008
movl %r14d, 0xc(%rsp)
movq 0xb0(%rbx), %rsi
cmpq 0xb8(%rbx), %rsi
je 0x6651
movl %r14d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xb0(%rbx)
jmp 0x665c
movq %rbp, %rdi
movq %r12, %rdx
callq 0xbd60
movq %r13, %rdi
movq %r12, %rsi
callq 0xbf5a
jmp 0x6600
movq 0xd8(%rsp), %rsi
leaq 0x58(%rsp), %rdi
leaq 0x170(%rsp), %rcx
leaq 0xc8(%rsp), %rdx
callq 0xaeb4
movq 0xa8(%rsp), %rsi
leaq 0x40(%rsp), %rdi
leaq 0x170(%rsp), %rcx
leaq 0x98(%rsp), %rdx
callq 0xaeb4
movq 0x18(%rsp), %r14
movq 0x58(%rsp), %r15
movq 0x60(%rsp), %r12
cmpq %r12, %r15
je 0x66ee
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 0xc1e6
movq %r15, %rdi
movq %r12, %rsi
callq 0xc2c9
movq 0x40(%rsp), %r15
movq 0x48(%rsp), %r12
cmpq %r12, %r15
je 0x672a
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 0xc1e6
movq %r15, %rdi
movq %r12, %rsi
callq 0xc2c9
testq %r14, %r14
jle 0x6929
xorl %r12d, %r12d
leaq 0x20(%rsp), %r13
movl $0x0, 0x8(%rsp)
movq 0xae8(%rbx), %rcx
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
je 0x6ba8
movq (%rax), %rax
leaq (%r12,%r12,2), %r15
shlq $0x3, %r15
movq 0x18(%rax), %rsi
addq %r15, %rsi
leaq 0x170(%rsp), %rdi
callq 0xaeee
movq 0xae8(%rbx), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rdx
jbe 0x6bba
movq 0x8(%rax), %rax
addq 0x18(%rax), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0xaeee
movq 0x170(%rsp), %r15
movq 0x178(%rsp), %rbp
cmpq %rbp, %r15
je 0x67ea
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 0x20(%rsp), %r15
movq 0x28(%rsp), %rbp
cmpq %rbp, %r15
je 0x6826
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 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
movq 0x170(%rsp), %rdi
movq 0x178(%rsp), %rdx
cmpq %rcx, %rax
setne %sil
cmpq %rdx, %rdi
setne %r8b
andb %sil, %r8b
cmpb $0x1, %r8b
jne 0x68f1
xorl %esi, %esi
movq %rdi, %r8
movl (%rax), %r9d
movl (%r8), %r10d
cmpl %r10d, %r9d
jge 0x6871
addq $0x4, %rax
jmp 0x687e
jg 0x687a
incq %rsi
addq $0x4, %rax
addq $0x4, %r8
cmpq %rcx, %rax
je 0x6888
cmpq %rdx, %r8
jne 0x6860
movq 0x20(%rsp), %rax
testq %rsi, %rsi
je 0x68f6
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rdx
movq 0x28(%rsp), %rsi
cmpq %rdx, %rcx
setne %r8b
cmpq %rsi, %rax
setne %r9b
andb %r8b, %r9b
cmpb $0x1, %r9b
jne 0x68f6
xorl %r8d, %r8d
movq %rax, %r9
movl (%rcx), %r10d
movl (%r9), %r11d
cmpl %r11d, %r10d
jge 0x68cf
addq $0x4, %rcx
jmp 0x68dc
jg 0x68d8
incq %r8
addq $0x4, %rcx
addq $0x4, %r9
cmpq %rdx, %rcx
je 0x68e6
cmpq %rsi, %r9
jne 0x68be
testq %r8, %r8
je 0x68f6
incl 0x8(%rsp)
jmp 0x68f6
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x690b
movq %rax, %rdi
callq 0x32c0
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0x6915
callq 0x32c0
incq %r12
cmpq %r14, %r12
jne 0x6743
cvtsi2ssl 0x8(%rsp), %xmm0
jmp 0x692c
xorps %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
callq 0x31d0
subq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0xb824(%rip), %xmm0     # 0x12170
addsd 0x8(%rbx), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xb70(%rbx)
callq 0xd418
movss %xmm0, 0xb74(%rbx)
movq 0x11667(%rip), %rdi     # 0x17fd8
leaq 0xb95a(%rip), %rsi      # 0x122d2
movl $0x1d, %edx
callq 0x3340
xorps %xmm0, %xmm0
cvtsi2ss %r14, %xmm0
cvtsi2ssl 0x68(%rbx), %xmm1
movss 0x8(%rsp), %xmm2
divss %xmm0, %xmm2
movss %xmm2, 0x8(%rsp)
mulss %xmm2, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movq 0x11627(%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 0x170(%rsp), %rdi
callq 0x3410
leaq 0x170(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rcx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl 0x188(%rsp,%rcx), %edx
orl $0x4, %edx
movl %edx, 0x188(%rsp,%rcx)
movq -0x18(%rax), %rax
movq $0x2, 0x178(%rsp,%rax)
xorps %xmm0, %xmm0
cvtsi2ssl 0x68(%rbx), %xmm0
mulss 0x8(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x3500
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xb8a7(%rip), %rsi      # 0x122f0
leaq 0xb8b0(%rip), %rdx      # 0x12300
leaq 0x20(%rsp), %rdi
callq 0xb3fa
movss 0xb70(%rbx), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0xb74(%rbx), %xmm0
movss %xmm0, 0x10(%rsp)
leaq 0x178(%rsp), %rsi
leaq 0xf0(%rsp), %rdi
callq 0x34f0
leaq 0x140(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0xb490
leaq 0x110(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xb490
leaq 0x20(%rsp), %rsi
leaq 0xf0(%rsp), %rdx
leaq 0x140(%rsp), %rcx
leaq 0x110(%rsp), %r8
movq %rbx, %rdi
movss 0x18(%rsp), %xmm0
movss 0x10(%rsp), %xmm1
callq 0xa4c4
leaq 0x110(%rsp), %rdi
callq 0xb65e
leaq 0x140(%rsp), %rdi
callq 0xb65e
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6b16
callq 0x32c0
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x6b25
callq 0x32c0
movq 0x114a4(%rip), %rsi     # 0x17fd0
leaq 0x170(%rsp), %rdi
callq 0x3170
leaq 0x1e0(%rsp), %rdi
callq 0x30e0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x6b55
callq 0x32c0
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x6b64
callq 0x32c0
leaq 0x90(%rsp), %rdi
callq 0xb65e
leaq 0xc0(%rsp), %rdi
callq 0xb65e
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x6b8d
callq 0x32c0
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb9e0(%rip), %rdi      # 0x1258f
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3490
leaq 0xb9ce(%rip), %rdi      # 0x1258f
movl $0x1, %esi
xorl %eax, %eax
callq 0x3490
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0xb65e
jmp 0x6be2
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0xb65e
jmp 0x6bf4
movq %rax, %rbx
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6c0f
callq 0x32c0
jmp 0x6c0f
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x6c25
callq 0x32c0
jmp 0x6c25
jmp 0x6c22
movq %rax, %rbx
movq 0x113a4(%rip), %rsi     # 0x17fd0
leaq 0x170(%rsp), %rdi
callq 0x3170
leaq 0x1e0(%rsp), %rdi
callq 0x30e0
jmp 0x6c8c
jmp 0x6c5e
movq %rax, %rbx
jmp 0x6c9b
jmp 0x6cae
jmp 0x6c5e
jmp 0x6c5e
jmp 0x6c5e
jmp 0x6c59
movq %rax, %rbx
jmp 0x6c7a
movq %rax, %rbx
jmp 0x6c8c
movq %rax, %rbx
jmp 0x6ccb
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x6c7a
callq 0x32c0
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0x6c8c
callq 0x32c0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x6c9b
callq 0x32c0
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x6cb1
callq 0x32c0
jmp 0x6cb1
jmp 0x6cae
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xb65e
leaq 0xc0(%rsp), %rdi
callq 0xb65e
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x6cda
callq 0x32c0
movq %rbx, %rdi
callq 0x35c0