// File: /workspace/github_cpp_makefile_star2_O2/quancs[P]EAVC/./eavc.h
// Function: init_match_vc(int*, VerticeStatus*, unsigned int&)
void init_match_vc(int *dscore3, VerticeStatus *vInC3, unsigned int &cvSize3) {
#ifdef WIN32
    start = clock();
#else
    times(&start);
#endif

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

    memset(dscore3, 0, sizeof(int) * vNum);
    memcpy(vInC3, vInBest, vNum);

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

        if (not_in(vInC3, v1) && not_in(vInC3, v2)) {
            vInC3[v1] = IN;
            vInC3[v2] = IN;
            cvSize3 = cvSize3 + 2;
        }
    }

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

        if (in(vInC3, v1) && not_in(vInC3, v2))
            dscore3[v1]--;
        else if (in(vInC3, v2) && not_in(vInC3, v1))
            dscore3[v2]--;
    }

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

#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 match_vc=" << cvSize3 << "/" << uvSize << "/" << (cvSize3 + 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 0x3351(%rip), %rdi      # 0x71b8
callq 0x21b0
movl 0x32ca(%rip), %edx      # 0x713c
shlq $0x2, %rdx
xorl %r12d, %r12d
movq %r15, %rdi
xorl %esi, %esi
callq 0x20d0
movq 0x331e(%rip), %rsi      # 0x71a8
movl 0x32ac(%rip), %edx      # 0x713c
movq %r14, %rdi
callq 0x2120
andl $0x0, (%rbx)
movl 0x334b(%rip), %eax      # 0x71ec
movq 0x32b0(%rip), %rcx      # 0x7158
movq 0x32a1(%rip), %rdx      # 0x7150
movb $0x3, %sil
xorl %edi, %edi
cmpq %r12, %rax
je 0x3ee6
movl (%rcx,%r12,4), %r9d
movl (%rdx,%r9,8), %r8d
cmpb $0x1, (%r14,%r8)
ja 0x3ee1
movl 0x4(%rdx,%r9,8), %r9d
cmpb $0x1, (%r14,%r9)
ja 0x3ee1
movb %sil, (%r14,%r8)
movb %sil, (%r14,%r9)
addl $0x2, %edi
movl %edi, (%rbx)
incq %r12
jmp 0x3eb4
xorl %esi, %esi
cmpq %rsi, %rax
je 0x3f28
movl (%rcx,%rsi,4), %r8d
movl (%rdx,%r8,8), %edi
movl 0x4(%rdx,%r8,8), %r8d
movb (%r14,%rdi), %r10b
movb (%r14,%r8), %r9b
cmpb $0x3, %r10b
jb 0x3f10
cmpb $0x2, %r9b
jb 0x3f1f
jmp 0x3f23
cmpb $0x2, %r10b
je 0x3f23
movq %r8, %rdi
cmpb $0x3, %r9b
jb 0x3f23
decl (%r15,%rdi,4)
incq %rsi
jmp 0x3ee8
movl 0x32ba(%rip), %eax      # 0x71e8
movq 0x32ab(%rip), %rcx      # 0x71e0
movq 0x3274(%rip), %rdx      # 0x71b0
movq 0x323d(%rip), %rsi      # 0x7180
xorl %edi, %edi
cmpq %rax, %rdi
je 0x3f95
movl (%rcx,%rdi,4), %r8d
cmpb $0x3, (%r14,%r8)
jb 0x3f90
cmpl $0x0, (%r15,%r8,4)
jne 0x3f90
movb $0x0, (%r14,%r8)
movl (%rdx,%r8,4), %r9d
xorl %r10d, %r10d
cmpq %r10, %r9
je 0x3f8e
movq (%rsi,%r8,8), %r11
movl (%r11,%r10,4), %r11d
cmpb $0x2, (%r14,%r11)
movl $0x0, %ebp
adcl $-0x1, %ebp
orl $0x1, %ebp
addl %ebp, (%r15,%r11,4)
incq %r10
jmp 0x3f68
decl (%rbx)
incq %rdi
jmp 0x3f45
leaq 0x3264(%rip), %rdi      # 0x7200
callq 0x21b0
movq 0x3258(%rip), %rax      # 0x7200
movq 0x3209(%rip), %rcx      # 0x71b8
addq 0x3252(%rip), %rax      # 0x7208
addq 0x3203(%rip), %rcx      # 0x71c0
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
pushq $0x2
popq %rdi
callq 0x20e0
cvtsi2sd %rax, %xmm0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
mulsd 0x101e(%rip), %xmm1     # 0x5008
movapd %xmm1, %xmm0
callq 0x20b0
divsd 0x100d(%rip), %xmm0     # 0x5008
movsd %xmm0, 0x8(%rsp)
movq 0x2fd0(%rip), %rdi      # 0x6fd8
leaq 0x10a1(%rip), %rsi      # 0x50b0
callq 0x2150
movl (%rbx), %esi
movq %rax, %rdi
callq 0x20f0
leaq 0x1072(%rip), %r14      # 0x5097
movq %rax, %rdi
movq %r14, %rsi
callq 0x2150
movl 0x31b2(%rip), %esi      # 0x71e8
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2150
movl 0x31a5(%rip), %esi      # 0x71f4
addl (%rbx), %esi
movq %rax, %rdi
callq 0x20f0
leaq 0xff2(%rip), %rsi       # 0x5052
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x21a0
movq %rax, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20c0