// File: iPapatsoris[P]Maximum-Independent-Set/src/Graph.cpp
// Function: Graph::getGoodFunnel(unsigned int&, unsigned int&) const
bool Graph::getGoodFunnel(uint32_t &node1, uint32_t &node2) const {
    vector<Funnel> funnels;
    if (getFunnels(funnels)) {
        Funnel &funnel = funnels.back();
        node1 = funnel.a;
        node2 = funnel.v;
        //cout << "branching on good funnel ";
        //funnel.print();
        return true;
    } else {
        for (uint32_t i = 0 ; i < 2 ; i++) {
            for (auto &funnel: funnels) {
                uint32_t bDegree = getNodeDegree(funnel.b);
                uint32_t cDegree = getNodeDegree(funnel.c);
                if (!i && bDegree == 4 && cDegree == 4 || i && (bDegree == 4 || cDegree == 4)) {
                    node1 = funnel.a;
                    node2 = funnel.v;
                    //cout << "branching on good funnel ";
                    //funnel.print();
                    return true;
                }
            }
        }
    }
    return false;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movq %rdx, 0x88(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x70(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x1a180
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
xorl %eax, %eax
movl %eax, %r8d
movq %r8, %rdx
movq %r8, %rcx
callq 0x70c0
movb %al, 0x27(%rsp)
jmp 0x7ddb
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x7de5
jmp 0x7e49
leaq 0x70(%rsp), %rdi
callq 0x1a3c0
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movl (%rax), %ecx
movq 0x90(%rsp), %rax
movl %ecx, (%rax)
movq 0x58(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x88(%rsp), %rax
movl %ecx, (%rax)
movb $0x1, 0xa7(%rsp)
movl $0x1, 0x54(%rsp)
jmp 0x7f81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x1a360
jmp 0x7f9c
movl $0x0, 0x50(%rsp)
cmpl $0x2, 0x50(%rsp)
jae 0x7f6f
leaq 0x70(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
callq 0x1a1c0
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rdi
callq 0x1a1f0
movq %rax, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x1a220
testb $0x1, %al
jne 0x7e9c
jmp 0x7f5d
leaq 0x40(%rsp), %rdi
callq 0x1a260
movq 0x10(%rsp), %rdi
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rsi
addq $0x4, %rsi
callq 0x1a040
movl %eax, 0xc(%rsp)
jmp 0x7ec4
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %eax
movl %eax, 0x2c(%rsp)
movq 0x30(%rsp), %rsi
addq $0x8, %rsi
callq 0x1a040
movl %eax, 0x8(%rsp)
jmp 0x7ee5
movl 0x8(%rsp), %eax
movl %eax, 0x28(%rsp)
cmpl $0x0, 0x50(%rsp)
jne 0x7f02
cmpl $0x4, 0x2c(%rsp)
jne 0x7f02
cmpl $0x4, 0x28(%rsp)
je 0x7f17
cmpl $0x0, 0x50(%rsp)
je 0x7f4c
cmpl $0x4, 0x2c(%rsp)
je 0x7f17
cmpl $0x4, 0x28(%rsp)
jne 0x7f4c
movq 0x30(%rsp), %rax
movl (%rax), %ecx
movq 0x90(%rsp), %rax
movl %ecx, (%rax)
movq 0x30(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x88(%rsp), %rax
movl %ecx, (%rax)
movb $0x1, 0xa7(%rsp)
movl $0x1, 0x54(%rsp)
jmp 0x7f81
jmp 0x7f4e
leaq 0x40(%rsp), %rdi
callq 0x1a340
jmp 0x7e84
jmp 0x7f5f
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0x7e51
jmp 0x7f71
movb $0x0, 0xa7(%rsp)
movl $0x1, 0x54(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x1a360
movb 0xa7(%rsp), %al
andb $0x1, %al
addq $0xa8, %rsp
retq
movq 0x68(%rsp), %rdi
callq 0x2310
nopw %cs:(%rax,%rax)