// File: /workspace/github_cpp_makefile_star2_O2/quancs[P]EAVC/./eavc.h
// Function: check_solution(VerticeStatus*, unsigned int, int*)
bool check_solution(VerticeStatus *vInCTest, unsigned int cvSizeTest, int *scoreTest) {
    bool passAll = true;
    //test if cover all edges
    for (unsigned int e = 0, c = 0; e < eNum && c < 5; ++e) {
        if (not_in(vInCTest, edges[e].v1) && not_in(vInCTest, edges[e].v2)) {
            cout << "c error: uncovered edge " << e << endl;
            passAll = false;
            c++;
        }
    }

    //test if the claimed size is right
    unsigned int verified_vc_size = 0;
    for (unsigned int i = 0; i < vNum; i++) {
        if (in(vInCTest, i))
            verified_vc_size++;
    }
    if (cvSizeTest != verified_vc_size) {
        cout << "c error: claimed vc size(" << cvSizeTest << ") != " <<
             "verified vc size(" << verified_vc_size << ")" << endl;
        passAll = false;
    }

    //test if score is right
    if (scoreTest != nullptr) {
        int *scoreReal = new int[vNum];
        //calculate dscores
        for (unsigned int v = 0; v < vNum; v++) {
            if (vInCTest[v] == IN_ABS || vInCTest[v] == NIN_ABS)
                scoreReal[v] = 0;
            else {
                int factor = in(vInCTest, v) ? -1 : 1;

                scoreReal[v] = 0;
                unsigned int edgeCount = vDegree[v];
                for (unsigned int i = 0; i < edgeCount; i++) {
                    unsigned int adj = vAdj[v][i];
                    if (not_in(vInCTest, adj))
                        scoreReal[v]++;
                }
                scoreReal[v] = scoreReal[v] * factor;
            }
        }

        //compare
        for (unsigned int v = 0; v < vNum; v++) {
            if (scoreReal[v] != scoreTest[v]) {
                cout << "c error: for vertex " << v << ": real score(" << scoreReal[v] << ") != claimed score(" << scoreTest[v] << ")" << "   degree=" << vDegree[v] << endl;
                passAll = false;
                break;
            }
        }

        delete [] scoreReal;
    }

    return passAll;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq %rdi, %r14
movb $0x1, %bpl
xorl %r12d, %r12d
movl 0x378f(%rip), %eax      # 0x7140
movq 0x3620(%rip), %r13      # 0x6fd8
leaq 0x1702(%rip), %r15      # 0x50c1
xorl %ebx, %ebx
movl %eax, %ecx
cmpq %rcx, %r12
jae 0x3a18
cmpl $0x5, %ebx
jae 0x3a18
movq 0x377c(%rip), %rcx      # 0x7150
movl (%rcx,%r12,8), %edx
cmpb $0x1, (%r14,%rdx)
ja 0x3a13
movl 0x4(%rcx,%r12,8), %ecx
cmpb $0x1, (%r14,%rcx)
ja 0x3a13
movq %r13, %rdi
movq %r15, %rsi
callq 0x2150
movq %rax, %rdi
movq %r12, %rsi
callq 0x20f0
movq %rax, %rdi
callq 0x20c0
incl %ebx
xorl %ebp, %ebp
movl 0x372d(%rip), %eax      # 0x7140
incq %r12
jmp 0x39c1
movl 0x371e(%rip), %eax      # 0x713c
xorl %ecx, %ecx
xorl %ebx, %ebx
movl 0xc(%rsp), %r15d
cmpq %rcx, %rax
je 0x3a39
cmpb $0x3, (%r14,%rcx)
sbbl $-0x1, %ebx
incq %rcx
jmp 0x3a27
cmpl %r15d, %ebx
je 0x3a9d
movq 0x3593(%rip), %rdi      # 0x6fd8
leaq 0x16f6(%rip), %rsi      # 0x5142
callq 0x2150
movl %r15d, %esi
movq %rax, %rdi
callq 0x20f0
leaq 0x16f9(%rip), %rsi      # 0x515c
movq %rax, %rdi
callq 0x2150
leaq 0x16f0(%rip), %rsi      # 0x5162
movq %rax, %rdi
callq 0x2150
movl %ebx, %esi
movq %rax, %rdi
callq 0x20f0
leaq 0x16e9(%rip), %rsi      # 0x5174
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20c0
xorl %ebp, %ebp
movq 0x10(%rsp), %rbx
testq %rbx, %rbx
je 0x3be9
movl 0x368a(%rip), %r13d     # 0x713c
leaq (,%r13,4), %rdi
callq 0x2030
movq %rax, %r15
movq 0x36bf(%rip), %rax      # 0x7188
xorl %ecx, %ecx
movq 0x36ae(%rip), %rdx      # 0x7180
cmpq %r13, %rcx
je 0x3b2c
movzbl (%r14,%rcx), %esi
cmpl $0x4, %esi
je 0x3ae6
cmpl $0x1, %esi
jne 0x3aed
andl $0x0, (%r15,%rcx,4)
jmp 0x3b27
movl (%rax,%rcx,4), %r8d
xorl %edi, %edi
xorl %r9d, %r9d
cmpq %r9, %r8
je 0x3b15
movq (%rdx,%rcx,8), %r10
movl (%r10,%r9,4), %r10d
cmpb $0x1, (%r14,%r10)
ja 0x3b10
incl %edi
movl %edi, (%r15,%rcx,4)
incq %r9
jmp 0x3af6
movl %edi, %r8d
negl %r8d
cmpb $0x3, %sil
cmovbl %edi, %r8d
movl %r8d, (%r15,%rcx,4)
incq %rcx
jmp 0x3ad2
negq %r13
pushq $-0x1
popq %rax
leaq (%rax,%r13), %rcx
cmpq $-0x1, %rcx
je 0x3be1
movl 0x4(%r15,%rax,4), %r12d
leaq 0x1(%rax), %r14
cmpl 0x4(%rbx,%rax,4), %r12d
movq %r14, %rax
je 0x3b32
movq 0x347e(%rip), %rdi      # 0x6fd8
leaq 0x1615(%rip), %rsi      # 0x5176
callq 0x2150
movq %rax, %rdi
movq %r14, %rsi
callq 0x20f0
leaq 0x1613(%rip), %rsi      # 0x518b
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
movl %r12d, %esi
callq 0x21c0
leaq 0x1607(%rip), %rsi      # 0x5199
movq %rax, %rdi
callq 0x2150
movl (%rbx,%r14,4), %esi
movq %rax, %rdi
callq 0x21c0
leaq 0x15c7(%rip), %rsi      # 0x5174
movq %rax, %rdi
callq 0x2150
leaq 0x15f1(%rip), %rsi      # 0x51ad
movq %rax, %rdi
callq 0x2150
movq 0x35bd(%rip), %rcx      # 0x7188
movl (%rcx,%r14,4), %esi
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x20c0
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x2170
andb $0x1, %bpl
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq