// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movl %edi, %ebp
movaps 0xc2bc(%rip), %xmm0     # 0x11010
leaq 0x2a0(%rsp), %rdx
movaps %xmm0, -0x30(%rdx)
movaps 0xc319(%rip), %xmm0     # 0x11080
movaps %xmm0, -0x20(%rdx)
movaps 0xc31e(%rip), %xmm0     # 0x11090
movaps %xmm0, -0x10(%rdx)
movaps 0xd4e3(%rip), %xmm0     # 0x12260
leaq 0x250(%rsp), %rcx
movaps %xmm0, (%rcx)
movabsq $0x200000003, %rax      # imm = 0x200000003
movq %rax, 0x10(%rcx)
leaq 0xe8(%rsp), %rax
movq %rax, (%rsp)
xorl %r14d, %r14d
leaq 0xb0(%rsp), %rbx
leaq 0x270(%rsp), %rsi
movl $0x3, %r8d
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0x8600
leaq 0xf0(%rsp), %rax
movl $0x0, (%rax)
movq %r14, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %r14, 0x20(%rax)
movq 0x20(%rbx), %rsi
subq 0x18(%rbx), %rsi
sarq $0x5, %rsi
leaq 0x98(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x8574
leaq 0x60(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x68(%rsp), %rdi
leaq 0xb0(%rsp), %rbx
leaq 0xe8(%rsp), %rcx
movq %rbx, %rsi
callq *0x1340c(%rip)          # 0x18238
leaq 0x18(%rsp), %rsi
movq $0x0, (%rsi)
movl $0x2, 0x8(%rsi)
leaq 0x48(%rsp), %rdi
leaq 0x17(%rsp), %rcx
movl $0x3, %edx
callq 0x87b0
testb %bpl, %bpl
je 0x4f32
movq 0x1316d(%rip), %rdi     # 0x17fd0
leaq 0xc304(%rip), %rsi      # 0x1116e
movl $0x7, %edx
callq 0x32a0
leaq 0x218(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x86d2
leaq 0x178(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x897c
leaq 0x18(%rsp), %rdi
leaq 0x218(%rsp), %r14
leaq 0x178(%rsp), %rdx
movq %r14, %rsi
callq 0x36ec
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x13107(%rip), %rdi     # 0x17fd0
callq 0x32a0
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4ee9
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x178(%rsp), %rdi
callq 0x8b50
leaq 0x230(%rsp), %r15
movq 0x18(%r15), %rdi
movl $0x1, %esi
callq 0x3250
movq %r15, %rdi
callq 0x88ea
movq -0x18(%r15), %rdi
cmpq %r14, %rdi
je 0x4f32
movq (%rdi), %r15
movl $0x28, %esi
callq 0x3250
movq %r15, %rdi
cmpq %r14, %r15
jne 0x4f1d
leaq 0xc8(%rsp), %r14
xorl %r13d, %r13d
leaq 0x68(%rsp), %r15
leaq 0x18(%rsp), %r12
movq %r13, 0x18(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x850e
movq 0x48(%rsp), %rdi
xorps %xmm0, %xmm0
cvtsi2ssl (%rdi,%r13,4), %xmm0
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x532a
jp 0x532a
incq %r13
cmpq $0x3, %r13
jne 0x4f47
leaq 0x60(%rsp), %rdx
movq $0x1, (%rdx)
leaq 0x18(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0xe8(%rsp), %rcx
callq *0x13290(%rip)          # 0x18238
leaq 0x68(%rsp), %rdi
callq 0x8b64
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x4ff4
leaq 0x70(%rsp), %rcx
leaq 0x20(%rsp), %rdx
movl (%rdx), %esi
movl %esi, (%rcx)
movq %rax, 0x8(%rcx)
movups 0x10(%rdx), %xmm0
movups %xmm0, 0x10(%rcx)
movq %rcx, 0x8(%rax)
movq 0x20(%rdx), %rax
movq %rax, 0x20(%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rdx)
movq %rdx, 0x10(%rdx)
movq %rdx, 0x18(%rdx)
movq %rax, 0x20(%rdx)
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x8b50
movq $0x0, (%r15)
movl $0x2, 0x8(%r15)
leaq 0x24(%rsp), %rdx
leaq 0x48(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xa822
testb %bpl, %bpl
je 0x5105
movq 0x12f9c(%rip), %rdi     # 0x17fd0
leaq 0xc13b(%rip), %rsi      # 0x11176
movl $0x7, %edx
callq 0x32a0
leaq 0x1e0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x86d2
leaq 0x148(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x897c
leaq 0x18(%rsp), %rdi
leaq 0x1e0(%rsp), %r15
leaq 0x148(%rsp), %rdx
movq %r15, %rsi
callq 0x36ec
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x12f36(%rip), %rdi     # 0x17fd0
callq 0x32a0
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x50ba
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x148(%rsp), %rdi
callq 0x8b50
leaq 0x1f8(%rsp), %r12
movq 0x18(%r12), %rdi
movl $0x1, %esi
callq 0x3250
movq %r12, %rdi
callq 0x88ea
movq -0x18(%r12), %rdi
cmpq %r15, %rdi
je 0x5105
movq (%rdi), %r12
movl $0x28, %esi
callq 0x3250
movq %r12, %rdi
cmpq %r15, %r12
jne 0x50f0
xorl %r13d, %r13d
leaq 0x68(%rsp), %r15
leaq 0x18(%rsp), %r12
movq %r13, 0x18(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x850e
movq 0x48(%rsp), %rdi
xorps %xmm0, %xmm0
cvtsi2ssl (%rdi,%r13,4), %xmm0
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x532a
jp 0x532a
incq %r13
cmpq $0x3, %r13
jne 0x5112
leaq 0x60(%rsp), %rdx
movq $0x2, (%rdx)
leaq 0x18(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0xe8(%rsp), %rcx
callq *0x130c5(%rip)          # 0x18238
leaq 0x68(%rsp), %rdi
callq 0x8b64
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x51bf
leaq 0x70(%rsp), %rcx
leaq 0x20(%rsp), %rdx
movl (%rdx), %esi
movl %esi, (%rcx)
movq %rax, 0x8(%rcx)
movups 0x10(%rdx), %xmm0
movups %xmm0, 0x10(%rcx)
movq %rcx, 0x8(%rax)
movq 0x20(%rdx), %rax
movq %rax, 0x20(%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rdx)
movq %rdx, 0x10(%rdx)
movq %rdx, 0x18(%rdx)
movq %rax, 0x20(%rdx)
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x8b50
movabsq $0x200000002, %rax      # imm = 0x200000002
movq %rax, (%r15)
movl $0x0, 0x8(%r15)
leaq 0x24(%rsp), %rdx
leaq 0x48(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xa822
testb %bpl, %bpl
je 0x52d6
movq 0x12dcb(%rip), %rdi     # 0x17fd0
leaq 0xbf72(%rip), %rsi      # 0x1117e
movl $0x7, %edx
callq 0x32a0
leaq 0x1a8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x86d2
leaq 0x118(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x897c
leaq 0x18(%rsp), %rdi
leaq 0x1a8(%rsp), %r15
leaq 0x118(%rsp), %rdx
movq %r15, %rsi
callq 0x36ec
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x12d65(%rip), %rdi     # 0x17fd0
callq 0x32a0
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x528b
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x118(%rsp), %rdi
callq 0x8b50
leaq 0x1c0(%rsp), %r12
movq 0x18(%r12), %rdi
movl $0x1, %esi
callq 0x3250
movq %r12, %rdi
callq 0x88ea
movq -0x18(%r12), %rdi
cmpq %r15, %rdi
je 0x52d6
movq (%rdi), %r12
movl $0x28, %esi
callq 0x3250
movq %r12, %rdi
cmpq %r15, %r12
jne 0x52c1
xorl %r13d, %r13d
leaq 0x68(%rsp), %r15
leaq 0x18(%rsp), %r12
movq %r13, 0x18(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x850e
movq 0x48(%rsp), %rdi
xorps %xmm0, %xmm0
cvtsi2ssl (%rdi,%r13,4), %xmm0
movss (%rax), %xmm1
movaps %xmm0, %xmm2
cmpeqss %xmm1, %xmm2
movd %xmm2, %ebp
andl $0x1, %ebp
ucomiss %xmm0, %xmm1
jne 0x532c
jp 0x532c
leaq 0x1(%r13), %rax
cmpq $0x2, %r13
movq %rax, %r13
jne 0x52e3
jmp 0x532c
xorl %ebp, %ebp
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0x68(%rsp), %rdi
callq 0x8b50
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x5360
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0xe8(%rsp), %rdi
callq 0x8b92
movq 0xe0(%rsp), %rdi
movl $0x1, %esi
callq 0x3250
movq %r14, %rdi
callq 0x88ea
movq 0xb0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x53a9
movq (%rdi), %r14
movl $0x28, %esi
callq 0x3250
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x5394
movl %ebp, %eax
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x53e0
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x53e0
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x8b50
jmp 0x53f2
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
jmp 0x5490
jmp 0x54ae
jmp 0x54ae
jmp 0x54ae
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5431
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x5431
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x8b50
jmp 0x5443
movq %rax, %rbx
leaq 0x1e0(%rsp), %rdi
jmp 0x5490
jmp 0x54ae
jmp 0x54ae
jmp 0x54ae
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5476
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x5476
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
callq 0x8b50
jmp 0x5488
movq %rax, %rbx
leaq 0x218(%rsp), %rdi
callq 0x876c
jmp 0x54b1
jmp 0x54ae
jmp 0x54ae
movq %rax, %rbx
jmp 0x54c8
movq %rax, %rbx
jmp 0x54d2
movq %rax, %rbx
jmp 0x54ef
jmp 0x54ae
jmp 0x54ae
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x54c8
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0x68(%rsp), %rdi
callq 0x8b50
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x54ef
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0xe8(%rsp), %rdi
callq 0x8b92
leaq 0xb0(%rsp), %rdi
callq 0x876c
movq %rbx, %rdi
callq 0x3400