// File: /workspace/github_cpp_makefile_star2_O1/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 0x8213
movq 0xedf8(%rip), %r14      # 0x16fd0
leaq 0x805d(%rip), %rsi      # 0x1023c
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 0x8030(%rip), %rsi      # 0x10253
leaq 0x8049(%rip), %rdx      # 0x10273
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0xa2a8
leaq 0x78(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xe0c8
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x8260
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 0x120(%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 0xe8(%rsp), %rdi
leaq 0x118(%rsp), %rcx
movq %r15, %rsi
movq %r12, %rdx
movl %ebx, %r8d
callq 0xc863
shrq $0x5, %r13
callq 0x3060
subq %r14, %rax
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
imulq %rcx
movq %rdx, %r14
movslq %r13d, %rsi
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x9c80
leaq 0xb0(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x9d0a
movq 0x50(%rsp), %rdx
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rbx
leaq 0x38(%rsp), %rcx
movq %rbx, %rsi
callq 0x4146
movq %r14, 0x28(%rsp)
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x833b
movl $0x1, %esi
callq 0x32b0
leaq 0xc8(%rsp), %r14
movq %r14, %rdi
callq 0x9f26
movq -0x18(%r14), %rdi
cmpq %rbx, %rdi
je 0x8369
movq (%rdi), %r14
movl $0x28, %esi
callq 0x32b0
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x8354
testl %r13d, %r13d
setle %r14b
jle 0x84d8
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movq %r13, 0x30(%rsp)
xorl %r12d, %r12d
movq 0xec44(%rip), %r13      # 0x16fd0
leaq 0xe8(%rsp), %r15
movq %rsp, %rbx
cmpb $0x0, 0xc(%rsp)
je 0x846f
movl $0xc, %edx
movq %r13, %rdi
leaq 0x7ec3(%rip), %rsi      # 0x10274
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 0x7e87(%rip), %rsi      # 0x10281
callq 0x3300
movq %r12, (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x9b4c
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq %r13, %rdi
callq 0x33f0
movq %rax, %rbp
movl $0x5, %edx
movq %rax, %rdi
leaq 0x7cdb(%rip), %rsi      # 0x1010a
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 0x9b4c
movq 0x10(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsi2ssl (%rcx,%r12,4), %xmm0
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x8497
jnp 0x84c6
movq %r12, (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x9b4c
movss (%rax), %xmm0
ucomiss 0x7c3f(%rip), %xmm0     # 0x100f0
jae 0x84c6
movq 0x10(%rsp), %rax
cmpl $0x7fffffff, (%rax,%r12,4) # imm = 0x7FFFFFFF
jne 0x8559
incq %r12
cmpq 0x30(%rsp), %r12
setae %r14b
jne 0x8397
movq 0xeaf1(%rip), %rdi      # 0x16fd0
leaq 0x7da6(%rip), %rsi      # 0x1028c
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 0xeaba(%rip), %rdi      # 0x16fd0
callq 0x33f0
movq %rax, %rbx
leaq 0x7d7d(%rip), %rsi      # 0x102a2
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 0x8570
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
leaq 0x78(%rsp), %r15
je 0x858c
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
leaq 0x90(%rsp), %rbx
leaq 0xe8(%rsp), %rdi
callq 0xa186
leaq 0x118(%rsp), %rdi
callq 0xa1c8
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x85c1
movl $0x1, %esi
callq 0x32b0
movq %rbx, %rdi
callq 0x9f26
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0x85e8
movq (%rdi), %rbx
movl $0x28, %esi
callq 0x32b0
movq %rbx, %rdi
cmpq %r15, %rbx
jne 0x85d3
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 0xb0(%rsp), %rdi
callq 0x9da4
jmp 0x8660
movq %rax, %rbx
jmp 0x8660
movq %rax, %rbx
jmp 0x8677
movq %rax, %rbx
jmp 0x8684
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x869b
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x869b
jmp 0x8646
jmp 0x8646
jmp 0x8646
jmp 0x8646
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8660
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x8677
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
leaq 0xe8(%rsp), %rdi
callq 0xa186
leaq 0x118(%rsp), %rdi
callq 0xa1c8
leaq 0x78(%rsp), %rdi
callq 0x9da4
movq %rbx, %rdi
callq 0x34a0