// File: /workspace/github_cpp_makefile_star2_O1/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 0xc714
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x64b9
movl (%rbx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x64c6
leaq 0x10(%rsp), %rdi
movq %rbx, %rdx
callq 0xdeac
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 0x2c84
movq %rbx, 0x30(%rsp)
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0x656e
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %rbp
cmpq %rbp, %rbx
movq %rax, 0x38(%rsp)
je 0x6561
leaq 0x8(%rax), %r12
movl (%rbx), %eax
movl %eax, 0x8(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xc5e2
xorl %ecx, %ecx
cmpl $-0x1, %eax
setne %cl
addl %ecx, %r13d
addq $0x4, %rbx
cmpq %rbp, %rbx
jne 0x6539
movq 0x38(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
jne 0x6521
movq 0x50(%rsp), %rbx
testq %rbx, %rbx
je 0x659f
leal 0x5(%r13), %ebp
xorl %r15d, %r15d
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0xc98e
addl 0x58(%rsp), %eax
addl %ebp, %r15d
subl %eax, %r15d
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x657f
jmp 0x65a2
xorl %r15d, %r15d
leaq 0x8(%rsp), %rdx
movl $0x4, (%rdx)
leaq 0xc(%rsp), %rcx
movl $0x0, (%rcx)
movq %r14, %rdi
movq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x2b5a
movl %eax, %ebp
leaq 0x8(%rsp), %rdx
movl $0x5, (%rdx)
leaq 0xc(%rsp), %rcx
movl $0x0, (%rcx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2b5a
movl %eax, %ecx
xorl $0x5, %ecx
orl %ebp, %ecx
jne 0x6616
cmpl $0xd, %r13d
ja 0x6656
cmpl $0xc, %r13d
jb 0x6606
cmpl $0x2, %r15d
ja 0x6656
xorl %ebx, %ebx
cmpl $0xa, %r13d
jb 0x665b
cmpl $0x5, %r15d
jae 0x6656
jmp 0x665b
movl %ebp, %ecx
xorl $0x1, %ecx
movl %eax, %edx
xorl $0x4, %edx
orl %ecx, %edx
jne 0x6634
cmpl $0xc, %r13d
ja 0x6656
xorl %ebx, %ebx
cmpl $0xb, %r13d
jae 0x6650
jmp 0x665b
movl %ebp, %ecx
xorl $0x2, %ecx
movl %eax, %edx
xorl $0x3, %edx
orl %ecx, %edx
jne 0x6685
cmpl $0xb, %r13d
ja 0x6656
xorl %ebx, %ebx
cmpl $0xa, %r13d
jb 0x665b
cmpl $0x2, %r15d
jb 0x665b
movl $0x1, %ebx
leaq 0x40(%rsp), %rdi
callq 0xcff8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6674
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 0x669a
cmpl $0x2, %eax
jne 0x669a
cmpl $0xa, %r13d
ja 0x665b
movl %ebp, %ecx
xorl $0x4, %ecx
movl %eax, %edx
xorl $0x1, %edx
orl %ecx, %edx
jne 0x66bd
cmpl $0xb, %r13d
ja 0x6656
xorl %ebx, %ebx
cmpl $0xa, %r13d
jb 0x665b
testl %r15d, %r15d
jne 0x6656
jmp 0x665b
xorl $0x5, %ebp
orl %eax, %ebp
sete %al
cmpl $0xa, %r13d
setae %cl
andb %al, %cl
movzbl %cl, %ebx
jmp 0x665b
jmp 0x66db
jmp 0x66e2
jmp 0x66e2
jmp 0x66e2
movq %rax, %rbx
jmp 0x66ef
jmp 0x66e2
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xcff8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x66fe
callq 0x21a0
movq %rbx, %rdi
callq 0x2320