// File: /workspace/github_cpp_makefile_star2_O3/flastest[P]HeterogeneousParallelDijkstra/workloads.cc
// Function: test4(bool)
bool test4(bool TEST_DEBUG)
{
	const int num_nodes = 3;
	enum nodes { A, B, C};
	Edge edge_array[] = { 
			Edge(A, B), 
			Edge(B, C)
	};
	int weights[] = { 
		2, 3
	};
	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));



	// test4a, 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 << "test4a\n" << print_dijkstra_results(g,distances);
	for (int i = 0; i < num_nodes; i++)
	{
		if (distances[vertex(i,g)] != true_distances[i]){
			return false;
		}
	}

	// test4b, with source B.
	s = vertex(B, g);

	distances = dijkstra_algorithm(g, s, p);

	true_distances = {INFINITY, 0, 3};
	if (TEST_DEBUG) cout << "test4b\n" << print_dijkstra_results(g,distances);
	for (int i = 0; i < num_nodes; i++)
	{
		if (distances[vertex(i,g)] != true_distances[i]){
			return false;
		}
	}


	// test4c, with source C.
	s = vertex(C, g);

	distances = dijkstra_algorithm(g, s, p);

	true_distances = {INFINITY, INFINITY, 0};
	if (TEST_DEBUG) cout << "test4c\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 $0x268, %rsp            # imm = 0x268
movl %edi, %ebp
movaps 0xa7a7(%rip), %xmm0     # 0x110c0
leaq 0x120(%rsp), %rdx
movaps %xmm0, -0x10(%rdx)
movabsq $0x300000002, %rax      # imm = 0x300000002
leaq 0x128(%rsp), %rcx
movq %rax, (%rcx)
leaq 0xe0(%rsp), %rax
movq %rax, (%rsp)
xorl %r14d, %r14d
leaq 0xa8(%rsp), %rbx
leaq 0x110(%rsp), %rsi
movl $0x3, %r8d
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0x8600
leaq 0xe8(%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 0x90(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x8574
leaq 0x58(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x60(%rsp), %rdi
leaq 0xa8(%rsp), %rbx
leaq 0xe0(%rsp), %rcx
movq %rbx, %rsi
callq *0x11868(%rip)          # 0x18238
movsd 0xa6f8(%rip), %xmm0     # 0x110d0
leaq 0x10(%rsp), %rsi
movsd %xmm0, (%rsi)
movl $0x40a00000, 0x8(%rsi)  # imm = 0x40A00000
leaq 0x40(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movl $0x3, %edx
callq 0x87f6
testb %bpl, %bpl
je 0x6adb
movq 0x115c4(%rip), %rdi     # 0x17fd0
leaq 0xa793(%rip), %rsi      # 0x111a6
movl $0x7, %edx
callq 0x32a0
leaq 0x230(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x86d2
leaq 0x190(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x897c
leaq 0x10(%rsp), %rdi
leaq 0x230(%rsp), %r14
leaq 0x190(%rsp), %rdx
movq %r14, %rsi
callq 0x36ec
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x1155e(%rip), %rdi     # 0x17fd0
callq 0x32a0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6a92
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x190(%rsp), %rdi
callq 0x8b50
leaq 0x248(%rsp), %r15
movq 0x18(%r15), %rdi
movl $0x1, %esi
callq 0x3250
movq %r15, %rdi
callq 0x88ea
movq -0x18(%r15), %rdi
cmpq %r14, %rdi
je 0x6adb
movq (%rdi), %r15
movl $0x28, %esi
callq 0x3250
movq %r15, %rdi
cmpq %r14, %r15
jne 0x6ac6
leaq 0xc0(%rsp), %r14
xorl %r13d, %r13d
leaq 0x60(%rsp), %r15
leaq 0x10(%rsp), %r12
movq %r13, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x850e
movss (%rax), %xmm0
movq 0x40(%rsp), %rdi
ucomiss (%rdi,%r13,4), %xmm0
jne 0x6ec7
jp 0x6ec7
incq %r13
cmpq $0x3, %r13
jne 0x6af0
leaq 0x58(%rsp), %rdx
movq $0x1, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0xe0(%rsp), %rcx
callq *0x116ee(%rip)          # 0x18238
leaq 0x60(%rsp), %rdi
callq 0x8b64
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x6b96
leaq 0x68(%rsp), %rcx
leaq 0x18(%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 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x8b50
movss 0xa585(%rip), %xmm0     # 0x11130
movlps %xmm0, (%r15)
movl $0x40400000, 0x8(%r15)  # imm = 0x40400000
leaq 0x1c(%rsp), %rdx
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xaa3c
testb %bpl, %bpl
je 0x6cac
movq 0x113f5(%rip), %rdi     # 0x17fd0
leaq 0xa5cc(%rip), %rsi      # 0x111ae
movl $0x7, %edx
callq 0x32a0
leaq 0x1f8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x86d2
leaq 0x160(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x897c
leaq 0x10(%rsp), %rdi
leaq 0x1f8(%rsp), %r15
leaq 0x160(%rsp), %rdx
movq %r15, %rsi
callq 0x36ec
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x1138f(%rip), %rdi     # 0x17fd0
callq 0x32a0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6c61
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x160(%rsp), %rdi
callq 0x8b50
leaq 0x210(%rsp), %r12
movq 0x18(%r12), %rdi
movl $0x1, %esi
callq 0x3250
movq %r12, %rdi
callq 0x88ea
movq -0x18(%r12), %rdi
cmpq %r15, %rdi
je 0x6cac
movq (%rdi), %r12
movl $0x28, %esi
callq 0x3250
movq %r12, %rdi
cmpq %r15, %r12
jne 0x6c97
xorl %r13d, %r13d
leaq 0x60(%rsp), %r15
leaq 0x10(%rsp), %r12
movq %r13, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x850e
movss (%rax), %xmm0
movq 0x40(%rsp), %rdi
ucomiss (%rdi,%r13,4), %xmm0
jne 0x6ec7
jp 0x6ec7
incq %r13
cmpq $0x3, %r13
jne 0x6cb9
leaq 0x58(%rsp), %rdx
movq $0x2, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0xe0(%rsp), %rcx
callq *0x11525(%rip)          # 0x18238
leaq 0x60(%rsp), %rdi
callq 0x8b64
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x6d5f
leaq 0x68(%rsp), %rcx
leaq 0x18(%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 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x8b50
movsd 0xa36c(%rip), %xmm0     # 0x110e0
movsd %xmm0, (%r15)
movl $0x0, 0x8(%r15)
leaq 0x1c(%rsp), %rdx
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xaa3c
testb %bpl, %bpl
je 0x6e76
movq 0x1122b(%rip), %rdi     # 0x17fd0
leaq 0xa40a(%rip), %rsi      # 0x111b6
movl $0x7, %edx
callq 0x32a0
leaq 0x1c0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x86d2
leaq 0x130(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x897c
leaq 0x10(%rsp), %rdi
leaq 0x1c0(%rsp), %r15
leaq 0x130(%rsp), %rdx
movq %r15, %rsi
callq 0x36ec
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x111c5(%rip), %rdi     # 0x17fd0
callq 0x32a0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e2b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x130(%rsp), %rdi
callq 0x8b50
leaq 0x1d8(%rsp), %r12
movq 0x18(%r12), %rdi
movl $0x1, %esi
callq 0x3250
movq %r12, %rdi
callq 0x88ea
movq -0x18(%r12), %rdi
cmpq %r15, %rdi
je 0x6e76
movq (%rdi), %r12
movl $0x28, %esi
callq 0x3250
movq %r12, %rdi
cmpq %r15, %r12
jne 0x6e61
xorl %r13d, %r13d
leaq 0x60(%rsp), %r15
leaq 0x10(%rsp), %r12
movq %r13, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x850e
movss (%rax), %xmm0
movq 0x40(%rsp), %rdi
movss (%rdi,%r13,4), %xmm1
movaps %xmm0, %xmm2
cmpeqss %xmm1, %xmm2
movd %xmm2, %ebp
andl $0x1, %ebp
ucomiss %xmm1, %xmm0
jne 0x6ec9
jp 0x6ec9
leaq 0x1(%r13), %rax
cmpq $0x2, %r13
movq %rax, %r13
jne 0x6e83
jmp 0x6ec9
xorl %ebp, %ebp
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0x60(%rsp), %rdi
callq 0x8b50
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x6efd
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0xe0(%rsp), %rdi
callq 0x8b92
movq 0xd8(%rsp), %rdi
movl $0x1, %esi
callq 0x3250
movq %r14, %rdi
callq 0x88ea
movq 0xa8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x6f46
movq (%rdi), %r14
movl $0x28, %esi
callq 0x3250
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x6f31
movl %ebp, %eax
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6f7d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x6f7d
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x8b50
jmp 0x6f8f
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
jmp 0x702d
jmp 0x704b
jmp 0x704b
jmp 0x704b
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6fce
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x6fce
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0x8b50
jmp 0x6fe0
movq %rax, %rbx
leaq 0x1f8(%rsp), %rdi
jmp 0x702d
jmp 0x704b
jmp 0x704b
jmp 0x704b
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7013
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x7013
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x8b50
jmp 0x7025
movq %rax, %rbx
leaq 0x230(%rsp), %rdi
callq 0x876c
jmp 0x704e
jmp 0x704b
jmp 0x704b
movq %rax, %rbx
jmp 0x7065
movq %rax, %rbx
jmp 0x706f
movq %rax, %rbx
jmp 0x708c
jmp 0x704b
jmp 0x704b
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7065
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0x60(%rsp), %rdi
callq 0x8b50
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x708c
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0xe0(%rsp), %rdi
callq 0x8b92
leaq 0xa8(%rsp), %rdi
callq 0x876c
movq %rbx, %rdi
callq 0x3400