// File: 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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
leaq 0x60de(%rip), %rdi      # 0xb1b8
callq 0x21b0
movq 0x50(%rsp), %rdi
movl 0x6052(%rip), %eax      # 0xb13c
movl %eax, %edx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x20c0
movq 0x48(%rsp), %rdi
movq 0x60a5(%rip), %rsi      # 0xb1a8
movl 0x6033(%rip), %eax      # 0xb13c
movl %eax, %edx
callq 0x2100
movq 0x40(%rsp), %rax
movl $0x0, (%rax)
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
cmpl 0x60bf(%rip), %eax      # 0xb1ec
jae 0x51cf
movq 0x601e(%rip), %rax      # 0xb158
movl 0x2c(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x38(%rsp)
movq 0x6004(%rip), %rax      # 0xb150
movl 0x38(%rsp), %ecx
movl (%rax,%rcx,8), %eax
movl %eax, 0x34(%rsp)
movq 0x5ff2(%rip), %rax      # 0xb150
movl 0x38(%rsp), %ecx
movl 0x4(%rax,%rcx,8), %eax
movl %eax, 0x30(%rsp)
movq 0x48(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x72f0
testb $0x1, %al
jne 0x517e
jmp 0x51bd
movq 0x48(%rsp), %rdi
movl 0x30(%rsp), %esi
callq 0x72f0
testb $0x1, %al
jne 0x5192
jmp 0x51bd
movq 0x48(%rsp), %rax
movl 0x34(%rsp), %ecx
movb $0x3, (%rax,%rcx)
movq 0x48(%rsp), %rax
movl 0x30(%rsp), %ecx
movb $0x3, (%rax,%rcx)
movq 0x40(%rsp), %rax
movl (%rax), %ecx
addl $0x2, %ecx
movq 0x40(%rsp), %rax
movl %ecx, (%rax)
jmp 0x51bf
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x5123
movl $0x0, 0x28(%rsp)
movl 0x28(%rsp), %eax
cmpl 0x600b(%rip), %eax      # 0xb1ec
jae 0x52a8
movq 0x5f6a(%rip), %rax      # 0xb158
movl 0x28(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x38(%rsp)
movq 0x5f50(%rip), %rax      # 0xb150
movl 0x38(%rsp), %ecx
movl (%rax,%rcx,8), %eax
movl %eax, 0x34(%rsp)
movq 0x5f3e(%rip), %rax      # 0xb150
movl 0x38(%rsp), %ecx
movl 0x4(%rax,%rcx,8), %eax
movl %eax, 0x30(%rsp)
movq 0x48(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x72c0
testb $0x1, %al
jne 0x5232
jmp 0x525a
movq 0x48(%rsp), %rdi
movl 0x30(%rsp), %esi
callq 0x72f0
testb $0x1, %al
jne 0x5246
jmp 0x525a
movq 0x50(%rsp), %rax
movl 0x34(%rsp), %ecx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x5296
movq 0x48(%rsp), %rdi
movl 0x30(%rsp), %esi
callq 0x72c0
testb $0x1, %al
jne 0x526e
jmp 0x5294
movq 0x48(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x72f0
testb $0x1, %al
jne 0x5282
jmp 0x5294
movq 0x50(%rsp), %rax
movl 0x30(%rsp), %ecx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x5296
jmp 0x5298
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x51d7
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x5f2e(%rip), %eax      # 0xb1e8
jae 0x53ca
movq 0x5f19(%rip), %rax      # 0xb1e0
movl 0x24(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x3c(%rsp)
movq 0x48(%rsp), %rdi
movl 0x3c(%rsp), %esi
callq 0x72c0
testb $0x1, %al
jne 0x52e9
jmp 0x53b8
movq 0x50(%rsp), %rax
movl 0x3c(%rsp), %ecx
cmpl $0x0, (%rax,%rcx,4)
jne 0x53b8
movq 0x48(%rsp), %rax
movl 0x3c(%rsp), %ecx
movb $0x0, (%rax,%rcx)
movq 0x50(%rsp), %rax
movl 0x3c(%rsp), %ecx
imull $0xffffffff, (%rax,%rcx,4), %edx # imm = 0xFFFFFFFF
movq 0x50(%rsp), %rax
movl 0x3c(%rsp), %ecx
movl %edx, (%rax,%rcx,4)
movq 0x5e84(%rip), %rax      # 0xb1b0
movl 0x3c(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x20(%rsp), %eax
jae 0x53ac
movq 0x5e30(%rip), %rax      # 0xb180
movl 0x3c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x1c(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x18(%rsp)
movq 0x48(%rsp), %rdi
movl 0x18(%rsp), %esi
callq 0x72f0
testb $0x1, %al
jne 0x5377
jmp 0x538b
movq 0x50(%rsp), %rax
movl 0x18(%rsp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x539d
movq 0x50(%rsp), %rax
movl 0x18(%rsp), %ecx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x539f
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x533f
movq 0x40(%rsp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
jmp 0x53ba
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x52b0
leaq 0x5e2f(%rip), %rdi      # 0xb200
callq 0x21b0
movq 0x5e23(%rip), %rax      # 0xb200
subq 0x5dd4(%rip), %rax      # 0xb1b8
addq 0x5e1d(%rip), %rax      # 0xb208
subq 0x5dce(%rip), %rax      # 0xb1c0
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x2, %edi
callq 0x20d0
movsd 0x8(%rsp), %xmm0
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x2be4(%rip), %xmm0     # 0x8008
mulsd 0x10(%rsp), %xmm0
callq 0x20b0
movsd 0x2bd1(%rip), %xmm1     # 0x8008
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x5b90(%rip), %rdi      # 0xafd8
leaq 0x2ca3(%rip), %rsi      # 0x80f2
callq 0x2130
movq %rax, %rdi
movq 0x40(%rsp), %rax
movl (%rax), %esi
callq 0x2180
movq %rax, %rdi
leaq 0x2c6c(%rip), %rsi      # 0x80d9
callq 0x2130
movq %rax, %rdi
movl 0x5d6d(%rip), %esi      # 0xb1e8
callq 0x2180
movq %rax, %rdi
leaq 0x2c4f(%rip), %rsi      # 0x80d9
callq 0x2130
movq %rax, %rdi
movq 0x40(%rsp), %rax
movl (%rax), %esi
addl 0x5d55(%rip), %esi      # 0xb1f4
callq 0x2180
movq %rax, %rdi
leaq 0x2be6(%rip), %rsi      # 0x8094
callq 0x2130
movq %rax, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x21f0
movq %rax, %rdi
movq 0x5afd(%rip), %rsi      # 0xafc8
callq 0x2140
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)