// File: /workspace/github_cpp_makefile_star2_O1/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 0x8700
movq 0xe90b(%rip), %rbx      # 0x16fd0
leaq 0x7be3(%rip), %rsi      # 0x102af
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 0x7bb6(%rip), %rsi      # 0x102c6
leaq 0x7bbe(%rip), %rdx      # 0x102d5
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0xa2a8
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0xeaf0
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x874d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x68(%rsp), %rsi
movq 0x20(%rsi), %r12
subq 0x18(%rsi), %r12
leaq 0x40(%rsp), %rdx
movq $0x1, (%rdx)
leaq 0x110(%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 0xd8(%rsp), %rdi
leaq 0x108(%rsp), %rcx
movl %ebp, %r8d
callq 0xc863
shrq $0x5, %r12
movslq %r12d, %rsi
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x9c80
leaq 0xa0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x9d0a
movq 0x40(%rsp), %rdx
leaq 0x10(%rsp), %rdi
leaq 0xa0(%rsp), %r14
leaq 0x28(%rsp), %rcx
movq %r14, %rsi
callq 0x4146
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x87fc
movl $0x1, %esi
callq 0x32b0
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdi
callq 0x9f26
movq -0x18(%rbx), %rdi
cmpq %r14, %rdi
je 0x882a
movq (%rdi), %rbx
movl $0x28, %esi
callq 0x32b0
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x8815
testl %r12d, %r12d
setle %bpl
jle 0x8997
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
leaq 0xd8(%rsp), %r13
movq %rsp, %r14
cmpb $0x0, 0xc(%rsp)
je 0x8934
movl $0xc, %edx
movq 0xe76d(%rip), %rdi      # 0x16fd0
leaq 0x7a0a(%rip), %rsi      # 0x10274
callq 0x3300
movq 0xe75a(%rip), %rdi      # 0x16fd0
movl %r15d, %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 0xe71c(%rip), %rdi      # 0x16fd0
leaq 0x79c6(%rip), %rsi      # 0x10281
callq 0x3300
movq %r15, (%rsp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x9b4c
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq 0xe6f3(%rip), %rdi      # 0x16fd0
callq 0x33f0
movq %rax, %rbx
movl $0x5, %edx
movq %rax, %rdi
leaq 0x7816(%rip), %rsi      # 0x1010a
callq 0x3300
movq 0x10(%rsp), %rax
movl (%rax,%r15,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 %r15, (%rsp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x9b4c
movq 0x10(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2ssl (%rcx,%r15,4), %xmm0
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x895c
jnp 0x8987
movq %r15, (%rsp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x9b4c
movss (%rax), %xmm0
ucomiss 0x777a(%rip), %xmm0     # 0x100f0
jae 0x8987
movq 0x10(%rsp), %rax
cmpl $0x7fffffff, (%rax,%r15,4) # imm = 0x7FFFFFFF
jne 0x8997
incq %r15
cmpq %r12, %r15
setae %bpl
jne 0x884c
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x89ae
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
leaq 0x68(%rsp), %r14
je 0x89ca
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
leaq 0x80(%rsp), %rbx
leaq 0xd8(%rsp), %rdi
callq 0xa186
leaq 0x108(%rsp), %rdi
callq 0xa1c8
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x89ff
movl $0x1, %esi
callq 0x32b0
movq %rbx, %rdi
callq 0x9f26
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x8a26
movq (%rdi), %rbx
movl $0x28, %esi
callq 0x32b0
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x8a11
andb $0x1, %bpl
movl %ebp, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x9da4
jmp 0x8a9b
movq %rax, %rbx
jmp 0x8a9b
movq %rax, %rbx
jmp 0x8ab2
movq %rax, %rbx
jmp 0x8abf
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x8ad6
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x8ad6
jmp 0x8a81
jmp 0x8a81
jmp 0x8a81
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8a9b
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x8ab2
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
leaq 0xd8(%rsp), %rdi
callq 0xa186
leaq 0x108(%rsp), %rdi
callq 0xa1c8
leaq 0x68(%rsp), %rdi
callq 0x9da4
movq %rbx, %rdi
callq 0x34a0