// File: /workspace/github_cpp_makefile_star2_O2/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, %ebx
testl %edi, %edi
je 0x7ad8
movq 0xf504(%rip), %rdi      # 0x16fc8
leaq 0x6814(%rip), %rsi      # 0xe2df
callq 0x4290
movq %rax, %rdi
callq 0x4150
leaq 0x6817(%rip), %rsi      # 0xe2f6
leaq 0x48(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x8ab4
leaq 0x98(%rsp), %rdi
leaq 0x48(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0xd6d0
leaq 0x48(%rsp), %rdi
callq 0x4120
leaq 0x98(%rsp), %rsi
movq 0x20(%rsi), %r12
subq 0x18(%rsi), %r12
leaq 0x28(%rsp), %rdx
movq $0x1, (%rdx)
leaq 0x70(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0xd0(%rsp), %rdi
leaq 0x68(%rsp), %rcx
movl %ebp, %r8d
callq 0xba1d
shrq $0x5, %r12
movslq %r12d, %rsi
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x899c
leaq 0x100(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x89ee
movq 0x28(%rsp), %rdx
leaq 0x8(%rsp), %rdi
leaq 0x100(%rsp), %rsi
leaq 0x30(%rsp), %rcx
callq 0x4a63
leaq 0x100(%rsp), %rdi
callq 0x8a32
xorl %r14d, %r14d
testl %r12d, %r12d
movl $0x0, %r15d
movq %r12, 0x20(%rsp)
cmovgl %r12d, %r15d
leaq 0xd0(%rsp), %rbp
movq %rsp, %r12
cmpq %r14, %r15
je 0x7cb0
testb %bl, %bl
je 0x7c58
movq 0xf3e8(%rip), %rdi      # 0x16fc8
leaq 0x66bd(%rip), %rsi      # 0xe2a4
callq 0x4290
movq %rax, %rdi
movl %r14d, %esi
callq 0x4460
movq %rax, %rdi
callq 0x4150
movq 0xf3c2(%rip), %rdi      # 0x16fc8
leaq 0x66a4(%rip), %rsi      # 0xe2b1
callq 0x4290
movq %rax, %r13
movq %r14, (%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x88ac
movss (%rax), %xmm0
movq %r13, %rdi
callq 0x4200
movq %rax, %rdi
leaq 0x6500(%rip), %rsi      # 0xe13a
callq 0x4290
movq 0x8(%rsp), %rcx
movl (%rcx,%r14,4), %esi
movq %rax, %rdi
callq 0x4460
movq %rax, %rdi
callq 0x4150
movq %r14, (%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x88ac
movq 0x8(%rsp), %rcx
cvtsi2ssl (%rcx,%r14,4), %xmm0
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x7c7d
jnp 0x7ca8
movq %r14, (%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x88ac
movss (%rax), %xmm0
ucomiss 0x6489(%rip), %xmm0     # 0xe120
jae 0x7ca8
movq 0x8(%rsp), %rax
cmpl $0x7fffffff, (%rax,%r14,4) # imm = 0x7FFFFFFF
jne 0x7cb0
incq %r14
jmp 0x7bcc
movslq 0x20(%rsp), %rax
cmpq %rax, %r14
setge %bl
leaq 0x8(%rsp), %rdi
callq 0x930c
leaq 0x30(%rsp), %rdi
callq 0x9c58
leaq 0xd0(%rsp), %rdi
callq 0x8ef0
leaq 0x68(%rsp), %rdi
callq 0x8fb4
leaq 0x98(%rsp), %rdi
callq 0x8a32
movl %ebx, %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 0x8a32
jmp 0x7d4f
movq %rax, %rbx
jmp 0x7d4f
movq %rax, %rbx
jmp 0x7d59
movq %rax, %rbx
jmp 0x7d66
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x4120
jmp 0x7d7d
movq %rax, %rbx
jmp 0x7d7d
jmp 0x7d42
jmp 0x7d42
jmp 0x7d42
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x930c
leaq 0x30(%rsp), %rdi
callq 0x9c58
leaq 0xd0(%rsp), %rdi
callq 0x8ef0
leaq 0x68(%rsp), %rdi
callq 0x8fb4
leaq 0x98(%rsp), %rdi
callq 0x8a32
movq %rbx, %rdi
callq 0x4470