// File: /workspace/github_cpp_makefile_star2_O1/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 %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
setne 0xb(%rsp)
je 0x61f6
movq %rdi, %r13
movq %rcx, 0x28(%rsp)
xorl %r12d, %r12d
movl $0x2, %ebp
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
leaq (%r12,%r12,2), %rcx
movq %rcx, 0x30(%rsp)
cmpb $0x0, 0x8(%rax,%rcx,4)
jne 0x61c9
leal 0x1(%r12), %esi
movq (%r13), %rax
movq 0x8(%r13), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
imulq %r14, %rcx
cmpq %rsi, %rcx
seta %bl
jbe 0x61c9
movl %ebp, %r15d
leaq (%rsi,%rsi,2), %rcx
cmpb $0x0, 0x8(%rax,%rcx,4)
jne 0x61a4
movq 0x30(%rsp), %rdx
cmpl $0x5, 0x4(%rax,%rdx,4)
je 0x60b2
leaq (%rax,%rcx,4), %rax
cmpl $0x5, 0x4(%rax)
jne 0x61a4
leal -0x1(%r15), %eax
movb 0x3c(%r13), %cl
cmpb $0x1, %cl
jne 0x6106
movq 0x48(%r13), %rdx
movq (%rdx), %rdi
movq 0x8(%rdx), %rdx
subq %rdi, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
jbe 0x620b
movl (%rdi,%r12,4), %edx
movl %edx, 0xc(%rsp)
testb %cl, %cl
je 0x610b
movq 0x48(%r13), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rsi, %rdx
jbe 0x6217
movl (%rax,%rsi,4), %eax
jmp 0x610b
movl %r12d, 0xc(%rsp)
movl %eax, 0x10(%rsp)
movq %r13, %rdi
leaq 0xc(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0xc5e2
movl $0x7, %ecx
cmpl $-0x1, %eax
jne 0x619b
movl %ebp, %r14d
movq 0x28(%rsp), %rbp
movq (%rbp), %rax
cmpq %rax, 0x8(%rbp)
je 0x6141
movq %rax, 0x8(%rbp)
movl $0x0, 0x14(%rsp)
movq %r13, %rdi
leaq 0xc(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbp, %rcx
leaq 0x14(%rsp), %r8
callq 0x4bae
movq 0x8(%rbp), %rax
subq (%rbp), %rax
xorl %ecx, %ecx
cmpq $0x9, %rax
movl %r14d, %ebp
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
jb 0x619b
movl 0xc(%rsp), %eax
movq 0x18(%rsp), %rcx
movl %eax, (%rcx)
movl 0x10(%rsp), %eax
movq 0x20(%rsp), %rcx
movl %eax, (%rcx)
movl $0x1, %ecx
cmpl $0x7, %ecx
je 0x61a4
testl %ecx, %ecx
jne 0x61f1
movl %r15d, %esi
movq (%r13), %rax
movq 0x8(%r13), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
imulq %r14, %rcx
incl %r15d
cmpq %rsi, %rcx
seta %bl
ja 0x6089
incl %r12d
movq (%r13), %rax
movq 0x8(%r13), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
imulq %r14, %rcx
incl %ebp
cmpq %r12, %rcx
seta 0xb(%rsp)
ja 0x604e
jmp 0x61f6
testb $0x1, %bl
je 0x61c9
movb 0xb(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x145cc(%rip), %rdi     # 0x1a7de
movq %r12, %rsi
jmp 0x621e
leaq 0x145c0(%rip), %rdi     # 0x1a7de
xorl %eax, %eax
callq 0x22a0
nop