// File: /workspace/github_cpp_makefile_star2_O1/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 %eax, %eax
movabsq $-0x5555555555555555, %r13 # imm = 0xAAAAAAAAAAAAAAAB
leaq 0x30(%rsp), %rbp
leaq 0x10(%rsp), %r15
movl %eax, 0xc(%rsp)
movl %eax, %eax
movq (%r14), %rcx
movq (%rcx), %rcx
leaq (%rax,%rax,2), %rdx
movl 0x4(%rcx,%rdx,4), %eax
testl %eax, %eax
je 0x11897
leaq (%rcx,%rdx,4), %rcx
cmpb $0x0, 0x8(%rcx)
jne 0x11897
cmpl $0x1, %eax
je 0x1189f
cmpl $0x3, (%rbx)
jne 0x1189f
movl 0xc(%rsp), %eax
incl %eax
jmp 0x1186b
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
movq (%r14), %rdi
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
imulq %r13, %rdx
cmpq %rax, %rdx
jbe 0x11897
leaq (%rax,%rax,2), %rax
cmpb $0x0, 0x8(%rcx,%rax,4)
jne 0x11a13
leaq (%rcx,%rax,4), %rax
movl 0xc(%rsp), %edx
leaq (%rdx,%rdx,2), %rdx
movl 0x4(%rcx,%rdx,4), %ecx
cmpl 0x4(%rax), %ecx
ja 0x11a13
leaq 0xc(%rsp), %rsi
callq 0x12a52
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 0x1193c
movq 0x18(%rdi), %rax
movq 0x8(%rax), %r12
subq (%rax), %r12
shrq $0x2, %r12
jmp 0x11946
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 0xc714
movq (%r14), %rax
movq 0x18(%rax), %rcx
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq (%rcx), %rcx
movq %rcx, 0x20(%rsp)
movl 0x8(%rsp), %esi
movq (%rax), %rax
leaq (%rsi,%rsi,2), %rsi
movl (%rax,%rsi,4), %eax
leaq (%rdx,%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 0x1931c
testb %al, %al
je 0x119f8
movq (%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x12a52
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 0x2f00
movq (%r14), %rax
movl 0xc(%rsp), %ecx
movq (%rax), %rdx
leaq (%rcx,%rcx,2), %rcx
xorl %eax, %eax
cmpl $0x0, 0x4(%rdx,%rcx,4)
sete %cl
je 0x11a1c
xorl %r12d, %r12d
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x11a0a
callq 0x21a0
testl %r12d, %r12d
jne 0x11897
movl 0x8(%rsp), %eax
jmp 0x118a3
movb %cl, %al
leal (%rax,%rax,4), %r12d
jmp 0x119fb
jmp 0x11a2a
jmp 0x11a2a
jmp 0x11a2a
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x11a3c
callq 0x21a0
movq %rbx, %rdi
callq 0x2320