// File: /workspace/github_cpp_makefile_star2_O2/iPapatsoris[P]Maximum-Independent-Set/src/Reductions.cpp
// Function: Reductions::removeDominatedNodes2(unsigned int const&)
bool Reductions::removeDominatedNodes2(const uint32_t &theta) {
    for (uint32_t pos1 = 0 ; pos1 < graph.nodeIndex.size() ; pos1++) {
        if (!graph.nodeIndex[pos1].edges || graph.nodeIndex[pos1].removed || theta == 3 && graph.nodeIndex[pos1].edges != 1) {
            continue;
        }
        for (uint32_t pos2 = pos1+1 ; pos2 < graph.nodeIndex.size() ; pos2++) {
            if (graph.nodeIndex[pos2].removed || graph.nodeIndex[pos1].edges > graph.nodeIndex[pos2].edges) {
                continue;
            }
            uint32_t node1 = graph.getNode(pos1);
            vector<uint32_t> neighbors1;
            uint32_t nextNodeOffset = (pos2 == graph.nodeIndex.size()-1 ? graph.edgeBuffer->size() : graph.nodeIndex[pos2+1].offset);
            graph.gatherNeighbors(node1, neighbors1);
            vector<uint32_t>::iterator begin = graph.edgeBuffer->begin();
            vector<uint32_t>::iterator end = graph.edgeBuffer->begin();
            std::advance(begin, graph.nodeIndex[pos2].offset);
            std::advance(end, nextNodeOffset);
            if (isSubsetOf(neighbors1, begin, end)) {
                uint32_t node2 = graph.getNode(pos2);
                //cout << "Dominated node " << node2 << "\n";
                graph.remove(node2, reduceInfo, (theta == 3 ? true : false));
                if (!graph.nodeIndex[pos1].edges) {
                    break;
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rdi), %rax
movq %rax, 0x28(%rsp)
xorl %ecx, %ecx
pushq $0xc
popq %r13
leaq 0x30(%rsp), %rbp
leaq 0x10(%rsp), %r15
movl %ecx, 0xc(%rsp)
movl %ecx, %eax
movq (%r14), %rdi
movq (%rdi), %rsi
imulq $0xc, %rax, %rax
movl 0x4(%rsi,%rax), %edx
testl %edx, %edx
je 0xf7c2
addq %rsi, %rax
cmpb $0x0, 0x8(%rax)
jne 0xf7c2
movq 0x8(%rdi), %rax
cmpl $0x1, %edx
je 0xf672
cmpl $0x3, (%rbx)
je 0xf7c2
jmp 0xf672
movq %rbp, %rdi
callq 0xb872
movl 0x8(%rsp), %ecx
movq (%r14), %rdi
movq (%rdi), %rsi
movq 0x8(%rdi), %rax
subq %rsi, %rax
cqto
idivq %r13
movl 0xc(%rsp), %edx
imulq $0xc, %rdx, %rdx
addq %rsi, %rdx
addq $0x4, %rdx
incl %ecx
movl %ecx, 0x8(%rsp)
movl %ecx, %ecx
cmpq %rcx, %rax
jbe 0xf7be
imulq $0xc, %rcx, %r8
cmpb $0x1, 0x8(%rsi,%r8)
je 0xf689
addq %rsi, %r8
movl (%rdx), %r9d
cmpl 0x4(%r8), %r9d
ja 0xf689
leaq 0xc(%rsp), %rsi
callq 0x103c0
movl %eax, 0x1c(%rsp)
andq $0x0, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movl 0x8(%rsp), %ecx
movq (%r14), %rdi
movq (%rdi), %rsi
movq 0x8(%rdi), %rax
subq %rsi, %rax
cqto
idivq %r13
decq %rax
cmpq %rcx, %rax
jne 0xf6fd
movq 0x18(%rdi), %rax
movq 0x8(%rax), %r12
subq (%rax), %r12
shrq $0x2, %r12
jmp 0xf707
incl %ecx
imulq $0xc, %rcx, %rax
movl (%rsi,%rax), %r12d
orl $-0x1, 0x10(%rsp)
leaq 0x1c(%rsp), %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
movq %r15, %r8
callq 0xa3c8
movq (%r14), %rax
movq 0x18(%rax), %rcx
movq (%rcx), %rcx
movq %rcx, 0x10(%rsp)
movq %rcx, 0x20(%rsp)
movl 0x8(%rsp), %edx
movq (%rax), %rax
imulq $0xc, %rdx, %rdx
movl (%rax,%rdx), %eax
leaq (%rcx,%rax,4), %rax
movq %rax, 0x10(%rsp)
movl %r12d, %eax
leaq (%rcx,%rax,4), %rax
movq %rax, 0x20(%rsp)
movq %rbp, %rdi
movq %r15, %rsi
leaq 0x20(%rsp), %rdx
callq 0x15f70
testb %al, %al
je 0xf65c
movq (%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x103c0
movl %eax, 0x18(%rsp)
cmpl $0x3, (%rbx)
movq (%r14), %rdi
sete 0x7(%rsp)
leaq 0x18(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x7(%rsp), %rcx
callq 0x2bae
movq (%r14), %rax
movl 0xc(%rsp), %ecx
movq (%rax), %rax
imulq $0xc, %rcx, %rcx
cmpl $0x0, 0x4(%rax,%rcx)
jne 0xf65c
movq %rbp, %rdi
callq 0xb872
movl 0xc(%rsp), %ecx
incl %ecx
jmp 0xf61f
jmp 0xf7cf
jmp 0xf7cf
jmp 0xf7cf
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xb872
movq %rbx, %rdi
callq 0x22c0