// File: /workspace/github_cpp_makefile_star2_O1/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 0x7c54
movq %rbx, %rdi
callq 0x53e0
xorpd %xmm0, %xmm0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4c18
leaq -0x2a0(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x2b0(%rbp), %rdi
callq 0x2bfe
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 0x2bfe
leaq -0x48(%rbp), %rdi
leaq -0x2b0(%rbp), %rdx
movq %rbx, %rsi
callq 0x7de2
movq -0x250(%rbp), %rdi
cmpq %r12, %rdi
je 0xaec2
callq 0x21f0
movq -0x2b0(%rbp), %rdi
cmpq %r15, %rdi
je 0xaed3
callq 0x21f0
leaq -0x48(%rbp), %r15
cmpq %r15, -0x48(%rbp)
je 0xb1e8
leaq -0x230(%rbp), %r13
leaq -0x80(%rbp), %r14
leaq -0x68(%rbp), %r12
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x7cce
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4f1e
leaq -0xb0(%rbp), %rdi
movq %rax, %rsi
callq 0x66b0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4f6a
movq %r14, %rdi
movq %rax, %rsi
callq 0x655c
movq -0x98(%rbp), %r15
leaq -0xa8(%rbp), %rax
cmpq %rax, %r15
je 0xb17e
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x2bfe
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 0x2bfe
movq %r12, %rdi
movq %r14, %rsi
callq 0x655c
leaq -0x1b0(%rbp), %rdi
movq %r12, %rsi
callq 0xad34
movsd %xmm0, -0x30(%rbp)
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0xaffc
movq (%rdi), %r13
callq 0x21f0
movq %r13, %rdi
cmpq %r12, %r13
jne 0xafec
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0xb014
callq 0x21f0
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
cmpq %rax, %rdi
je 0xb02c
callq 0x21f0
leaq 0x20(%r15), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4d8e
movsd %xmm0, -0x50(%rbp)
movq %rbx, %rdi
leaq -0x230(%rbp), %rsi
callq 0x4d8e
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 0xb08e
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4d8e
ucomisd 0x400e(%rip), %xmm0     # 0xf090
jne 0xb16e
jp 0xb16e
movq %rbx, %rdi
leaq -0x230(%rbp), %rsi
callq 0x4d8e
addsd -0x30(%rbp), %xmm0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4c18
leaq -0x120(%rbp), %rax
movq %rax, -0x130(%rbp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
leaq -0x130(%rbp), %rdi
callq 0x2bfe
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 0x2bfe
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
leaq -0x130(%rbp), %rdx
callq 0x7e0c
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xb156
callq 0x21f0
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xb16e
callq 0x21f0
movq %r15, %rdi
callq 0x2280
movq %rax, %r15
jmp 0xaf35
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0xb197
movq (%rdi), %r15
callq 0x21f0
movq %r15, %rdi
cmpq %r14, %r15
jne 0xb187
leaq -0xb0(%rbp), %rdi
callq 0x2d76
movq -0x1d0(%rbp), %rdi
leaq -0x1c0(%rbp), %rax
cmpq %rax, %rdi
je 0xb1bb
callq 0x21f0
movq -0x230(%rbp), %rdi
leaq -0x220(%rbp), %rax
cmpq %rax, %rdi
leaq -0x48(%rbp), %r15
leaq -0x230(%rbp), %r13
je 0xb1de
callq 0x21f0
cmpq %r15, -0x48(%rbp)
jne 0xaef0
leaq -0x48(%rbp), %rdi
callq 0x7f3e
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 0xb2e3
movq %rax, %rbx
movq -0x2b0(%rbp), %rdi
cmpq %r15, %rdi
je 0xb2e8
callq 0x21f0
jmp 0xb2e8
jmp 0xb231
movq %rax, %rbx
jmp 0xb2e8
movq %rax, %rbx
jmp 0xb2d0
movq %rax, %rbx
jmp 0xb2dc
movq %rax, %rbx
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
jmp 0xb2a8
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
jmp 0xb290
movq %rax, %rbx
jmp 0xb289
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0xb289
movq (%rdi), %r15
callq 0x21f0
movq %r15, %rdi
cmpq %r12, %r15
jne 0xb279
leaq -0x1b0(%rbp), %rdi
callq 0x2b90
jmp 0xb2b7
movq %rax, %rbx
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
cmpq %rax, %rdi
je 0xb2b7
callq 0x21f0
jmp 0xb2b7
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0xb2d0
movq (%rdi), %r15
callq 0x21f0
movq %r15, %rdi
cmpq %r14, %r15
jne 0xb2c0
leaq -0xb0(%rbp), %rdi
callq 0x2d76
leaq -0x230(%rbp), %rdi
callq 0x2b90
leaq -0x48(%rbp), %rdi
callq 0x7f3e
movq %rbx, %rdi
callq 0x2380