// File: /workspace/github_cpp_makefile_star2_O1/Manca[P]algorithms1/./assignment5.hpp
// Function: assignment5::computeShortestPaths()
void computeShortestPaths()
    {
        if (_G.size() == 0)
            return;
        
        while (_processed_so_far.size() != _G.size())
        {
            // for each edge (u, v) where u in X and v not in X
            std::pair<int,int> min_pair;
            int local_min = -1;
            for (int vertex : _processed_so_far)
            {
                for (auto edge : _G[vertex])
                {
                    // target vertex (v) is not in X
                    if (std::find(_processed_so_far.begin(), _processed_so_far.end(), edge.first) == _processed_so_far.end())
                    {
                        if (local_min == -1 || _shortest_paths[vertex] + edge.second < local_min)
                        {
                            min_pair = edge;
                            local_min = _shortest_paths[vertex] + edge.second;
                        }
                    }
                }
            }
            _processed_so_far.push_back(min_pair.first);
            _shortest_paths[min_pair.first] = local_min;
        }
        
        // reporting shortest paths for: 7,37,59,82,99,115,133,165,188,197
        cout << "Dijkstra's algorithm computed shortest paths to nodes 7,37,59,82,99,115,133,165,188,197: " << endl;
        cout << _shortest_paths[7] << ", ";
        cout << _shortest_paths[37] << ", ";
        cout << _shortest_paths[59] << ", ";
        cout << _shortest_paths[82] << ", ";
        cout << _shortest_paths[99] << ", ";
        cout << _shortest_paths[115] << ", ";
        cout << _shortest_paths[133] << ", ";
        cout << _shortest_paths[165] << ", ";
        cout << _shortest_paths[188] << ", ";
        cout << _shortest_paths[197] << ", respectively." << endl;
    }

// Assembly:
cmpq $0x0, 0x9864(%rip)      # 0xe278
je 0x4d60
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x9871(%rip), %rbp      # 0xe2a0
movq 0x9862(%rip), %rbx      # 0xe298
movq %rbp, %rax
subq %rbx, %rax
sarq $0x2, %rax
cmpq 0x9831(%rip), %rax      # 0xe278
je 0x4b6c
leaq 0x10(%rsp), %r13
movq $0x0, 0x8(%rsp)
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpq %rbp, %rbx
je 0x4b03
movl (%rbx), %eax
movl %eax, 0x4(%rsp)
leaq 0x97d9(%rip), %rdi      # 0xe250
leaq 0x4(%rsp), %rsi
callq 0x6482
movq (%rax), %r15
movq 0x8(%rax), %r12
cmpq %r12, %r15
je 0x4afa
movq (%r15), %rax
movq %rax, 0x10(%rsp)
movq 0x97fc(%rip), %rdi      # 0xe298
movq 0x97fd(%rip), %rsi      # 0xe2a0
movq %r13, %rdx
callq 0x8ce4
cmpq 0x97ee(%rip), %rax      # 0xe2a0
jne 0x4af4
cmpl $-0x1, %r14d
je 0x4ad2
movslq 0x4(%rsp), %rax
movq 0x97ba(%rip), %rcx      # 0xe280
movl 0x14(%rsp), %edx
addl (%rcx,%rax,4), %edx
cmpl %r14d, %edx
jge 0x4af4
movl 0x10(%rsp), %eax
movl 0x14(%rsp), %r14d
movl %eax, 0x8(%rsp)
movl %r14d, 0xc(%rsp)
movslq 0x4(%rsp), %rax
movq 0x9790(%rip), %rcx      # 0xe280
addl (%rcx,%rax,4), %r14d
addq $0x8, %r15
jmp 0x4a88
addq $0x4, %rbx
jmp 0x4a61
movq 0x9796(%rip), %rsi      # 0xe2a0
cmpq 0x9797(%rip), %rsi      # 0xe2a8
je 0x4b26
movl 0x8(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x977c(%rip)      # 0xe2a0
jmp 0x4b37
leaq 0x976b(%rip), %rdi      # 0xe298
leaq 0x8(%rsp), %rdx
callq 0x739e
movslq 0x8(%rsp), %rax
movq 0x973d(%rip), %rcx      # 0xe280
movl %r14d, (%rcx,%rax,4)
movq 0x9752(%rip), %rbp      # 0xe2a0
movq 0x9743(%rip), %rbx      # 0xe298
movq %rbp, %rax
subq %rbx, %rax
sarq $0x2, %rax
cmpq 0x9712(%rip), %rax      # 0xe278
jne 0x4a52
movq 0x9465(%rip), %rbx      # 0xdfd8
leaq 0x5783(%rip), %rsi      # 0xa2fd
movl $0x59, %edx
movq %rbx, %rdi
callq 0x2200
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
movq 0x96cb(%rip), %rax      # 0xe280
movl 0x1c(%rax), %esi
movq %rbx, %rdi
callq 0x2300
leaq 0x5790(%rip), %r14      # 0xa357
movl $0x2, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq 0x96a2(%rip), %rax      # 0xe280
movl 0x94(%rax), %esi
movq %rbx, %rdi
callq 0x2300
movl $0x2, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq 0x967d(%rip), %rax      # 0xe280
movl 0xec(%rax), %esi
movq %rbx, %rdi
callq 0x2300
movl $0x2, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq 0x9658(%rip), %rax      # 0xe280
movl 0x148(%rax), %esi
movq %rbx, %rdi
callq 0x2300
movl $0x2, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq 0x9633(%rip), %rax      # 0xe280
movl 0x18c(%rax), %esi
movq %rbx, %rdi
callq 0x2300
movl $0x2, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq 0x960e(%rip), %rax      # 0xe280
movl 0x1cc(%rax), %esi
movq %rbx, %rdi
callq 0x2300
movl $0x2, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq 0x95e9(%rip), %rax      # 0xe280
movl 0x214(%rax), %esi
movq %rbx, %rdi
callq 0x2300
movl $0x2, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq 0x95c4(%rip), %rax      # 0xe280
movl 0x294(%rax), %esi
movq %rbx, %rdi
callq 0x2300
movl $0x2, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq 0x959f(%rip), %rax      # 0xe280
movl 0x2f0(%rax), %esi
movq %rbx, %rdi
callq 0x2300
movl $0x2, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq 0x957a(%rip), %rax      # 0xe280
movl 0x314(%rax), %esi
movq %rbx, %rdi
callq 0x2300
movq %rax, %rbx
leaq 0x563c(%rip), %rsi      # 0xa35a
movl $0xf, %edx
movq %rax, %rdi
callq 0x2200
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq