// File: /workspace/github_cpp_makefile_star2_O1/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 0xc23e(%rip), %xmm0     # 0x11010
leaq 0x2a0(%rsp), %rdx
movaps %xmm0, -0x30(%rdx)
movaps 0xc29b(%rip), %xmm0     # 0x11080
movaps %xmm0, -0x20(%rdx)
movaps 0xc2a0(%rip), %xmm0     # 0x11090
movaps %xmm0, -0x10(%rdx)
movaps 0xd425(%rip), %xmm0     # 0x12220
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 0x8758
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 0x86ce
leaq 0x60(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x68(%rsp), %rdi
leaq 0xb0(%rsp), %rbx
leaq 0xe8(%rsp), %rcx
movq %rbx, %rsi
callq *0x1338e(%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 0x8908
testb %bpl, %bpl
je 0x4fb9
movq 0x130ef(%rip), %rdi     # 0x17fd0
leaq 0xc242(%rip), %rsi      # 0x1112a
movl $0x7, %edx
callq 0x32a0
leaq 0x188(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x8826
leaq 0x220(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x8ace
leaq 0x18(%rsp), %rdi
leaq 0x188(%rsp), %r14
leaq 0x220(%rsp), %rdx
movq %r14, %rsi
callq 0x36ec
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x13089(%rip), %rdi     # 0x17fd0
callq 0x32a0
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4f67
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x220(%rsp), %rdi
callq 0x8ca2
movq 0x1b8(%rsp), %rdi
testq %rdi, %rdi
je 0x4f8b
movl $0x1, %esi
callq 0x3250
leaq 0x1a0(%rsp), %r15
movq %r15, %rdi
callq 0x8a42
movq -0x18(%r15), %rdi
cmpq %r14, %rdi
je 0x4fb9
movq (%rdi), %r15
movl $0x28, %esi
callq 0x3250
movq %r15, %rdi
cmpq %r14, %r15
jne 0x4fa4
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 0x8668
movq 0x48(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2ssl (%rcx,%r13,4), %xmm0
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x53bb
jp 0x53bb
incq %r13
cmpq $0x3, %r13
jne 0x4fce
leaq 0x60(%rsp), %rdx
movq $0x1, (%rdx)
leaq 0x18(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0xe8(%rsp), %rcx
callq *0x13209(%rip)          # 0x18238
leaq 0x68(%rsp), %rdi
callq 0x8cb6
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x507b
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 0x8ca2
movq $0x0, (%r15)
movl $0x2, 0x8(%r15)
leaq 0x24(%rsp), %rdx
leaq 0x48(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xaa7a
testb %bpl, %bpl
je 0x5194
movq 0x12f15(%rip), %rdi     # 0x17fd0
leaq 0xc070(%rip), %rsi      # 0x11132
movl $0x7, %edx
callq 0x32a0
leaq 0x150(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x8826
leaq 0x1f0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x8ace
leaq 0x18(%rsp), %rdi
leaq 0x150(%rsp), %r15
leaq 0x1f0(%rsp), %rdx
movq %r15, %rsi
callq 0x36ec
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x12eaf(%rip), %rdi     # 0x17fd0
callq 0x32a0
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5141
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x1f0(%rsp), %rdi
callq 0x8ca2
movq 0x180(%rsp), %rdi
testq %rdi, %rdi
je 0x5165
movl $0x1, %esi
callq 0x3250
leaq 0x168(%rsp), %r12
movq %r12, %rdi
callq 0x8a42
movq -0x18(%r12), %rdi
cmpq %r15, %rdi
je 0x5194
movq (%rdi), %r12
movl $0x28, %esi
callq 0x3250
movq %r12, %rdi
cmpq %r15, %r12
jne 0x517f
xorl %r13d, %r13d
leaq 0x68(%rsp), %r15
leaq 0x18(%rsp), %r12
movq %r13, 0x18(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x8668
movq 0x48(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2ssl (%rcx,%r13,4), %xmm0
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x53bb
jp 0x53bb
incq %r13
cmpq $0x3, %r13
jne 0x51a1
leaq 0x60(%rsp), %rdx
movq $0x2, (%rdx)
leaq 0x18(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0xe8(%rsp), %rcx
callq *0x13036(%rip)          # 0x18238
leaq 0x68(%rsp), %rdi
callq 0x8cb6
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x524e
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 0x8ca2
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 0xaa7a
testb %bpl, %bpl
je 0x536d
movq 0x12d3c(%rip), %rdi     # 0x17fd0
leaq 0xbe9f(%rip), %rsi      # 0x1113a
movl $0x7, %edx
callq 0x32a0
leaq 0x118(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x8826
leaq 0x1c0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x8ace
leaq 0x18(%rsp), %rdi
leaq 0x118(%rsp), %r15
leaq 0x1c0(%rsp), %rdx
movq %r15, %rsi
callq 0x36ec
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x12cd6(%rip), %rdi     # 0x17fd0
callq 0x32a0
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x531a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x1c0(%rsp), %rdi
callq 0x8ca2
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x533e
movl $0x1, %esi
callq 0x3250
leaq 0x130(%rsp), %r12
movq %r12, %rdi
callq 0x8a42
movq -0x18(%r12), %rdi
cmpq %r15, %rdi
je 0x536d
movq (%rdi), %r12
movl $0x28, %esi
callq 0x3250
movq %r12, %rdi
cmpq %r15, %r12
jne 0x5358
xorl %ebp, %ebp
leaq 0x68(%rsp), %r12
leaq 0x18(%rsp), %r13
xorl %r15d, %r15d
movq %rbp, 0x18(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x8668
movq 0x48(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2ssl (%rcx,%rbp,4), %xmm0
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x53be
jp 0x53be
cmpq $0x2, %rbp
leaq 0x1(%rbp), %rax
setae %r15b
movq %rax, %rbp
cmpq $0x3, %rax
jne 0x537c
jmp 0x53be
xorl %r15d, %r15d
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x53d5
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0x68(%rsp), %rdi
callq 0x8ca2
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x53fc
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0xe8(%rsp), %rdi
callq 0x8ce4
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x5420
movl $0x1, %esi
callq 0x3250
movq %r14, %rdi
callq 0x8a42
movq 0xb0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x544a
movq (%rdi), %r14
movl $0x28, %esi
callq 0x3250
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x5435
andb $0x1, %r15b
movl %r15d, %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 0x5486
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x5486
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x8ca2
jmp 0x5498
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
jmp 0x5536
jmp 0x5554
jmp 0x5554
jmp 0x5554
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x54d7
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x54d7
movq %rax, %rbx
leaq 0x1f0(%rsp), %rdi
callq 0x8ca2
jmp 0x54e9
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
jmp 0x5536
jmp 0x5554
jmp 0x5554
jmp 0x5554
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x551c
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x551c
movq %rax, %rbx
leaq 0x220(%rsp), %rdi
callq 0x8ca2
jmp 0x552e
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
callq 0x88c0
jmp 0x5557
jmp 0x5554
jmp 0x5554
movq %rax, %rbx
jmp 0x556e
movq %rax, %rbx
jmp 0x5578
movq %rax, %rbx
jmp 0x5595
jmp 0x5554
jmp 0x5554
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x556e
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0x68(%rsp), %rdi
callq 0x8ca2
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x5595
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0xe8(%rsp), %rdi
callq 0x8ce4
leaq 0xb0(%rsp), %rdi
callq 0x88c0
movq %rbx, %rdi
callq 0x3400