// File: /workspace/github_cpp_makefile_star2_O3/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 $0x118, %rsp            # imm = 0x118
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r15
leaq 0x4b69(%rip), %rdi      # 0x81d8
callq 0x21d0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
leaq 0x1c02(%rip), %rax      # 0x528a
movq %rax, 0xa8(%rsp)
leaq 0x1bfb(%rip), %rax      # 0x5292
movq %rax, 0xa0(%rsp)
movl 0x4b63(%rip), %ebx      # 0x8208
leaq (,%rbx,8), %rdi
callq 0x2030
movq %rax, %r12
movl $0x0, (%r14)
movl 0x4b4a(%rip), %eax      # 0x820c
movl %eax, 0x20(%rsp)
movq %rbx, 0x10(%rsp)
leaq (,%rbx,4), %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x70(%rsp)
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x78(%rsp)
cmpl $0x0, 0x4a68(%rip)      # 0x815c
je 0x3745
movq 0x4acb(%rip), %rax      # 0x81c8
xorl %ecx, %ecx
movq 0x4aca(%rip), %rdx      # 0x81d0
xorl %ebx, %ebx
movzbl (%rax,%rcx), %edi
movb %dil, (%r13,%rcx)
movl (%rdx,%rcx,4), %esi
movl %esi, (%r15,%rcx,4)
cmpl $0x1, %edi
je 0x3735
cmpl $0x4, %edi
je 0x3735
movb $0x0, (%r13,%rcx)
movl %ebx, %edi
movl %ecx, 0x4(%r12,%rdi,8)
movl %esi, (%r12,%rdi,8)
incl %ebx
incq %rcx
movl 0x4a1e(%rip), %esi      # 0x815c
cmpq %rsi, %rcx
jb 0x3708
jmp 0x3747
xorl %ebx, %ebx
leaq 0xf8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x4846
movq 0x108(%rsp), %rax
movq 0x110(%rsp), %rcx
testq %rax, %rax
je 0x3793
leaq 0x108(%rsp), %rdx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdx)
movupd -0x10(%rdx), %xmm0
movapd %xmm0, 0x30(%rsp)
movq %rax, 0x40(%rsp)
jmp 0x37a6
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq %rcx, 0x48(%rsp)
movq 0x10(%rsp), %rcx
cmpl $0x2, %ecx
movq %r13, 0x80(%rsp)
movq %r14, 0x88(%rsp)
jb 0x3830
leaq -0x2(%rcx), %r13
shrq %r13
leaq 0x50(%rsp), %r14
movq (%r12,%r13,8), %rbp
movq %r14, %rdi
leaq 0x30(%rsp), %rsi
callq 0x4846
movq %r12, %rdi
movq %r13, %rsi
movq 0x10(%rsp), %rdx
movq %rbp, %rcx
movq %r14, %rbp
movq %r14, %r8
callq 0x52aa
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x3812
movq %rbp, %rdi
movq %rbp, %rsi
movl $0x3, %edx
callq *%rax
addq $-0x1, %r13
movq %rbp, %r14
jb 0x37d1
movq 0x40(%rsp), %rax
movq 0x80(%rsp), %r13
movq 0x88(%rsp), %r14
testq %rax, %rax
je 0x3844
leaq 0x30(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x108(%rsp), %rax
testq %rax, %rax
je 0x3863
leaq 0xf8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
testl %ebx, %ebx
setne %al
cmpl $0x0, 0x20(%rsp)
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3c11
leaq -0x8(%r12), %rax
movq %rax, 0xf0(%rsp)
movq %r12, 0x10(%rsp)
movq 0x10(%rsp), %rbp
movl (%r12), %eax
movl %eax, 0x2c(%rsp)
movl $0x0, 0xc(%rsp)
xorl %eax, %eax
movl %eax, 0x1c(%rsp)
movl 0x2c(%rsp), %eax
cmpl %eax, (%r12)
jne 0x3a29
movl 0x4(%r12), %r12d
leaq 0xd0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x4846
cmpl $0x1, %ebx
je 0x39b8
movq 0xe0(%rsp), %rax
movq 0xe8(%rsp), %rcx
testq %rax, %rax
je 0x3919
leaq 0xe0(%rsp), %rdx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdx)
movq %rcx, 0x48(%rsp)
movupd 0xd0(%rsp), %xmm0
movapd %xmm0, 0x30(%rsp)
movq %rax, 0x40(%rsp)
jmp 0x3931
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq %rcx, 0x48(%rsp)
movl %ebx, %r14d
movq -0x8(%rbp,%r14,8), %r13
movq (%rbp), %rax
movq %rax, -0x8(%rbp,%r14,8)
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x4846
movq 0xf0(%rsp), %rax
leaq (%rax,%r14,8), %rdx
subq %rbp, %rdx
sarq $0x3, %rdx
movq %rbp, %rdi
xorl %esi, %esi
movq %r13, %rcx
leaq 0x50(%rsp), %r8
callq 0x52aa
movq 0x60(%rsp), %rax
testq %rax, %rax
movq 0x88(%rsp), %r14
movq 0x80(%rsp), %r13
je 0x399f
leaq 0x50(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x39b8
leaq 0x30(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xe0(%rsp), %rax
testq %rax, %rax
je 0x39d7
leaq 0xd0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movl (%r15,%r12,4), %eax
cmpl %eax, 0x2c(%rsp)
jne 0x39fb
movl 0x1c(%rsp), %edx
movl %edx, %eax
movq 0x78(%rsp), %rcx
movl %r12d, (%rcx,%rax,4)
movl %edx, %eax
incl %eax
movq 0x10(%rsp), %r12
jmp 0x3a1d
testl %eax, %eax
jle 0x3a14
movl 0xc(%rsp), %ecx
movl %ecx, %eax
movq 0x70(%rsp), %rdx
movl %r12d, (%rdx,%rax,4)
incl %ecx
movl %ecx, 0xc(%rsp)
movq 0x10(%rsp), %r12
movl 0x1c(%rsp), %eax
decl %ebx
jne 0x38a4
xorl %ebx, %ebx
jmp 0x3a2d
movl 0x1c(%rsp), %eax
testl %eax, %eax
je 0x3b05
movq 0x46fc(%rip), %rsi      # 0x8138
movq 0x478d(%rip), %rdi      # 0x81d0
movq 0x4756(%rip), %r8       # 0x81a0
movl %eax, %r9d
movq %rsi, %rcx
shrq $0x3d, %rcx
movq %rsi, %rax
shrq $0x16, %rax
xorq %rsi, %rax
addb $0x16, %cl
shrq %cl, %rax
xorl %edx, %edx
divl %r9d
movq 0x78(%rsp), %r10
movl (%r10,%rdx,4), %ecx
movl -0x4(%r10,%r9,4), %eax
movl %eax, (%r10,%rdx,4)
movl (%r15,%rcx,4), %eax
cmpl 0x2c(%rsp), %eax
jne 0x3ace
incl (%r14)
negl (%r15,%rcx,4)
movb $0x3, (%r13,%rcx)
movl (%rdi,%rcx,4), %eax
testq %rax, %rax
je 0x3ae7
movq (%r8,%rcx,8), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %r10d
cmpb $0x1, (%r13,%r10)
movl (%r15,%r10,4), %r11d
ja 0x3abd
decl %r11d
movl %r11d, (%r15,%r10,4)
decl 0x20(%rsp)
jmp 0x3ac4
incl %r11d
movl %r11d, (%r15,%r10,4)
incq %rdx
cmpq %rdx, %rax
jne 0x3aa0
jmp 0x3ae7
testl %eax, %eax
jle 0x3ae7
movl 0xc(%rsp), %edx
movl %edx, %eax
movq 0x70(%rsp), %r10
movl %ecx, (%r10,%rax,4)
incl %edx
movl %edx, 0xc(%rsp)
movabsq $0x5851f42d4c957f2d, %rax # imm = 0x5851F42D4C957F2D
imulq %rax, %rsi
decq %r9
jne 0x3a4d
movq %rsi, 0x4633(%rip)      # 0x8138
movl 0xc(%rsp), %eax
testl %eax, %eax
je 0x3bfd
movl %eax, %r12d
movq 0x70(%rsp), %rax
movl -0x4(%rax,%r12,4), %eax
movl %ebx, %ebx
movq 0x10(%rsp), %rcx
movl %eax, 0x4(%rcx,%rbx,8)
movl (%r15,%rax,4), %eax
movl %eax, (%rcx,%rbx,8)
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x4846
movq 0xc0(%rsp), %rax
movq 0xc8(%rsp), %rcx
testq %rax, %rax
je 0x3b85
leaq 0xc0(%rsp), %rdx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdx)
movq %rcx, 0x68(%rsp)
movupd 0xb0(%rsp), %xmm0
movapd %xmm0, 0x50(%rsp)
movq %rax, 0x60(%rsp)
jmp 0x3b9d
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movq %rcx, 0x68(%rsp)
movq 0x10(%rsp), %rdi
movq -0x8(%rdi,%rbx,8), %rcx
leaq -0x1(%rbx), %rsi
xorl %edx, %edx
leaq 0x50(%rsp), %r8
callq 0x5405
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x3bd0
leaq 0x50(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xc0(%rsp), %rax
testq %rax, %rax
je 0x3bef
leaq 0xb0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
decq %r12
incl %ebx
testq %r12, %r12
jne 0x3b14
testl %ebx, %ebx
movq 0x10(%rsp), %r12
je 0x3c11
cmpl $0x0, 0x20(%rsp)
jne 0x3892
movl 0x45f1(%rip), %eax      # 0x8208
testq %rax, %rax
je 0x3c88
movq 0x45dd(%rip), %rcx      # 0x8200
movq 0x45a6(%rip), %rdx      # 0x81d0
movq 0x456f(%rip), %rsi      # 0x81a0
xorl %edi, %edi
movl (%rcx,%rdi,4), %r9d
cmpl $0x0, (%r15,%r9,4)
jne 0x3c80
cmpb $0x3, (%r13,%r9)
jb 0x3c80
decl (%r14)
movb $0x0, (%r13,%r9)
movl (%rdx,%r9,4), %r8d
testq %r8, %r8
je 0x3c80
movq (%rsi,%r9,8), %r9
xorl %r10d, %r10d
movl (%r9,%r10,4), %r11d
cmpb $0x2, (%r13,%r11)
movl $0x0, %ebx
adcl $-0x1, %ebx
orl $0x1, %ebx
addl %ebx, (%r15,%r11,4)
incq %r10
cmpq %r10, %r8
jne 0x3c5f
incq %rdi
cmpq %rax, %rdi
jne 0x3c33
movq 0x70(%rsp), %rdi
callq 0x2190
movq 0x78(%rsp), %rdi
callq 0x2190
movq %r12, %rdi
callq 0x2190
leaq 0x4575(%rip), %rdi      # 0x8220
callq 0x21d0
movq 0x4569(%rip), %rax      # 0x8220
movq 0x451a(%rip), %rcx      # 0x81d8
addq 0x4563(%rip), %rax      # 0x8228
addq 0x4514(%rip), %rcx      # 0x81e0
subq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x20(%rsp)
movl $0x2, %edi
callq 0x20f0
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd 0x20(%rsp), %xmm1
divsd %xmm0, %xmm1
mulsd 0x2307(%rip), %xmm1     # 0x6008
movapd %xmm1, %xmm0
callq 0x20c0
movsd %xmm0, 0x20(%rsp)
movq 0x42c1(%rip), %rdi      # 0x7fd8
leaq 0x2370(%rip), %rsi      # 0x608e
movl $0x18, %edx
callq 0x2180
movl (%r14), %esi
movq 0x42a6(%rip), %rdi      # 0x7fd8
callq 0x2100
movq %rax, %rbx
leaq 0x2366(%rip), %rsi      # 0x60a7
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
movl 0x44b4(%rip), %esi      # 0x8208
movq %rbx, %rdi
callq 0x2100
movq %rax, %rbx
leaq 0x2341(%rip), %rsi      # 0x60a7
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
movl 0x449b(%rip), %esi      # 0x8214
addl (%r14), %esi
movq %rbx, %rdi
callq 0x2100
movq %rax, %rbx
leaq 0x22d4(%rip), %rsi      # 0x6062
movl $0x6, %edx
movq %rax, %rdi
callq 0x2180
movsd 0x20(%rsp), %xmm0
divsd 0x225f(%rip), %xmm0     # 0x6008
movq %rbx, %rdi
callq 0x21c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq 0xa0(%rsp), %rax
testq %rax, %rax
je 0x3dfa
leaq 0x90(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3f8b
jmp 0x3f8b
jmp 0x3f8b
jmp 0x3f61
jmp 0x3f61
jmp 0x3f61
jmp 0x3f61
jmp 0x3f8b
jmp 0x3f61
movq %rax, %rbx
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x3e5f
leaq 0x50(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x3e5f
jmp 0x3f8b
movq %rax, %rbx
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x3e78
leaq 0x30(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x108(%rsp), %rax
testq %rax, %rax
je 0x3f64
leaq 0xf8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x3f64
jmp 0x3f8b
jmp 0x3f8b
jmp 0x3f8b
jmp 0x3f8b
movq %rax, %rbx
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x3eda
leaq 0x50(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x3eda
jmp 0x3f8b
movq %rax, %rbx
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x3ef3
leaq 0x30(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xe0(%rsp), %rax
testq %rax, %rax
je 0x3f64
leaq 0xd0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x3f64
jmp 0x3f8b
jmp 0x3f8b
jmp 0x3f8b
jmp 0x3f8b
jmp 0x3f8b
jmp 0x3f61
movq %rax, %rbx
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x3f3c
leaq 0x50(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xc0(%rsp), %rax
testq %rax, %rax
je 0x3f64
leaq 0xb0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x3f64
jmp 0x3f8b
jmp 0x3f8b
movq %rax, %rbx
movq 0xa0(%rsp), %rax
testq %rax, %rax
je 0x3f83
leaq 0x90(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %rbx, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x55a3