// File: /workspace/github_cpp_makefile_star2_O2/quancs[P]EAVC/./eavc.h
// Function: preprocess()
void preprocess() {
#ifdef WIN32
    start = clock();
#else
    times(&start);
#endif
    checkAdjDomV = vInC;
    dVDegree = new unsigned[vNum];//static_cast<unsigned *>(static_cast<void *>(dscore));//dynamic vertex degree
    memcpy(dVDegree, vDegree, sizeof (int)*vNum);

    uvSet = new unsigned[vNum];//cVertexes; //untested vertice set
    uvSize = 0; //untested vertice set size

    for (unsigned v = 0; v < vNum; v++) {
        vInBest[v] = UNKNOWN;
        uvSet[v] = v;
        checkAdjDomV[v] = IN;
    }
    uvSize = vNum;

    for (bool found = true; found;) {
        found = false;
        for (unsigned i = 0; i < uvSize; ) {
            unsigned v = uvSet[i];

            bool remove = false;
            if (vInBest[v] != UNKNOWN)
                remove = true;
            else if (dVDegree[v] == 0) {
                remove = prep_handle_degree_0(v);
            } else if (dVDegree[v] == 1) {
                remove = prep_handle_degree_1(v);
            } else if (dVDegree[v] == 2 && checkAdjDomV[v] == IN) {
                remove = prep_handle_degree_2(v);
            }
            if (remove) { //if vForSure in uvSet, remove it
                found = true;
                uvSize--;
                unsigned lastV = uvSet[uvSize];
                uvSet[i] = lastV;
            } else
                i++;
        }
    }

    for (bool findDomHappened = true; findDomHappened;) {
        findDomHappened = false;
        for (unsigned i = 0; i < uvSize; ) {
            unsigned v = uvSet[i];

            bool remove = false;

            if (vInBest[v] != UNKNOWN)
                remove = true;
            else if (dVDegree[v] == 0)
                remove = prep_handle_degree_0(v);
            else if (dVDegree[v] == 1)
                remove = prep_handle_degree_1(v);
            else if (checkAdjDomV[v] == IN)
                remove = prep_handle_dom(v, findDomHappened);

            if (remove) { //if vForSure in uvSet, remove it
                findDomHappened = true;
                uvSize--;
                unsigned lastV = uvSet[uvSize];
                uvSet[i] = lastV;
            } else
                i++;
        }
    }

    //fix uncovEdges
    ueSize = 0;
    for (unsigned i = 0; i < uvSize; i++) {
        unsigned v = uvSet[i];
        for (unsigned j = 0; j < dVDegree[v]; j++) {
            unsigned e = vEdges[v][j];
            unsigned eIndex = uncovEdgeIndexes[e];
            if (eIndex >= ueSize || uncovEdges[eIndex] != e) { //uncovEdges doesn't contains e
                uncovEdges[ueSize] = e;
                uncovEdgeIndexes[e] = ueSize;
                ueSize++;
            }
        }
    }

    //fix cVertices, layout: IN_ABS vertexes | unused area
    cvSize = 0;
    for (unsigned v = 0; v < vNum; v++) {
        if (vInBest[v] == UNKNOWN)
            vInBest[v] = NIN;
        else if (vInBest[v] == IN_ABS) {
            cVertexes[cvSize] = v;
            cVertexIndexes[v] = cvSize;
            cvSize++;
        }
    }

    bestSize = total_IN_ABS;

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

    cout << "c preprocess: total_IN_ABS=" << total_IN_ABS << ", total_NIN_ABS=" << total_NIN_ABS  << " time=" << preprocessTime << endl;

    cout << "c graph: |V'|=" << uvSize << " |E'|=" << ueSize << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x4974(%rip), %rdi      # 0x71b8
callq 0x21b0
movq 0x4940(%rip), %r15      # 0x7190
movq %r15, 0x4981(%rip)      # 0x71d8
movl 0x48de(%rip), %r14d     # 0x713c
leaq (,%r14,4), %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x493b(%rip)      # 0x71b0
movq 0x490c(%rip), %rsi      # 0x7188
movq %rax, %rdi
movq %rbx, %rdx
callq 0x2120
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x494a(%rip)      # 0x71e0
xorl %ecx, %ecx
movq 0x4909(%rip), %rdx      # 0x71a8
cmpq %rcx, %r14
je 0x28b5
movb $0x2, (%rdx,%rcx)
movl %ecx, (%rax,%rcx,4)
movb $0x3, (%r15,%rcx)
incq %rcx
jmp 0x289f
movl %r14d, 0x492c(%rip)     # 0x71e8
xorl %ebx, %ebx
xorl %ebp, %ebp
cmpl %r14d, %ebx
jb 0x28d7
xorl %ebx, %ebx
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x28c0
jmp 0x2969
movq 0x4902(%rip), %rax      # 0x71e0
movl %ebx, %r15d
movl (%rax,%r15,4), %edi
movq 0x48bc(%rip), %rax      # 0x71a8
cmpb $0x2, (%rax,%rdi)
jne 0x2933
movq 0x48b7(%rip), %rcx      # 0x71b0
movl (%rcx,%rdi,4), %ecx
cmpl $0x2, %ecx
je 0x291d
cmpl $0x1, %ecx
je 0x2916
testl %ecx, %ecx
jne 0x295b
movb $0x1, (%rax,%rdi)
incl 0x490c(%rip)            # 0x7220
jmp 0x2933
callq 0x48d9
jmp 0x292f
movq 0x48b4(%rip), %rax      # 0x71d8
cmpb $0x3, (%rax,%rdi)
jne 0x295b
callq 0x494f
testb %al, %al
je 0x295b
movl 0x48ae(%rip), %r14d     # 0x71e8
decl %r14d
movl %r14d, 0x48a4(%rip)     # 0x71e8
movq 0x4895(%rip), %rax      # 0x71e0
movl (%rax,%r14,4), %ecx
movl %ecx, (%rax,%r15,4)
movb $0x1, %bpl
jmp 0x28c0
incl %ebx
movl 0x4884(%rip), %r14d     # 0x71e8
jmp 0x28c0
movb $0x1, %al
leaq 0x7(%rsp), %rbx
testb $0x1, %al
je 0x2a25
movb $0x0, 0x7(%rsp)
xorl %r15d, %r15d
movl %r15d, %r15d
cmpl %r14d, %r15d
jae 0x2a1c
movq 0x484d(%rip), %rax      # 0x71e0
movl (%rax,%r15,4), %edi
movq 0x480a(%rip), %rax      # 0x71a8
cmpb $0x2, (%rax,%rdi)
jne 0x29e3
movq 0x4805(%rip), %rcx      # 0x71b0
movl (%rcx,%rdi,4), %ecx
cmpl $0x1, %ecx
je 0x29c3
testl %ecx, %ecx
jne 0x29ca
movb $0x1, (%rax,%rdi)
incl 0x485f(%rip)            # 0x7220
jmp 0x29e3
callq 0x48d9
jmp 0x29df
movq 0x4807(%rip), %rax      # 0x71d8
cmpb $0x3, (%rax,%rdi)
jne 0x2a0d
movq %rbx, %rsi
callq 0x4a5b
testb %al, %al
je 0x2a0d
movb $0x1, 0x7(%rsp)
movl 0x47f9(%rip), %r14d     # 0x71e8
decl %r14d
movl %r14d, 0x47ef(%rip)     # 0x71e8
movq 0x47e0(%rip), %rax      # 0x71e0
movl (%rax,%r14,4), %ecx
movl %ecx, (%rax,%r15,4)
jmp 0x2983
incl %r15d
movl 0x47d1(%rip), %r14d     # 0x71e8
jmp 0x2980
movb 0x7(%rsp), %al
jmp 0x2970
andl $0x0, 0x47c0(%rip)      # 0x71ec
movq 0x47ad(%rip), %rax      # 0x71e0
movq 0x4776(%rip), %rcx      # 0x71b0
movq 0x4737(%rip), %rdx      # 0x7178
movq 0x4718(%rip), %rsi      # 0x7160
movq 0x4709(%rip), %rdi      # 0x7158
movl %r14d, %r8d
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpq %r8, %r9
je 0x2aa3
movl (%rax,%r9,4), %r11d
movl (%rcx,%r11,4), %ebx
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x2a9e
movq (%rdx,%r11,8), %r15
movl (%r15,%r14,4), %r15d
movl (%rsi,%r15,4), %r12d
cmpl %r10d, %r12d
jae 0x2a84
cmpl %r15d, (%rdi,%r12,4)
je 0x2a99
movl %r10d, %r12d
movl %r15d, (%rdi,%r12,4)
movl %r10d, (%rsi,%r15,4)
incl %r10d
movl %r10d, 0x4753(%rip)     # 0x71ec
incq %r14
jmp 0x2a68
incq %r9
jmp 0x2a58
andl $0x0, 0x4746(%rip)      # 0x71f0
movq 0x46f7(%rip), %rax      # 0x71a8
movq 0x46e0(%rip), %rcx      # 0x7198
movq 0x46e1(%rip), %rdx      # 0x71a0
xorl %esi, %esi
movl 0x4674(%rip), %r8d      # 0x713c
xorl %edi, %edi
movl %r8d, %r9d
cmpq %r9, %rsi
jae 0x2b07
movzbl (%rax,%rsi), %r9d
cmpl $0x4, %r9d
je 0x2ae9
cmpl $0x2, %r9d
jne 0x2b02
movb $0x0, (%rax,%rsi)
jmp 0x2b02
movl %edi, %r8d
movl %esi, (%rcx,%r8,4)
movl %edi, (%rdx,%rsi,4)
incl %edi
movl %edi, 0x46f5(%rip)      # 0x71f0
movl 0x463a(%rip), %r8d      # 0x713c
incq %rsi
jmp 0x2aca
movl 0x46e7(%rip), %eax      # 0x71f4
movl %eax, 0x46e5(%rip)      # 0x71f8
leaq 0x46e6(%rip), %rdi      # 0x7200
callq 0x21b0
movq 0x46da(%rip), %rax      # 0x7200
movq 0x468b(%rip), %rcx      # 0x71b8
addq 0x46d4(%rip), %rax      # 0x7208
addq 0x4685(%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 0x24a0(%rip), %xmm1     # 0x5008
movapd %xmm1, %xmm0
callq 0x20b0
divsd 0x248f(%rip), %xmm0     # 0x5008
movsd %xmm0, 0x8(%rsp)
movq 0x4452(%rip), %rbx      # 0x6fd8
leaq 0x2498(%rip), %rsi      # 0x5025
movq %rbx, %rdi
callq 0x2150
movl 0x4659(%rip), %esi      # 0x71f4
movq %rax, %rdi
callq 0x20f0
leaq 0x2497(%rip), %rsi      # 0x5041
movq %rax, %rdi
callq 0x2150
movl 0x4668(%rip), %esi      # 0x7220
movq %rax, %rdi
callq 0x20f0
leaq 0x248b(%rip), %rsi      # 0x5052
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
leaq 0x246d(%rip), %rsi      # 0x5059
movq %rbx, %rdi
callq 0x2150
movl 0x45ee(%rip), %esi      # 0x71e8
movq %rax, %rdi
callq 0x20f0
leaq 0x245f(%rip), %rsi      # 0x5068
movq %rax, %rdi
callq 0x2150
movl 0x45d5(%rip), %esi      # 0x71ec
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x20c0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq