// File: /workspace/github_cpp_makefile_star2_O2/flastest[P]HeterogeneousParallelDijkstra/workloads.cc
// Function: test2(bool)
bool test2(bool TEST_DEBUG)
{
	const int num_nodes = 3;
	enum nodes { A, B, C };
	//char name[] = "ABCDE";
	Edge edge_array[] = { 
			Edge(A, B), Edge(A, C), 
			Edge(B, A), Edge(B, C), 
			Edge(C, A), Edge(C, B)
	};
	int weights[] = { 
		0, 3,
		0, 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));



	// test2a, with source A.
	vertex_descriptor s = vertex(A, g);

	auto distances = dijkstra_algorithm(g, s, p);

	vector<int> true_distances = {0, 0, 2};
	if (TEST_DEBUG) cout << "test2a\n" << print_dijkstra_results(g,distances);
	for (int i = 0; i < num_nodes; i++)
	{
		if (distances[vertex(i,g)] != true_distances[i]){
			return false;
		}
	}
	


	// test2b, with source B.
	s = vertex(B, g);

	distances = dijkstra_algorithm(g, s, p);

	true_distances = {0, 0, 2};
	if (TEST_DEBUG) cout << "test2b\n" << print_dijkstra_results(g,distances);
	for (int i = 0; i < num_nodes; i++)
	{
		if (distances[vertex(i,g)] != true_distances[i]){
			return false;
		}
	}
	

	// test2c, with source C.
	s = vertex(C, g);

	distances = dijkstra_algorithm(g, s, p);

	true_distances = {2, 2, 0};
	if (TEST_DEBUG) cout << "test2c\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 $0x2a8, %rsp            # imm = 0x2A8
movl %edi, %ebx
movaps 0x9d41(%rip), %xmm0     # 0xe010
leaq 0x2a0(%rsp), %rdx
movaps %xmm0, -0x30(%rdx)
movaps 0x9d9e(%rip), %xmm0     # 0xe080
movaps %xmm0, -0x20(%rdx)
movaps 0x9da3(%rip), %xmm0     # 0xe090
movaps %xmm0, -0x10(%rdx)
movaps 0xb278(%rip), %xmm0     # 0xf570
leaq 0x250(%rsp), %rcx
movaps %xmm0, (%rcx)
movabsq $0x200000003, %rax      # imm = 0x200000003
movq %rax, 0x10(%rcx)
leaq 0xd0(%rsp), %rax
movq %rax, (%rsp)
leaq 0x98(%rsp), %r14
leaq 0x270(%rsp), %rsi
pushq $0x3
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 *0x12eb5(%rip)          # 0x17250
leaq 0x18(%rsp), %rsi
andq $0x0, (%rsi)
movl $0x2, 0x8(%rsi)
leaq 0x50(%rsp), %rdi
pushq $0x3
popq %rdx
leaq 0x17(%rsp), %rcx
callq 0x6c06
testb %bl, %bl
je 0x444d
movq 0x12bfc(%rip), %rdi     # 0x16fc8
leaq 0x9d8b(%rip), %rsi      # 0xe15e
callq 0x3270
movq %rax, %r14
leaq 0x218(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x6bac
leaq 0x178(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e78
leaq 0x18(%rsp), %rdi
leaq 0x218(%rsp), %rsi
leaq 0x178(%rsp), %rdx
callq 0x366c
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x3250
leaq 0x18(%rsp), %rdi
callq 0x3110
leaq 0x178(%rsp), %rdi
callq 0x70ae
leaq 0x218(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x68(%rsp), %r14
leaq 0x18(%rsp), %r15
cmpq $0x3, %r12
je 0x4492
movq %r12, 0x18(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a6a
movq 0x50(%rsp), %rcx
cvtsi2ssl (%rcx,%r12,4), %xmm0
movss (%rax), %xmm1
incq %r12
ucomiss %xmm0, %xmm1
jne 0x45bf
jnp 0x445a
jmp 0x45bf
leaq 0x48(%rsp), %rdx
movq $0x1, (%rdx)
leaq 0x18(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0xd0(%rsp), %rcx
callq *0x12d97(%rip)          # 0x17250
leaq 0x68(%rsp), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x70c2
movq %r14, %rdi
callq 0x70ae
andq $0x0, (%r14)
movl $0x2, 0x8(%r14)
leaq 0x24(%rsp), %rdx
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x9372
testb %bl, %bl
je 0x4583
movq 0x12ac6(%rip), %rdi     # 0x16fc8
leaq 0x9c5d(%rip), %rsi      # 0xe166
callq 0x3270
movq %rax, %r14
leaq 0x1e0(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x6bac
leaq 0x148(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e78
leaq 0x18(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
leaq 0x148(%rsp), %rdx
callq 0x366c
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x3250
leaq 0x18(%rsp), %rdi
callq 0x3110
leaq 0x148(%rsp), %rdi
callq 0x70ae
leaq 0x1e0(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x68(%rsp), %r14
leaq 0x18(%rsp), %r15
cmpq $0x3, %r12
je 0x460d
movq %r12, 0x18(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a6a
movq 0x50(%rsp), %rcx
cvtsi2ssl (%rcx,%r12,4), %xmm0
movss (%rax), %xmm1
incq %r12
ucomiss %xmm0, %xmm1
jne 0x45bf
jnp 0x4590
xorl %ebx, %ebx
leaq 0x50(%rsp), %rdi
callq 0x74ca
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 $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x48(%rsp), %rdx
movq $0x2, (%rdx)
leaq 0x18(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0xd0(%rsp), %rcx
callq *0x12c1c(%rip)          # 0x17250
leaq 0x68(%rsp), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x70c2
movq %r14, %rdi
callq 0x70ae
movabsq $0x200000002, %rax      # imm = 0x200000002
movq %rax, (%r14)
andl $0x0, 0x8(%r14)
leaq 0x24(%rsp), %rdx
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x9372
testb %bl, %bl
je 0x4704
movq 0x12945(%rip), %rdi     # 0x16fc8
leaq 0x9ae4(%rip), %rsi      # 0xe16e
callq 0x3270
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x6bac
leaq 0x118(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e78
leaq 0x18(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0x366c
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x3250
leaq 0x18(%rsp), %rdi
callq 0x3110
leaq 0x118(%rsp), %rdi
callq 0x70ae
leaq 0x1a8(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x68(%rsp), %r14
leaq 0x18(%rsp), %r15
cmpq $0x3, %r12
sete %bl
je 0x45c1
movq %r12, 0x18(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a6a
movq 0x50(%rsp), %rcx
cvtsi2ssl (%rcx,%r12,4), %xmm0
movss (%rax), %xmm1
incq %r12
ucomiss %xmm0, %xmm1
jne 0x45c1
jnp 0x4711
jmp 0x45c1
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3110
jmp 0x4762
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x70ae
jmp 0x4774
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
jmp 0x47e3
jmp 0x4805
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3110
jmp 0x4795
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x70ae
jmp 0x47a7
movq %rax, %rbx
leaq 0x1e0(%rsp), %rdi
jmp 0x47e3
jmp 0x4805
jmp 0x4805
jmp 0x4805
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3110
jmp 0x47c9
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
callq 0x70ae
jmp 0x47db
movq %rax, %rbx
leaq 0x218(%rsp), %rdi
callq 0x6bf0
jmp 0x4808
jmp 0x4805
jmp 0x4805
jmp 0x4805
jmp 0x4805
movq %rax, %rbx
jmp 0x4812
movq %rax, %rbx
jmp 0x481c
movq %rax, %rbx
jmp 0x4829
jmp 0x4805
jmp 0x4805
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x74ca
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