// File: /workspace/github_cpp_makefile_star2_O3/iPapatsoris[P]Maximum-Independent-Set/src/Graph.cpp
// Function: Graph::getOptimalDegree4Node2() const
uint32_t Graph::getOptimalDegree4Node2() const {
    GraphTraversal graphTraversal(*this);
    while (graphTraversal.curNode != NONE) {
        if (getNodeDegree(graphTraversal.curNode) == 4) {
            vector<uint32_t> neighborsV;
            gatherNeighbors(graphTraversal.curNode, neighborsV);
            for (uint32_t neighborV: neighborsV) {
                if (getNodeDegree(neighborV) == 3) {
                    vector<uint32_t> neighborsN;
                    gatherNeighbors(neighborV, neighborsN);
                    for (uint32_t neighborN: neighborsN) {
                        if (neighborN != graphTraversal.curNode && getNodeDegree(neighborN) == 4) {
                            return graphTraversal.curNode;
                        }
                    }
                }
            }
        }
        getNextNode(graphTraversal);
    }
    return NONE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
leaq 0x14(%rsp), %r14
movq $-0x1, (%r14)
movq %r14, %rsi
callq 0xb94a
cmpl $-0x1, (%r14)
je 0x4547
leaq 0x14(%rsp), %r12
leaq 0x1c(%rsp), %r13
movq %rbx, %rdi
movq %r12, %rsi
callq 0xc2d2
cmpl $0x4, %eax
jne 0x4531
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movl $0xffffffff, 0x20(%rsp) # imm = 0xFFFFFFFF
movq %rbx, %rdi
movq %r12, %rsi
leaq 0x40(%rsp), %rdx
xorl %ecx, %ecx
leaq 0x20(%rsp), %r8
callq 0xc092
movq 0x40(%rsp), %r15
movq 0x48(%rsp), %rbp
cmpq %rbp, %r15
je 0x450a
movl (%r15), %eax
movl %eax, 0x1c(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xc2d2
cmpl $0x3, %eax
jne 0x44f8
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0xffffffff, 0x10(%rsp) # imm = 0xFFFFFFFF
movq %rbx, %rdi
movq %r13, %r12
movq %r13, %rsi
leaq 0x20(%rsp), %rdx
xorl %ecx, %ecx
leaq 0x10(%rsp), %r8
callq 0xc092
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %r13
cmpq %r13, %r14
je 0x44d2
movl 0x14(%rsp), %ecx
movl (%r14), %eax
movl %eax, 0x10(%rsp)
cmpl %ecx, %eax
je 0x44c4
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0xc2d2
movl 0x14(%rsp), %ecx
cmpl $0x4, %eax
je 0x44d7
addq $0x4, %r14
cmpq %r13, %r14
jne 0x44a3
movb $0x1, %r13b
jmp 0x44de
movb $0x1, %r13b
jmp 0x44e3
xorl %r13d, %r13d
movl %ecx, 0xc(%rsp)
movq 0x20(%rsp), %r14
testq %r14, %r14
je 0x44f0
movq %r14, %rdi
callq 0x21a0
testb %r13b, %r13b
je 0x450f
movq %r12, %r13
addq $0x4, %r15
cmpq %rbp, %r15
jne 0x4442
movb $0x1, %r14b
jmp 0x4515
movb $0x1, %r14b
jmp 0x451a
xorl %r14d, %r14d
movq %r12, %r13
movq 0x40(%rsp), %r15
leaq 0x14(%rsp), %r12
testq %r15, %r15
je 0x452c
movq %r15, %rdi
callq 0x21a0
testb %r14b, %r14b
je 0x454f
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb94a
cmpl $-0x1, 0x14(%rsp)
jne 0x43eb
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movl 0xc(%rsp), %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4566
jmp 0x456b
movq %rax, %rbx
jmp 0x457d
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x457d
callq 0x21a0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x458c
callq 0x21a0
movq %rbx, %rdi
callq 0x2320