// File: /workspace/github_cpp_makefile_star2_O3/guitld[P]Graph-Algorithms/source/Graph.cpp
// Function: Graph::dijkstra(int)
vector<int> Graph::dijkstra(int u){

     // Defining structures for the algorithm
     unordered_map<int, bool> visited;
     priority_queue <pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
     vector<int> dists (this->size(), 0);

     pq.push(pair<int, int> (0, u));
     
     while (!pq.empty()){
          // Popping the top of the priority queue
          pair<int,int> curr_v = pq.top();
          pq.pop();
          // Check whether the node was visited or not
          if (!visited[curr_v.second]){
               // Modifying its distance from 'u' vertex
               dists[curr_v.second - 1] = curr_v.first;
               visited[curr_v.second] = true;
               // Looping through its neighbors
               for (auto const &neighbor : this->adj_lists[curr_v.second])
                    if (!visited[neighbor.first])
                         pq.push(pair<int, int> (curr_v.first + neighbor.second, neighbor.first));
          }
     }
     
     return dists;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %edx, %ebx
movq %rdi, %r14
leaq -0x70(%rbp), %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)
movaps %xmm0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movq %rsi, -0x68(%rbp)
movslq 0x18(%rsi), %rsi
leaq -0x30(%rbp), %rdx
movl $0x0, (%rdx)
leaq -0x40(%rbp), %rcx
callq 0x49ae
leaq -0x30(%rbp), %rsi
movl $0x0, (%rsi)
movl %ebx, 0x4(%rsi)
leaq -0x60(%rbp), %rdi
callq 0x4a36
movq %r14, -0x38(%rbp)
movq -0x60(%rbp), %rdi
cmpq -0x58(%rbp), %rdi
je 0x459d
leaq -0x60(%rbp), %r12
leaq -0xa0(%rbp), %r13
leaq -0x40(%rbp), %rbx
movq (%rdi), %rax
movq %rax, -0x30(%rbp)
movq %r12, %rdi
callq 0x4ab0
movq %r13, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x62b8
cmpb $0x0, (%rax)
je 0x4532
movq -0x60(%rbp), %rdi
cmpq -0x58(%rbp), %rdi
jne 0x4506
jmp 0x459d
movl -0x30(%rbp), %eax
movslq -0x2c(%rbp), %rcx
movq -0x38(%rbp), %rdx
movq (%rdx), %rdx
movl %eax, -0x4(%rdx,%rcx,4)
movq %r13, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x62b8
movb $0x1, (%rax)
movq -0x68(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x4d1c
movq %rax, %r14
movq (%rax), %r15
cmpq %r14, %r15
je 0x4526
leaq 0x10(%r15), %rsi
movq %r13, %rdi
callq 0x62b8
cmpb $0x0, (%rax)
jne 0x4598
movl 0x14(%r15), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x40(%rbp)
movl 0x10(%r15), %eax
movl %eax, -0x3c(%rbp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4a36
movq (%r15), %r15
jmp 0x4566
testq %rdi, %rdi
je 0x45ae
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
leaq -0xa0(%rbp), %rdi
callq 0x4c94
movq -0x38(%rbp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x45e4
movq %rax, %rbx
jmp 0x45f8
jmp 0x45dd
jmp 0x45dd
jmp 0x45dd
movq %rax, %rbx
movq -0x38(%rbp), %r14
movq (%r14), %rdi
testq %rdi, %rdi
je 0x45f8
movq 0x10(%r14), %rsi
subq %rdi, %rsi
callq 0x2160
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x460d
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
leaq -0xa0(%rbp), %rdi
callq 0x4c94
movq %rbx, %rdi
callq 0x2260
nop