// File: iPapatsoris[P]Maximum-Independent-Set/src/Graph.cpp
// Function: Graph::getOptimalDegree4Node1() const
uint32_t Graph::getOptimalDegree4Node1() 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);
                    if (edgeExists(neighborsN[0], neighborsN[1]) || edgeExists(neighborsN[0], neighborsN[2]) || edgeExists(neighborsN[1], neighborsN[2])) {
                        return graphTraversal.curNode;
                    }
                }
            }
        }
        getNextNode(graphTraversal);
    }
    return NONE;
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xe8(%rsp)
movq 0xe8(%rsp), %rsi
movq %rsi, 0x68(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x2a40
cmpl $-0x1, 0xe0(%rsp)
je 0x5529
movq 0x68(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x1a040
cmpl $0x4, %eax
jne 0x5512
leaq 0xc8(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x17e60
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rdx
movl $0xffffffff, 0xc4(%rsp) # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %ecx
leaq 0xe0(%rsp), %rsi
leaq 0xc4(%rsp), %r8
callq 0x19c30
jmp 0x52b4
leaq 0xc8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x19b50
movq %rax, 0xa0(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x1a0e0
movq %rax, 0x98(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x1a110
testb $0x1, %al
jne 0x530c
jmp 0x54e0
leaq 0xa0(%rsp), %rdi
callq 0x1a150
movq 0x68(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x94(%rsp)
leaq 0x94(%rsp), %rsi
callq 0x1a040
movl %eax, 0x5c(%rsp)
jmp 0x533a
movl 0x5c(%rsp), %eax
cmpl $0x3, %eax
jne 0x54cc
leaq 0x78(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x17e60
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rdx
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %ecx
leaq 0x94(%rsp), %rsi
leaq 0x74(%rsp), %r8
callq 0x19c30
jmp 0x5380
xorl %eax, %eax
movl %eax, %esi
leaq 0x78(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x18900
movq 0x38(%rsp), %rdi
movq %rax, 0x40(%rsp)
movl $0x1, %esi
callq 0x18900
movq 0x68(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq %rax, %rdx
callq 0x18920
movb %al, 0x4f(%rsp)
jmp 0x53bf
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x5460
jmp 0x53cd
xorl %eax, %eax
movl %eax, %esi
leaq 0x78(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x18900
movq 0x20(%rsp), %rdi
movq %rax, 0x28(%rsp)
movl $0x2, %esi
callq 0x18900
movq 0x68(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rax, %rdx
callq 0x18920
movb %al, 0x37(%rsp)
jmp 0x540c
movb 0x37(%rsp), %al
testb $0x1, %al
jne 0x5460
jmp 0x5416
leaq 0x78(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl $0x1, %esi
callq 0x18900
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rsp)
movl $0x2, %esi
callq 0x18900
movq 0x68(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
callq 0x18920
movb %al, 0x1f(%rsp)
jmp 0x5456
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x5460
jmp 0x54ae
movl 0xe0(%rsp), %eax
movl %eax, 0xf4(%rsp)
movl $0x1, 0x70(%rsp)
jmp 0x54b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x5503
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x18520
jmp 0x5503
movl $0x0, 0x70(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x18520
movl 0x70(%rsp), %eax
testl %eax, %eax
jne 0x54e8
jmp 0x54ca
jmp 0x54cc
jmp 0x54ce
leaq 0xa0(%rsp), %rdi
callq 0x1a160
jmp 0x52ee
movl $0x0, 0x70(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x18520
movl 0x70(%rsp), %eax
testl %eax, %eax
je 0x5501
jmp 0x54ff
jmp 0x5534
jmp 0x5512
leaq 0xc8(%rsp), %rdi
callq 0x18520
jmp 0x5543
movq 0x68(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x185f0
jmp 0x5249
movl $0xffffffff, 0xf4(%rsp) # imm = 0xFFFFFFFF
movl 0xf4(%rsp), %eax
addq $0xf8, %rsp
retq
movq 0xb8(%rsp), %rdi
callq 0x2310