// File: /workspace/github_cpp_makefile_star2_O1/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 $0x48, %rsp
leaq 0x5876(%rip), %rdi      # 0x81d8
callq 0x21d0
movq 0x5842(%rip), %r14      # 0x81b0
movq %r14, 0x5883(%rip)      # 0x81f8
movl 0x57e1(%rip), %ebx      # 0x815c
shlq $0x2, %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x5842(%rip)      # 0x81d0
movq 0x5813(%rip), %rsi      # 0x81a8
movq %rax, %rdi
movq %rbx, %rdx
callq 0x2140
movq %rbx, %rdi
callq 0x2030
movq %rax, 0x5851(%rip)      # 0x8200
movl $0x0, 0x584f(%rip)      # 0x8208
movl 0x579d(%rip), %ecx      # 0x815c
testq %rcx, %rcx
je 0x29e1
movq 0x57fd(%rip), %rdx      # 0x81c8
xorl %esi, %esi
movb $0x2, (%rdx,%rsi)
movl %esi, (%rax,%rsi,4)
movb $0x3, (%r14,%rsi)
incq %rsi
cmpq %rsi, %rcx
jne 0x29cd
movl %ecx, 0x5821(%rip)      # 0x8208
testl %ecx, %ecx
je 0x2b0b
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x5805(%rip), %rax      # 0x8200
movl %ebp, %r15d
movl (%rax,%r15,4), %ebx
movq 0x57bf(%rip), %r13      # 0x81c8
cmpb $0x2, (%r13,%rbx)
jne 0x2aa9
movq 0x57b4(%rip), %r12      # 0x81d0
movl (%r12,%rbx,4), %eax
cmpl $0x2, %eax
je 0x2aca
cmpl $0x1, %eax
je 0x2a44
testl %eax, %eax
jne 0x2ae2
movb $0x1, (%r13,%rbx)
incl 0x57fe(%rip)            # 0x8240
jmp 0x2aa9
movq 0x5755(%rip), %rax      # 0x81a0
movq %rax, 0x10(%rsp)
movq (%rax,%rbx,8), %rax
movl (%rax), %r14d
movb $0x4, (%r13,%r14)
incl 0x57b1(%rip)            # 0x8214
movl %r14d, %edi
callq 0x28ca
movb $0x1, (%r13,%rbx)
incl 0x57c9(%rip)            # 0x8240
movl (%r12,%r14,4), %eax
testq %rax, %rax
je 0x2aa1
movq 0x10(%rsp), %rcx
movq (%rcx,%r14,8), %rcx
movq 0x5768(%rip), %rdx      # 0x81f8
xorl %esi, %esi
movl (%rcx,%rsi,4), %edi
movb $0x3, (%rdx,%rdi)
incq %rsi
cmpq %rsi, %rax
jne 0x2a92
movl $0x0, (%r12,%r14,4)
movl 0x5759(%rip), %eax      # 0x8208
decl %eax
movl %eax, 0x5751(%rip)      # 0x8208
movq 0x5742(%rip), %rcx      # 0x8200
movl (%rcx,%rax,4), %eax
movl %eax, (%rcx,%r15,4)
movb $0x1, %r14b
jmp 0x2ae4
movq 0x5727(%rip), %rax      # 0x81f8
cmpb $0x3, (%rax,%rbx)
jne 0x2ae2
movl %ebx, %edi
callq 0x56d1
testb %al, %al
jne 0x2aa9
incl %ebp
cmpl 0x571e(%rip), %ebp      # 0x8208
jb 0x29f4
testb $0x1, %r14b
je 0x2b0b
xorl %r14d, %r14d
cmpl $0x0, 0x5708(%rip)      # 0x8208
movl $0x0, %ebp
jne 0x29f4
movl 0x5702(%rip), %r12d     # 0x8214
movl 0x5727(%rip), %r11d     # 0x8240
movl 0x56e9(%rip), %ecx      # 0x8208
movq 0x56da(%rip), %rdx      # 0x8200
movq 0x569b(%rip), %r8       # 0x81c8
movq 0x569c(%rip), %rdi      # 0x81d0
movq 0x5665(%rip), %r14      # 0x81a0
movq 0x56b6(%rip), %r13      # 0x81f8
movq %rdx, 0x38(%rsp)
movq %r8, 0x10(%rsp)
movq %rdi, 0x40(%rsp)
xorl %esi, %esi
xorl %r9d, %r9d
testl %ecx, %ecx
je 0x2db2
movl %esi, %r10d
movl (%rdx,%r10,4), %ebp
cmpb $0x2, (%r8,%rbp)
jne 0x2d94
movl (%rdi,%rbp,4), %eax
cmpl $0x1, %eax
je 0x2b96
testl %eax, %eax
jne 0x2c17
movb $0x1, (%r8,%rbp)
incl %r11d
movl %r11d, 0x56b1(%rip)     # 0x8240
movb $0x1, %al
jmp 0x2d90
movq %r10, 0x28(%rsp)
movl %r9d, 0xc(%rsp)
movl %esi, 0x1c(%rsp)
movq %rcx, 0x30(%rsp)
movq (%r14,%rbp,8), %rax
movq %r14, %r15
movl %r11d, %r14d
movl (%rax), %ebx
movb $0x4, (%r8,%rbx)
incl %r12d
movl %r12d, 0x5650(%rip)     # 0x8214
movl %ebx, %edi
callq 0x28ca
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %r8
movb $0x1, (%r8,%rbp)
incl %r14d
movl %r14d, %r11d
movl %r14d, 0x5659(%rip)     # 0x8240
movq %r15, %r14
movl (%rdi,%rbx,4), %eax
testq %rax, %rax
je 0x2c09
movq (%r14,%rbx,8), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
movb $0x3, (%r13,%rsi)
incq %rdx
cmpq %rdx, %rax
jne 0x2bf8
movl $0x0, (%rdi,%rbx,4)
movb $0x1, %al
jmp 0x2d78
cmpb $0x3, (%r13,%rbp)
jne 0x2da8
movq %r10, 0x28(%rsp)
movl %r9d, 0xc(%rsp)
movl %esi, 0x1c(%rsp)
movq %rcx, 0x30(%rsp)
movl %r11d, 0x24(%rsp)
movl %r12d, 0x20(%rsp)
testl %eax, %eax
je 0x2d66
movb $0x1, %r12b
xorl %r15d, %r15d
movq (%r14,%rbp,8), %rcx
movl (%rcx,%r15,4), %ebx
movl (%rdi,%rbx,4), %edx
movl $0x4, %esi
cmpl %edx, %eax
ja 0x2d45
cmpl $0x1, %eax
adcl $0x0, %eax
movb $0x1, %dil
xorl %esi, %esi
movl (%rcx,%rsi,4), %r9d
xorl %r10d, %r10d
cmpl %ebx, %r9d
sete %r10b
movzbl %dil, %r8d
movl $0x0, %r11d
cmovnel %r11d, %r8d
leal 0x5(,%r10,2), %r10d
testq %rdx, %rdx
je 0x2cc5
cmpl %ebx, %r9d
je 0x2cc5
movq (%r14,%rbx,8), %r8
xorl %r10d, %r10d
cmpl %r9d, (%r8,%r10,4)
je 0x2cbf
incq %r10
cmpq %r10, %rdx
jne 0x2ca6
movl $0x5, %r10d
xorl %r8d, %r8d
jmp 0x2cc5
xorl %r10d, %r10d
movl %edi, %r8d
cmpl $0x7, %r10d
je 0x2cd0
testl %r10d, %r10d
jne 0x2cdb
incq %rsi
movl %r8d, %edi
cmpq %rax, %rsi
jne 0x2c71
xorl %esi, %esi
testb $0x1, %r8b
je 0x2d3b
movq 0x10(%rsp), %rax
movb $0x4, (%rax,%rbx)
movl 0x20(%rsp), %eax
incl %eax
movl %eax, 0x20(%rsp)
movl %eax, 0x5518(%rip)      # 0x8214
movl %ebx, %edi
callq 0x28ca
movq 0x40(%rsp), %rdi
movl (%rdi,%rbx,4), %eax
testq %rax, %rax
je 0x2d27
movq (%r14,%rbx,8), %rcx
xorl %edx, %edx
movl (%rcx,%rdx,4), %esi
movb $0x3, (%r13,%rsi)
incq %rdx
cmpq %rdx, %rax
jne 0x2d16
movl $0x0, (%rdi,%rbx,4)
movl $0x1, %esi
movb $0x1, %al
movl %eax, 0xc(%rsp)
jmp 0x2d40
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %r8
testb $0x3, %sil
jne 0x2d60
incq %r15
movl (%rdi,%rbp,4), %eax
cmpq %rax, %r15
setb %r12b
jb 0x2c4e
jmp 0x2d66
testb $0x1, %r12b
jne 0x2d6c
movb $0x0, (%r13,%rbp)
xorl %eax, %eax
movl 0x20(%rsp), %r12d
movl 0x24(%rsp), %r11d
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
movl 0x1c(%rsp), %esi
movl 0xc(%rsp), %r9d
movq 0x28(%rsp), %r10
testb %al, %al
je 0x2da8
decl %ecx
movl %ecx, 0x546c(%rip)      # 0x8208
movl (%rdx,%rcx,4), %eax
movl %eax, (%rdx,%r10,4)
movb $0x1, %r9b
jmp 0x2daa
incl %esi
cmpl %ecx, %esi
jb 0x2b5e
testb $0x1, %r9b
jne 0x2b51
movl $0x0, 0x5446(%rip)      # 0x820c
movl 0x543c(%rip), %eax      # 0x8208
testq %rax, %rax
je 0x2e47
movl 0x5435(%rip), %ecx      # 0x820c
movq 0x5422(%rip), %rdx      # 0x8200
movq 0x53eb(%rip), %rsi      # 0x81d0
movq 0x53ac(%rip), %rdi      # 0x8198
movq 0x538d(%rip), %r8       # 0x8180
movq 0x537e(%rip), %r9       # 0x8178
xorl %r10d, %r10d
movl (%rdx,%r10,4), %ebx
movl (%rsi,%rbx,4), %r11d
testq %r11, %r11
je 0x2e3f
movq (%rdi,%rbx,8), %rbx
xorl %r14d, %r14d
movl (%rbx,%r14,4), %r15d
movl (%r8,%r15,4), %r12d
cmpl %ecx, %r12d
jae 0x2e24
cmpl %r15d, (%r9,%r12,4)
je 0x2e37
movl %ecx, %r12d
movl %r15d, (%r9,%r12,4)
movl %ecx, (%r8,%r15,4)
incl %ecx
movl %ecx, 0x53d5(%rip)      # 0x820c
incq %r14
cmpq %r14, %r11
jne 0x2e11
incq %r10
cmpq %rax, %r10
jne 0x2dfd
movl $0x0, 0x53bf(%rip)      # 0x8210
cmpl $0x0, 0x5304(%rip)      # 0x815c
je 0x2eaf
movl 0x53b0(%rip), %eax      # 0x8210
movq 0x5361(%rip), %rcx      # 0x81c8
movq 0x534a(%rip), %rdx      # 0x81b8
movq 0x534b(%rip), %rsi      # 0x81c0
xorl %edi, %edi
movzbl (%rcx,%rdi), %r8d
cmpl $0x4, %r8d
je 0x2e8e
cmpl $0x2, %r8d
jne 0x2ea0
movb $0x0, (%rcx,%rdi)
jmp 0x2ea0
movl %eax, %r8d
movl %edi, (%rdx,%r8,4)
movl %eax, (%rsi,%rdi,4)
incl %eax
movl %eax, 0x5370(%rip)      # 0x8210
incq %rdi
movl 0x52b2(%rip), %r8d      # 0x815c
cmpq %r8, %rdi
jb 0x2e77
movl 0x535f(%rip), %eax      # 0x8214
movl %eax, 0x535d(%rip)      # 0x8218
leaq 0x535e(%rip), %rdi      # 0x8220
callq 0x21d0
movq 0x5352(%rip), %rax      # 0x8220
movq 0x5303(%rip), %rcx      # 0x81d8
addq 0x534c(%rip), %rax      # 0x8228
addq 0x52fd(%rip), %rcx      # 0x81e0
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x2, %edi
callq 0x20f0
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
mulsd 0x30f3(%rip), %xmm1     # 0x6008
movapd %xmm1, %xmm0
callq 0x20c0
divsd 0x30e2(%rip), %xmm0     # 0x6008
movsd %xmm0, 0x10(%rsp)
movq 0x50a5(%rip), %rbx      # 0x7fd8
leaq 0x30eb(%rip), %rsi      # 0x6025
movl $0x1b, %edx
movq %rbx, %rdi
callq 0x2180
movl 0x52c7(%rip), %esi      # 0x8214
movq %rbx, %rdi
callq 0x2100
movq %rax, %r14
leaq 0x30e2(%rip), %rsi      # 0x6041
movl $0x10, %edx
movq %rax, %rdi
callq 0x2180
movl 0x52ce(%rip), %esi      # 0x8240
movq %r14, %rdi
callq 0x2100
movq %rax, %r14
leaq 0x30ce(%rip), %rsi      # 0x6052
movl $0x6, %edx
movq %rax, %rdi
callq 0x2180
movq %r14, %rdi
movsd 0x10(%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 0x3089(%rip), %rsi      # 0x6059
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2180
movl 0x5225(%rip), %esi      # 0x8208
movq %rbx, %rdi
callq 0x2100
movq %rax, %rbx
leaq 0x3073(%rip), %rsi      # 0x6068
movl $0x6, %edx
movq %rax, %rdi
callq 0x2180
movl 0x5204(%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 $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2110