// File: 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
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movb %dil, %al
andb $0x1, %al
movb %al, -0x2(%rbp)
movl %esi, -0x8(%rbp)
testb $0x1, -0x2(%rbp)
je 0xa54e
movq 0x30a95(%rip), %rdi     # 0x3afc8
leaq 0x1cc16(%rip), %rsi     # 0x27150
callq 0x4320
movq %rax, %rdi
movq 0x30a57(%rip), %rsi     # 0x3afa0
callq 0x4380
leaq -0x61(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0x4590
movq -0x1a8(%rbp), %rdx
leaq 0x1cbfb(%rip), %rsi     # 0x27167
leaq -0x60(%rbp), %rdi
callq 0xd040
jmp 0xa577
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x1, %edx
callq 0x23a10
jmp 0xa58b
leaq -0x60(%rbp), %rdi
callq 0x41d0
leaq -0x61(%rbp), %rdi
callq 0x43a0
leaq -0x40(%rbp), %rdi
callq 0xc720
movq %rax, -0x1b0(%rbp)
jmp 0xa5af
movq -0x1b0(%rbp), %rax
movl %eax, -0x78(%rbp)
movl $0x1, %edi
leaq -0x40(%rbp), %rsi
callq 0xcb40
movq %rax, -0x1b8(%rbp)
jmp 0xa5d0
movq -0x1b8(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x1c0(%rbp)
callq 0xcb20
callq 0x4060
movq -0x1c0(%rbp), %rcx
movq %rax, -0xb8(%rbp)
movl -0x8(%rbp), %r8d
leaq -0xe8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x1cbe0
jmp 0xa61b
callq 0x4060
movq %rax, -0xf0(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xd120
movq %rax, -0x1c8(%rbp)
jmp 0xa643
movq -0x1c8(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x108(%rbp), %rdi
callq 0xd0f0
movq %rax, -0x1d0(%rbp)
jmp 0xa666
movq -0x1d0(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0x100(%rbp), %rdi
callq 0xd170
movq %rax, -0x1d8(%rbp)
jmp 0xa689
movq -0x1d8(%rbp), %rax
cvtsi2ss %rax, %xmm0
movss %xmm0, -0xf4(%rbp)
movslq -0x78(%rbp), %rax
movq %rax, -0x1e8(%rbp)
leaq -0x121(%rbp), %rdi
movq %rdi, -0x1e0(%rbp)
callq 0xcb60
movq -0x1e8(%rbp), %rsi
movq -0x1e0(%rbp), %rdx
leaq -0x120(%rbp), %rdi
callq 0xcb80
jmp 0xa6d7
leaq -0x121(%rbp), %rdi
callq 0xcbf0
leaq -0x178(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xcc10
jmp 0xa6f5
movq -0x80(%rbp), %rdx
leaq -0x140(%rbp), %rdi
leaq -0x178(%rbp), %rsi
leaq -0x120(%rbp), %rcx
callq 0x4fa0
jmp 0xa715
leaq -0x178(%rbp), %rdi
callq 0xcc90
movl $0x0, -0x17c(%rbp)
movl -0x17c(%rbp), %eax
cmpl -0x78(%rbp), %eax
jge 0xaa31
testb $0x1, -0x2(%rbp)
je 0xa922
movq 0x3087d(%rip), %rdi     # 0x3afc8
leaq 0x1ca36(%rip), %rsi     # 0x27188
callq 0x4320
movq %rax, -0x1f0(%rbp)
jmp 0xa760
movq -0x1f0(%rbp), %rdi
movl -0x17c(%rbp), %esi
callq 0x4570
movq %rax, -0x1f8(%rbp)
jmp 0xa77b
movq -0x1f8(%rbp), %rdi
movq 0x30817(%rip), %rsi     # 0x3afa0
callq 0x4380
jmp 0xa790
movq 0x30831(%rip), %rdi     # 0x3afc8
leaq 0x1c9f7(%rip), %rsi     # 0x27195
callq 0x4320
movq %rax, -0x200(%rbp)
jmp 0xa7ac
movslq -0x17c(%rbp), %rax
movq %rax, -0x188(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0xc610
movq %rax, -0x208(%rbp)
jmp 0xa7d6
movq -0x200(%rbp), %rdi
movq -0x208(%rbp), %rax
movss (%rax), %xmm0
callq 0x4270
movq %rax, -0x210(%rbp)
jmp 0xa7f6
movq -0x210(%rbp), %rdi
leaq 0x1c81a(%rip), %rsi     # 0x2701e
callq 0x4320
movq %rax, -0x218(%rbp)
jmp 0xa812
movslq -0x17c(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0xccc0
movq -0x218(%rbp), %rdi
movl (%rax), %esi
callq 0x4570
movq %rax, -0x220(%rbp)
jmp 0xa83c
movq -0x220(%rbp), %rdi
movq 0x30756(%rip), %rsi     # 0x3afa0
callq 0x4380
jmp 0xa851
jmp 0xa922
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0xa879
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x41d0
leaq -0x61(%rbp), %rdi
callq 0x43a0
jmp 0xab1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0xab14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0xab08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0xaafc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x121(%rbp), %rdi
callq 0xcbf0
jmp 0xaafc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0xaaf0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x178(%rbp), %rdi
callq 0xcc90
jmp 0xaaf0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x140(%rbp), %rdi
callq 0xca30
jmp 0xaaf0
movslq -0x17c(%rbp), %rax
movq %rax, -0x190(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0xc610
movq %rax, -0x228(%rbp)
jmp 0xa94c
movq -0x228(%rbp), %rax
movss (%rax), %xmm0
movss %xmm0, -0x22c(%rbp)
movslq -0x17c(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0xccc0
movss -0x22c(%rbp), %xmm0
cvtsi2ssl (%rax), %xmm1
ucomiss %xmm1, %xmm0
jne 0xa98a
jp 0xa98a
jmp 0xaa1b
movslq -0x17c(%rbp), %rax
movq %rax, -0x198(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0xc610
movq %rax, -0x238(%rbp)
jmp 0xa9b4
movq -0x238(%rbp), %rax
movss (%rax), %xmm0
xorl %eax, %eax
movss 0x1c63b(%rip), %xmm1    # 0x27004
ucomiss %xmm1, %xmm0
movb %al, -0x239(%rbp)
jne 0xa9d8
jp 0xa9d8
jmp 0xa9fa
movslq -0x17c(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0xccc0
cmpl $0x7fffffff, (%rax)     # imm = 0x7FFFFFFF
setne %al
movb %al, -0x239(%rbp)
movb -0x239(%rbp), %al
testb $0x1, %al
jne 0xaa06
jmp 0xaa19
movb $0x0, -0x1(%rbp)
movl $0x1, -0x19c(%rbp)
jmp 0xaaa9
jmp 0xaa1b
jmp 0xaa1d
movl -0x17c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x17c(%rbp)
jmp 0xa72b
movq 0x30590(%rip), %rdi     # 0x3afc8
leaq 0x1c761(%rip), %rsi     # 0x271a0
callq 0x4320
movq %rax, -0x248(%rbp)
jmp 0xaa4d
movq -0x248(%rbp), %rdi
movss -0xf4(%rbp), %xmm0
callq 0x4270
movq %rax, -0x250(%rbp)
jmp 0xaa6a
movq -0x250(%rbp), %rdi
leaq 0x1c73e(%rip), %rsi     # 0x271b6
callq 0x4320
movq %rax, -0x258(%rbp)
jmp 0xaa86
movq -0x258(%rbp), %rdi
movq 0x3050c(%rip), %rsi     # 0x3afa0
callq 0x4380
jmp 0xaa9b
movb $0x1, -0x1(%rbp)
movl $0x1, -0x19c(%rbp)
leaq -0x140(%rbp), %rdi
callq 0xca30
leaq -0x120(%rbp), %rdi
callq 0xcdb0
leaq -0xe8(%rbp), %rdi
callq 0xcd10
leaq -0xb0(%rbp), %rdi
callq 0xce10
leaq -0x40(%rbp), %rdi
callq 0xcc90
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
leaq -0x120(%rbp), %rdi
callq 0xcdb0
leaq -0xe8(%rbp), %rdi
callq 0xcd10
leaq -0xb0(%rbp), %rdi
callq 0xce10
leaq -0x40(%rbp), %rdi
callq 0xcc90
movq -0x70(%rbp), %rdi
callq 0x4580
nopw %cs:(%rax,%rax)