// File: /workspace/github_cpp_makefile_star2_O2/flastest[P]HeterogeneousParallelDijkstra/workloads.cc
// Function: test5(bool)
bool test5(bool TEST_DEBUG)
{
	const int num_nodes = 2;
	enum nodes { A, B };
	Edge edge_array[] = { 
			Edge(A, B), 
			Edge(B, B)
	};
	int weights[] = { 
		1, 1
	};
	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));



	// test5a, with source A.
	vertex_descriptor s = vertex(A, g);

	auto distances = dijkstra_algorithm(g, s, p);

	vector<float> true_distances = { 0, 1};
	if (TEST_DEBUG) cout << "test5a\n" << print_dijkstra_results(g,distances);
	for (int i = 0; i < num_nodes; i++)
	{
		if (distances[vertex(i,g)] != true_distances[i]){
			return false;
		}
	}

	// test5b, with source B.
	s = vertex(B, g);

	distances = dijkstra_algorithm(g, s, p);

	true_distances = {INFINITY, 0};
	if (TEST_DEBUG) cout << "test5b\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 $0x1f8, %rsp            # imm = 0x1F8
movl %edi, %ebx
movaps 0x84ca(%rip), %xmm0     # 0xe0f0
leaq 0xa0(%rsp), %rdx
movaps %xmm0, -0x10(%rdx)
movabsq $0x100000001, %rax      # imm = 0x100000001
leaq 0x120(%rsp), %rcx
movq %rax, (%rcx)
leaq 0xb8(%rsp), %rax
movq %rax, (%rsp)
leaq 0xe8(%rsp), %r14
leaq 0x90(%rsp), %rsi
pushq $0x2
popq %r8
movq %r14, %rdi
xorl %r9d, %r9d
callq 0x6b18
leaq 0xc0(%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 0xa0(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x6aba
leaq 0x58(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x60(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0xb8(%rsp), %rcx
callq *0x1157f(%rip)          # 0x17250
movsd 0x8427(%rip), %xmm0     # 0xe100
leaq 0x10(%rsp), %rsi
movsd %xmm0, (%rsi)
leaq 0x40(%rsp), %rdi
pushq $0x2
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x6c3c
testb %bl, %bl
je 0x5d84
movq 0x112c5(%rip), %rdi     # 0x16fc8
leaq 0x84a4(%rip), %rsi      # 0xe1ae
callq 0x3270
movq %rax, %r14
leaq 0x1c0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x6bac
leaq 0x158(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x6e78
leaq 0x10(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
leaq 0x158(%rsp), %rdx
callq 0x366c
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3250
leaq 0x10(%rsp), %rdi
callq 0x3110
leaq 0x158(%rsp), %rdi
callq 0x70ae
leaq 0x1c0(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x60(%rsp), %r14
leaq 0x10(%rsp), %r15
cmpq $0x2, %r12
je 0x5dc5
movq %r12, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a6a
movss (%rax), %xmm0
movq 0x40(%rsp), %rax
ucomiss (%rax,%r12,4), %xmm0
leaq 0x1(%r12), %r12
jne 0x5dbe
jnp 0x5d91
xorl %ebx, %ebx
jmp 0x5ef3
leaq 0x58(%rsp), %rdx
movq $0x1, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0xb8(%rsp), %rcx
callq *0x11464(%rip)          # 0x17250
leaq 0x60(%rsp), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x70c2
movq %r14, %rdi
callq 0x70ae
movss 0x8312(%rip), %xmm0     # 0xe120
movlps %xmm0, (%r14)
leaq 0x18(%rsp), %rdx
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x95d0
testb %bl, %bl
je 0x5eb6
movq 0x11193(%rip), %rdi     # 0x16fc8
leaq 0x837a(%rip), %rsi      # 0xe1b6
callq 0x3270
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x6bac
leaq 0x128(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x6e78
leaq 0x10(%rsp), %rdi
leaq 0x188(%rsp), %rsi
leaq 0x128(%rsp), %rdx
callq 0x366c
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x3250
leaq 0x10(%rsp), %rdi
callq 0x3110
leaq 0x128(%rsp), %rdi
callq 0x70ae
leaq 0x188(%rsp), %rdi
callq 0x6bf0
xorl %r12d, %r12d
leaq 0x60(%rsp), %r14
leaq 0x10(%rsp), %r15
cmpq $0x2, %r12
sete %bl
je 0x5ef3
movq %r12, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a6a
movss (%rax), %xmm0
movq 0x40(%rsp), %rax
ucomiss (%rax,%r12,4), %xmm0
leaq 0x1(%r12), %r12
jne 0x5ef3
jnp 0x5ec3
leaq 0x40(%rsp), %rdi
callq 0x9546
leaq 0x60(%rsp), %rdi
callq 0x70ae
leaq 0xa0(%rsp), %rdi
callq 0x74ca
leaq 0xb8(%rsp), %rdi
callq 0x7172
leaq 0xe8(%rsp), %rdi
callq 0x6bf0
movl %ebx, %eax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3110
jmp 0x5f51
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x70ae
jmp 0x5f63
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
jmp 0x5f9b
jmp 0x5fbb
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3110
jmp 0x5f81
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x70ae
jmp 0x5f93
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x6bf0
jmp 0x5fbe
jmp 0x5fbb
jmp 0x5fbb
jmp 0x5fbb
jmp 0x5fbb
movq %rax, %rbx
jmp 0x5fc8
movq %rax, %rbx
jmp 0x5fd2
movq %rax, %rbx
jmp 0x5fdf
jmp 0x5fbb
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x9546
leaq 0x60(%rsp), %rdi
callq 0x70ae
leaq 0xa0(%rsp), %rdi
callq 0x74ca
leaq 0xb8(%rsp), %rdi
callq 0x7172
leaq 0xe8(%rsp), %rdi
callq 0x6bf0
movq %rbx, %rdi
callq 0x3420