// File: /workspace/github_cpp_makefile_star2_O3/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
movl 0x41ad(%rip), %eax      # 0x8160
testl %eax, %eax
je 0x4056
xorl %r12d, %r12d
movb $0x1, %bpl
movq 0x41a8(%rip), %rcx      # 0x8170
movq 0x4009(%rip), %r13      # 0x7fd8
leaq 0x20fb(%rip), %r15      # 0x60d1
xorl %ebx, %ebx
movl (%rcx,%r12,8), %edx
cmpb $0x1, (%r14,%rdx)
ja 0x4045
movl 0x4(%rcx,%r12,8), %edx
cmpb $0x1, (%r14,%rdx)
ja 0x4045
movl $0x18, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2180
movq %r13, %rdi
movq %r12, %rsi
callq 0x2100
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
incl %ebx
movq 0x4133(%rip), %rcx      # 0x8170
xorl %ebp, %ebp
movl 0x411b(%rip), %eax      # 0x8160
incq %r12
movl %eax, %edx
cmpq %rdx, %r12
jae 0x4059
cmpl $0x5, %ebx
jb 0x3fd8
jmp 0x4059
movb $0x1, %bpl
movl 0x40fd(%rip), %eax      # 0x815c
testq %rax, %rax
je 0x407f
xorl %ecx, %ecx
xorl %ebx, %ebx
movl 0xc(%rsp), %r12d
cmpb $0x3, (%r14,%rcx)
sbbl $-0x1, %ebx
incq %rcx
cmpq %rcx, %rax
jne 0x406d
jmp 0x4086
xorl %ebx, %ebx
movl 0xc(%rsp), %r12d
cmpl %r12d, %ebx
je 0x412a
movq 0x3f42(%rip), %r15      # 0x7fd8
leaq 0x20b5(%rip), %rsi      # 0x6152
movl $0x19, %edx
movq %r15, %rdi
callq 0x2180
movl %r12d, %esi
movq %r15, %rdi
callq 0x2100
movq %rax, %r15
leaq 0x20ad(%rip), %rsi      # 0x616c
movl $0x5, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x209f(%rip), %rsi      # 0x6172
movl $0x11, %edx
movq %r15, %rdi
callq 0x2180
movl %ebx, %esi
movq %r15, %rdi
callq 0x2100
movq %rax, %r15
leaq 0x2090(%rip), %rsi      # 0x6184
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
xorl %ebp, %ebp
movq 0x10(%rsp), %rbx
testq %rbx, %rbx
je 0x42ca
movl 0x401d(%rip), %r13d     # 0x815c
leaq (,%r13,4), %rdi
callq 0x2030
movq %rax, %r15
testq %r13, %r13
je 0x42c2
movq 0x4049(%rip), %rax      # 0x81a8
movq 0x403a(%rip), %rcx      # 0x81a0
xorl %edx, %edx
movzbl (%r14,%rdx), %esi
cmpl $0x4, %esi
je 0x4177
cmpl $0x1, %esi
jne 0x4181
movl $0x0, (%r15,%rdx,4)
jmp 0x41c2
movl (%rax,%rdx,4), %r8d
testq %r8, %r8
je 0x41ae
movq (%rcx,%rdx,8), %r9
xorl %edi, %edi
xorl %r10d, %r10d
movl (%r9,%r10,4), %r11d
cmpb $0x1, (%r14,%r11)
ja 0x41a4
incl %edi
movl %edi, (%r15,%rdx,4)
incq %r10
cmpq %r10, %r8
jne 0x4193
jmp 0x41b0
xorl %edi, %edi
movl %edi, %r8d
negl %r8d
cmpb $0x3, %sil
cmovbl %edi, %r8d
movl %r8d, (%r15,%rdx,4)
incq %rdx
cmpq %r13, %rdx
jne 0x4168
testq %r13, %r13
je 0x42c2
xorl %r14d, %r14d
movl (%r15,%r14,4), %r12d
cmpl (%rbx,%r14,4), %r12d
jne 0x41ed
incq %r14
cmpq %r14, %r13
jne 0x41d6
jmp 0x42c2
movq 0x3de4(%rip), %r13      # 0x7fd8
leaq 0x1f8b(%rip), %rsi      # 0x6186
movl $0x14, %edx
movq %r13, %rdi
callq 0x2180
movq %r13, %rdi
movq %r14, %rsi
callq 0x2100
movq %rax, %r13
leaq 0x1f7e(%rip), %rsi      # 0x619b
movl $0xd, %edx
movq %rax, %rdi
callq 0x2180
movq %r13, %rdi
movl %r12d, %esi
callq 0x21f0
movq %rax, %r12
leaq 0x1f6a(%rip), %rsi      # 0x61a9
movl $0x13, %edx
movq %rax, %rdi
callq 0x2180
movl (%rbx,%r14,4), %esi
movq %r12, %rdi
callq 0x21f0
movq %rax, %rbx
leaq 0x1f22(%rip), %rsi      # 0x6184
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x1f47(%rip), %rsi      # 0x61bd
movl $0xa, %edx
movq %rbx, %rdi
callq 0x2180
movq 0x3f1e(%rip), %rax      # 0x81a8
movl (%rax,%r14,4), %esi
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
callq 0x2110
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x2190
andb $0x1, %bpl
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq