// File: /workspace/github_cpp_makefile_star2_O2/iPapatsoris[P]Maximum-Independent-Set/src/Mis.cpp
// Function: Mis::removeHypernodes(std::unordered_set<unsigned int, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<unsigned int>>&)
void Mis::removeHypernodes(unordered_set<uint32_t> &nodes) {
    unordered_set<uint32_t> toRemove;
    for (auto &h: hypernodeToInnernode) {
        bool marked = false;
        for (auto n: h.second.nodes) {
            if (hypernodeToInnernode.find(n) == hypernodeToInnernode.end() && nodes.find(n) == nodes.end()) {
                toRemove.insert(h.first);
                marked = true;
                break;
            }
        }
        if (marked) {
            continue;
        }
        for (auto n: h.second.neighbors) {
            if (hypernodeToInnernode.find(n) == hypernodeToInnernode.end() && nodes.find(n) == nodes.end()) {
                toRemove.insert(h.first);
                break;
            }
        }
    }

    /* Also remove outer hypernodes of hypernodes to be removed */
    while (toRemove.size()) {
        auto n = *toRemove.begin();
        hypernodeToInnernode.erase(n);
        for (auto &h: hypernodeToInnernode) {
            bool marked = false;
            for (auto i: h.second.nodes) {
                if (i == n) {
                    toRemove.insert(h.first);
                    marked = true;
                    break;
                }
            }
            if (!marked) {
                for (auto i: h.second.neighbors) {
                    if (i == n) {
                        toRemove.insert(h.first);
                        break;
                    }
                }
            }
        }
        toRemove.erase(n);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x50(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
leaq 0x18(%rdi), %r14
addq $0x28, %rbx
leaq 0xc(%rsp), %r12
movq %rbx, 0x18(%rsp)
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x14ed8
leaq 0x8(%rbx), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rbx), %r13
movq 0x18(%rbx), %rbp
cmpq %rbp, %r13
je 0x14e75
movl (%r13), %eax
movl %eax, 0xc(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x156f0
testq %rax, %rax
jne 0x14e6f
movq %r15, %rdi
movq %r12, %rsi
callq 0xc35a
testq %rax, %rax
je 0x14eb0
addq $0x4, %r13
jmp 0x14e42
movq 0x28(%rbx), %r13
movq 0x30(%rbx), %rbp
cmpq %rbp, %r13
je 0x14e25
movl (%r13), %eax
movl %eax, 0xc(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x156f0
testq %rax, %rax
jne 0x14eaa
movq %r15, %rdi
movq %r12, %rsi
callq 0xc35a
testq %rax, %rax
je 0x14ec4
addq $0x4, %r13
jmp 0x14e7d
leaq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xbc1a
jmp 0x14e25
leaq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xbc1a
jmp 0x14e25
leaq 0xc(%rsp), %r15
leaq 0x20(%rsp), %r12
cmpq $0x0, 0x38(%rsp)
je 0x14f6e
movq 0x30(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0xc(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x15aec
movq 0x18(%rsp), %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x14f5e
leaq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movl 0xc(%rsp), %eax
cmpq %rcx, %rdx
je 0x14f3c
leaq 0x4(%rdx), %rdi
cmpl %eax, (%rdx)
movq %rdi, %rdx
jne 0x14f22
movq %r12, %rdi
callq 0xbc1a
jmp 0x14f0a
movq 0x28(%rbx), %rdx
movq 0x30(%rbx), %rcx
cmpq %rcx, %rdx
je 0x14f0a
leaq 0x4(%rdx), %rdi
cmpl %eax, (%rdx)
movq %rdi, %rdx
jne 0x14f44
movq %r12, %rdi
callq 0xbc1a
jmp 0x14f0a
movq %r12, %rdi
movq %r15, %rsi
callq 0xb93a
jmp 0x14ee2
leaq 0x20(%rsp), %rdi
callq 0xad26
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14f97
jmp 0x14f97
jmp 0x14f97
jmp 0x14f97
jmp 0x14f97
jmp 0x14f97
jmp 0x14f97
jmp 0x14f97
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xad26
movq %rbx, %rdi
callq 0x22c0