// File: /workspace/github_cpp_makefile_star2_O2/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 0x5eb0(%rip), %rsi      # 0xe3f6
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x8ab4
leaq 0x5e4f(%rip), %rsi      # 0xe3ae
leaq 0x28(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x8ab4
pushq $0x1
popq %rbx
pushq $0x2
popq %r15
cmpl $0x1, %ebp
jle 0x85da
movq 0x8(%r14), %rdi
callq 0x43c0
movl %eax, 0x4(%rsp)
cmpl $0x2, %ebp
je 0x85de
movq 0x10(%r14), %rdi
callq 0x43c0
movl %eax, %ebx
leal 0x1(%rbx), %r15d
cmpl $0x4, %ebp
jb 0x85de
movq 0x18(%r14), %rdi
callq 0x43c0
cmpl %ebx, %eax
cmovgl %eax, %r15d
cmpl $0x4, %ebp
je 0x85de
movq 0x20(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x44b0
cmpl $0x6, %ebp
jb 0x8637
movq 0x28(%r14), %rsi
leaq 0x28(%rsp), %rdi
callq 0x44b0
jmp 0x8637
movl %ebx, 0x4(%rsp)
leaq 0x5dd3(%rip), %rsi      # 0xe3b8
leaq 0x8(%rsp), %rdi
callq 0x44b0
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x4330
leaq 0x48(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movl $0x1388, %edx           # imm = 0x1388
callq 0x46cc
leaq 0x48(%rsp), %rdi
callq 0x4120
movq 0xe9a5(%rip), %rdi      # 0x16fc8
leaq 0x5d9a(%rip), %rsi      # 0xe3c4
callq 0x4290
movq %rax, %rdi
callq 0x4150
leaq 0x88(%rsp), %rdi
callq 0x4420
leaq 0x88(%rsp), %rdi
leaq 0x28(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x4140
leaq 0x68(%rsp), %rbp
pushq $0x1
popq %r14
leaq 0x5b46(%rip), %r12      # 0xe1af
cmpl %r15d, %ebx
jg 0x86fa
movq 0xe94f(%rip), %rdi      # 0x16fc8
leaq 0x5d5e(%rip), %rsi      # 0xe3de
callq 0x4290
movq %rax, %rdi
movl %ebx, %esi
callq 0x4460
movq %rax, %rdi
callq 0x4150
leaq 0x88(%rsp), %rdi
movl %ebx, %esi
callq 0x4460
movq %rax, %rdi
leaq 0x5d45(%rip), %rsi      # 0xe3f5
callq 0x4290
movq %rax, %r13
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x4330
movl %r14d, %edi
movl %ebx, %esi
movl 0x4(%rsp), %edx
movq %rbp, %rcx
callq 0x81a8
movq %r13, %rdi
movl %eax, %esi
callq 0x4460
movq %rax, %rdi
movq %r12, %rsi
callq 0x4290
movq %rbp, %rdi
callq 0x4120
addl %ebx, %ebx
jmp 0x8669
leaq 0x88(%rsp), %rdi
callq 0x4360
leaq 0x88(%rsp), %rdi
callq 0x43a0
leaq 0x28(%rsp), %rdi
callq 0x4120
leaq 0x8(%rsp), %rdi
callq 0x4120
xorl %eax, %eax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x4120
jmp 0x8778
jmp 0x8754
movq %rax, %rbx
jmp 0x8782
jmp 0x8768
movq %rax, %rbx
jmp 0x8778
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4120
jmp 0x876b
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x43a0
leaq 0x28(%rsp), %rdi
callq 0x4120
leaq 0x8(%rsp), %rdi
callq 0x4120
movq %rbx, %rdi
callq 0x4470