// File: /workspace/github_cpp_makefile_star2_O2/iPapatsoris[P]Maximum-Independent-Set/src/Graph.cpp
// Function: Graph::buildCC(std::unordered_set<unsigned int, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<unsigned int>> const&, std::vector<unsigned int, std::allocator<unsigned int>>&, std::vector<unsigned int, std::allocator<unsigned int>>&) const
bool Graph::buildCC(const unordered_set<uint32_t> &excludedNodes, vector<uint32_t> &component1, vector<uint32_t> &component2) const {
    component1.clear();
    component2.clear();
    uint32_t component = 0;
    unordered_set<uint32_t> exploredSet;
    stack<uint32_t> frontier;
    Graph::GraphTraversal graphTraversal(*this);
    while (graphTraversal.curNode != NONE) {
        if (excludedNodes.find(graphTraversal.curNode) == excludedNodes.end() && exploredSet.insert(graphTraversal.curNode).second) {
            if (component == 2) {
                return false;
            }
            vector<uint32_t> *componentNodes = (component == 0 ? &component1 : &component2);
            componentNodes->push_back(graphTraversal.curNode);
            frontier.push(graphTraversal.curNode);
            while (!frontier.empty()) {
                uint32_t node = frontier.top();
                frontier.pop();
                Graph::GraphTraversal neighbors(*this, node);
                while (neighbors.curEdgeOffset != NONE) {
                    node = (*edgeBuffer)[neighbors.curEdgeOffset];
                    if (excludedNodes.find(node) == excludedNodes.end() && exploredSet.insert(node).second) {
                        frontier.push(node);
                        componentNodes->push_back(node);
                    }
                    getNextEdge(neighbors);
                }
            }
            component++;
        }
        getNextNode(graphTraversal);
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rdx), %rax
cmpq %rax, 0x8(%rdx)
je 0x8c7a
movq %rax, 0x8(%r14)
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x8c87
movq %rax, 0x8(%rbx)
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 %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x270e
movl $0x0, 0x10(%rsp)
leaq 0x8(%rsp), %rsi
leaq 0x14(%rsp), %r14
leaq 0x28(%rsp), %r13
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl 0x8(%rsp), %ebx
cmpl $-0x1, %ebx
je 0x8e1e
movq %r15, %rdi
callq 0xdae2
testq %rax, %rax
jne 0x8e07
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xbc1a
testb $0x1, %dl
je 0x8e07
cmpl $0x2, 0x10(%rsp)
leaq 0x8(%rsp), %rsi
je 0x8e1e
cmpl $0x0, 0x10(%rsp)
movq 0x20(%rsp), %rbx
cmoveq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1ac
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xdb00
movq 0x60(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0x8e03
cmpq 0x68(%rsp), %rax
jne 0x8d82
movq 0x78(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movl -0x4(%rax), %eax
movl %eax, 0x14(%rsp)
leaq 0x30(%rsp), %rdi
callq 0xdd28
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x9dde
movl 0x2c(%rsp), %eax
cmpq %rbp, %rax
je 0x8d5a
movq 0x18(%r12), %rcx
movq (%rcx), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0x14(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0xdae2
testq %rax, %rax
jne 0x8df6
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0xbc1a
testb $0x1, %dl
je 0x8df6
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0xdb00
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa1ac
movq %r12, %rdi
movq %r13, %rsi
callq 0xa1ca
jmp 0x8da1
incl 0x10(%rsp)
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x9cf8
leaq 0x8(%rsp), %rsi
jmp 0x8cea
cmpl $-0x1, %ebx
sete %bl
leaq 0x30(%rsp), %rdi
callq 0xb818
leaq 0x80(%rsp), %rdi
callq 0xad26
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8e64
movq %rax, %rbx
jmp 0x8e71
jmp 0x8e64
jmp 0x8e64
jmp 0x8e64
jmp 0x8e64
jmp 0x8e64
jmp 0x8e64
jmp 0x8e64
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xb818
leaq 0x80(%rsp), %rdi
callq 0xad26
movq %rbx, %rdi
callq 0x22c0