// File: /workspace/github_cpp_makefile_star2_O1/quancs[P]EAVC/./eavc.h
// Function: init_edge_greedy_vc(int*, VerticeStatus*, unsigned int&)
void init_edge_greedy_vc(int *dscore2, VerticeStatus *vInC2, unsigned int &cvSize2) {
#ifdef WIN32
    start = clock();
#else
    times(&start);
#endif

    unsigned int v, e;
    unsigned int v1, v2;

    memcpy(vInC2, vInBest, vNum);
    memset(dscore2, 0, sizeof(int) * vNum);
    cvSize2 = 0;

    for (unsigned i = 0; i < ueSize; i++) {
        e = uncovEdges[i];
        v1 = edges[e].v1;
        v2 = edges[e].v2;

        if (not_in(vInC2, v1) && not_in(vInC2, v2)) { //if uncovered, choose the endpoint with higher degree
            if (dVDegree[v1] > dVDegree[v2]) {
                vInC2[v1] = IN;
            } else {
                vInC2[v2] = IN;
            }
            cvSize2++;
        }
    }

    //calculate dscores: for the vertexes in C, reduce its score by 1; for the vertexes not in C, remain its score to 0, including IN_ABS and NIN_ABS vertexes
    for (unsigned i = 0; i < ueSize; i++) {
        e = uncovEdges[i];
        v1 = edges[e].v1;
        v2 = edges[e].v2;

        if (in(vInC2, v1) && not_in(vInC2, v2)) dscore2[v1]--;
        else if (in(vInC2, v2) && not_in(vInC2, v1)) dscore2[v2]--;
    }

    //remove redundent vertices
    for (unsigned i = 0; i < uvSize; i++) {
        v = uvSet[i];
        if (in(vInC2, v) && dscore2[v] == 0) {
            vInC2[v] = NIN;
            dscore2[v] = -1 * dscore2[v];
            unsigned int degree = dVDegree[v];
            for (unsigned int i = 0; i < degree; i++) {
                unsigned int vadj = vAdj[v][i];
                if (vInC2[vadj] == false) {
                    dscore2[vadj]++;
                } else
                    dscore2[vadj]--;
            }
            cvSize2--;
        }
    }

#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 edge_greedy_vc=" << cvSize2 << "/" << uvSize << "/" << (cvSize2 + total_IN_ABS) << " time=" << initTime << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x3cb3(%rip), %rdi      # 0x81d8
callq 0x21d0
movq 0x3c97(%rip), %rsi      # 0x81c8
movl 0x3c25(%rip), %edx      # 0x815c
movq %r14, %rdi
callq 0x2140
movl 0x3c17(%rip), %edx      # 0x815c
shlq $0x2, %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x20e0
movl $0x0, (%rbx)
movl 0x3cad(%rip), %eax      # 0x820c
testq %rax, %rax
je 0x460a
movl (%rbx), %ecx
movq 0x3c07(%rip), %rdx      # 0x8178
movq 0x3bf8(%rip), %rsi      # 0x8170
movq 0x3c51(%rip), %rdi      # 0x81d0
xorl %r8d, %r8d
movl (%rdx,%r8,4), %r10d
movl (%rsi,%r10,8), %r9d
cmpb $0x1, (%r14,%r9)
ja 0x45ba
movl 0x4(%rsi,%r10,8), %r10d
cmpb $0x1, (%r14,%r10)
ja 0x45ba
movl (%rdi,%r9,4), %r11d
cmpl (%rdi,%r10,4), %r11d
ja 0x45af
addq %r14, %r10
movq %r10, %r9
jmp 0x45b2
addq %r14, %r9
movb $0x3, (%r9)
incl %ecx
movl %ecx, (%rbx)
incq %r8
cmpq %r8, %rax
jne 0x4582
movq 0x3baf(%rip), %rcx      # 0x8178
movq 0x3ba0(%rip), %rdx      # 0x8170
xorl %esi, %esi
movl (%rcx,%rsi,4), %edi
movl (%rdx,%rdi,8), %r8d
movl 0x4(%rdx,%rdi,8), %edi
movb (%r14,%r8), %r9b
cmpb $0x3, %r9b
jb 0x45ee
cmpb $0x2, (%r14,%rdi)
jb 0x45fe
cmpb $0x1, %r9b
ja 0x4602
cmpb $0x3, (%r14,%rdi)
movq %rdi, %r8
jb 0x4602
decl (%r15,%r8,4)
incq %rsi
cmpq %rsi, %rax
jne 0x45d2
movl 0x3bf8(%rip), %eax      # 0x8208
testq %rax, %rax
je 0x4686
movq 0x3be4(%rip), %rcx      # 0x8200
movq 0x3bad(%rip), %rdx      # 0x81d0
movq 0x3b76(%rip), %rsi      # 0x81a0
xorl %edi, %edi
xorl %r8d, %r8d
movl (%rcx,%r8,4), %r10d
cmpb $0x3, (%r14,%r10)
jb 0x467e
cmpl $0x0, (%r15,%r10,4)
jne 0x467e
movb $0x0, (%r14,%r10)
movl $0x0, (%r15,%r10,4)
movl (%rdx,%r10,4), %r9d
testq %r9, %r9
je 0x467c
movq (%rsi,%r10,8), %r10
xorl %r11d, %r11d
movl (%r10,%r11,4), %r12d
cmpb (%r14,%r12), %dil
movl $0x0, %ebp
sbbl %ebp, %ebp
orl $0x1, %ebp
addl %ebp, (%r15,%r12,4)
incq %r11
cmpq %r11, %r9
jne 0x465e
decl (%rbx)
incq %r8
cmpq %rax, %r8
jne 0x462f
leaq 0x3b93(%rip), %rdi      # 0x8220
callq 0x21d0
movq 0x3b87(%rip), %rax      # 0x8220
movq 0x3b38(%rip), %rcx      # 0x81d8
addq 0x3b81(%rip), %rax      # 0x8228
addq 0x3b32(%rip), %rcx      # 0x81e0
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x2, %edi
callq 0x20f0
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
mulsd 0x1928(%rip), %xmm1     # 0x6008
movapd %xmm1, %xmm0
callq 0x20c0
divsd 0x1917(%rip), %xmm0     # 0x6008
movsd %xmm0, 0x8(%rsp)
movq 0x38da(%rip), %r14      # 0x7fd8
leaq 0x1994(%rip), %rsi      # 0x6099
movl $0x16, %edx
movq %r14, %rdi
callq 0x2180
movl (%rbx), %esi
movq %r14, %rdi
callq 0x2100
movq %rax, %r14
leaq 0x1971(%rip), %r15      # 0x6097
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2180
movl 0x3acc(%rip), %esi      # 0x8208
movq %r14, %rdi
callq 0x2100
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2180
movl 0x3ab7(%rip), %esi      # 0x8214
addl (%rbx), %esi
movq %r14, %rdi
callq 0x2100
movq %rax, %rbx
leaq 0x18e1(%rip), %rsi      # 0x6052
movl $0x6, %edx
movq %rax, %rdi
callq 0x2180
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
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
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2110