// File: /workspace/github_cpp_makefile_star2_O3/flastest[P]HeterogeneousParallelDijkstra/parallel_workloads.cc
// Function: test_DOTA(bool, int)
bool test_DOTA(bool TEST_DEBUG, int num_threads){
	//aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah
	if (TEST_DEBUG) std::cout<<"loading graph from BBO"<<std::endl;
	graph_t g = graph_from_file("DotaLeague/DotaLeague_Edge_Basic",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;

	auto startTime = chrono::high_resolution_clock::now();
	distance_map_t parallel_results = parallel_dijkstra(g, s, pred, num_threads);
	auto endTime = chrono::high_resolution_clock::now();

	float t = chrono::duration_cast<std::chrono::microseconds>( endTime - startTime ).count();

	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
	}

	std::cout<<"test dota graph took " << t << "microseconds"<<std::endl;
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movl %esi, %ebx
movl %edi, 0xc(%rsp)
testl %edi, %edi
je 0x80a9
movq 0xdf62(%rip), %r14      # 0x15fd0
leaq 0x8207(%rip), %rsi      # 0x1027c
movl $0x16, %edx
movq %r14, %rdi
callq 0x3300
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
leaq 0x68(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x81da(%rip), %rsi      # 0x10293
leaq 0x81f3(%rip), %rdx      # 0x102b3
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0xa112
leaq 0x78(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xddfc
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x80f6
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x78(%rsp), %r15
movq 0x20(%r15), %r13
subq 0x18(%r15), %r13
leaq 0x50(%rsp), %r12
movq $0x1, (%r12)
leaq 0xe8(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
callq 0x3060
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
leaq 0xe0(%rsp), %rcx
movq %r15, %rsi
movq %r12, %rdx
movl %ebx, %r8d
callq 0xc5b5
shrq $0x5, %r13
callq 0x3060
subq %r14, %rax
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
imulq %rcx
movq %rdx, %r15
movslq %r13d, %rsi
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x9ade
leaq 0x110(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x9b6c
movq 0x50(%rsp), %rdx
leaq 0x10(%rsp), %rdi
leaq 0x110(%rsp), %rbx
leaq 0x38(%rsp), %rcx
movq %rbx, %rsi
callq 0x4141
leaq 0x128(%rsp), %r14
movq 0x18(%r14), %rdi
movl $0x1, %esi
callq 0x32b0
movq %r14, %rdi
callq 0x9d84
movq -0x18(%r14), %rdi
cmpq %rbx, %rdi
je 0x81f1
movq (%rdi), %r14
movl $0x28, %esi
callq 0x32b0
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x81dc
movq %r15, 0x28(%rsp)
testl %r13d, %r13d
jle 0x8366
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movq %r13, 0x30(%rsp)
xorl %r12d, %r12d
movq 0xddbb(%rip), %r13      # 0x15fd0
leaq 0xb0(%rsp), %r15
movq %rsp, %rbx
xorl %r14d, %r14d
cmpb $0x0, 0xc(%rsp)
je 0x82fb
movl $0xc, %edx
movq %r13, %rdi
leaq 0x8077(%rip), %rsi      # 0x102b4
callq 0x3300
movq %r13, %rdi
movl %r12d, %esi
callq 0x3480
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbp, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movl $0xa, %edx
movq %r13, %rdi
leaq 0x803b(%rip), %rsi      # 0x102c1
callq 0x3300
movq %r12, (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x99a8
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq %r13, %rdi
callq 0x33f0
movq %rax, %rbp
movl $0x5, %edx
movq %rax, %rdi
leaq 0x7e8f(%rip), %rsi      # 0x1014a
callq 0x3300
movq 0x10(%rsp), %rax
movl (%rax,%r12,4), %esi
movq %rbp, %rdi
callq 0x3480
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbp, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movq %r12, (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x99a8
movq 0x10(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2ssl (%rcx,%r12,4), %xmm0
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x8323
jnp 0x8352
movq %r12, (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x99a8
movss (%rax), %xmm0
ucomiss 0x7df3(%rip), %xmm0     # 0x10130
jae 0x8352
movq 0x10(%rsp), %rdi
cmpl $0x7fffffff, (%rdi,%r12,4) # imm = 0x7FFFFFFF
jne 0x83f4
incq %r12
cmpq 0x30(%rsp), %r12
setae %r14b
jne 0x8223
jmp 0x8369
movb $0x1, %r14b
movq 0xdc60(%rip), %rdi      # 0x15fd0
leaq 0x7f55(%rip), %rsi      # 0x102cc
movl $0x15, %edx
callq 0x3300
movq 0x28(%rsp), %rcx
movq %rcx, %rax
shrq $0x3f, %rax
sarq $0x7, %rcx
addq %rax, %rcx
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
cvtss2sd %xmm0, %xmm0
movq 0xdc29(%rip), %rdi      # 0x15fd0
callq 0x33f0
movq %rax, %rbx
leaq 0x7f2c(%rip), %rsi      # 0x102e2
movl $0xc, %edx
movq %rax, %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
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8401
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
leaq 0x90(%rsp), %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x8420
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
leaq 0xb0(%rsp), %rdi
callq 0x9fea
leaq 0xe0(%rsp), %rdi
callq 0xa02c
movq 0xa8(%rsp), %rdi
movl $0x1, %esi
callq 0x32b0
movq %rbx, %rdi
callq 0x9d84
movq 0x78(%rsp), %rdi
leaq 0x78(%rsp), %r15
cmpq %r15, %rdi
je 0x8478
movq (%rdi), %rbx
movl $0x28, %esi
callq 0x32b0
movq %rbx, %rdi
cmpq %r15, %rbx
jne 0x8463
andb $0x1, %r14b
movl %r14d, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x9c06
jmp 0x84f0
movq %rax, %rbx
jmp 0x84f0
movq %rax, %rbx
jmp 0x8507
movq %rax, %rbx
jmp 0x8514
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x852b
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x852b
jmp 0x84d6
jmp 0x84d6
jmp 0x84d6
jmp 0x84d6
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x84f0
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x8507
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
leaq 0xb0(%rsp), %rdi
callq 0x9fea
leaq 0xe0(%rsp), %rdi
callq 0xa02c
leaq 0x78(%rsp), %rdi
callq 0x9c06
movq %rbx, %rdi
callq 0x34a0