// File: /workspace/github_cpp_makefile_star2_O1/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 0xa6a5(%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 0x8758
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 0x86ce
leaq 0x58(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x60(%rsp), %rdi
leaq 0xa8(%rsp), %rbx
leaq 0xe0(%rsp), %rcx
movq %rbx, %rsi
callq *0x11766(%rip)          # 0x18238
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movl $0x40a00000, 0x8(%rsi)  # imm = 0x40A00000
leaq 0x40(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movl $0x3, %edx
callq 0x894e
testb %bpl, %bpl
je 0x6be7
movq 0x114c1(%rip), %rdi     # 0x17fd0
leaq 0xa64c(%rip), %rsi      # 0x11162
movl $0x7, %edx
callq 0x32a0
leaq 0x1a0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x8826
leaq 0x238(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x8ace
leaq 0x10(%rsp), %rdi
leaq 0x1a0(%rsp), %r14
leaq 0x238(%rsp), %rdx
movq %r14, %rsi
callq 0x36ec
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x1145b(%rip), %rdi     # 0x17fd0
callq 0x32a0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6b95
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x238(%rsp), %rdi
callq 0x8ca2
movq 0x1d0(%rsp), %rdi
testq %rdi, %rdi
je 0x6bb9
movl $0x1, %esi
callq 0x3250
leaq 0x1b8(%rsp), %r15
movq %r15, %rdi
callq 0x8a42
movq -0x18(%r15), %rdi
cmpq %r14, %rdi
je 0x6be7
movq (%rdi), %r15
movl $0x28, %esi
callq 0x3250
movq %r15, %rdi
cmpq %r14, %r15
jne 0x6bd2
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 0x8668
movss (%rax), %xmm0
movq 0x40(%rsp), %rax
ucomiss (%rax,%r13,4), %xmm0
jne 0x6fd4
jp 0x6fd4
incq %r13
cmpq $0x3, %r13
jne 0x6bfc
leaq 0x58(%rsp), %rdx
movq $0x1, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0xe0(%rsp), %rcx
callq *0x115e2(%rip)          # 0x18238
leaq 0x60(%rsp), %rdi
callq 0x8cb6
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x6ca2
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 0x8ca2
movq $0x7f800000, (%r15)     # imm = 0x7F800000
movl $0x40400000, 0x8(%r15)  # imm = 0x40400000
leaq 0x1c(%rsp), %rdx
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xaca2
testb %bpl, %bpl
je 0x6dbb
movq 0x112ee(%rip), %rdi     # 0x17fd0
leaq 0xa481(%rip), %rsi      # 0x1116a
movl $0x7, %edx
callq 0x32a0
leaq 0x168(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x8826
leaq 0x208(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x8ace
leaq 0x10(%rsp), %rdi
leaq 0x168(%rsp), %r15
leaq 0x208(%rsp), %rdx
movq %r15, %rsi
callq 0x36ec
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x11288(%rip), %rdi     # 0x17fd0
callq 0x32a0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6d68
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x208(%rsp), %rdi
callq 0x8ca2
movq 0x198(%rsp), %rdi
testq %rdi, %rdi
je 0x6d8c
movl $0x1, %esi
callq 0x3250
leaq 0x180(%rsp), %r12
movq %r12, %rdi
callq 0x8a42
movq -0x18(%r12), %rdi
cmpq %r15, %rdi
je 0x6dbb
movq (%rdi), %r12
movl $0x28, %esi
callq 0x3250
movq %r12, %rdi
cmpq %r15, %r12
jne 0x6da6
xorl %r13d, %r13d
leaq 0x60(%rsp), %r15
leaq 0x10(%rsp), %r12
movq %r13, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x8668
movss (%rax), %xmm0
movq 0x40(%rsp), %rax
ucomiss (%rax,%r13,4), %xmm0
jne 0x6fd4
jp 0x6fd4
incq %r13
cmpq $0x3, %r13
jne 0x6dc8
leaq 0x58(%rsp), %rdx
movq $0x2, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0xe0(%rsp), %rcx
callq *0x11416(%rip)          # 0x18238
leaq 0x60(%rsp), %rdi
callq 0x8cb6
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x6e6e
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 0x8ca2
movabsq $0x7f8000007f800000, %rax # imm = 0x7F8000007F800000
movq %rax, (%r15)
movl $0x0, 0x8(%r15)
leaq 0x1c(%rsp), %rdx
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xaca2
testb %bpl, %bpl
je 0x6f8d
movq 0x1111c(%rip), %rdi     # 0x17fd0
leaq 0xa2b7(%rip), %rsi      # 0x11172
movl $0x7, %edx
callq 0x32a0
leaq 0x130(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x8826
leaq 0x1d8(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x8ace
leaq 0x10(%rsp), %rdi
leaq 0x130(%rsp), %r15
leaq 0x1d8(%rsp), %rdx
movq %r15, %rsi
callq 0x36ec
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x110b6(%rip), %rdi     # 0x17fd0
callq 0x32a0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6f3a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x1d8(%rsp), %rdi
callq 0x8ca2
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x6f5e
movl $0x1, %esi
callq 0x3250
leaq 0x148(%rsp), %r12
movq %r12, %rdi
callq 0x8a42
movq -0x18(%r12), %rdi
cmpq %r15, %rdi
je 0x6f8d
movq (%rdi), %r12
movl $0x28, %esi
callq 0x3250
movq %r12, %rdi
cmpq %r15, %r12
jne 0x6f78
xorl %ebp, %ebp
leaq 0x60(%rsp), %r12
leaq 0x10(%rsp), %r13
xorl %r15d, %r15d
movq %rbp, 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x8668
movss (%rax), %xmm0
movq 0x40(%rsp), %rax
ucomiss (%rax,%rbp,4), %xmm0
jne 0x6fd7
jp 0x6fd7
cmpq $0x2, %rbp
leaq 0x1(%rbp), %rax
setae %r15b
movq %rax, %rbp
cmpq $0x3, %rax
jne 0x6f9c
jmp 0x6fd7
xorl %r15d, %r15d
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x6fee
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0x60(%rsp), %rdi
callq 0x8ca2
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x7015
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0xe0(%rsp), %rdi
callq 0x8ce4
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x7039
movl $0x1, %esi
callq 0x3250
movq %r14, %rdi
callq 0x8a42
movq 0xa8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7063
movq (%rdi), %r14
movl $0x28, %esi
callq 0x3250
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x704e
andb $0x1, %r15b
movl %r15d, %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 0x709f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x709f
movq %rax, %rbx
leaq 0x1d8(%rsp), %rdi
callq 0x8ca2
jmp 0x70b1
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
jmp 0x714f
jmp 0x716d
jmp 0x716d
jmp 0x716d
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x70f0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x70f0
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0x8ca2
jmp 0x7102
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
jmp 0x714f
jmp 0x716d
jmp 0x716d
jmp 0x716d
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7135
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x7135
movq %rax, %rbx
leaq 0x238(%rsp), %rdi
callq 0x8ca2
jmp 0x7147
movq %rax, %rbx
leaq 0x1a0(%rsp), %rdi
callq 0x88c0
jmp 0x7170
jmp 0x716d
jmp 0x716d
movq %rax, %rbx
jmp 0x7187
movq %rax, %rbx
jmp 0x7191
movq %rax, %rbx
jmp 0x71ae
jmp 0x716d
jmp 0x716d
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7187
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0x60(%rsp), %rdi
callq 0x8ca2
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x71ae
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
leaq 0xe0(%rsp), %rdi
callq 0x8ce4
leaq 0xa8(%rsp), %rdi
callq 0x88c0
movq %rbx, %rdi
callq 0x3400