// File: /workspace/github_cpp_makefile_star2_O3/flastest[P]HeterogeneousParallelDijkstra/parallel_workloads.cc
// Function: main
int main(int argc, char** argv)
{


	bool debug_on = true;
	int number_trials = 1;
	int num_threads = 1;
	int max_threads = 2;
	std::string graph_name = "";
	std::string ostream_name = "times.txt";

	if (argc >= 2)
	{
		number_trials = atoi(argv[1]);
	}
	if (argc >= 3)
	{
		num_threads = atoi(argv[2]);
		max_threads = num_threads + 1;
	}
	if (argc >= 4)
	{
		max_threads = atoi(argv[3]);
		if (max_threads	< num_threads + 1) max_threads = num_threads + 1;
	} 
	if (argc >= 5) 
	{
		graph_name = argv[4];
	}
	if (argc<5) {
		graph_name = "1knodes.txt";

		generate_graph(graph_name,1000,5000);
		std::cout<<"graph has been generated." <<std::endl;
	}

	if (argc >= 6)
	{
		ostream_name = argv[5];
	}
	


	ofstream file_stream;
  	file_stream.open (ostream_name);

  	for (int i = num_threads; i <= max_threads; i*=2)
  	{
  		std::cout <<"about to start thread "<<i<<std::endl;
  		file_stream<<i<<"\t"<<get_min_graph_time_for_given_amount_of_threads(debug_on, i, number_trials, graph_name)<< "\n";

  	}

	file_stream.close();


}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rsi, %r14
movl %edi, %ebp
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x6e4f(%rip), %rdx      # 0x10406
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0xa112
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x6dea(%rip), %rsi      # 0x103be
leaq 0x6dec(%rip), %rdx      # 0x103c7
leaq 0x28(%rsp), %rdi
callq 0xa112
movl $0x1, %ebx
cmpl $0x1, %ebp
jle 0x960e
movq 0x8(%r14), %rdi
callq 0x33e0
movl %eax, 0x4(%rsp)
cmpl $0x2, %ebp
jne 0x987a
movl $0x2, (%rsp)
jmp 0x961d
movl $0x2, (%rsp)
movl $0x1, 0x4(%rsp)
leaq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x6d9b(%rip), %rcx      # 0x103c8
movl $0xb, %r8d
xorl %esi, %esi
callq 0x33d0
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0xa07c
leaq 0x68(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movl $0x1388, %edx           # imm = 0x1388
callq 0x377c
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x9685
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0xc944(%rip), %r14      # 0x15fd0
leaq 0x6d41(%rip), %rsi      # 0x103d4
movl $0x19, %edx
movq %r14, %rdi
callq 0x3300
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq 0xc912(%rip), %rdi      # 0x15fd0
callq 0x3040
movq %rax, %rdi
callq 0x31d0
leaq 0x88(%rsp), %rdi
callq 0x3440
leaq 0x88(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x10, %edx
callq 0x3150
movl (%rsp), %eax
cmpl %eax, %ebx
jg 0x97e9
leaq 0x58(%rsp), %r13
movq 0xc8ca(%rip), %r14      # 0x15fd0
leaq 0x48(%rsp), %rbp
leaq 0x6aad(%rip), %r15      # 0x101bf
movl $0x16, %edx
movq %r14, %rdi
leaq 0x6ccd(%rip), %rsi      # 0x103ee
callq 0x3300
movq %r14, %rdi
movl %ebx, %esi
callq 0x3480
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
leaq 0x88(%rsp), %rdi
movl %ebx, %esi
callq 0x3480
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6c8a(%rip), %rsi      # 0x10405
callq 0x3300
movq %r13, 0x48(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0xa07c
movl $0x1, %edi
movl %ebx, %esi
movl 0x4(%rsp), %edx
movq %rbp, %rcx
callq 0x8fc5
movq %r12, %rdi
movl %eax, %esi
callq 0x3480
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3300
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x97de
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32b0
addl %ebx, %ebx
cmpl (%rsp), %ebx
jle 0x9712
leaq 0x88(%rsp), %rdi
callq 0x3370
movq 0xc7c3(%rip), %rax      # 0x15fc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x90(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x88(%rsp,%rcx)
callq 0x3240
leaq 0x180(%rsp), %rdi
callq 0x30f0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x984a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x9866
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32b0
xorl %eax, %eax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r14), %rdi
callq 0x33e0
movl %eax, %ebx
leal 0x1(%rbx), %r15d
cmpl $0x4, %ebp
jb 0x9909
movq 0x18(%r14), %rdi
callq 0x33e0
cmpl %ebx, %eax
cmovgl %eax, %r15d
cmpl $0x4, %ebp
movl %r15d, (%rsp)
je 0x961d
movq 0x20(%r14), %r15
leaq 0x8(%rsp), %r12
movq 0x8(%r12), %r13
movq %r15, %rdi
callq 0x3130
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x33d0
cmpl $0x6, %ebp
jb 0x96cb
movq 0x28(%r14), %r14
leaq 0x28(%rsp), %r15
movq 0x8(%r15), %r12
movq %r14, %rdi
callq 0x3130
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x33d0
jmp 0x96cb
movl %r15d, (%rsp)
jmp 0x961d
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x9968
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x9968
jmp 0x9937
movq %rax, %rbx
jmp 0x9984
jmp 0x9958
movq %rax, %rbx
jmp 0x9968
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x995b
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x995b
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x33b0
leaq 0x38(%rsp), %rax
movq 0x28(%rsp), %rdi
cmpq %rax, %rdi
je 0x9984
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x99a0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x34a0