// File: /workspace/github_cpp_makefile_star2_O1/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 0x6532
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 0xafc8
incq %r13
movslq 0x68(%rbx), %rax
cmpq %rax, %r13
jl 0x64fd
movq 0xa8(%rbx), %rax
cmpq %rax, 0xb0(%rbx)
je 0x6549
movq %rax, 0xb0(%rbx)
movq %r14, 0x18(%rsp)
movq 0xc0(%rbx), %rax
cmpq %rax, 0xc8(%rbx)
je 0x6565
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 0x6618
movq 0x70(%rsp), %rax
movl (%rax), %r14d
movq %r15, %rdi
callq 0xb066
movl %r14d, 0xc(%rsp)
movq 0xb0(%rbx), %rsi
cmpq 0xb8(%rbx), %rsi
je 0x6600
movl %r14d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xb0(%rbx)
jmp 0x660b
movq %rbp, %rdi
movq %r12, %rdx
callq 0xbdaa
movq %r13, %rdi
movq %r12, %rsi
callq 0xbfa4
jmp 0x65b4
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 0x6693
movq 0x70(%rsp), %rax
movl (%rax), %r14d
movq %r15, %rdi
callq 0xb066
movl %r14d, 0xc(%rsp)
movq 0xb0(%rbx), %rsi
cmpq 0xb8(%rbx), %rsi
je 0x667b
movl %r14d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xb0(%rbx)
jmp 0x6686
movq %rbp, %rdi
movq %r12, %rdx
callq 0xbdaa
movq %r13, %rdi
movq %r12, %rsi
callq 0xbfa4
jmp 0x662a
movq 0xd8(%rsp), %rsi
leaq 0x58(%rsp), %rdi
leaq 0x170(%rsp), %rcx
leaq 0xc8(%rsp), %rdx
callq 0xaf0e
movq 0xa8(%rsp), %rsi
leaq 0x40(%rsp), %rdi
leaq 0x170(%rsp), %rcx
leaq 0x98(%rsp), %rdx
callq 0xaf0e
movq 0x18(%rsp), %r14
movq 0x58(%rsp), %r15
movq 0x60(%rsp), %r12
cmpq %r12, %r15
je 0x6718
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 0x40(%rsp), %r15
movq 0x48(%rsp), %r12
cmpq %r12, %r15
je 0x6754
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
testq %r14, %r14
jle 0x6945
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0xae8(%rbx), %rcx
movq (%rcx), %rax
cmpq %rax, 0x8(%rcx)
je 0x6bc4
movq (%rax), %rax
leaq (%r12,%r12,2), %r15
shlq $0x3, %r15
movq 0x18(%rax), %rsi
addq %r15, %rsi
leaq 0x170(%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 0x6bd6
movq 0x8(%rax), %rax
addq 0x18(%rax), %r15
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0xaf48
movq 0x170(%rsp), %r15
movq 0x178(%rsp), %rbp
cmpq %rbp, %r15
je 0x680c
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 0xc229
movq %r15, %rdi
movq %rbp, %rsi
callq 0xc30c
movq 0x20(%rsp), %r15
movq 0x28(%rsp), %rbp
cmpq %rbp, %r15
je 0x6848
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 0xc229
movq %r15, %rdi
movq %rbp, %rsi
callq 0xc30c
movq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
movq 0x170(%rsp), %rdx
movq 0x178(%rsp), %rsi
cmpq %rcx, %rax
setne %dil
cmpq %rsi, %rdx
setne %r8b
andb %dil, %r8b
cmpb $0x1, %r8b
jne 0x6911
xorl %edi, %edi
movl (%rax), %r8d
movl (%rdx), %r9d
cmpl %r9d, %r8d
jge 0x6890
addq $0x4, %rax
jmp 0x689d
jg 0x6899
incq %rdi
addq $0x4, %rax
addq $0x4, %rdx
cmpq %rcx, %rax
je 0x68a7
cmpq %rsi, %rdx
jne 0x687f
testq %rdi, %rdi
je 0x6911
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
cmpq %rcx, %rax
setne %dil
cmpq %rsi, %rdx
setne %r9b
andb %dil, %r9b
xorl %r8d, %r8d
cmpb $0x1, %r9b
jne 0x690e
xorl %edi, %edi
movl (%rax), %r8d
movl (%rdx), %r9d
cmpl %r9d, %r8d
jge 0x68ed
addq $0x4, %rax
jmp 0x68fa
jg 0x68f6
incq %rdi
addq $0x4, %rax
addq $0x4, %rdx
cmpq %rcx, %rax
je 0x6904
cmpq %rsi, %rdx
jne 0x68dc
xorl %r8d, %r8d
testq %rdi, %rdi
setne %r8b
addl %r8d, %r13d
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x6920
callq 0x32c0
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0x6932
callq 0x32c0
incq %r12
cmpq %r14, %r12
jne 0x6763
cvtsi2ss %r13d, %xmm0
jmp 0x6948
xorps %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
callq 0x31d0
subq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0xb808(%rip), %xmm0     # 0x12170
addsd 0x8(%rbx), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xb70(%rbx)
callq 0xd4f4
movss %xmm0, 0xb74(%rbx)
movq 0x1164b(%rip), %rdi     # 0x17fd8
leaq 0xb946(%rip), %rsi      # 0x122da
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 0x1160b(%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 0xb893(%rip), %rsi      # 0x122f8
leaq 0xb89c(%rip), %rdx      # 0x12308
leaq 0x20(%rsp), %rdi
callq 0xb452
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 0xb4e2
leaq 0x110(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xb4e2
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 0xa536
leaq 0x110(%rsp), %rdi
callq 0xb6b0
leaq 0x140(%rsp), %rdi
callq 0xb6b0
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6b32
callq 0x32c0
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x6b41
callq 0x32c0
movq 0x11488(%rip), %rsi     # 0x17fd0
leaq 0x170(%rsp), %rdi
callq 0x3170
leaq 0x1e0(%rsp), %rdi
callq 0x30e0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x6b71
callq 0x32c0
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x6b80
callq 0x32c0
leaq 0x90(%rsp), %rdi
callq 0xb6b0
leaq 0xc0(%rsp), %rdi
callq 0xb6b0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x6ba9
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 0xb9cc(%rip), %rdi      # 0x12597
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3490
leaq 0xb9ba(%rip), %rdi      # 0x12597
movl $0x1, %esi
xorl %eax, %eax
callq 0x3490
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0xb6b0
jmp 0x6bfe
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0xb6b0
jmp 0x6c10
movq %rax, %rbx
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6c2b
callq 0x32c0
jmp 0x6c2b
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x6c41
callq 0x32c0
jmp 0x6c41
jmp 0x6c3e
movq %rax, %rbx
movq 0x11388(%rip), %rsi     # 0x17fd0
leaq 0x170(%rsp), %rdi
callq 0x3170
leaq 0x1e0(%rsp), %rdi
callq 0x30e0
jmp 0x6ca8
jmp 0x6c7a
movq %rax, %rbx
jmp 0x6cb7
jmp 0x6cca
jmp 0x6c7a
jmp 0x6c7a
jmp 0x6c7a
jmp 0x6c75
movq %rax, %rbx
jmp 0x6c96
movq %rax, %rbx
jmp 0x6ca8
movq %rax, %rbx
jmp 0x6ce7
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x6c96
callq 0x32c0
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0x6ca8
callq 0x32c0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x6cb7
callq 0x32c0
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x6ccd
callq 0x32c0
jmp 0x6ccd
jmp 0x6cca
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xb6b0
leaq 0xc0(%rsp), %rdi
callq 0xb6b0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x6cf6
callq 0x32c0
movq %rbx, %rdi
callq 0x35c0