// File: pollo[P]graph-partitioning/graph.cpp
// Function: Graph::get_nodes_bfs(std::vector<int, std::allocator<int>>*) const
void Graph::get_nodes_bfs(vector<int>* nodes) const {
  vector<bool> visited(counted_nodes_number, false);
  queue<int> q;

  nodes->reserve(counted_nodes_number);

  for (int i=0; i<counted_nodes_number; i++)
  {
    if (!visited[i])
    {
      visited[i] = true;
      q.push(i);
      while (!q.empty())
      {
        int node = q.front();
        nodes->push_back(node);
        q.pop();
        for (vector<int>::const_iterator neighbor =
               get_neighbors(node).begin();
             neighbor != get_neighbors(node).end();
             ++neighbor)
        {
          if (!visited[*neighbor])
          {
            visited[*neighbor] = true;
            q.push(*neighbor);
          }
        }
      }
    }
  }

  printf("%d %d\n",counted_nodes_number, (int)nodes->size());
}

// Assembly:
subq $0x178, %rsp            # imm = 0x178
movq %rdi, 0x170(%rsp)
movq %rsi, 0x168(%rsp)
movq 0x170(%rsp), %rax
movq %rax, 0x60(%rsp)
movslq 0x8(%rax), %rax
movq %rax, 0x68(%rsp)
movb $0x0, 0x13f(%rsp)
leaq 0x13e(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x4210
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rcx
leaq 0x140(%rsp), %rdi
leaq 0x13f(%rsp), %rdx
callq 0x4220
jmp 0x33f8
leaq 0x13e(%rsp), %rdi
callq 0x42a0
leaq 0xd8(%rsp), %rdi
callq 0x42b0
jmp 0x3414
movq 0x60(%rsp), %rax
movq 0x168(%rsp), %rdi
movslq 0x8(%rax), %rsi
callq 0x42e0
jmp 0x342c
movl $0x0, 0xd4(%rsp)
movq 0x60(%rsp), %rcx
movl 0xd4(%rsp), %eax
cmpl 0x8(%rcx), %eax
jge 0x3732
movslq 0xd4(%rsp), %rsi
leaq 0x140(%rsp), %rdi
callq 0x43f0
movq %rdx, 0x50(%rsp)
movq %rax, 0x58(%rsp)
jmp 0x346d
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
movq %rcx, 0xc0(%rsp)
movq %rax, 0xc8(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x4450
xorb $-0x1, %al
testb $0x1, %al
jne 0x349f
jmp 0x371a
movslq 0xd4(%rsp), %rsi
leaq 0x140(%rsp), %rdi
callq 0x43f0
movq %rdx, 0x40(%rsp)
movq %rax, 0x48(%rsp)
jmp 0x34c0
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rcx, 0xb0(%rsp)
movq %rax, 0xb8(%rsp)
leaq 0xb0(%rsp), %rdi
movl $0x1, %esi
callq 0x4480
leaq 0xd8(%rsp), %rdi
leaq 0xd4(%rsp), %rsi
callq 0x44d0
jmp 0x3503
jmp 0x3505
leaq 0xd8(%rsp), %rdi
callq 0x4500
movb %al, 0x3f(%rsp)
jmp 0x3518
movb 0x3f(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3527
jmp 0x3718
leaq 0xd8(%rsp), %rdi
callq 0x4520
movq %rax, 0x30(%rsp)
jmp 0x353b
movq 0x30(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xac(%rsp)
movq 0x168(%rsp), %rdi
leaq 0xac(%rsp), %rsi
callq 0x3ee0
jmp 0x3560
leaq 0xd8(%rsp), %rdi
callq 0x4530
jmp 0x356f
movq 0x60(%rsp), %rdi
movl 0xac(%rsp), %esi
callq 0x3280
movq %rax, %rdi
callq 0x3f50
movq %rax, 0xa0(%rsp)
movq 0x60(%rsp), %rdi
movl 0xac(%rsp), %esi
callq 0x3280
movq %rax, %rdi
callq 0x3fc0
movq %rax, 0x98(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x3f80
testb $0x1, %al
jne 0x35cf
jmp 0x3713
leaq 0xa0(%rsp), %rdi
callq 0x3ff0
movslq (%rax), %rsi
leaq 0x140(%rsp), %rdi
callq 0x43f0
movq %rdx, 0x20(%rsp)
movq %rax, 0x28(%rsp)
jmp 0x35f8
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, 0x88(%rsp)
movq %rax, 0x90(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x4450
xorb $-0x1, %al
testb $0x1, %al
jne 0x362a
jmp 0x36ff
leaq 0xa0(%rsp), %rdi
callq 0x3ff0
movslq (%rax), %rsi
leaq 0x140(%rsp), %rdi
callq 0x43f0
movq %rdx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
jmp 0x3653
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, 0x78(%rsp)
movq %rax, 0x80(%rsp)
leaq 0x78(%rsp), %rdi
movl $0x1, %esi
callq 0x4480
leaq 0xa0(%rsp), %rdi
callq 0x3ff0
movq %rax, %rsi
leaq 0xd8(%rsp), %rdi
callq 0x44d0
jmp 0x3698
jmp 0x36ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
leaq 0x13e(%rsp), %rdi
callq 0x42a0
jmp 0x3790
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
jmp 0x3783
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x4580
jmp 0x3783
jmp 0x3701
leaq 0xa0(%rsp), %rdi
callq 0x4540
jmp 0x3590
jmp 0x3505
jmp 0x371a
jmp 0x371c
movl 0xd4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd4(%rsp)
jmp 0x3437
movq 0x60(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x168(%rsp), %rdi
callq 0x4560
movl 0xc(%rsp), %esi
movl %eax, %edx
leaq 0x8b0b(%rip), %rdi      # 0xc263
xorl %eax, %eax
callq 0x2030
jmp 0x3761
leaq 0xd8(%rsp), %rdi
callq 0x4580
leaq 0x140(%rsp), %rdi
callq 0x4590
addq $0x178, %rsp            # imm = 0x178
retq
leaq 0x140(%rsp), %rdi
callq 0x4590
movq 0x130(%rsp), %rdi
callq 0x2270
nopl (%rax)