// File: /workspace/github_cpp_makefile_star2_O3/guitld[P]Graph-Algorithms/source/Graph.cpp
// Function: Graph::DFS_Util_Connected_Components(int, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&)
void Graph::DFS_Util_Connected_Components(int u, vector <int> &visitedNodes, vector <int> &componentsSize){
     if (adj_lists.find(u) == adj_lists.end()){
          cout << "Vértice não se encontra no grafo" << endl;
     }

     vector <int> visited;
     stack <int> stack;
     stack.push(u);
     visited.push_back(u);

     while (!stack.empty()){
          int curr_v = stack.top();
          stack.pop();

          for (auto const &neighbor : adj_lists[curr_v]){
               if (find(visited.begin(), visited.end(), neighbor.first) == visited.end()){
                    visited.push_back(neighbor.first);
                    stack.push(neighbor.first);
               }
          }    
     }
     componentsSize.push_back(visited.size());
     visitedNodes.insert(visitedNodes.end(), visited.begin(), visited.end());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, %r15
movq %rdx, %r14
leaq -0x30(%rbp), %rax
movl %esi, (%rax)
movq %rdi, -0xc0(%rbp)
movq %rax, %rsi
callq 0x57b0
testq %rax, %rax
jne 0x3d14
movq 0x62f7(%rip), %rbx      # 0x9fd0
leaq 0x3380(%rip), %rsi      # 0x7060
movl $0x22, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
leaq -0xb0(%rbp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x52d6
movq %r15, -0xb8(%rbp)
movq -0x80(%rbp), %rax
movq -0x70(%rbp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
movq %r14, -0x58(%rbp)
je 0x3d6f
movl -0x30(%rbp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, -0x80(%rbp)
jmp 0x3d7f
leaq -0xb0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x547c
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x3d98
movl -0x30(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x3da5
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x568e
movq -0x80(%rbp), %rax
cmpq -0xa0(%rbp), %rax
je 0x3eb7
leaq -0x50(%rbp), %r13
leaq -0xb0(%rbp), %rbx
movq -0x78(%rbp), %rdi
cmpq %rdi, %rax
je 0x3dd6
movl -0x4(%rax), %ecx
addq $-0x4, %rax
movl %ecx, -0x2c(%rbp)
jmp 0x3e18
movq -0x68(%rbp), %rax
movq -0x8(%rax), %rax
movl 0x1fc(%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x200, %esi            # imm = 0x200
callq 0x2160
movq -0x68(%rbp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, -0x68(%rbp)
movq -0x8(%rax), %rax
movq %rax, -0x78(%rbp)
leaq 0x200(%rax), %rcx
movq %rcx, -0x70(%rbp)
movl $0x1fc, %ecx            # imm = 0x1FC
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0xc0(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x4d1c
movq %rax, %r14
movq (%rax), %r15
cmpq %r14, %r15
je 0x3ea6
leaq 0x10(%r15), %r12
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq %r12, %rdx
callq 0x5811
movq -0x48(%rbp), %rsi
cmpq %rsi, %rax
jne 0x3ea1
cmpq -0x40(%rbp), %rax
je 0x3e6a
movl (%r12), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x3e75
movq %r13, %rdi
movq %r12, %rdx
callq 0x568e
movq -0x80(%rbp), %rax
movq -0x70(%rbp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x3e96
movl (%r12), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, -0x80(%rbp)
jmp 0x3ea1
movq %rbx, %rdi
movq %r12, %rsi
callq 0x547c
movq (%r15), %r15
jmp 0x3e32
movq -0x80(%rbp), %rax
cmpq -0xa0(%rbp), %rax
jne 0x3dc1
movq -0x48(%rbp), %rax
subq -0x50(%rbp), %rax
shrq $0x2, %rax
movl %eax, -0x2c(%rbp)
movq -0xb8(%rbp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x3ee7
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
movq -0x58(%rbp), %rdi
jmp 0x3ef4
leaq -0x2c(%rbp), %rdx
callq 0x58c0
movq -0x58(%rbp), %rdi
movq 0x8(%rdi), %rsi
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %rcx
callq 0x599c
leaq -0xb0(%rbp), %rdi
callq 0x4ba6
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x3f26
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3f47
jmp 0x3f47
jmp 0x3f47
movq %rax, %rbx
jmp 0x3f56
jmp 0x3f47
jmp 0x3f47
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x4ba6
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x3f6b
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2260
nop