// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Maximum-Independent-Set/src/Graph.cpp
// Function: Graph::nodeIsEffective(unsigned int const&) const
uint32_t Graph::nodeIsEffective(const uint32_t &node) const {
    vector<uint32_t> neighbors;
    gatherNeighbors(node, neighbors);
    neighbors.push_back(node);
    unordered_set<uint32_t> neighborsAtDistance2;
    getNeighborsAtDistance2(node, neighborsAtDistance2);
    uint32_t f = 0;
    for (auto it = neighborsAtDistance2.begin() ; it != neighborsAtDistance2.end() ; it++) {
        for (auto neighbor: neighbors) {
            if (edgeExists(*it, neighbor)) {
                f++;
            }
        }
    }
    uint32_t g = 0;
    for (auto it = neighborsAtDistance2.begin() ; it != neighborsAtDistance2.end() ; it++) {
        g += (5 - getNodeDegree(*it) + f - neighborsAtDistance2.size());
    }

    uint32_t k4 = getNumberOfDegreeNeighbors(node, 4);
    uint32_t k5 = getNumberOfDegreeNeighbors(node, 5);
    bool effective = false;
    if (k4 == 0 && k5 == 5) {
        if (f >= 14 && g >= 0 || f >= 12 && g >= 3 || f >= 10 && g >= 5) {
            effective = true;
        }
    } else if (k4 == 1 && k5 == 4) {
        if (f >= 13 && g >= 0 || f >= 11 && g >= 2) {
            effective = true;
        }
    } else if (k4 == 2 && k5 == 3) {
        if (f >= 12 && g >= 0 || f >= 10 && g >= 2) {
            effective = true;
        }
    } else if (k4 == 3 && k5 == 2 && f >= 11 && g >= 0) {
        effective = true;
    } else if (k4 == 4 && k5 == 1) {
        if (f >= 12 && g >= 0 || f >= 10 && g >= 1) {
            effective = true;
        }
    } else if (k4 == 5 && k5 == 0 && f >= 10 && g >= 0) {
        effective = true;
    }
    return effective;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
leaq 0x40(%rsp), %r8
movl $0xffffffff, (%r8)      # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0xc092
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x64fd
movl (%rbx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x650a
leaq 0x10(%rsp), %rdi
movq %rbx, %rdx
callq 0xd7b4
leaq 0x70(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
leaq 0x8(%rsp), %rcx
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
xorl %r13d, %r13d
leaq 0x40(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
xorl %r8d, %r8d
callq 0x2cca
movq 0x50(%rsp), %rax
movl $0x0, %r15d
testq %rax, %rax
je 0x65f5
movq %rbx, 0x30(%rsp)
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %rbp
cmpq %rbp, %rbx
movq %rax, 0x38(%rsp)
je 0x65af
leaq 0x8(%rax), %r12
movl (%rbx), %eax
movl %eax, 0x8(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xbf3a
xorl %ecx, %ecx
cmpl $-0x1, %eax
setne %cl
addl %ecx, %r13d
addq $0x4, %rbx
cmpq %rbp, %rbx
jne 0x6587
movq 0x38(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
jne 0x656f
movq 0x50(%rsp), %rbx
testq %rbx, %rbx
je 0x65ed
leal 0x5(%r13), %ebp
xorl %r15d, %r15d
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0xc2d2
addl 0x58(%rsp), %eax
addl %ebp, %r15d
subl %eax, %r15d
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x65cd
jmp 0x65f0
xorl %r15d, %r15d
movq 0x30(%rsp), %rbx
leaq 0x8(%rsp), %rdx
movl $0x4, (%rdx)
leaq 0xc(%rsp), %rcx
movl $0x0, (%rcx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2b7c
movl %eax, %ebp
leaq 0x8(%rsp), %rdx
movl $0x5, (%rdx)
leaq 0xc(%rsp), %rcx
movl $0x0, (%rcx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2b7c
movl %eax, %ecx
xorl $0x5, %ecx
orl %ebp, %ecx
jne 0x6664
cmpl $0xd, %r13d
ja 0x66a4
cmpl $0xc, %r13d
jb 0x6654
cmpl $0x2, %r15d
ja 0x66a4
xorl %ebx, %ebx
cmpl $0xa, %r13d
jb 0x66a9
cmpl $0x5, %r15d
jae 0x66a4
jmp 0x66a9
movl %ebp, %ecx
xorl $0x1, %ecx
movl %eax, %edx
xorl $0x4, %edx
orl %ecx, %edx
jne 0x6682
cmpl $0xc, %r13d
ja 0x66a4
xorl %ebx, %ebx
cmpl $0xb, %r13d
jae 0x669e
jmp 0x66a9
movl %ebp, %ecx
xorl $0x2, %ecx
movl %eax, %edx
xorl $0x3, %edx
orl %ecx, %edx
jne 0x66d3
cmpl $0xb, %r13d
ja 0x66a4
xorl %ebx, %ebx
cmpl $0xa, %r13d
jb 0x66a9
cmpl $0x2, %r15d
jb 0x66a9
movl $0x1, %ebx
leaq 0x40(%rsp), %rdi
callq 0xc950
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x66c2
callq 0x21a0
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %ebx
cmpl $0x3, %ebp
jne 0x66e8
cmpl $0x2, %eax
jne 0x66e8
cmpl $0xa, %r13d
ja 0x66a9
movl %ebp, %ecx
xorl $0x4, %ecx
movl %eax, %edx
xorl $0x1, %edx
orl %ecx, %edx
jne 0x670b
cmpl $0xb, %r13d
ja 0x66a4
xorl %ebx, %ebx
cmpl $0xa, %r13d
jb 0x66a9
testl %r15d, %r15d
jne 0x66a4
jmp 0x66a9
xorl $0x5, %ebp
orl %eax, %ebp
sete %al
cmpl $0xa, %r13d
setae %cl
andb %al, %cl
movzbl %cl, %ebx
jmp 0x66a9
jmp 0x6729
jmp 0x6730
jmp 0x6730
jmp 0x6730
movq %rax, %rbx
jmp 0x673d
jmp 0x6730
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xc950
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x674c
callq 0x21a0
movq %rbx, %rdi
callq 0x2320