// File: /workspace/github_cpp_makefile_star2_O2/flastest[P]HeterogeneousParallelDijkstra/workloads.cc
// Function: test3(bool)
bool test3(bool TEST_DEBUG)
{
	const int num_nodes = 5;
	enum nodes { A, B, C, D, E };
	Edge edge_array[] = { 
			Edge(A, B), Edge(A, C), 
			Edge(B, A), Edge(B, D), 
			Edge(C, A), Edge(C, D),
			Edge(D, B), Edge(D, C),
			Edge(E,B)
	};
	int weights[] = { 
		2, 2,
		2, 2,
		2, 2,
		2, 2,
		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));



	// test3a, with source A.
	vertex_descriptor s = vertex(A, g);

	auto distances = dijkstra_algorithm(g, s, p);

	vector<float> true_distances = {0, 2, 2, 4, INFINITY};
	if (TEST_DEBUG) cout << "test3a\n" << print_dijkstra_results(g,distances);
	for (int i = 0; i < num_nodes; i++)
	{
		if (distances[vertex(i,g)] != true_distances[i]){
			return false;
		}
	}
	


	// test3b, with source B.
	s = vertex(B, g);

	distances = dijkstra_algorithm(g, s, p);

	true_distances = {2, 0, 4, 2, INFINITY};
	if (TEST_DEBUG) cout << "test3b\n" << print_dijkstra_results(g,distances);
	for (int i = 0; i < num_nodes; i++)
	{
		if (distances[vertex(i,g)] != true_distances[i]){
			return false;
		}
	}
	

	// test3c, with source C.
	s = vertex(C, g);

	distances = dijkstra_algorithm(g, s, p);

	true_distances = {2, 4, 0, 2, INFINITY};
	if (TEST_DEBUG) cout << "test3c\n" << print_dijkstra_results(g,distances);
	for (int i = 0; i < num_nodes; i++)
	{
		if (distances[vertex(i,g)] != true_distances[i]){
			return false;
		}
	}
	


	// test3d, with source D.
	s = vertex(D, g);

	distances = dijkstra_algorithm(g, s, p);

	true_distances = {4, 2, 2, 0, INFINITY};
	if (TEST_DEBUG) cout << "test3d\n" << print_dijkstra_results(g,distances);
	for (int i = 0; i < num_nodes; i++)
	{
		if (distances[vertex(i,g)] != true_distances[i]){
			return false;
		}
	}


	// test3e, with source E.
	s = vertex(E, g);

	distances = dijkstra_algorithm(g, s, p);

	true_distances = {4, 2, 6, 4, 0};
	if (TEST_DEBUG) cout << "test3c\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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x398, %rsp            # imm = 0x398
movl %edi, %ebx
movaps 0x9215(%rip), %xmm0     # 0xe010
leaq 0x398(%rsp), %rdx
movaps %xmm0, -0x48(%rdx)
movaps 0x9292(%rip), %xmm0     # 0xe0a0
movaps %xmm0, -0x38(%rdx)
movaps 0x9227(%rip), %xmm0     # 0xe040
movaps %xmm0, -0x28(%rdx)
movaps 0x928c(%rip), %xmm0     # 0xe0b0
movaps %xmm0, -0x18(%rdx)
movabsq $0x100000004, %rax      # imm = 0x100000004
movq %rax, -0x8(%rdx)
movaps 0xa783(%rip), %xmm0     # 0xf5c0
leaq 0x320(%rsp), %rcx
movaps %xmm0, 0x10(%rcx)
movaps 0xa760(%rip), %xmm0     # 0xf5b0
movaps %xmm0, (%rcx)
movl $0x2, 0x20(%rcx)
leaq 0xd0(%rsp), %rax
movq %rax, (%rsp)
leaq 0x98(%rsp), %r14
leaq 0x350(%rsp), %rsi
pushq $0x5
popq %r8
movq %r14, %rdi
xorl %r9d, %r9d
callq 0x6b18
leaq 0xd8(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq 0x20(%r14), %rsi
subq 0x18(%r14), %rsi
sarq $0x5, %rsi
leaq 0x100(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x6aba
leaq 0x48(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x68(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0xd0(%rsp), %rcx
callq *0x1236c(%rip)          # 0x17250
movups 0xa6e9(%rip), %xmm0     # 0xf5d4
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movl $0x7f800000, 0x10(%rsi) # imm = 0x7F800000
leaq 0x50(%rsp), %rdi
pushq $0x5
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x6c3c
testb %bl, %bl
je 0x4f9c
movq 0x120ad(%rip), %rdi     # 0x16fc8
leaq 0x9254(%rip), %rsi      # 0xe176
callq 0x3270
movq %rax, %r14
leaq 0x2e8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x6bac
leaq 0x1d8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e78
leaq 0x10(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
leaq 0x1d8(%rsp), %rdx
callq 0x366c
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3250
leaq 0x10(%rsp), %rdi
callq 0x3110
leaq 0x1d8(%rsp), %rdi
callq 0x70ae
leaq 0x2e8(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x68(%rsp), %r14
leaq 0x10(%rsp), %r15
cmpq $0x5, %r12
je 0x4fdf
movq %r12, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a6a
movss (%rax), %xmm0
movq 0x50(%rsp), %rax
ucomiss (%rax,%r12,4), %xmm0
leaq 0x1(%r12), %r12
jne 0x5387
jnp 0x4fa9
jmp 0x5387
leaq 0x48(%rsp), %rdx
movq $0x1, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0xd0(%rsp), %rcx
callq *0x1224a(%rip)          # 0x17250
leaq 0x68(%rsp), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x70c2
movq %r14, %rdi
callq 0x70ae
movups 0xa5c1(%rip), %xmm0     # 0xf5e8
movaps %xmm0, (%r14)
movl $0x7f800000, 0x10(%r14) # imm = 0x7F800000
leaq 0x24(%rsp), %rdx
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x95d0
testb %bl, %bl
je 0x50d7
movq 0x11f72(%rip), %rdi     # 0x16fc8
leaq 0x9121(%rip), %rsi      # 0xe17e
callq 0x3270
movq %rax, %r14
leaq 0x2b0(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x6bac
leaq 0x1a8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e78
leaq 0x10(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
leaq 0x1a8(%rsp), %rdx
callq 0x366c
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3250
leaq 0x10(%rsp), %rdi
callq 0x3110
leaq 0x1a8(%rsp), %rdi
callq 0x70ae
leaq 0x2b0(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x68(%rsp), %r14
leaq 0x10(%rsp), %r15
cmpq $0x5, %r12
je 0x511a
movq %r12, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a6a
movss (%rax), %xmm0
movq 0x50(%rsp), %rax
ucomiss (%rax,%r12,4), %xmm0
leaq 0x1(%r12), %r12
jne 0x5387
jnp 0x50e4
jmp 0x5387
leaq 0x48(%rsp), %rdx
movq $0x2, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0xd0(%rsp), %rcx
callq *0x1210f(%rip)          # 0x17250
leaq 0x68(%rsp), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x70c2
movq %r14, %rdi
callq 0x70ae
movups 0xa49a(%rip), %xmm0     # 0xf5fc
movaps %xmm0, (%r14)
movl $0x7f800000, 0x10(%r14) # imm = 0x7F800000
leaq 0x24(%rsp), %rdx
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x95d0
testb %bl, %bl
je 0x5212
movq 0x11e37(%rip), %rdi     # 0x16fc8
leaq 0x8fee(%rip), %rsi      # 0xe186
callq 0x3270
movq %rax, %r14
leaq 0x278(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x6bac
leaq 0x178(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e78
leaq 0x10(%rsp), %rdi
leaq 0x278(%rsp), %rsi
leaq 0x178(%rsp), %rdx
callq 0x366c
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3250
leaq 0x10(%rsp), %rdi
callq 0x3110
leaq 0x178(%rsp), %rdi
callq 0x70ae
leaq 0x278(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x68(%rsp), %r14
leaq 0x10(%rsp), %r15
cmpq $0x5, %r12
je 0x5255
movq %r12, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a6a
movss (%rax), %xmm0
movq 0x50(%rsp), %rax
ucomiss (%rax,%r12,4), %xmm0
leaq 0x1(%r12), %r12
jne 0x5387
jnp 0x521f
jmp 0x5387
leaq 0x48(%rsp), %rdx
movq $0x3, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0xd0(%rsp), %rcx
callq *0x11fd4(%rip)          # 0x17250
leaq 0x68(%rsp), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x70c2
movq %r14, %rdi
callq 0x70ae
movups 0xa373(%rip), %xmm0     # 0xf610
movaps %xmm0, (%r14)
movl $0x7f800000, 0x10(%r14) # imm = 0x7F800000
leaq 0x24(%rsp), %rdx
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x95d0
testb %bl, %bl
je 0x534d
movq 0x11cfc(%rip), %rdi     # 0x16fc8
leaq 0x8ebb(%rip), %rsi      # 0xe18e
callq 0x3270
movq %rax, %r14
leaq 0x240(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x6bac
leaq 0x148(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e78
leaq 0x10(%rsp), %rdi
leaq 0x240(%rsp), %rsi
leaq 0x148(%rsp), %rdx
callq 0x366c
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3250
leaq 0x10(%rsp), %rdi
callq 0x3110
leaq 0x148(%rsp), %rdi
callq 0x70ae
leaq 0x240(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x68(%rsp), %r14
leaq 0x10(%rsp), %r15
cmpq $0x5, %r12
je 0x53d5
movq %r12, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a6a
movss (%rax), %xmm0
movq 0x50(%rsp), %rax
ucomiss (%rax,%r12,4), %xmm0
leaq 0x1(%r12), %r12
jne 0x5387
jnp 0x535a
xorl %ebx, %ebx
leaq 0x50(%rsp), %rdi
callq 0x9546
leaq 0x68(%rsp), %rdi
callq 0x70ae
leaq 0x100(%rsp), %rdi
callq 0x74ca
leaq 0xd0(%rsp), %rdi
callq 0x7172
leaq 0x98(%rsp), %rdi
callq 0x6bf0
movl %ebx, %eax
addq $0x398, %rsp            # imm = 0x398
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x48(%rsp), %rdx
movq $0x4, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0xd0(%rsp), %rcx
callq *0x11e54(%rip)          # 0x17250
leaq 0x68(%rsp), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x70c2
movq %r14, %rdi
callq 0x70ae
movups 0xa207(%rip), %xmm0     # 0xf624
movaps %xmm0, (%r14)
andl $0x0, 0x10(%r14)
leaq 0x24(%rsp), %rdx
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x95d0
testb %bl, %bl
je 0x54ca
movq 0x11b7f(%rip), %rdi     # 0x16fc8
leaq 0x8d36(%rip), %rsi      # 0xe186
callq 0x3270
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x6bac
leaq 0x118(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e78
leaq 0x10(%rsp), %rdi
leaq 0x208(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0x366c
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x3250
leaq 0x10(%rsp), %rdi
callq 0x3110
leaq 0x118(%rsp), %rdi
callq 0x70ae
leaq 0x208(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x68(%rsp), %r14
leaq 0x10(%rsp), %r15
cmpq $0x5, %r12
sete %bl
je 0x5389
movq %r12, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a6a
movss (%rax), %xmm0
movq 0x50(%rsp), %rax
ucomiss (%rax,%r12,4), %xmm0
leaq 0x1(%r12), %r12
jne 0x5389
jnp 0x54d7
jmp 0x5389
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3110
jmp 0x5526
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x70ae
jmp 0x5538
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
jmp 0x5627
jmp 0x564d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3110
jmp 0x555c
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x70ae
jmp 0x556e
movq %rax, %rbx
leaq 0x240(%rsp), %rdi
jmp 0x5627
jmp 0x564d
jmp 0x564d
jmp 0x564d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3110
jmp 0x559c
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
callq 0x70ae
jmp 0x55ae
movq %rax, %rbx
leaq 0x278(%rsp), %rdi
jmp 0x5627
jmp 0x564d
jmp 0x564d
jmp 0x564d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3110
jmp 0x55d9
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x70ae
jmp 0x55eb
movq %rax, %rbx
leaq 0x2b0(%rsp), %rdi
jmp 0x5627
jmp 0x564d
jmp 0x564d
jmp 0x564d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3110
jmp 0x560d
movq %rax, %rbx
leaq 0x1d8(%rsp), %rdi
callq 0x70ae
jmp 0x561f
movq %rax, %rbx
leaq 0x2e8(%rsp), %rdi
callq 0x6bf0
jmp 0x5650
jmp 0x564d
jmp 0x564d
jmp 0x564d
jmp 0x564d
movq %rax, %rbx
jmp 0x565a
movq %rax, %rbx
jmp 0x5664
movq %rax, %rbx
jmp 0x5671
jmp 0x564d
jmp 0x564d
jmp 0x564d
jmp 0x564d
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x9546
leaq 0x68(%rsp), %rdi
callq 0x70ae
leaq 0x100(%rsp), %rdi
callq 0x74ca
leaq 0xd0(%rsp), %rdi
callq 0x7172
leaq 0x98(%rsp), %rdi
callq 0x6bf0
movq %rbx, %rdi
callq 0x3420