// File: flastest[P]HeterogeneousParallelDijkstra/workloads.cc
// Function: test6(bool)
bool test6(bool TEST_DEBUG)
{
	const int num_nodes = 3;
	enum nodes { A, B, C};
	Edge edge_array[] = { 
			Edge(A, B), 
			Edge(B, C),
			Edge(C, B)
	};
	int weights[] = { 
		2, 3, 2
	};
	int num_arcs = sizeof(edge_array) / sizeof(Edge);

	//the graph
	graph_t g(edge_array, edge_array + num_arcs, weights, num_nodes);

	// Keeps track of the predecessor of each vertex
	predecessor_map_t p;
	// Keeps track of the distance to each vertex
	std::vector<int> d(num_vertices(g));



	// test6a, with source A.
	vertex_descriptor s = vertex(A, g);

	auto distances = dijkstra_algorithm(g, s, p);

	vector<float> true_distances = { 0, 2, 5};
	if (TEST_DEBUG) cout << "test6a\n" << print_dijkstra_results(g,distances);
	for (int i = 0; i < num_nodes; i++)
	{
		if (distances[vertex(i,g)] != true_distances[i]){
			return false;
		}
	}

	// test6b, with source B.
	s = vertex(B, g);

	distances = dijkstra_algorithm(g, s, p);

	true_distances = {INFINITY, 0, 3};
	if (TEST_DEBUG) cout << "test6b\n" << print_dijkstra_results(g,distances);
	for (int i = 0; i < num_nodes; i++)
	{
		if (distances[vertex(i,g)] != true_distances[i]){
			return false;
		}
	}


	// test6c, with source C.
	s = vertex(C, g);

	distances = dijkstra_algorithm(g, s, p);

	true_distances = {INFINITY, 2, 0};
	if (TEST_DEBUG) cout << "test6c\n" << print_dijkstra_results(g,distances);
	for (int i = 0; i < num_nodes; i++)
	{
		if (distances[vertex(i,g)] != true_distances[i]){
			return false;
		}
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x480, %rsp            # imm = 0x480
movb %dil, %al
andb $0x1, %al
movb %al, -0x2(%rbp)
movl $0x3, -0x8(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x1, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
movq %rdi, -0x3e0(%rbp)
leaq -0x24(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0xa210
leaq -0x18(%rbp), %rdi
movl $0x1, -0x2c(%rbp)
movl $0x2, -0x30(%rbp)
leaq -0x2c(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0xa210
leaq -0x10(%rbp), %rdi
movl $0x2, -0x34(%rbp)
movl $0x1, -0x38(%rbp)
leaq -0x34(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xa210
movq -0x3e0(%rbp), %rsi
movabsq $0x300000002, %rax      # imm = 0x300000002
movq %rax, -0x48(%rbp)
movl $0x2, -0x40(%rbp)
movl $0x3, -0x4c(%rbp)
movslq -0x4c(%rbp), %rax
leaq -0x20(%rbp,%rax,8), %rdx
movq %rsp, %rax
leaq -0x89(%rbp), %rcx
movq %rcx, (%rax)
xorl %eax, %eax
movl %eax, %r9d
leaq -0x88(%rbp), %rdi
movq %rdi, -0x3d8(%rbp)
leaq -0x48(%rbp), %rcx
movl $0x3, %r8d
callq 0xb180
leaq -0xc0(%rbp), %rdi
callq 0xb210
movq -0x3d8(%rbp), %rdi
callq 0xae10
movq %rax, -0x3d0(%rbp)
jmp 0x98fa
leaq -0xe5(%rbp), %rdi
movq %rdi, -0x3e8(%rbp)
callq 0xae50
movq -0x3d0(%rbp), %rsi
movq -0x3e8(%rbp), %rdx
leaq -0xd8(%rbp), %rdi
callq 0xae70
jmp 0x9929
leaq -0xe5(%rbp), %rdi
callq 0xaee0
xorl %eax, %eax
movl %eax, %edi
leaq -0x88(%rbp), %rsi
callq 0xb230
movq %rax, -0x3f0(%rbp)
jmp 0x994e
movq -0x3f0(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq 0x3498d(%rip), %rax     # 0x3e2f0
leaq -0x120(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
callq *%rax
jmp 0x9983
movl $0x0, -0x154(%rbp)
movl $0x40000000, -0x150(%rbp) # imm = 0x40000000
movl $0x40a00000, -0x14c(%rbp) # imm = 0x40A00000
leaq -0x154(%rbp), %rax
movq %rax, -0x148(%rbp)
movq $0x3, -0x140(%rbp)
leaq -0x155(%rbp), %rdi
movq %rdi, -0x3f8(%rbp)
callq 0xb5d0
movq -0x3f8(%rbp), %rcx
movq -0x148(%rbp), %rsi
movq -0x140(%rbp), %rdx
leaq -0x138(%rbp), %rdi
callq 0xb5f0
jmp 0x99f0
leaq -0x155(%rbp), %rdi
callq 0xb670
testb $0x1, -0x2(%rbp)
je 0x9b94
movq 0x345bb(%rip), %rdi     # 0x3dfc8
leaq 0x1f68a(%rip), %rsi     # 0x2909e
callq 0x4310
movq %rax, -0x400(%rbp)
jmp 0x9a22
leaq -0x1b0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xb300
jmp 0x9a37
leaq -0x1e0(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xb3d0
jmp 0x9a4c
leaq -0x178(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
callq 0x4970
jmp 0x9a68
movq -0x400(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x42f0
jmp 0x9a7d
leaq -0x178(%rbp), %rdi
callq 0x41e0
leaq -0x1e0(%rbp), %rdi
callq 0xb400
leaq -0x1b0(%rbp), %rdi
callq 0xb380
jmp 0x9b94
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0xa1e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0xe5(%rbp), %rdi
callq 0xaee0
jmp 0xa1e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0xa1dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x155(%rbp), %rdi
callq 0xb670
jmp 0xa1d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0xa1c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x9b83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x9b77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x41e0
leaq -0x1e0(%rbp), %rdi
callq 0xb400
leaq -0x1b0(%rbp), %rdi
callq 0xb380
jmp 0xa1c4
movl $0x0, -0x1e4(%rbp)
cmpl $0x3, -0x1e4(%rbp)
jge 0x9c51
movslq -0x1e4(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xb230
movq %rax, -0x408(%rbp)
jmp 0x9bc7
movq -0x408(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0xad00
movq %rax, -0x410(%rbp)
jmp 0x9bf1
movq -0x410(%rbp), %rax
movss (%rax), %xmm0
movss %xmm0, -0x414(%rbp)
movslq -0x1e4(%rbp), %rsi
leaq -0x138(%rbp), %rdi
callq 0xb690
movss -0x414(%rbp), %xmm0
ucomiss (%rax), %xmm0
jne 0x9c28
jp 0x9c28
jmp 0x9c3b
movb $0x0, -0x1(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0xa17a
jmp 0x9c3d
movl -0x1e4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e4(%rbp)
jmp 0x9b9e
movl $0x1, %edi
leaq -0x88(%rbp), %rsi
callq 0xb230
movq %rax, -0x420(%rbp)
jmp 0x9c6b
movq -0x420(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq 0x34670(%rip), %rax     # 0x3e2f0
leaq -0x228(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
callq *%rax
jmp 0x9ca0
leaq -0x120(%rbp), %rdi
leaq -0x228(%rbp), %rsi
movq %rsi, -0x428(%rbp)
callq 0xb420
movq -0x428(%rbp), %rdi
callq 0xb400
movl $0x7f800000, -0x244(%rbp) # imm = 0x7F800000
movl $0x0, -0x240(%rbp)
movl $0x40400000, -0x23c(%rbp) # imm = 0x40400000
leaq -0x244(%rbp), %rax
movq %rax, -0x238(%rbp)
movq $0x3, -0x230(%rbp)
movq -0x238(%rbp), %rsi
movq -0x230(%rbp), %rdx
leaq -0x138(%rbp), %rdi
callq 0xb6b0
jmp 0x9d19
testb $0x1, -0x2(%rbp)
je 0x9e23
movq 0x3429e(%rip), %rdi     # 0x3dfc8
leaq 0x1f375(%rip), %rsi     # 0x290a6
callq 0x4310
movq %rax, -0x430(%rbp)
jmp 0x9d3f
leaq -0x2a0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xb300
jmp 0x9d54
leaq -0x2d0(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xb3d0
jmp 0x9d69
leaq -0x268(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
leaq -0x2d0(%rbp), %rdx
callq 0x4970
jmp 0x9d85
movq -0x430(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x42f0
jmp 0x9d9a
leaq -0x268(%rbp), %rdi
callq 0x41e0
leaq -0x2d0(%rbp), %rdi
callq 0xb400
leaq -0x2a0(%rbp), %rdi
callq 0xb380
jmp 0x9e23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x9e12
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x9e06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x41e0
leaq -0x2d0(%rbp), %rdi
callq 0xb400
leaq -0x2a0(%rbp), %rdi
callq 0xb380
jmp 0xa1c4
movl $0x0, -0x2d4(%rbp)
cmpl $0x3, -0x2d4(%rbp)
jge 0x9ee0
movslq -0x2d4(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xb230
movq %rax, -0x438(%rbp)
jmp 0x9e56
movq -0x438(%rbp), %rax
movq %rax, -0x2e0(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0xad00
movq %rax, -0x440(%rbp)
jmp 0x9e80
movq -0x440(%rbp), %rax
movss (%rax), %xmm0
movss %xmm0, -0x444(%rbp)
movslq -0x2d4(%rbp), %rsi
leaq -0x138(%rbp), %rdi
callq 0xb690
movss -0x444(%rbp), %xmm0
ucomiss (%rax), %xmm0
jne 0x9eb7
jp 0x9eb7
jmp 0x9eca
movb $0x0, -0x1(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0xa17a
jmp 0x9ecc
movl -0x2d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2d4(%rbp)
jmp 0x9e2d
movl $0x2, %edi
leaq -0x88(%rbp), %rsi
callq 0xb230
movq %rax, -0x450(%rbp)
jmp 0x9efa
movq -0x450(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq 0x343e1(%rip), %rax     # 0x3e2f0
leaq -0x310(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
callq *%rax
jmp 0x9f2f
leaq -0x120(%rbp), %rdi
leaq -0x310(%rbp), %rsi
movq %rsi, -0x458(%rbp)
callq 0xb420
movq -0x458(%rbp), %rdi
callq 0xb400
movl $0x7f800000, -0x32c(%rbp) # imm = 0x7F800000
movl $0x40000000, -0x328(%rbp) # imm = 0x40000000
movl $0x0, -0x324(%rbp)
leaq -0x32c(%rbp), %rax
movq %rax, -0x320(%rbp)
movq $0x3, -0x318(%rbp)
movq -0x320(%rbp), %rsi
movq -0x318(%rbp), %rdx
leaq -0x138(%rbp), %rdi
callq 0xb6b0
jmp 0x9fa8
testb $0x1, -0x2(%rbp)
je 0xa0b2
movq 0x3400f(%rip), %rdi     # 0x3dfc8
leaq 0x1f0ee(%rip), %rsi     # 0x290ae
callq 0x4310
movq %rax, -0x460(%rbp)
jmp 0x9fce
leaq -0x388(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xb300
jmp 0x9fe3
leaq -0x3b8(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xb3d0
jmp 0x9ff8
leaq -0x350(%rbp), %rdi
leaq -0x388(%rbp), %rsi
leaq -0x3b8(%rbp), %rdx
callq 0x4970
jmp 0xa014
movq -0x460(%rbp), %rdi
leaq -0x350(%rbp), %rsi
callq 0x42f0
jmp 0xa029
leaq -0x350(%rbp), %rdi
callq 0x41e0
leaq -0x3b8(%rbp), %rdi
callq 0xb400
leaq -0x388(%rbp), %rdi
callq 0xb380
jmp 0xa0b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0xa0a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0xa095
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x350(%rbp), %rdi
callq 0x41e0
leaq -0x3b8(%rbp), %rdi
callq 0xb400
leaq -0x388(%rbp), %rdi
callq 0xb380
jmp 0xa1c4
movl $0x0, -0x3bc(%rbp)
cmpl $0x3, -0x3bc(%rbp)
jge 0xa16c
movslq -0x3bc(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xb230
movq %rax, -0x468(%rbp)
jmp 0xa0e5
movq -0x468(%rbp), %rax
movq %rax, -0x3c8(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x3c8(%rbp), %rsi
callq 0xad00
movq %rax, -0x470(%rbp)
jmp 0xa10f
movq -0x470(%rbp), %rax
movss (%rax), %xmm0
movss %xmm0, -0x474(%rbp)
movslq -0x3bc(%rbp), %rsi
leaq -0x138(%rbp), %rdi
callq 0xb690
movss -0x474(%rbp), %xmm0
ucomiss (%rax), %xmm0
jne 0xa146
jp 0xa146
jmp 0xa156
movb $0x0, -0x1(%rbp)
movl $0x1, -0x1f4(%rbp)
jmp 0xa17a
jmp 0xa158
movl -0x3bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3bc(%rbp)
jmp 0xa0bc
movb $0x1, -0x1(%rbp)
movl $0x1, -0x1f4(%rbp)
leaq -0x138(%rbp), %rdi
callq 0xb700
leaq -0x120(%rbp), %rdi
callq 0xb400
leaq -0xd8(%rbp), %rdi
callq 0xb120
leaq -0xc0(%rbp), %rdi
callq 0xb530
leaq -0x88(%rbp), %rdi
callq 0xb380
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x480, %rsp            # imm = 0x480
popq %rbp
retq
leaq -0x138(%rbp), %rdi
callq 0xb700
leaq -0x120(%rbp), %rdi
callq 0xb400
leaq -0xd8(%rbp), %rdi
callq 0xb120
leaq -0xc0(%rbp), %rdi
callq 0xb530
leaq -0x88(%rbp), %rdi
callq 0xb380
movq -0xe0(%rbp), %rdi
callq 0x4520
nopl (%rax)