// File: /workspace/github_cpp_makefile_star2_O3/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 0x7cd4
movq %rbx, %rdi
callq 0x5424
xorpd %xmm0, %xmm0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4c56
leaq -0x2a0(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x2b0(%rbp), %rdi
callq 0x2c2e
movupd 0x20(%r14), %xmm0
movupd 0x30(%r14), %xmm1
movups 0x40(%r14), %xmm2
movups 0x50(%r14), %xmm3
leaq -0x250(%rbp), %rdi
movups %xmm3, -0x10(%rdi)
movups %xmm2, -0x20(%rdi)
movupd %xmm1, -0x30(%rdi)
movupd %xmm0, -0x40(%rdi)
leaq -0x240(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x60(%r14), %rsi
movq 0x68(%r14), %rdx
addq %rsi, %rdx
callq 0x2c2e
leaq -0x48(%rbp), %rdi
leaq -0x2b0(%rbp), %rdx
movq %rbx, %rsi
callq 0x7e62
movq -0x250(%rbp), %rdi
cmpq %r12, %rdi
je 0xaf2e
callq 0x21f0
movq -0x2b0(%rbp), %rdi
cmpq %r15, %rdi
je 0xaf3f
callq 0x21f0
leaq -0x48(%rbp), %r15
cmpq %r15, -0x48(%rbp)
je 0xb254
leaq -0x230(%rbp), %r13
leaq -0x80(%rbp), %r14
leaq -0x68(%rbp), %r12
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x7d4e
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4f5c
leaq -0xb0(%rbp), %rdi
movq %rax, %rsi
callq 0x6756
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4fa8
movq %r14, %rdi
movq %rax, %rsi
callq 0x6602
movq -0x98(%rbp), %r15
leaq -0xa8(%rbp), %rax
cmpq %rax, %r15
je 0xb1ea
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x2c2e
movupd 0x40(%r15), %xmm0
movupd 0x50(%r15), %xmm1
movups 0x60(%r15), %xmm2
movups 0x70(%r15), %xmm3
leaq -0x1a0(%rbp), %rax
movups %xmm3, 0x40(%rax)
movups %xmm2, 0x30(%rax)
movupd %xmm1, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
leaq -0x140(%rbp), %rax
movq %rax, -0x150(%rbp)
movq 0x80(%r15), %rsi
movq 0x88(%r15), %rdx
addq %rsi, %rdx
leaq -0x150(%rbp), %rdi
callq 0x2c2e
movq %r12, %rdi
movq %r14, %rsi
callq 0x6602
leaq -0x1b0(%rbp), %rdi
movq %r12, %rsi
callq 0xadb0
movsd %xmm0, -0x30(%rbp)
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0xb068
movq (%rdi), %r13
callq 0x21f0
movq %r13, %rdi
cmpq %r12, %r13
jne 0xb058
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0xb080
callq 0x21f0
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
cmpq %rax, %rdi
je 0xb098
callq 0x21f0
leaq 0x20(%r15), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4dcc
movsd %xmm0, -0x50(%rbp)
movq %rbx, %rdi
leaq -0x230(%rbp), %rsi
callq 0x4dcc
cvttsd2si -0x30(%rbp), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd %xmm1, -0x30(%rbp)
addsd %xmm1, %xmm0
movsd -0x50(%rbp), %xmm1
ucomisd %xmm0, %xmm1
ja 0xb0fa
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4dcc
ucomisd 0x3fa2(%rip), %xmm0     # 0xf090
jne 0xb1da
jp 0xb1da
movq %rbx, %rdi
leaq -0x230(%rbp), %rsi
callq 0x4dcc
addsd -0x30(%rbp), %xmm0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4c56
leaq -0x120(%rbp), %rax
movq %rax, -0x130(%rbp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
leaq -0x130(%rbp), %rdi
callq 0x2c2e
leaq 0x40(%r15), %rax
movupd (%rax), %xmm0
movupd 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
leaq -0x120(%rbp), %rax
movups %xmm3, 0x40(%rax)
movups %xmm2, 0x30(%rax)
movupd %xmm1, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
leaq -0xc0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq 0x80(%r15), %rsi
movq 0x88(%r15), %rdx
addq %rsi, %rdx
leaq -0xd0(%rbp), %rdi
callq 0x2c2e
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
leaq -0x130(%rbp), %rdx
callq 0x7e8c
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xb1c2
callq 0x21f0
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xb1da
callq 0x21f0
movq %r15, %rdi
callq 0x2280
movq %rax, %r15
jmp 0xafa1
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0xb203
movq (%rdi), %r15
callq 0x21f0
movq %r15, %rdi
cmpq %r14, %r15
jne 0xb1f3
leaq -0xb0(%rbp), %rdi
callq 0x2dba
movq -0x1d0(%rbp), %rdi
leaq -0x1c0(%rbp), %rax
cmpq %rax, %rdi
je 0xb227
callq 0x21f0
movq -0x230(%rbp), %rdi
leaq -0x220(%rbp), %rax
cmpq %rax, %rdi
leaq -0x48(%rbp), %r15
leaq -0x230(%rbp), %r13
je 0xb24a
callq 0x21f0
cmpq %r15, -0x48(%rbp)
jne 0xaf5c
leaq -0x48(%rbp), %rdi
callq 0x7fbe
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x2b0(%rbp), %rdi
jmp 0xb34f
movq %rax, %rbx
movq -0x2b0(%rbp), %rdi
cmpq %r15, %rdi
je 0xb354
callq 0x21f0
jmp 0xb354
jmp 0xb29d
movq %rax, %rbx
jmp 0xb354
movq %rax, %rbx
jmp 0xb33c
movq %rax, %rbx
jmp 0xb348
movq %rax, %rbx
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
jmp 0xb314
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
jmp 0xb2fc
movq %rax, %rbx
jmp 0xb2f5
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0xb2f5
movq (%rdi), %r15
callq 0x21f0
movq %r15, %rdi
cmpq %r12, %r15
jne 0xb2e5
leaq -0x1b0(%rbp), %rdi
callq 0x2bc0
jmp 0xb323
movq %rax, %rbx
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
cmpq %rax, %rdi
je 0xb323
callq 0x21f0
jmp 0xb323
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0xb33c
movq (%rdi), %r15
callq 0x21f0
movq %r15, %rdi
cmpq %r14, %r15
jne 0xb32c
leaq -0xb0(%rbp), %rdi
callq 0x2dba
leaq -0x230(%rbp), %rdi
callq 0x2bc0
leaq -0x48(%rbp), %rdi
callq 0x7fbe
movq %rbx, %rdi
callq 0x2380