// File: /workspace/github_cpp_makefile_star2_O3/flastest[P]HeterogeneousParallelDijkstra/parallel_workloads.cc
// Function: test_cit(bool, int)
bool test_cit(bool TEST_DEBUG, int num_threads)
{
	if (TEST_DEBUG) std::cout<<"loading graph from cit"<<std::endl;
	graph_t g = cit_graph_from_file("cit-Patents.txt",true);
	
	//number of nodes in g
	int num_nodes = num_vertices(g);


	//get a source node...
	vertex_descriptor s = vertex(1, g);

	predecessor_map_t pred;

	distance_map_t parallel_results = parallel_dijkstra(g, s, pred, num_threads);

	std::vector<vertex_descriptor> p_BGL(num_nodes);

	std::vector<int> BGL_results = testBGL ( g,  s, p_BGL);	

	for (int i = 0 ; i < num_nodes; i++)
	{
		if(TEST_DEBUG)
		{	
			std::cout<<"test number "<<i<<std::endl;
			std::cout<<"comparing " <<parallel_results[i] <<" and "<<BGL_results[i]<<std::endl;
		}
		if(parallel_results[i] != BGL_results[i])
		{
			if(parallel_results[i] != INFINITY && BGL_results[i] !=  2147483647) return false;
		}
		
		//not sure if I need to check predecessors because they might be different
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movl %esi, %ebp
movl %edi, 0xc(%rsp)
testl %edi, %edi
je 0x8590
movq 0xda7b(%rip), %rbx      # 0x15fd0
leaq 0x7d93(%rip), %rsi      # 0x102ef
movl $0x16, %edx
movq %rbx, %rdi
callq 0x3300
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x7d66(%rip), %rsi      # 0x10306
leaq 0x7d6e(%rip), %rdx      # 0x10315
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0xa112
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0xe81f
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x85dd
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x68(%rsp), %rsi
movq 0x20(%rsi), %r13
subq 0x18(%rsi), %r13
leaq 0x40(%rsp), %rdx
movq $0x1, (%rdx)
leaq 0xd8(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0xa0(%rsp), %rdi
leaq 0xd0(%rsp), %rcx
movl %ebp, %r8d
callq 0xc5b5
shrq $0x5, %r13
movslq %r13d, %rsi
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x9ade
leaq 0x100(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x9b6c
movq 0x40(%rsp), %rdx
leaq 0x10(%rsp), %rdi
leaq 0x100(%rsp), %r14
leaq 0x28(%rsp), %rcx
movq %r14, %rsi
callq 0x4141
leaq 0x118(%rsp), %rbx
movq 0x18(%rbx), %rdi
movl $0x1, %esi
callq 0x32b0
movq %rbx, %rdi
callq 0x9d84
movq -0x18(%rbx), %rdi
cmpq %r14, %rdi
je 0x86b1
movq (%rdi), %rbx
movl $0x28, %esi
callq 0x32b0
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x869c
testl %r13d, %r13d
jle 0x881f
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %r12d, %r12d
leaq 0xa0(%rsp), %rbp
movq %rsp, %r14
xorl %r15d, %r15d
cmpb $0x0, 0xc(%rsp)
je 0x87ba
movl $0xc, %edx
movq 0xd8e7(%rip), %rdi      # 0x15fd0
leaq 0x7bc4(%rip), %rsi      # 0x102b4
callq 0x3300
movq 0xd8d4(%rip), %rdi      # 0x15fd0
movl %r12d, %esi
callq 0x3480
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movl $0xa, %edx
movq 0xd896(%rip), %rdi      # 0x15fd0
leaq 0x7b80(%rip), %rsi      # 0x102c1
callq 0x3300
movq %r12, (%rsp)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x99a8
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq 0xd86d(%rip), %rdi      # 0x15fd0
callq 0x33f0
movq %rax, %rbx
movl $0x5, %edx
movq %rax, %rdi
leaq 0x79d0(%rip), %rsi      # 0x1014a
callq 0x3300
movq 0x10(%rsp), %rax
movl (%rax,%r12,4), %esi
movq %rbx, %rdi
callq 0x3480
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movq %r12, (%rsp)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x99a8
movq 0x10(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2ssl (%rcx,%r12,4), %xmm0
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x87e2
jnp 0x880d
movq %r12, (%rsp)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x99a8
movss (%rax), %xmm0
ucomiss 0x7934(%rip), %xmm0     # 0x10130
jae 0x880d
movq 0x10(%rsp), %rdi
cmpl $0x7fffffff, (%rdi,%r12,4) # imm = 0x7FFFFFFF
jne 0x882c
incq %r12
cmpq %r13, %r12
setae %r15b
jne 0x86d2
jmp 0x8822
movb $0x1, %r15b
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8839
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
leaq 0x80(%rsp), %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x8858
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
leaq 0xa0(%rsp), %rdi
callq 0x9fea
leaq 0xd0(%rsp), %rdi
callq 0xa02c
movq 0x98(%rsp), %rdi
movl $0x1, %esi
callq 0x32b0
movq %rbx, %rdi
callq 0x9d84
movq 0x68(%rsp), %rdi
leaq 0x68(%rsp), %r14
cmpq %r14, %rdi
je 0x88b0
movq (%rdi), %rbx
movl $0x28, %esi
callq 0x32b0
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x889b
andb $0x1, %r15b
movl %r15d, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x9c06
jmp 0x8926
movq %rax, %rbx
jmp 0x8926
movq %rax, %rbx
jmp 0x893d
movq %rax, %rbx
jmp 0x894a
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x8961
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x8961
jmp 0x890c
jmp 0x890c
jmp 0x890c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8926
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x893d
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
leaq 0xa0(%rsp), %rdi
callq 0x9fea
leaq 0xd0(%rsp), %rdi
callq 0xa02c
leaq 0x68(%rsp), %rdi
callq 0x9c06
movq %rbx, %rdi
callq 0x34a0