// File: /workspace/github_cpp_makefile_star2_O2/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 $0xb8, %rsp
movq %rdi, %rbx
leaq 0x28(%rdi), %r15
movq (%r15), %r15
testq %r15, %r15
je 0xe411
movq 0x10(%r15), %r14
testq %r14, %r14
je 0xe407
movq %r14, %rdi
callq 0xb872
movq %r14, %rdi
callq 0x2160
jmp 0xe3ee
leaq 0x18(%rbx), %rdi
movq %rdi, 0x18(%rsp)
callq 0x10b4c
leaq 0xb0(%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
callq 0xa91e
movq (%rbx), %rsi
leaq 0x10(%rsp), %rdi
callq 0x270e
movl $0x0, 0x8(%rsp)
leaq 0x80(%rsp), %r15
leaq 0x20(%rsp), %r13
leaq 0xc(%rsp), %r14
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $-0x1, 0x10(%rsp)
je 0xe594
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0xbc1a
testb $0x1, %dl
je 0xe582
pushq $0x18
popq %rdi
callq 0x2190
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0xa1ac
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xdb00
movq 0x60(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0xe564
cmpq 0x68(%rsp), %rax
jne 0xe4f6
movq 0x78(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movl -0x4(%rax), %eax
movl %eax, 0xc(%rsp)
leaq 0x30(%rsp), %rdi
callq 0xdd28
movq (%rbx), %rsi
movq %r13, %rdi
movq %r14, %rdx
callq 0x2720
movl 0x24(%rsp), %eax
cmpq %rbp, %rax
je 0xe4ce
movq (%rbx), %rcx
movq 0x18(%rcx), %rcx
movq (%rcx), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0xc(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0xbc1a
testb $0x1, %dl
je 0xe557
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0xdb00
movq %r12, %rdi
movq %r14, %rsi
callq 0xa1ac
movq (%rbx), %rdi
movq %r13, %rsi
callq 0xa1ca
jmp 0xe515
movl 0x8(%rsp), %eax
movl %eax, 0x20(%rsp)
movq %r12, 0x28(%rsp)
movq 0x18(%rsp), %rdi
movq %r13, %rsi
callq 0x11426
incl 0x8(%rsp)
movq (%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x9cf8
jmp 0xe47b
leaq 0x30(%rsp), %rdi
callq 0xb818
leaq 0x80(%rsp), %rdi
callq 0xad26
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe5d0
movq %rax, %rbx
jmp 0xe5dd
jmp 0xe5d0
jmp 0xe5d0
jmp 0xe5d0
jmp 0xe5d0
jmp 0xe5d0
jmp 0xe5d0
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xb818
leaq 0x80(%rsp), %rdi
callq 0xad26
movq %rbx, %rdi
callq 0x22c0