// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x5880(%rip), %rdi      # 0x81d8
callq 0x21d0
movq 0x584c(%rip), %r14      # 0x81b0
movq %r14, 0x588d(%rip)      # 0x81f8
movl 0x57ea(%rip), %r15d     # 0x815c
leaq (,%r15,4), %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x5847(%rip)      # 0x81d0
movq 0x5818(%rip), %rsi      # 0x81a8
movq %rax, %rdi
movq %rbx, %rdx
callq 0x2140
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x5856(%rip)      # 0x8200
testq %r15, %r15
je 0x29cc
movq 0x5812(%rip), %rcx      # 0x81c8
xorl %edx, %edx
movb $0x2, (%rcx,%rdx)
movl %edx, (%rax,%rdx,4)
movb $0x3, (%r14,%rdx)
incq %rdx
cmpq %rdx, %r15
jne 0x29b8
movl %r15d, 0x5835(%rip)     # 0x8208
xorl %r12d, %r12d
xorl %ebp, %ebp
cmpl %r15d, %r12d
jb 0x29f0
xorl %r12d, %r12d
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x29d8
jmp 0x2b06
movq 0x5809(%rip), %r14      # 0x8200
movl %r12d, %ecx
movl (%r14,%rcx,4), %ebx
movq 0x57c3(%rip), %r13      # 0x81c8
cmpb $0x2, (%r13,%rbx)
jne 0x2ab6
movq 0x57b8(%rip), %rdx      # 0x81d0
movl (%rdx,%rbx,4), %eax
cmpl $0x2, %eax
je 0x2ad0
cmpl $0x1, %eax
je 0x2a3f
testl %eax, %eax
jne 0x2afe
movb $0x1, (%r13,%rbx)
incl 0x5803(%rip)            # 0x8240
jmp 0x2ab6
movq %rcx, 0x8(%rsp)
movq 0x5755(%rip), %rax      # 0x81a0
movq %rax, 0x18(%rsp)
movq (%rax,%rbx,8), %rax
movl (%rax), %ebp
movb $0x4, (%r13,%rbp)
incl 0x57b2(%rip)            # 0x8214
movl %ebp, %edi
movq %rdx, 0x10(%rsp)
callq 0x28c0
movq 0x10(%rsp), %r8
movb $0x1, (%r13,%rbx)
incl 0x57c1(%rip)            # 0x8240
movl (%r8,%rbp,4), %eax
testq %rax, %rax
je 0x2aa9
movq 0x18(%rsp), %rcx
movq (%rcx,%rbp,8), %rcx
movq 0x5760(%rip), %rdx      # 0x81f8
xorl %esi, %esi
movl (%rcx,%rsi,4), %edi
movb $0x3, (%rdx,%rdi)
incq %rsi
cmpq %rsi, %rax
jne 0x2a9a
movl $0x0, (%r8,%rbp,4)
movq 0x8(%rsp), %rcx
decl %r15d
movl %r15d, 0x5748(%rip)     # 0x8208
movl (%r14,%r15,4), %eax
movl %eax, (%r14,%rcx,4)
movb $0x1, %bpl
jmp 0x29d8
movq 0x5721(%rip), %rax      # 0x81f8
cmpb $0x3, (%rax,%rbx)
jne 0x2afe
movq %rcx, %r13
movl %ebx, %edi
callq 0x5487
movl 0x571a(%rip), %r15d     # 0x8208
testb %al, %al
je 0x2afe
movq 0x5707(%rip), %r14      # 0x8200
movq %r13, %rcx
jmp 0x2ab6
incl %r12d
jmp 0x29d8
movl 0x5708(%rip), %eax      # 0x8214
movl %eax, 0x10(%rsp)
movl 0x5729(%rip), %r10d     # 0x8240
movq 0x56e2(%rip), %r12      # 0x8200
movq 0x56a3(%rip), %r14      # 0x81c8
movq 0x56a4(%rip), %r13      # 0x81d0
movq 0x566d(%rip), %rax      # 0x81a0
movq %rax, 0x8(%rsp)
xorl %eax, %eax
movq 0x56b7(%rip), %r8       # 0x81f8
xorl %ebp, %ebp
cmpl %r15d, %ebp
jb 0x2b58
xorl %ebp, %ebp
testb $0x1, %al
movl $0x0, %eax
jne 0x2b43
jmp 0x2d0e
movl %ebp, %ebx
movl (%r12,%rbx,4), %esi
cmpb $0x2, (%r14,%rsi)
jne 0x2cf5
movl (%r13,%rsi,4), %ecx
cmpq $0x1, %rcx
je 0x2c6b
testl %ecx, %ecx
je 0x2c57
cmpb $0x3, (%r8,%rsi)
jne 0x2c50
movq %r8, 0x20(%rsp)
movl %r10d, 0x18(%rsp)
movq 0x8(%rsp), %rdx
movq %rsi, 0x28(%rsp)
movq (%rdx,%rsi,8), %rdx
xorl %esi, %esi
movl (%rdx,%rsi,4), %ebx
movl (%r13,%rbx,4), %edi
cmpl %edi, %ecx
ja 0x2be1
xorl %r8d, %r8d
movl (%rdx,%r8,4), %r9d
cmpl %ebx, %r9d
jne 0x2bc7
incq %r8
cmpq %rcx, %r8
jne 0x2bb4
jmp 0x2bfa
movq 0x8(%rsp), %r10
movq (%r10,%rbx,8), %r10
xorl %r11d, %r11d
cmpl %r9d, (%r10,%r11,4)
je 0x2bbd
incq %r11
cmpq %r11, %rdi
jne 0x2bd3
incq %rsi
cmpq %rcx, %rsi
jne 0x2ba5
movq 0x20(%rsp), %r8
movq 0x28(%rsp), %rcx
movb $0x0, (%r8,%rcx)
jmp 0x2c4b
movb $0x4, (%r14,%rbx)
movl 0x10(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
movl %eax, 0x5605(%rip)      # 0x8214
movl %ebx, %edi
callq 0x28c0
movl (%r13,%rbx,4), %eax
testq %rax, %rax
movq 0x20(%rsp), %r8
je 0x2c40
movq 0x8(%rsp), %rcx
movq (%rcx,%rbx,8), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
movb $0x3, (%r8,%rsi)
incq %rdx
cmpq %rdx, %rax
jne 0x2c30
movl $0x0, (%r13,%rbx,4)
movb $0x1, %al
movl 0x18(%rsp), %r10d
incl %ebp
jmp 0x2b43
movb $0x1, (%r14,%rsi)
incl %r10d
movl %r10d, 0x55da(%rip)     # 0x8240
jmp 0x2cf5
movq 0x8(%rsp), %rax
movq (%rax,%rsi,8), %rax
movl (%rax), %edi
movq %rdi, 0x30(%rsp)
movb $0x4, (%r14,%rdi)
movl 0x10(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
movl %eax, 0x5584(%rip)      # 0x8214
movl %r10d, 0x18(%rsp)
movq %r8, 0x20(%rsp)
movq %rsi, 0x28(%rsp)
callq 0x28c0
movq 0x30(%rsp), %r9
movq 0x20(%rsp), %r8
movl 0x18(%rsp), %r10d
movq 0x28(%rsp), %rax
movb $0x1, (%r14,%rax)
incl %r10d
movl %r10d, 0x5579(%rip)     # 0x8240
movl (%r13,%r9,4), %eax
testq %rax, %rax
je 0x2cec
movq 0x8(%rsp), %rcx
movq (%rcx,%r9,8), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
movb $0x3, (%r8,%rsi)
incq %rdx
cmpq %rdx, %rax
jne 0x2cdc
movl $0x0, (%r13,%r9,4)
decl %r15d
movl %r15d, 0x5509(%rip)     # 0x8208
movl (%r12,%r15,4), %eax
movl %eax, (%r12,%rbx,4)
movb $0x1, %al
jmp 0x2b43
movl $0x0, 0x54f4(%rip)      # 0x820c
testl %r15d, %r15d
je 0x2d87
movq 0x5474(%rip), %rax      # 0x8198
movq 0x5455(%rip), %rcx      # 0x8180
movq 0x5446(%rip), %rdx      # 0x8178
movl %r15d, %esi
xorl %edi, %edi
xorl %r8d, %r8d
movl (%r12,%rdi,4), %r10d
movl (%r13,%r10,4), %r9d
testq %r9, %r9
je 0x2d7f
movq (%rax,%r10,8), %r10
xorl %r11d, %r11d
movl (%r10,%r11,4), %ebx
movl (%rcx,%rbx,4), %r15d
cmpl %r8d, %r15d
jae 0x2d62
cmpl %ebx, (%rdx,%r15,4)
je 0x2d77
movl %r8d, %r15d
movl %ebx, (%rdx,%r15,4)
movl %r8d, (%rcx,%rbx,4)
incl %r8d
movl %r8d, 0x5495(%rip)      # 0x820c
incq %r11
cmpq %r11, %r9
jne 0x2d4f
incq %rdi
cmpq %rsi, %rdi
jne 0x2d3a
movl $0x0, 0x547f(%rip)      # 0x8210
movl 0x53c5(%rip), %esi      # 0x815c
testl %esi, %esi
je 0x2de6
movq 0x5416(%rip), %rax      # 0x81b8
xorl %ecx, %ecx
movq 0x5415(%rip), %rdx      # 0x81c0
xorl %edi, %edi
movzbl (%r14,%rcx), %r8d
cmpl $0x4, %r8d
je 0x2dc5
cmpl $0x2, %r8d
jne 0x2ddb
movb $0x0, (%r14,%rcx)
jmp 0x2ddb
movl %edi, %esi
movl %ecx, (%rax,%rsi,4)
movl %edi, (%rdx,%rcx,4)
incl %edi
movl %edi, 0x543b(%rip)      # 0x8210
movl 0x5381(%rip), %esi      # 0x815c
incq %rcx
movl %esi, %r8d
cmpq %r8, %rcx
jb 0x2dad
movl 0x10(%rsp), %eax
movl %eax, 0x5428(%rip)      # 0x8218
leaq 0x5429(%rip), %rdi      # 0x8220
callq 0x21d0
movq 0x541d(%rip), %rax      # 0x8220
movq 0x53ce(%rip), %rcx      # 0x81d8
addq 0x5417(%rip), %rax      # 0x8228
addq 0x53c8(%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 0x31be(%rip), %xmm1     # 0x6008
movapd %xmm1, %xmm0
callq 0x20c0
divsd 0x31ad(%rip), %xmm0     # 0x6008
movsd %xmm0, 0x8(%rsp)
movq 0x5170(%rip), %rbx      # 0x7fd8
leaq 0x31c6(%rip), %rsi      # 0x6035
movl $0x1b, %edx
movq %rbx, %rdi
callq 0x2180
movl 0x5392(%rip), %esi      # 0x8214
movq %rbx, %rdi
callq 0x2100
movq %rax, %r14
leaq 0x31bd(%rip), %rsi      # 0x6051
movl $0x10, %edx
movq %rax, %rdi
callq 0x2180
movl 0x5399(%rip), %esi      # 0x8240
movq %r14, %rdi
callq 0x2100
movq %rax, %r14
leaq 0x31a9(%rip), %rsi      # 0x6062
movl $0x6, %edx
movq %rax, %rdi
callq 0x2180
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x21c0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
leaq 0x3164(%rip), %rsi      # 0x6069
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2180
movl 0x52f0(%rip), %esi      # 0x8208
movq %rbx, %rdi
callq 0x2100
movq %rax, %rbx
leaq 0x314e(%rip), %rsi      # 0x6078
movl $0x6, %edx
movq %rax, %rdi
callq 0x2180
movl 0x52cf(%rip), %esi      # 0x820c
movq %rbx, %rdi
callq 0x2100
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 $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2110