// File: /workspace/github_cpp_makefile_star2_O2/iPapatsoris[P]Maximum-Independent-Set/src/Graph.cpp
// Function: Graph::getGoodPair(unsigned int&, unsigned int&, std::vector<unsigned int, std::allocator<unsigned int>>&) const
bool Graph::getGoodPair(uint32_t &node1, uint32_t &node2, vector<uint32_t> &commonNeighbors) const {
    for (uint32_t pos1 = 0 ; pos1 < nodeIndex.size() ; pos1++) {
        if (nodeIndex[pos1].removed) {
            continue;
        }
        for (uint32_t pos2 = pos1+1 ; pos2 < nodeIndex.size() ; pos2++) {
            if (nodeIndex[pos2].removed) {
                continue;
            }
            if (nodeIndex[pos1].edges == 5 || nodeIndex[pos2].edges == 5) {
                uint32_t nodeA = (!mapping ? pos1 : posToId->at(pos1));
                uint32_t nodeB = (!mapping ? pos2 : posToId->at(pos2));
                if (edgeExists(nodeA, nodeB)) {
                    continue;
                }
                commonNeighbors.clear();
                getCommonNeighbors(nodeA, nodeB, commonNeighbors);
                if (commonNeighbors.size() >= 3) {
                    node1 = nodeA;
                    node2 = nodeB;
                    //cout << "branching on a good pair " << node1 << "-" << node2 << "\n";
                    return true;
                }
            }
        }
    }
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, %rbx
movq (%rdi), %rcx
movq 0x8(%rdi), %rsi
xorl %r9d, %r9d
pushq $0xc
popq %r15
movq %rcx, %r8
movq %rdi, 0x8(%rsp)
movl %r9d, %r14d
movq %rsi, %rax
subq %r8, %rax
cqto
idivq %r15
cmpq %r14, %rax
jbe 0x5558
imulq $0xc, %r14, %r12
cmpb $0x0, 0x8(%r8,%r12)
je 0x544c
incl %r9d
jmp 0x5424
movq %rax, 0x30(%rsp)
movl %r9d, %ebp
incl %ebp
movl %ebp, %r13d
movq %rsi, %rax
subq %r8, %rax
cqto
idivq %r15
cmpq %r13, %rax
jbe 0x5447
imulq $0xc, %r13, %rax
cmpb $0x0, 0x8(%r8,%rax)
jne 0x5487
cmpl $0x5, 0x4(%r8,%r12)
je 0x548e
addq %rax, %r8
cmpl $0x5, 0x4(%r8)
je 0x548e
incl %ebp
movq %rcx, %r8
jmp 0x5456
movb 0x3c(%rbx), %al
movl %r9d, 0x10(%rsp)
movl %r9d, %ecx
cmpb $0x1, %al
jne 0x54b3
movq 0x48(%rbx), %rdi
movq %r14, %rsi
callq 0x9e18
movq 0x8(%rsp), %rbx
movl (%rax), %ecx
movb 0x3c(%rbx), %al
movl %ecx, 0x4(%rsp)
movl %ebp, %ecx
testb $0x1, %al
je 0x54d0
movq 0x48(%rbx), %rdi
movq %r13, %rsi
callq 0x9e18
movq 0x8(%rsp), %rbx
movl (%rax), %ecx
movl %ecx, (%rsp)
movq %rbx, %rdi
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
callq 0x9e3a
testb %al, %al
jne 0x552a
movq 0x28(%rsp), %r13
movq (%r13), %rax
cmpq %rax, 0x8(%r13)
je 0x54fa
movq %rax, 0x8(%r13)
andl $0x0, 0x14(%rsp)
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
movq %r13, %rcx
leaq 0x14(%rsp), %r8
callq 0x42fc
movq 0x8(%r13), %rax
subq (%r13), %rax
cmpq $0x8, %rax
ja 0x553e
movq (%rbx), %rcx
movq 0x8(%rbx), %rsi
movq %rcx, %r8
movl 0x10(%rsp), %r9d
jmp 0x5454
movl 0x4(%rsp), %eax
movq 0x18(%rsp), %rcx
movl %eax, (%rcx)
movl (%rsp), %eax
movq 0x20(%rsp), %rcx
movl %eax, (%rcx)
movq 0x30(%rsp), %rax
cmpq %r14, %rax
seta %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop