// File: /workspace/github_cpp_makefile_star2_O3/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
movabsq $-0x5555555555555555, %r13 # imm = 0xAAAAAAAAAAAAAAAB
leaq 0x30(%rsp), %rbp
leaq 0x10(%rsp), %r15
movl %ecx, 0xc(%rsp)
movl %ecx, %edx
movq (%r14), %rdi
movq (%rdi), %rax
leaq (%rdx,%rdx,2), %rsi
movl 0x4(%rax,%rsi,4), %edx
testl %edx, %edx
je 0x11269
leaq (%rax,%rsi,4), %rsi
cmpb $0x0, 0x8(%rsi)
jne 0x11269
cmpl $0x1, %edx
je 0x110d3
cmpl $0x3, (%rbx)
je 0x11269
movq 0x8(%rdi), %rsi
subq %rax, %rsi
sarq $0x2, %rsi
imulq %r13, %rsi
leal 0x1(%rcx), %edx
movl %edx, 0x8(%rsp)
cmpq %rdx, %rsi
jbe 0x11269
leaq (%rdx,%rdx,2), %rcx
cmpb $0x0, 0x8(%rax,%rcx,4)
jne 0x11240
leaq (%rax,%rcx,4), %rcx
movl 0xc(%rsp), %esi
leaq (%rsi,%rsi,2), %rsi
movl 0x4(%rax,%rsi,4), %esi
cmpl 0x4(%rcx), %esi
ja 0x11240
leaq 0xc(%rsp), %rsi
callq 0x12146
movl %eax, 0x1c(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movl 0x8(%rsp), %eax
movq (%r14), %rdi
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
imulq %r13, %rdx
decq %rdx
cmpq %rax, %rdx
jne 0x1116b
movq 0x18(%rdi), %rax
movq 0x8(%rax), %r12
subq (%rax), %r12
shrq $0x2, %r12
jmp 0x11175
incl %eax
leaq (%rax,%rax,2), %rax
movl (%rcx,%rax,4), %r12d
movl $0xffffffff, 0x10(%rsp) # imm = 0xFFFFFFFF
leaq 0x1c(%rsp), %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
movq %r15, %r8
callq 0xc092
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
leaq (%rdx,%rdx,2), %rdx
movl (%rax,%rdx,4), %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 0x18628
testb %al, %al
je 0x1121f
movq (%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x12146
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 0x2f76
movq (%r14), %rax
movl 0xc(%rsp), %ecx
movq (%rax), %rax
leaq (%rcx,%rcx,2), %rcx
cmpl $0x0, 0x4(%rax,%rcx,4)
je 0x11260
movb $0x1, %r12b
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x11231
callq 0x21a0
testb %r12b, %r12b
je 0x11265
movl 0x8(%rsp), %edx
movq (%r14), %rdi
movq (%rdi), %rax
incl %edx
movl %edx, 0x8(%rsp)
movq 0x8(%rdi), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
imulq %r13, %rcx
cmpq %rdx, %rcx
ja 0x110f2
jmp 0x11265
xorl %r12d, %r12d
jmp 0x11222
movl 0xc(%rsp), %ecx
incl %ecx
jmp 0x1109b
jmp 0x11276
jmp 0x11276
jmp 0x11276
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x11288
callq 0x21a0
movq %rbx, %rdi
callq 0x2320