// File: /workspace/github_cpp_makefile_star2_O2/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)
andq $0x0, 0x10(%rdx)
leaq 0x40(%rsp), %r8
orl $-0x1, (%r8)
xorl %ecx, %ecx
callq 0xa3c8
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0xa1ac
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
orl $-0x1, (%rcx)
xorl %r13d, %r13d
leaq 0x40(%rsp), %rdx
movq %r14, %rdi
movq %rbx, 0x30(%rsp)
movq %rbx, %rsi
xorl %r8d, %r8d
callq 0x2966
movq 0x50(%rsp), %rax
leaq 0x8(%rsp), %r15
testq %rax, %rax
je 0x57fc
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %rbp
movq %rax, 0x38(%rsp)
leaq 0x8(%rax), %r12
cmpq %rbp, %rbx
je 0x57f2
movl (%rbx), %eax
movl %eax, 0x8(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x9e3a
movzbl %al, %eax
addl %eax, %r13d
addq $0x4, %rbx
jmp 0x57cd
movq 0x38(%rsp), %rax
movq (%rax), %rax
jmp 0x57b5
movq 0x50(%rsp), %r12
leal 0x5(%r13), %ebp
xorl %r15d, %r15d
testq %r12, %r12
je 0x582a
leaq 0x8(%r12), %rsi
movq %r14, %rdi
callq 0xa5ce
addl %ebp, %r15d
addl 0x58(%rsp), %eax
subl %eax, %r15d
movq (%r12), %r12
jmp 0x5808
leaq 0x8(%rsp), %rdx
movl $0x4, (%rdx)
leaq 0xc(%rsp), %rcx
andl $0x0, (%rcx)
movq %r14, %rdi
movq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x285e
movl %eax, %ebp
leaq 0x8(%rsp), %rdx
movl $0x5, (%rdx)
leaq 0xc(%rsp), %rcx
andl $0x0, (%rcx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x285e
movl %eax, %ecx
xorl $0x5, %ecx
orl %ebp, %ecx
jne 0x5898
cmpl $0xd, %r13d
ja 0x58d8
cmpl $0xc, %r13d
jb 0x5888
cmpl $0x2, %r15d
ja 0x58d8
xorl %ebx, %ebx
cmpl $0xa, %r13d
jb 0x58db
cmpl $0x5, %r15d
jae 0x58d8
jmp 0x58db
movl %ebp, %ecx
xorl $0x1, %ecx
movl %eax, %edx
xorl $0x4, %edx
orl %ecx, %edx
jne 0x58b6
cmpl $0xc, %r13d
ja 0x58d8
xorl %ebx, %ebx
cmpl $0xb, %r13d
jae 0x58d2
jmp 0x58db
movl %ebp, %ecx
xorl $0x2, %ecx
movl %eax, %edx
xorl $0x3, %edx
orl %ecx, %edx
jne 0x5900
cmpl $0xb, %r13d
ja 0x58d8
xorl %ebx, %ebx
cmpl $0xa, %r13d
jb 0x58db
cmpl $0x2, %r15d
jb 0x58db
pushq $0x1
popq %rbx
leaq 0x40(%rsp), %rdi
callq 0xad26
leaq 0x10(%rsp), %rdi
callq 0xb872
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rcx
cmpl $0x3, %ebp
jne 0x5917
cmpl $0x2, %eax
jne 0x5917
cmpl $0xa, %r13d
jbe 0x5917
movl %ecx, %ebx
jmp 0x58db
movl %ebp, %edx
xorl $0x4, %edx
movl %eax, %esi
xorl $0x1, %esi
orl %edx, %esi
jne 0x593a
cmpl $0xb, %r13d
ja 0x5913
xorl %ebx, %ebx
cmpl $0xa, %r13d
jb 0x58db
testl %r15d, %r15d
jne 0x5913
jmp 0x58db
xorl $0x5, %ebp
orl %eax, %ebp
sete %al
cmpl $0xa, %r13d
setae %cl
andb %al, %cl
movzbl %cl, %ebx
jmp 0x58db
jmp 0x595f
jmp 0x595f
jmp 0x595f
jmp 0x5958
movq %rax, %rbx
jmp 0x596c
jmp 0x595f
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xad26
leaq 0x10(%rsp), %rdi
callq 0xb872
movq %rbx, %rdi
callq 0x22c0