// File: /workspace/github_cpp_makefile_star2_O2/jkeys-ecg-nmsu[P]graph-with-search-algorithms/Dijkstra.cpp
// Function: Dijkstra_list(Graph&, Node&)
void Dijkstra_list(Graph & g, Node & s) {
	ListPriorityQueue q(g);
	
	g.resetAllDist();	
	g.setDist(s, 0); //s is the root 

	q.insert(g, s);
	
	while ( !q.empty() ) {
		Node u = q.remove_min(g);
		
		set<Node> uAdjNodes = g.getAdjNodes(u);
		list<Edge> uEdges = g.getEdges(u);
		
		// for every adjacent node v: (u)--->(v)
		for(set<Node>::iterator v = uAdjNodes.begin(); v != uAdjNodes.end(); v++) {
			int edgeWeight = findEdgeWeight(*v, uEdges);

			if(g.dist(*v) > g.dist(u) + edgeWeight || g.dist(*v) == M_INFINITY) {		//if v has not been visited
				g.setDist(*v, g.dist(u) + edgeWeight);	//v.dist == u.dist + 1
				q.change_priority(g, *v);						//push the adjacent node to back of the queue
			}
		} //end adjNodes loop
	} //end while	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x6b50
movq %rbx, %rdi
callq 0x45f0
xorpd %xmm0, %xmm0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3fba
leaq -0x1b0(%rbp), %rdi
movq %r14, %rsi
callq 0x28ba
leaq -0x48(%rbp), %r15
leaq -0x1b0(%rbp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6c48
leaq -0x1b0(%rbp), %rdi
callq 0x2918
leaq -0x2b0(%rbp), %r12
leaq -0xb0(%rbp), %r14
cmpq %r15, -0x48(%rbp)
je 0x8ecd
leaq -0x130(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6bb6
movq %rbx, %rdi
movq %r13, %rsi
callq 0x428a
leaq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x5516
movq %rbx, %rdi
movq %r13, %rsi
callq 0x42ce
leaq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x53ec
movq -0x80(%rbp), %r15
leaq -0x90(%rbp), %rax
cmpq %rax, %r15
je 0x8ea3
leaq 0x20(%r15), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x28ba
movq %r14, %rdi
leaq -0x68(%rbp), %rsi
callq 0x53ec
movq %r12, %rdi
movq %r14, %rsi
callq 0x8c54
movsd %xmm0, -0x30(%rbp)
movq %r14, %rdi
callq 0x2a4a
movq %r12, %rdi
callq 0x2918
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4106
movsd %xmm0, -0x50(%rbp)
movq %rbx, %rdi
leaq -0x130(%rbp), %rsi
callq 0x4106
cvttsd2si -0x30(%rbp), %eax
cvtsi2sd %eax, %xmm1
movsd %xmm1, -0x30(%rbp)
addsd %xmm1, %xmm0
movsd -0x50(%rbp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x8e47
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4106
ucomisd 0x2225(%rip), %xmm0     # 0xb068
jne 0x8e93
jp 0x8e93
movq %rbx, %rdi
leaq -0x130(%rbp), %rsi
callq 0x4106
addsd -0x30(%rbp), %xmm0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3fba
leaq -0x230(%rbp), %rdi
movq %r13, %rsi
callq 0x28ba
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
leaq -0x230(%rbp), %r13
movq %r13, %rdx
callq 0x6c56
movq %r13, %rdi
callq 0x2918
movq %r15, %rdi
callq 0x2260
movq %rax, %r15
jmp 0x8da9
leaq -0x68(%rbp), %rdi
callq 0x2a4a
leaq -0x98(%rbp), %rdi
callq 0x2aa8
leaq -0x130(%rbp), %rdi
callq 0x2918
leaq -0x48(%rbp), %r15
jmp 0x8d55
leaq -0x48(%rbp), %rdi
callq 0x6cf8
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x1b0(%rbp), %rdi
jmp 0x8f52
jmp 0x8ef6
movq %rax, %rbx
jmp 0x8f57
movq %rax, %rbx
jmp 0x8f4b
movq %rax, %rbx
jmp 0x8f3f
movq %rax, %rbx
leaq -0x230(%rbp), %rdi
jmp 0x8f2c
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x2a4a
jmp 0x8f25
movq %rax, %rbx
leaq -0x2b0(%rbp), %rdi
callq 0x2918
jmp 0x8f36
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x2a4a
leaq -0x98(%rbp), %rdi
callq 0x2aa8
leaq -0x130(%rbp), %rdi
callq 0x2918
leaq -0x48(%rbp), %rdi
callq 0x6cf8
movq %rbx, %rdi
callq 0x2370