// File: 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
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x120(%rbp)
leaq -0xc(%rbp), %rsi
callq 0x6060
movq -0x120(%rbp), %rdi
movq %rax, -0x28(%rbp)
callq 0x59a0
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x6030
testb $0x1, %al
jne 0x46d5
jmp 0x46f7
movq 0x188ec(%rip), %rdi     # 0x1cfc8
leaq 0xe967(%rip), %rsi      # 0x1304a
callq 0x2190
movq %rax, %rdi
movq 0x188c6(%rip), %rsi     # 0x1cfb8
callq 0x21d0
leaq -0x48(%rbp), %rdi
callq 0x5ca0
leaq -0x98(%rbp), %rdi
callq 0x5c70
jmp 0x470e
leaq -0x98(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x5cc0
jmp 0x4720
leaq -0x48(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x5ea0
jmp 0x472f
jmp 0x4731
leaq -0x98(%rbp), %rdi
callq 0x5d20
movb %al, -0x121(%rbp)
jmp 0x4745
movb -0x121(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x4756
jmp 0x4906
leaq -0x98(%rbp), %rdi
callq 0x5f10
movq %rax, -0x130(%rbp)
jmp 0x476b
movq -0x130(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xa8(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5f30
jmp 0x4788
movq -0x120(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x5890
movq %rax, -0x138(%rbp)
jmp 0x47a4
movq -0x138(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x5a70
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x5aa0
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x5ad0
testb $0x1, %al
jne 0x47f4
jmp 0x4901
leaq -0xb8(%rbp), %rdi
callq 0x5b00
movq %rax, -0xc8(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x61e0
movq -0x148(%rbp), %rdi
movq %rax, -0xd8(%rbp)
callq 0x6210
movq %rax, -0xe0(%rbp)
movq -0xc8(%rbp), %rdx
movq -0xd8(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0x6190
movq %rax, -0x140(%rbp)
jmp 0x4854
movq -0x140(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x6210
movq %rax, -0xe8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x6150
testb $0x1, %al
jne 0x488b
jmp 0x48ee
movq -0xc8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x5ea0
jmp 0x489d
movq -0xc8(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x5cc0
jmp 0x48b2
jmp 0x48ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x49df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5ff0
jmp 0x49df
jmp 0x48f0
leaq -0xb8(%rbp), %rdi
callq 0x5b20
jmp 0x47d8
jmp 0x4731
movq -0x20(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5f50
movq -0x150(%rbp), %rdi
movl %eax, -0xec(%rbp)
leaq -0xec(%rbp), %rsi
callq 0x6280
jmp 0x4935
movq -0x18(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x6210
movq %rax, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x6360
leaq -0x48(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x61e0
movq -0x168(%rbp), %rdi
movq %rax, -0x108(%rbp)
callq 0x6210
movq -0x160(%rbp), %rdi
movq %rax, -0x110(%rbp)
movq -0xf8(%rbp), %rsi
movq -0x108(%rbp), %rdx
movq -0x110(%rbp), %rcx
callq 0x62b0
movq %rax, -0x158(%rbp)
jmp 0x49b3
movq -0x158(%rbp), %rax
movq %rax, -0x118(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5ff0
leaq -0x48(%rbp), %rdi
callq 0x5f90
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x5f90
movq -0xa0(%rbp), %rdi
callq 0x22c0
nopw %cs:(%rax,%rax)