// File: /workspace/github_cpp_makefile_star2_O2/quancs[P]EAVC/./eavc.h
// Function: init_vertex_greedy_vc(int*, VerticeStatus*, unsigned int&)
void init_vertex_greedy_vc(int *dscore1, VerticeStatus *vInC1, unsigned int &cvSize1) {  //super fast
#ifdef WIN32
    start = clock();
#else
    times(&start);
#endif
    struct ScoreVertex {
        int score;
        unsigned int vertex;
    };

    function<bool(const ScoreVertex &, const ScoreVertex &)> compFunc = [](const ScoreVertex & v1, const ScoreVertex & v2) {
        return v1.score < v2.score;//<:大的在前面，小的在后面
    };

    ScoreVertex *candidates = new ScoreVertex[uvSize];
    unsigned int candSize = 0;
    cvSize1 = 0;
    unsigned int ueSize1 = ueSize;

    unsigned *readdCandVertices = new unsigned[uvSize];
    unsigned racSize = 0;
    unsigned *highScoreVertices = new unsigned[uvSize];
    unsigned hsvSize = 0;
    int highestScore = static_cast<int>(vNum);

    for (unsigned int v = 0; v < vNum; v++) {
        vInC1[v] = vInBest[v];
        dscore1[v] = static_cast<int>(dVDegree[v]);
        if (vInC1[v] != IN_ABS && vInC1[v] != NIN_ABS) {
            vInC1[v] = NIN;
            candidates[candSize].vertex = v;
            candidates[candSize].score = dscore1[v];
            candSize++;
        }
    }

    make_heap(candidates, candidates + uvSize, compFunc);

    for (; candSize > 0 && ueSize1 > 0;) {
        highestScore = candidates[0].score;
        int gainValue;
        unsigned int v;
        //pop all vertices with bigest score value
        while (candSize > 0) {
            gainValue = candidates[0].score;
            v = candidates[0].vertex;
            if (gainValue == highestScore) {
                pop_heap(candidates, candidates + candSize, compFunc);
                candSize--;
                if (gainValue != dscore1[v]) {//readd the vertexes whose gain value has changed
                    if (dscore1[v] > 0) {
                        readdCandVertices[racSize] = v;
                        racSize++;
                    }
                } else {//add to highScoreVertices
                    highScoreVertices[hsvSize] = v;
                    hsvSize++;
                }
            } else {
                break;
            }
        }

        //Randomly select and add
        while (hsvSize > 0) {
            unsigned randomIndex = pcg32_fast() % hsvSize;
            hsvSize--;
            v = highScoreVertices[randomIndex];
            highScoreVertices[randomIndex] = highScoreVertices[hsvSize];

            if (dscore1[v] != highestScore) {
                if (dscore1[v] > 0) {
                    readdCandVertices[racSize] = v;
                    racSize++;
                }
            } else {// Add v to c
                cvSize1++;
                dscore1[v] = dscore1[v] * -1;
                vInC1[v] = IN;

                unsigned int edgeCount = dVDegree[v];
                for (unsigned int i = 0; i < edgeCount; ++i) {
                    unsigned int n = vAdj[v][i];//v's i'th neighbor

                    if (not_in(vInC1, n)) { //this adj isn't in cover set
                        dscore1[n]--;
                        ueSize1--;
                    } else {
                        dscore1[n]++;
                    }
                }
            }
        }

        //readd
        while (racSize > 0) {
            racSize--;
            v = readdCandVertices[racSize];

            candidates[candSize].vertex = v;
            candidates[candSize].score = dscore1[v];
            push_heap(candidates, candidates + candSize, compFunc);
            candSize++;
        }
    }

    for (unsigned i = 0; i < uvSize; i++) {
        unsigned v = uvSet[i];
        if (dscore1[v] == 0 && in(vInC1, v)) {
            cvSize1--;
            // remove v from c
            vInC1[v] = NIN;

            unsigned int edgeCount = dVDegree[v];
            for (unsigned int i = 0; i < edgeCount; ++i) {
                unsigned int n = vAdj[v][i];//v's i'th neighbor
                if (not_in(vInC1, n))
                    dscore1[n]++;
                else
                    dscore1[n]--;
            }
        }
    }
    delete [] readdCandVertices;
    delete [] highScoreVertices;
    delete [] candidates;

#ifdef WIN32
    finish = clock();
    double initTime = (static_cast<double>(finish - start)) / CLOCKS_PER_SEC;
#else
    times(&finish);
    double initTime = double(finish.tms_utime - start.tms_utime + finish.tms_stime - start.tms_stime) / sysconf(_SC_CLK_TCK);
#endif

    initTime = round(initTime * 100) / 100.0;

    cout << "c init vertex_greedy_vc=" << cvSize1 << "/" << uvSize << "/" << (cvSize1 + total_IN_ABS) << " time=" << initTime << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdx, %r14
movq %rsi, 0x10(%rsp)
movq %rdi, %r15
leaq 0x3fe5(%rip), %rdi      # 0x71b8
callq 0x21b0
xorpd %xmm0, %xmm0
movapd %xmm0, 0xd0(%rsp)
leaq 0x1532(%rip), %rax      # 0x471e
movq %rax, 0xe8(%rsp)
leaq 0x152b(%rip), %rax      # 0x4726
movq %rax, 0xe0(%rsp)
movl 0x3fde(%rip), %r13d     # 0x71e8
leaq (,%r13,8), %rdi
callq 0x2030
movq %rax, %rbp
andl $0x0, (%r14)
movl 0x3fc8(%rip), %eax      # 0x71ec
movl %eax, 0x18(%rsp)
leaq (,%r13,4), %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, %r12
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x50(%rsp)
movq 0x3f59(%rip), %rax      # 0x71a8
xorl %ecx, %ecx
movq 0x3f58(%rip), %rdx      # 0x71b0
xorl %ebx, %ebx
movl 0x3edc(%rip), %esi      # 0x713c
cmpq %rsi, %rcx
jae 0x329d
movzbl (%rax,%rcx), %edi
movq 0x10(%rsp), %rsi
movb %dil, (%rsi,%rcx)
movl (%rdx,%rcx,4), %esi
movl %esi, (%r15,%rcx,4)
cmpl $0x1, %edi
je 0x3298
cmpl $0x4, %edi
je 0x3298
movq 0x10(%rsp), %rdi
movb $0x0, (%rdi,%rcx)
movl %ebx, %edi
movl %ecx, 0x4(%rbp,%rdi,8)
movl %esi, (%rbp,%rdi,8)
incl %ebx
incq %rcx
jmp 0x325a
leaq 0x118(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x408a
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
andq $0x0, 0x90(%rsp)
movq 0x128(%rsp), %rcx
movq 0x130(%rsp), %rax
movq %rax, 0x98(%rsp)
testq %rcx, %rcx
movq %r14, 0xa0(%rsp)
je 0x3320
leaq 0x128(%rsp), %rdx
movups -0x10(%rdx), %xmm1
movaps %xmm1, 0x80(%rsp)
movupd %xmm0, (%rdx)
movupd -0x10(%rdx), %xmm1
movapd %xmm1, 0x20(%rsp)
movq %rcx, 0x30(%rsp)
movapd %xmm0, 0x90(%rsp)
jmp 0x332c
movapd %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movq %rax, 0x38(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x4b92
movq %r13, 0x8(%rsp)
cmpl $0x2, %r13d
jb 0x3391
movq 0x8(%rsp), %rax
leaq -0x2(%rax), %r14
shrq %r14
movq (%rbp,%r14,8), %r13
leaq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x408a
movq %rbp, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
movq %r13, %rcx
leaq 0x60(%rsp), %r8
callq 0x473e
leaq 0x60(%rsp), %rdi
callq 0x4b92
addq $-0x1, %r14
jb 0x3355
leaq 0x20(%rsp), %rdi
callq 0x4b92
leaq 0x118(%rsp), %rdi
callq 0x4b92
leaq 0xb0(%rsp), %r13
movq %r12, 0xf0(%rsp)
movq %r15, (%rsp)
movq %rbp, 0x40(%rsp)
testl %ebx, %ebx
je 0x3759
cmpl $0x0, 0x18(%rsp)
je 0x3759
movl (%rbp), %r15d
movl %ebx, %ebx
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x8(%rsp)
movl %r15d, 0x5c(%rsp)
leaq -0x8(,%rbx,8), %r14
decq %rbx
movq %rbx, %rcx
movl 0x1c(%rsp), %ebp
cmpq $-0x1, %rcx
je 0x359c
movq %rcx, %rbx
movq 0x40(%rsp), %rax
cmpl %r15d, (%rax)
jne 0x35a0
movl 0x4(%rax), %eax
movq %rax, 0x48(%rsp)
movq %r13, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x408a
movq %rbx, 0xa8(%rsp)
subq $0x1, %rbx
jb 0x3543
xorpd %xmm1, %xmm1
movapd %xmm1, 0x80(%rsp)
andq $0x0, 0x90(%rsp)
movq 0xc0(%rsp), %rax
movq 0xc8(%rsp), %rcx
movq %rcx, 0x98(%rsp)
testq %rax, %rax
je 0x34bc
movups 0xb0(%rsp), %xmm0
movaps %xmm0, 0x80(%rsp)
leaq 0xc0(%rsp), %rdx
movupd %xmm1, (%rdx)
movq %rcx, 0x38(%rsp)
movupd 0xb0(%rsp), %xmm0
movapd %xmm0, 0x20(%rsp)
movq %rax, 0x30(%rsp)
leaq 0x90(%rsp), %rax
movupd %xmm1, (%rax)
jmp 0x34cd
movapd %xmm1, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x4b92
movq 0x40(%rsp), %r12
movq 0xa8(%rsp), %rcx
movq (%r12,%rcx,8), %r13
movq (%r12), %rax
movq %rax, (%r12,%rcx,8)
leaq 0x60(%rsp), %r15
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
callq 0x408a
movq %r14, %rdx
sarq $0x3, %rdx
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rcx
movq %r15, %r8
callq 0x473e
movq %r15, %rdi
callq 0x4b92
leaq 0x20(%rsp), %rdi
callq 0x4b92
movq 0xf0(%rsp), %r12
leaq 0xb0(%rsp), %r13
movl 0x5c(%rsp), %r15d
movq %r13, %rdi
callq 0x4b92
movq (%rsp), %rax
movq 0x48(%rsp), %rdx
movl (%rax,%rdx,4), %eax
cmpl %eax, %r15d
je 0x3583
addq $-0x8, %r14
movq %rbx, %rcx
testl %eax, %eax
jle 0x33fd
movl 0x8(%rsp), %ecx
movl %ecx, %eax
movl %edx, (%r12,%rax,4)
incl %ecx
movl %ecx, 0x8(%rsp)
incq %rbx
jmp 0x33ef
movq 0x50(%rsp), %rax
movl %edx, (%rax,%rbp,4)
incl 0x1c(%rsp)
movq 0xa8(%rsp), %rbx
jmp 0x33ef
xorl %ebx, %ebx
jmp 0x35a2
incl %ebx
movq 0x3c07(%rip), %rax      # 0x71b0
movq %rax, 0x48(%rsp)
movq 0x3bcb(%rip), %r13      # 0x7180
movl 0x8(%rsp), %r14d
testq %rbp, %rbp
je 0x3653
callq 0x2385
xorl %edx, %edx
divl %ebp
movq 0x50(%rsp), %rsi
movl (%rsi,%rdx,4), %eax
movl -0x4(%rsi,%rbp,4), %ecx
movl %ecx, (%rsi,%rdx,4)
movq (%rsp), %rcx
movl (%rcx,%rax,4), %ecx
cmpl %r15d, %ecx
je 0x35f8
decq %rbp
testl %ecx, %ecx
jle 0x35b5
movl %eax, (%r12,%r14,4)
incl 0x8(%rsp)
jmp 0x35b5
movq 0xa0(%rsp), %rcx
incl (%rcx)
movq (%rsp), %rcx
negl (%rcx,%rax,4)
movq 0x10(%rsp), %r8
movb $0x3, (%r8,%rax)
movq 0x48(%rsp), %rcx
movl (%rcx,%rax,4), %ecx
decq %rbp
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x35b5
movq (%r13,%rax,8), %rsi
movl (%rsi,%rdx,4), %esi
cmpb $0x1, (%r8,%rsi)
movq (%rsp), %r9
movl (%r9,%rsi,4), %edi
ja 0x3648
decl %edi
movl %edi, (%r9,%rsi,4)
decl 0x18(%rsp)
jmp 0x364e
incl %edi
movl %edi, (%r9,%rsi,4)
incq %rdx
jmp 0x3620
movq (%rsp), %r15
movq 0x40(%rsp), %rbp
subq $0x1, %r14
jb 0x374c
movl (%r12,%r14,4), %eax
movl %ebx, %r13d
movl %eax, 0x4(%rbp,%r13,8)
movl (%r15,%rax,4), %eax
movl %eax, (%rbp,%r13,8)
leaq 0xf8(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x408a
xorpd %xmm1, %xmm1
movapd %xmm1, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movq 0x108(%rsp), %rax
movq 0x110(%rsp), %rcx
movq %rcx, 0x38(%rsp)
testq %rax, %rax
je 0x36f8
movups 0xf8(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
leaq 0x108(%rsp), %rdx
movupd %xmm1, (%rdx)
movq %rcx, 0x78(%rsp)
movupd 0xf8(%rsp), %xmm0
movapd %xmm0, 0x60(%rsp)
movq %rax, 0x70(%rsp)
leaq 0x20(%rsp), %rdi
movupd %xmm1, 0x10(%rdi)
jmp 0x370e
movapd %xmm1, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
movq %rcx, 0x78(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x4b92
movq -0x8(%rbp,%r13,8), %rcx
decq %r13
movq %rbp, %rdi
movq %r13, %rsi
xorl %edx, %edx
leaq 0x60(%rsp), %r13
movq %r13, %r8
callq 0x485a
movq %r13, %rdi
callq 0x4b92
leaq 0xf8(%rsp), %rdi
callq 0x4b92
incl %ebx
jmp 0x365c
leaq 0xb0(%rsp), %r13
jmp 0x33c1
movl 0x3a89(%rip), %eax      # 0x71e8
movq 0x3a7a(%rip), %rcx      # 0x71e0
movq 0x3a43(%rip), %rdx      # 0x71b0
movq 0x3a0c(%rip), %rsi      # 0x7180
xorl %edi, %edi
movq 0xa0(%rsp), %r14
cmpq %rax, %rdi
je 0x37de
movl (%rcx,%rdi,4), %r8d
cmpl $0x0, (%r15,%r8,4)
jne 0x37d9
movq 0x10(%rsp), %r9
cmpb $0x3, (%r9,%r8)
jb 0x37d9
decl (%r14)
movq 0x10(%rsp), %r9
movb $0x0, (%r9,%r8)
movl (%rdx,%r8,4), %r9d
xorl %r10d, %r10d
cmpq %r10, %r9
je 0x37d9
movq (%rsi,%r8,8), %r11
movl (%r11,%r10,4), %r11d
movq 0x10(%rsp), %rbx
cmpb $0x2, (%rbx,%r11)
movl $0x0, %ebx
adcl $-0x1, %ebx
orl $0x1, %ebx
addl %ebx, (%r15,%r11,4)
incq %r10
jmp 0x37ae
incq %rdi
jmp 0x377e
movq %r12, %rdi
callq 0x2170
movq 0x50(%rsp), %rdi
callq 0x2170
movq %rbp, %rdi
callq 0x2170
leaq 0x3a01(%rip), %rdi      # 0x7200
callq 0x21b0
movq 0x39f5(%rip), %rax      # 0x7200
movq 0x39a6(%rip), %rcx      # 0x71b8
addq 0x39ef(%rip), %rax      # 0x7208
addq 0x39a0(%rip), %rcx      # 0x71c0
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, (%rsp)
pushq $0x2
popq %rdi
callq 0x20e0
cvtsi2sd %rax, %xmm0
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
mulsd 0x17bd(%rip), %xmm1     # 0x5008
movapd %xmm1, %xmm0
callq 0x20b0
movsd %xmm0, (%rsp)
movq 0x3778(%rip), %rdi      # 0x6fd8
leaq 0x1817(%rip), %rsi      # 0x507e
callq 0x2150
movl (%r14), %esi
movq %rax, %rdi
callq 0x20f0
leaq 0x1819(%rip), %rsi      # 0x5097
movq %rax, %rdi
callq 0x2150
movl 0x395c(%rip), %esi      # 0x71e8
movq %rax, %rdi
callq 0x20f0
leaq 0x17fc(%rip), %rsi      # 0x5097
movq %rax, %rdi
callq 0x2150
movl 0x394b(%rip), %esi      # 0x71f4
addl (%r14), %esi
movq %rax, %rdi
callq 0x20f0
leaq 0x1797(%rip), %rsi      # 0x5052
movq %rax, %rdi
callq 0x2150
movsd (%rsp), %xmm0
divsd 0x1738(%rip), %xmm0     # 0x5008
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
leaq 0xd0(%rsp), %rdi
callq 0x4b92
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3957
jmp 0x3957
jmp 0x3957
jmp 0x3957
jmp 0x3957
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x4b92
jmp 0x391b
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4b92
leaq 0x118(%rsp), %rdi
jmp 0x3971
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x4b92
jmp 0x3941
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4b92
leaq 0xb0(%rsp), %rdi
jmp 0x3971
jmp 0x3957
movq %rax, %rbx
jmp 0x3976
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x4b92
leaq 0xf8(%rsp), %rdi
callq 0x4b92
leaq 0xd0(%rsp), %rdi
callq 0x4b92
movq %rbx, %rdi
callq 0x21e0