// File: /workspace/github_cpp_makefile_star2_O3/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, %r15
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
cmpq %rax, %rcx
je 0x6208
movq %rdi, %r13
movq %rsi, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
movl $0x2, %ebp
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
xorl %r12d, %r12d
movl %r12d, %edx
leaq (%r12,%r12,2), %rbx
movq %rdx, 0x30(%rsp)
leal 0x1(%rdx), %esi
cmpb $0x0, 0x8(%rax,%rbx,4)
movq %rsi, 0x28(%rsp)
jne 0x61ea
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
imulq %rdi, %rdx
cmpq %rsi, %rdx
jbe 0x61ea
movl %ebp, %r14d
leaq (%rsi,%rsi,2), %rdx
cmpb $0x0, 0x8(%rax,%rdx,4)
jne 0x61cd
cmpl $0x5, 0x4(%rax,%rbx,4)
je 0x611f
leaq (%rax,%rdx,4), %rdx
cmpl $0x5, 0x4(%rdx)
jne 0x61cd
cmpb $0x1, 0x3c(%r13)
jne 0x6157
movq 0x48(%r13), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
jbe 0x623c
movl (%rax,%r12,4), %ecx
movl %ecx, 0xc(%rsp)
cmpq %rsi, %rdx
jbe 0x6233
movl (%rax,%rsi,4), %eax
jmp 0x6164
leal -0x1(%r14), %eax
movq 0x30(%rsp), %rcx
movl %ecx, 0xc(%rsp)
movl %eax, 0x10(%rsp)
movq %r13, %rdi
leaq 0xc(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0xbf3a
cmpl $-0x1, %eax
jne 0x61bb
movq (%r15), %rax
cmpq %rax, 0x8(%r15)
je 0x618c
movq %rax, 0x8(%r15)
movl $0x0, 0x14(%rsp)
movq %r13, %rdi
leaq 0xc(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r15, %rcx
leaq 0x14(%rsp), %r8
callq 0x4c42
movq 0x8(%r15), %rax
subq (%r15), %rax
cmpq $0x8, %rax
ja 0x620c
movq (%r13), %rax
movq 0x8(%r13), %rcx
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
movl %r14d, %esi
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
imulq %rdi, %rdx
incl %r14d
cmpq %rsi, %rdx
ja 0x60fb
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
imulq %rdi, %rdx
incl %ebp
movq 0x28(%rsp), %r12
cmpq %r12, %rdx
ja 0x60c2
xorl %eax, %eax
jmp 0x6224
movl 0xc(%rsp), %eax
movq 0x18(%rsp), %rcx
movl %eax, (%rcx)
movl 0x10(%rsp), %eax
movq 0x20(%rsp), %rcx
movl %eax, (%rcx)
movb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x135a4(%rip), %rdi     # 0x197de
jmp 0x6246
leaq 0x1359b(%rip), %rdi     # 0x197de
movq %r12, %rsi
xorl %eax, %eax
callq 0x22a0
nop