// File: 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:
subq $0x238, %rsp            # imm = 0x238
movq %rdi, 0x230(%rsp)
movq %rsi, 0x228(%rsp)
movq 0x230(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x1f0(%rsp), %rdi
callq 0x1a020
movq 0x78(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x1e8(%rsp)
movq 0x1e8(%rsp), %rdi
callq 0x42c70
movq %rax, 0x1e0(%rsp)
movq 0x1e8(%rsp), %rdi
callq 0x42550
movq %rax, 0x1d8(%rsp)
leaq 0x1e0(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x42530
testb $0x1, %al
jne 0x417ca
jmp 0x41b46
leaq 0x1e0(%rsp), %rdi
callq 0x42d10
movq %rax, 0x1d0(%rsp)
movb $0x0, 0x1cf(%rsp)
movq 0x1d0(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x1c0(%rsp)
movq 0x1c0(%rsp), %rdi
callq 0x19b50
movq %rax, 0x1b8(%rsp)
movq 0x1c0(%rsp), %rdi
callq 0x1a0e0
movq %rax, 0x1b0(%rsp)
leaq 0x1b8(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x1a110
testb $0x1, %al
jne 0x41843
jmp 0x4199a
leaq 0x1b8(%rsp), %rdi
callq 0x1a150
movq 0x78(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x1ac(%rsp)
addq $0x18, %rdi
leaq 0x1ac(%rsp), %rsi
callq 0x42500
movq %rax, 0x70(%rsp)
jmp 0x41876
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rax
movq %rax, 0x1a0(%rsp)
addq $0x18, %rdi
callq 0x42550
movq %rax, 0x188(%rsp)
leaq 0x1a0(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x42d30
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x6f(%rsp)
jne 0x418bd
jmp 0x41914
movq 0x228(%rsp), %rdi
leaq 0x1ac(%rsp), %rsi
callq 0x192c0
movq %rax, 0x60(%rsp)
jmp 0x418d9
movq 0x60(%rsp), %rax
movq %rax, 0x180(%rsp)
movq 0x228(%rsp), %rdi
callq 0x19250
movq %rax, 0x178(%rsp)
leaq 0x180(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x1a690
movb %al, 0x6f(%rsp)
movb 0x6f(%rsp), %al
testb $0x1, %al
jne 0x4191e
jmp 0x41986
movq 0x1d0(%rsp), %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x18960
movb %dl, 0x57(%rsp)
movq %rax, 0x58(%rsp)
jmp 0x4193e
movb 0x57(%rsp), %al
movq 0x58(%rsp), %rcx
movq %rcx, 0x168(%rsp)
movb %al, 0x170(%rsp)
movb $0x1, 0x1cf(%rsp)
jmp 0x4199a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x198(%rsp)
movl %eax, 0x194(%rsp)
leaq 0x1f0(%rsp), %rdi
callq 0x1a030
jmp 0x41e13
jmp 0x41988
leaq 0x1b8(%rsp), %rdi
callq 0x1a160
jmp 0x41825
testb $0x1, 0x1cf(%rsp)
je 0x419a9
jmp 0x41b34
movq 0x1d0(%rsp), %rax
addq $0x8, %rax
addq $0x18, %rax
movq %rax, 0x160(%rsp)
movq 0x160(%rsp), %rdi
callq 0x19b50
movq %rax, 0x158(%rsp)
movq 0x160(%rsp), %rdi
callq 0x1a0e0
movq %rax, 0x150(%rsp)
leaq 0x158(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x1a110
testb $0x1, %al
jne 0x41a09
jmp 0x41b32
leaq 0x158(%rsp), %rdi
callq 0x1a150
movq 0x78(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x14c(%rsp)
addq $0x18, %rdi
leaq 0x14c(%rsp), %rsi
callq 0x42500
movq %rax, 0x48(%rsp)
jmp 0x41a3c
movq 0x78(%rsp), %rdi
movq 0x48(%rsp), %rax
movq %rax, 0x140(%rsp)
addq $0x18, %rdi
callq 0x42550
movq %rax, 0x138(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x42d30
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x47(%rsp)
jne 0x41a83
jmp 0x41ada
movq 0x228(%rsp), %rdi
leaq 0x14c(%rsp), %rsi
callq 0x192c0
movq %rax, 0x38(%rsp)
jmp 0x41a9f
movq 0x38(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x228(%rsp), %rdi
callq 0x19250
movq %rax, 0x128(%rsp)
leaq 0x130(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x1a690
movb %al, 0x47(%rsp)
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x41ae4
jmp 0x41b1e
movq 0x1d0(%rsp), %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x18960
movb %dl, 0x2f(%rsp)
movq %rax, 0x30(%rsp)
jmp 0x41b04
movb 0x2f(%rsp), %al
movq 0x30(%rsp), %rcx
movq %rcx, 0x118(%rsp)
movb %al, 0x120(%rsp)
jmp 0x41b32
jmp 0x41b20
leaq 0x158(%rsp), %rdi
callq 0x1a160
jmp 0x419eb
jmp 0x41b34
leaq 0x1e0(%rsp), %rdi
callq 0x42d50
jmp 0x417ac
jmp 0x41b48
leaq 0x1f0(%rsp), %rdi
callq 0x191e0
cmpq $0x0, %rax
je 0x41dfe
leaq 0x1f0(%rsp), %rdi
callq 0x19220
movq %rax, 0x108(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x192a0
movq 0x78(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x114(%rsp)
addq $0x18, %rdi
leaq 0x114(%rsp), %rsi
callq 0x42d80
jmp 0x41ba2
movq 0x78(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x100(%rsp)
movq 0x100(%rsp), %rdi
callq 0x42c70
movq %rax, 0xf8(%rsp)
movq 0x100(%rsp), %rdi
callq 0x42550
movq %rax, 0xf0(%rsp)
leaq 0xf8(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x42530
testb $0x1, %al
jne 0x41bfb
jmp 0x41de2
leaq 0xf8(%rsp), %rdi
callq 0x42d10
movq %rax, 0xe8(%rsp)
movb $0x0, 0xe7(%rsp)
movq 0xe8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0xd8(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x19b50
movq %rax, 0xd0(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x1a0e0
movq %rax, 0xc8(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x1a110
testb $0x1, %al
jne 0x41c71
jmp 0x41ced
leaq 0xd0(%rsp), %rdi
callq 0x1a150
movl (%rax), %eax
movl %eax, 0xc4(%rsp)
movl 0xc4(%rsp), %eax
cmpl 0x114(%rsp), %eax
jne 0x41cd9
movq 0xe8(%rsp), %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x18960
movb %dl, 0x1f(%rsp)
movq %rax, 0x20(%rsp)
jmp 0x41cb7
movb 0x1f(%rsp), %al
movq 0x20(%rsp), %rcx
movq %rcx, 0xb0(%rsp)
movb %al, 0xb8(%rsp)
movb $0x1, 0xe7(%rsp)
jmp 0x41ced
jmp 0x41cdb
leaq 0xd0(%rsp), %rdi
callq 0x1a160
jmp 0x41c56
testb $0x1, 0xe7(%rsp)
jne 0x41dce
movq 0xe8(%rsp), %rax
addq $0x8, %rax
addq $0x18, %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x19b50
movq %rax, 0xa0(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x1a0e0
movq %rax, 0x98(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x1a110
testb $0x1, %al
jne 0x41d58
jmp 0x41dcc
leaq 0xa0(%rsp), %rdi
callq 0x1a150
movl (%rax), %eax
movl %eax, 0x94(%rsp)
movl 0x94(%rsp), %eax
cmpl 0x114(%rsp), %eax
jne 0x41db8
movq 0xe8(%rsp), %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x18960
movb %dl, 0xf(%rsp)
movq %rax, 0x10(%rsp)
jmp 0x41d9e
movb 0xf(%rsp), %al
movq 0x10(%rsp), %rcx
movq %rcx, 0x80(%rsp)
movb %al, 0x88(%rsp)
jmp 0x41dcc
jmp 0x41dba
leaq 0xa0(%rsp), %rdi
callq 0x1a160
jmp 0x41d3d
jmp 0x41dce
jmp 0x41dd0
leaq 0xf8(%rsp), %rdi
callq 0x42d50
jmp 0x41bdd
leaq 0x1f0(%rsp), %rdi
leaq 0x114(%rsp), %rsi
callq 0x1a890
jmp 0x41df9
jmp 0x41b48
leaq 0x1f0(%rsp), %rdi
callq 0x1a030
addq $0x238, %rsp            # imm = 0x238
retq
movq 0x198(%rsp), %rdi
callq 0x2310