// File: /workspace/github_cpp_makefile_star2_O1/iPapatsoris[P]Maximum-Independent-Set/src/Reductions.cpp
// Function: Reductions::buildCC()
void Reductions::buildCC() {
    for (auto &cc: ccToNodes) {
        delete cc.second;
    }
    ccToNodes.clear();
    uint32_t component = 0;
    unordered_set<uint32_t> exploredSet;
    stack<uint32_t> frontier;
    Graph::GraphTraversal graphTraversal(graph);
    while (graphTraversal.curNode != NONE) {
        if (exploredSet.insert(graphTraversal.curNode).second) {
            vector<uint32_t> *componentNodes = new vector<uint32_t>();
            componentNodes->push_back(graphTraversal.curNode);
            frontier.push(graphTraversal.curNode);
            bool big = false;
            while (!frontier.empty()) {
                uint32_t node = frontier.top();
                frontier.pop();
                Graph::GraphTraversal neighbors(graph, node);
                while (neighbors.curEdgeOffset != NONE) {
                    node = (*graph.edgeBuffer)[neighbors.curEdgeOffset];
                    if (exploredSet.insert(node).second) {
                        frontier.push(node);
                        if (!big) {
                            componentNodes->push_back(node);
                        }
                        else if (componentNodes->size() > 20) {
                            big = true;
                        }
                    }
                    graph.getNextEdge(neighbors);
                }
            }
            if (!big) {
                ccToNodes.insert({component, componentNodes});
                component++;
            } else {
                delete componentNodes;
            }
        }
        graph.getNextNode(graphTraversal);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq 0x18(%rdi), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rdi), %r15
testq %r15, %r15
je 0x101ef
movq 0x10(%r15), %r14
testq %r14, %r14
je 0x101ea
movq (%r14), %rdi
testq %rdi, %rdi
je 0x101e2
callq 0x21a0
movq %r14, %rdi
callq 0x21a0
movq (%r15), %r15
jmp 0x101c7
movq 0x28(%rsp), %rdi
callq 0x132f6
leaq 0xc0(%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 0x30(%rsp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0xf874
movq (%rbx), %rsi
leaq 0xc(%rsp), %rdi
callq 0x29d8
movl $0x0, 0x14(%rsp)
leaq 0x90(%rsp), %r15
leaq 0x88(%rsp), %r14
leaq 0x8(%rsp), %r12
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl $-0x1, 0xc(%rsp)
je 0x1045d
movq %r15, 0x18(%rsp)
movq %r15, %rdi
leaq 0xc(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0xdc3e
testb $0x1, %dl
je 0x1044b
movl $0x18, %edi
callq 0x21e0
movq %rax, %rbp
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq 0x8(%rax), %rsi
testq %rsi, %rsi
je 0x102cd
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbp)
jmp 0x102da
movq %rbp, %rdi
leaq 0xc(%rsp), %rdx
callq 0xdeac
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x102fe
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x60(%rsp)
jmp 0x1030d
leaq 0x30(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0xf9dc
movq 0x60(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0x1042b
movq 0x68(%rsp), %rdi
cmpq %rdi, %rax
je 0x10334
movl -0x4(%rax), %ecx
addq $-0x4, %rax
movl %ecx, 0x8(%rsp)
jmp 0x10377
movq 0x78(%rsp), %rax
movq -0x8(%rax), %rax
movl 0x1fc(%rax), %eax
movl %eax, 0x8(%rsp)
callq 0x21a0
movq 0x78(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x78(%rsp)
movq -0x8(%rax), %rax
movq %rax, 0x68(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x70(%rsp)
movl $0x1fc, %ecx            # imm = 0x1FC
addq %rcx, %rax
movq %rax, 0x60(%rsp)
movq (%rbx), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x29ee
movl 0x8c(%rsp), %eax
cmpq %r13, %rax
je 0x1030d
movq (%rbx), %rcx
movq 0x18(%rcx), %rcx
movq (%rcx), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0x8(%rsp)
movq %r15, 0x18(%rsp)
movq %r15, %rdi
movq %r12, %rsi
leaq 0x18(%rsp), %rdx
callq 0xdc3e
testb $0x1, %dl
je 0x1041b
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x103e9
movl 0x8(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x60(%rsp)
jmp 0x103f6
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0xf9dc
movq 0x8(%rbp), %rsi
cmpq 0x10(%rbp), %rsi
je 0x10410
movl 0x8(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbp)
jmp 0x1041b
movq %rbp, %rdi
movq %r12, %rdx
callq 0xdeac
movq (%rbx), %rdi
movq %r14, %rsi
callq 0xc4d8
jmp 0x1038a
movl 0x14(%rsp), %eax
movl %eax, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x13ae8
incl 0x14(%rsp)
movq (%rbx), %rdi
leaq 0xc(%rsp), %rsi
callq 0xc034
jmp 0x1026e
leaq 0x30(%rsp), %rdi
callq 0xd9d2
leaq 0x90(%rsp), %rdi
callq 0xcff8
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10499
movq %rax, %rbx
jmp 0x104a6
jmp 0x10499
jmp 0x10499
jmp 0x10499
jmp 0x10499
jmp 0x10499
jmp 0x10499
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xd9d2
leaq 0x90(%rsp), %rdi
callq 0xcff8
movq %rbx, %rdi
callq 0x2320
nop