// File: /workspace/github_cpp_makefile_star2_O2/iPapatsoris[P]Maximum-Independent-Set/src/Graph.cpp
// Function: Graph::getGoodFunnelTheta5(unsigned int&, unsigned int&) const
bool Graph::getGoodFunnelTheta5(uint32_t &node1, uint32_t &node2) const {
    GraphTraversal graphTraversal(*this);
    while (graphTraversal.curNode != NONE) {
        uint32_t nodeV = graphTraversal.curNode;
        uint32_t vDegree = getNodeDegree(nodeV);
        if (vDegree == 3) {
            //cout << "nodeV " << nodeV << endl;
            vector<uint32_t> neighborsV;
            gatherNeighbors(nodeV, neighborsV);
            for (uint32_t i = 0 ; i < neighborsV.size() ; i++) {
                uint32_t nodeA = neighborsV[i];
                uint32_t nodeB, nodeC;
                if (i == 0) {
                    nodeB = neighborsV[1];
                    nodeC = neighborsV[2];
                } else if (i == 1) {
                    nodeB = neighborsV[0];
                    nodeC = neighborsV[2];
                } else if (i == 2) {
                    nodeB = neighborsV[0];
                    nodeC = neighborsV[1];
                } else {
                    nodeB = neighborsV[0];
                    nodeC = neighborsV[1];
                }
                if (edgeExists(nodeB, nodeC))  {
                    vector<uint32_t> neighborsA;
                    gatherNeighbors(nodeA, neighborsA);
                    for (auto neighborA: neighborsA) {
                        if (neighborA != nodeV && getNodeDegree(neighborA) == 5) {
                            vector<uint32_t> commonNeighbors;
                            getCommonNeighbors(neighborA, nodeV, commonNeighbors, 3);
                            if (commonNeighbors.size() >= 3) {
                                node1 = nodeA;
                                node2 = nodeV;
                                //cout << "branching on theta-5 good funnel " << node1 << "-" << node2 << "\n";
                                return true;
                            }
                        }
                    }
                }
            }
        }
        getNextNode(graphTraversal);
    }
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdi, %r15
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x270e
leaq 0xc(%rsp), %r13
leaq 0x1c(%rsp), %r12
movl 0x58(%rsp), %ebp
cmpl $-0x1, %ebp
je 0x539f
movl %ebp, 0xc(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0xa5ce
cmpl $0x3, %eax
jne 0x5354
movl %ebp, 0x14(%rsp)
andq $0x0, 0x70(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
orl $-0x1, 0x40(%rsp)
movq %r15, %rdi
movq %r13, %r14
movq %r13, %rsi
leaq 0x60(%rsp), %rdx
xorl %ecx, %ecx
leaq 0x40(%rsp), %r8
callq 0xa3c8
xorl %ebp, %ebp
movl %ebp, %ebp
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbp, %rcx
jbe 0x5342
movl (%rax,%rbp,4), %ecx
movl %ecx, 0x10(%rsp)
cmpq $0x2, %rbp
je 0x525a
cmpl $0x1, %ebp
je 0x5265
testl %ebp, %ebp
jne 0x525a
movl 0x4(%rax), %ecx
jmp 0x5267
movl (%rax), %ecx
movl %ecx, 0x8(%rsp)
movl 0x4(%rax), %eax
jmp 0x526e
movl (%rax), %ecx
movl %ecx, 0x8(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x4(%rsp)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
callq 0x9e3a
testb %al, %al
je 0x533b
andq $0x0, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
orl $-0x1, 0x20(%rsp)
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x40(%rsp), %rdx
xorl %ecx, %ecx
leaq 0x20(%rsp), %r8
callq 0xa3c8
movq 0x40(%rsp), %rbx
movq 0x48(%rsp), %r13
cmpq %r13, %rbx
je 0x5331
movl (%rbx), %eax
movl %eax, 0x1c(%rsp)
cmpl 0xc(%rsp), %eax
je 0x532b
movq %r15, %rdi
movq %r12, %rsi
callq 0xa5ce
cmpl $0x5, %eax
jne 0x532b
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movl $0x3, 0x18(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
leaq 0x20(%rsp), %rcx
leaq 0x18(%rsp), %r8
callq 0x42fc
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
cmpq $0x9, %rax
jae 0x5364
leaq 0x20(%rsp), %rdi
callq 0xb872
addq $0x4, %rbx
jmp 0x52c2
leaq 0x40(%rsp), %rdi
callq 0xb872
incl %ebp
jmp 0x5223
leaq 0x60(%rsp), %rdi
callq 0xb872
leaq 0x58(%rsp), %rbx
movq %r14, %r13
movq %r15, %rdi
movq %rbx, %rsi
callq 0x9cf8
jmp 0x51cb
movl 0x10(%rsp), %eax
movq 0x78(%rsp), %rcx
movl %eax, (%rcx)
movl 0xc(%rsp), %eax
movq 0x80(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x20(%rsp), %rdi
callq 0xb872
leaq 0x40(%rsp), %rdi
callq 0xb872
leaq 0x60(%rsp), %rdi
callq 0xb872
movl 0x14(%rsp), %ebp
cmpl $-0x1, %ebp
setne %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x53bb
jmp 0x53cf
movq %rax, %rbx
jmp 0x53dc
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xb872
jmp 0x53d2
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xb872
leaq 0x60(%rsp), %rdi
callq 0xb872
movq %rbx, %rdi
callq 0x22c0