// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movl %edi, %ebx
movaps 0x8a16(%rip), %xmm0     # 0xe0c0
leaq 0x110(%rsp), %rdx
movaps %xmm0, -0x10(%rdx)
movabsq $0x300000002, %rax      # imm = 0x300000002
leaq 0x128(%rsp), %rcx
movq %rax, (%rcx)
leaq 0xd0(%rsp), %rax
movq %rax, (%rsp)
leaq 0x98(%rsp), %r14
leaq 0x100(%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 0x110(%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 *0x11afb(%rip)          # 0x17250
movsd 0x8973(%rip), %xmm0     # 0xe0d0
leaq 0x18(%rsp), %rsi
movsd %xmm0, (%rsi)
movl $0x40a00000, 0x8(%rsi)  # imm = 0x40A00000
leaq 0x50(%rsp), %rdi
pushq $0x3
popq %rdx
leaq 0x17(%rsp), %rcx
callq 0x6c3c
testb %bl, %bl
je 0x580f
movq 0x1183a(%rip), %rdi     # 0x16fc8
leaq 0x8a01(%rip), %rsi      # 0xe196
callq 0x3270
movq %rax, %r14
leaq 0x230(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x6bac
leaq 0x190(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e78
leaq 0x18(%rsp), %rdi
leaq 0x230(%rsp), %rsi
leaq 0x190(%rsp), %rdx
callq 0x366c
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x3250
leaq 0x18(%rsp), %rdi
callq 0x3110
leaq 0x190(%rsp), %rdi
callq 0x70ae
leaq 0x230(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x68(%rsp), %r14
leaq 0x18(%rsp), %r15
cmpq $0x3, %r12
je 0x5852
movq %r12, 0x18(%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 0x5985
jnp 0x581c
jmp 0x5985
leaq 0x48(%rsp), %rdx
movq $0x1, (%rdx)
leaq 0x18(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0xd0(%rsp), %rcx
callq *0x119d7(%rip)          # 0x17250
leaq 0x68(%rsp), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x70c2
movq %r14, %rdi
callq 0x70ae
movss 0x8885(%rip), %xmm0     # 0xe120
movlps %xmm0, (%r14)
movl $0x40400000, 0x8(%r14)  # imm = 0x40400000
leaq 0x24(%rsp), %rdx
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x95d0
testb %bl, %bl
je 0x594b
movq 0x116fe(%rip), %rdi     # 0x16fc8
leaq 0x88cd(%rip), %rsi      # 0xe19e
callq 0x3270
movq %rax, %r14
leaq 0x1f8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x6bac
leaq 0x160(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e78
leaq 0x18(%rsp), %rdi
leaq 0x1f8(%rsp), %rsi
leaq 0x160(%rsp), %rdx
callq 0x366c
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x3250
leaq 0x18(%rsp), %rdi
callq 0x3110
leaq 0x160(%rsp), %rdi
callq 0x70ae
leaq 0x1f8(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x68(%rsp), %r14
leaq 0x18(%rsp), %r15
cmpq $0x3, %r12
je 0x59d3
movq %r12, 0x18(%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 0x5985
jnp 0x5958
xorl %ebx, %ebx
leaq 0x50(%rsp), %rdi
callq 0x9546
leaq 0x68(%rsp), %rdi
callq 0x70ae
leaq 0x110(%rsp), %rdi
callq 0x74ca
leaq 0xd0(%rsp), %rdi
callq 0x7172
leaq 0x98(%rsp), %rdi
callq 0x6bf0
movl %ebx, %eax
addq $0x268, %rsp            # imm = 0x268
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 *0x11856(%rip)          # 0x17250
leaq 0x68(%rsp), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x70c2
movq %r14, %rdi
callq 0x70ae
movsd 0x86c4(%rip), %xmm0     # 0xe0e0
movsd %xmm0, (%r14)
andl $0x0, 0x8(%r14)
leaq 0x24(%rsp), %rdx
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x95d0
testb %bl, %bl
je 0x5aca
movq 0x1157f(%rip), %rdi     # 0x16fc8
leaq 0x8756(%rip), %rsi      # 0xe1a6
callq 0x3270
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x6bac
leaq 0x130(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e78
leaq 0x18(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
leaq 0x130(%rsp), %rdx
callq 0x366c
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x3250
leaq 0x18(%rsp), %rdi
callq 0x3110
leaq 0x130(%rsp), %rdi
callq 0x70ae
leaq 0x1c0(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x68(%rsp), %r14
leaq 0x18(%rsp), %r15
cmpq $0x3, %r12
sete %bl
je 0x5987
movq %r12, 0x18(%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 0x5987
jnp 0x5ad7
jmp 0x5987
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3110
jmp 0x5b26
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x70ae
jmp 0x5b38
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
jmp 0x5ba7
jmp 0x5bc9
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3110
jmp 0x5b59
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0x70ae
jmp 0x5b6b
movq %rax, %rbx
leaq 0x1f8(%rsp), %rdi
jmp 0x5ba7
jmp 0x5bc9
jmp 0x5bc9
jmp 0x5bc9
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3110
jmp 0x5b8d
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x70ae
jmp 0x5b9f
movq %rax, %rbx
leaq 0x230(%rsp), %rdi
callq 0x6bf0
jmp 0x5bcc
jmp 0x5bc9
jmp 0x5bc9
jmp 0x5bc9
jmp 0x5bc9
movq %rax, %rbx
jmp 0x5bd6
movq %rax, %rbx
jmp 0x5be0
movq %rax, %rbx
jmp 0x5bed
jmp 0x5bc9
jmp 0x5bc9
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x9546
leaq 0x68(%rsp), %rdi
callq 0x70ae
leaq 0x110(%rsp), %rdi
callq 0x74ca
leaq 0xd0(%rsp), %rdi
callq 0x7172
leaq 0x98(%rsp), %rdi
callq 0x6bf0
movq %rbx, %rdi
callq 0x3420