// File: /workspace/github_cpp_makefile_star2_O3/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 0xfb5b
movq 0x10(%r15), %r14
testq %r14, %r14
je 0xfb4e
movq (%r14), %rdi
testq %rdi, %rdi
je 0xfb4e
callq 0x21a0
movq %r14, %rdi
callq 0x21a0
movq (%r15), %r15
jmp 0xfb33
movq 0x28(%rsp), %rdi
callq 0x12928
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 0xf1ca
movq (%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x29d8
movq $0x0, 0x10(%rsp)
leaq 0x90(%rsp), %r15
leaq 0x88(%rsp), %r14
leaq 0x4(%rsp), %r12
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl $-0x1, 0x8(%rsp)
je 0xfdbc
movq %r15, 0x18(%rsp)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0xd538
testb $0x1, %dl
je 0xfdaa
movl $0x18, %edi
callq 0x21e0
movq %rax, %rbp
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, %rdi
xorl %esi, %esi
leaq 0x8(%rsp), %rdx
callq 0xd7b4
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0xfc54
movl 0x8(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x60(%rsp)
jmp 0xfc68
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xf38e
movq 0x60(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0xfd81
movq 0x68(%rsp), %rdi
cmpq %rdi, %rax
je 0xfc8a
movl -0x4(%rax), %ecx
addq $-0x4, %rax
movl %ecx, 0x4(%rsp)
jmp 0xfccd
movq 0x78(%rsp), %rax
movq -0x8(%rax), %rax
movl 0x1fc(%rax), %eax
movl %eax, 0x4(%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 0xfc63
movq (%rbx), %rcx
movq 0x18(%rcx), %rcx
movq (%rcx), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0x4(%rsp)
movq %r15, 0x18(%rsp)
movq %r15, %rdi
movq %r12, %rsi
leaq 0x18(%rsp), %rdx
callq 0xd538
testb $0x1, %dl
je 0xfd71
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0xfd3f
movl 0x4(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x60(%rsp)
jmp 0xfd4c
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0xf38e
movq 0x8(%rbp), %rsi
cmpq 0x10(%rbp), %rsi
je 0xfd66
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbp)
jmp 0xfd71
movq %rbp, %rdi
movq %r12, %rdx
callq 0xd7b4
movq (%rbx), %rdi
movq %r14, %rsi
callq 0xbe2e
jmp 0xfce0
movq 0x10(%rsp), %rax
movl %eax, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x13108
movq 0x10(%rsp), %rax
incl %eax
movq %rax, 0x10(%rsp)
movq (%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xb94a
jmp 0xfbdb
leaq 0x30(%rsp), %rdi
callq 0xd330
leaq 0x90(%rsp), %rdi
callq 0xc950
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xfdf8
movq %rax, %rbx
jmp 0xfe05
jmp 0xfdf8
jmp 0xfdf8
jmp 0xfdf8
jmp 0xfdf8
jmp 0xfdf8
jmp 0xfdf8
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xd330
leaq 0x90(%rsp), %rdi
callq 0xc950
movq %rbx, %rdi
callq 0x2320