// File: /workspace/github_cpp_makefile_star2_O2/gcollet[P]MstatX/src/main.cpp
// Function: main
int main (int argc, char **argv)
{
	clock_t t1,t2;
	t1 = clock();
	
	/* 
	 * Parses command line 
	 */
	try {
		Options::Get().Parse(argc, argv);
	}
	catch (exception &e) {
		cerr << e.what() << "\n";
		Options::Get().print_usage();
		exit(0);
	}
	cout << "Statistic: " << Options::Get().statistic << "\n";
	/* 
	 * Initiates Statistic factory
	 */
	try {
	  AddAllStatistics();
	} catch (exception &e){ 
		cerr << e.what() << "\n";
		exit(0);
	}
	
	/*
	 * Read the multiple alignment 
	 */
	Msa msa(Options::Get().input_fname);
	
	/* 
	 * Calculate the statistic & print it
	 */
	Statistic * stat = StatisticFactory::CreateByName(Options::Get().statistic);
	stat->calculate(msa);
	stat->print(msa);
	delete stat;
	
	/*
	 * Print time
	 */
	t2 = clock();		
	cout << "Mstatx computed in "<< (t2 - t1) / (double)CLOCKS_PER_SEC <<" seconds\nResults are written in " << Options::Get().output_fname << "\n\n";
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xf0, %rsp
movq %rsi, %r14
movl %edi, %ebp
callq 0x41a0
movq %rax, %rbx
callq 0x4a00
movl %ebp, %edi
movq %r14, %rsi
callq 0x5eba
movq 0xd2ea(%rip), %rdi      # 0x12fc0
leaq 0x7443(%rip), %rsi      # 0xd120
callq 0x4250
movq %rax, %r14
callq 0x4a00
leaq 0xc8(%rax), %rsi
movq %r14, %rdi
callq 0x4240
leaq 0x77f6(%rip), %rsi      # 0xd4f6
movq %rax, %rdi
callq 0x4250
callq 0xb4b8
callq 0x4a00
leaq 0x68(%rax), %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0x4350
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x9044
movq %rsp, %rdi
callq 0x4110
callq 0x4a00
addq $0xc8, %rax
movq %rax, %rdi
callq 0x6312
movq %rax, %r14
movq (%rax), %rax
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq *0x10(%rax)
movq (%r14), %rax
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq *0x18(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
callq 0x41a0
movq %rax, %r14
movq 0xd240(%rip), %rdi      # 0x12fc0
leaq 0x73a5(%rip), %rsi      # 0xd12c
callq 0x4250
subq %rbx, %r14
cvtsi2sd %r14, %xmm0
divsd 0x7374(%rip), %xmm0     # 0xd110
movq %rax, %rdi
callq 0x43c0
leaq 0x7395(%rip), %rsi      # 0xd140
movq %rax, %rdi
callq 0x4250
movq %rax, %rbx
callq 0x4a00
addq $0xa8, %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4240
leaq 0x7722(%rip), %rsi      # 0xd4f5
movq %rax, %rdi
callq 0x4250
leaq 0x20(%rsp), %rdi
callq 0x63b4
xorl %eax, %eax
addq $0xf0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4110
jmp 0x5eb1
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x5eb1
movq %rbx, %rdi
callq 0x40e0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0xd1c1(%rip), %rdi      # 0x12fe8
movq %rax, %rsi
callq 0x4250
leaq 0x76c0(%rip), %rsi      # 0xd4f6
movq %rax, %rdi
callq 0x4250
jmp 0x5e8b
movq %rax, %rbx
callq 0x43f0
jmp 0x5eb1
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x5eb1
movq %rbx, %rdi
callq 0x40e0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0xd17e(%rip), %rdi      # 0x12fe8
movq %rax, %rsi
callq 0x4250
leaq 0x767d(%rip), %rsi      # 0xd4f6
movq %rax, %rdi
callq 0x4250
callq 0x4a00
callq 0x5f08
xorl %edi, %edi
callq 0x42d0
movq %rax, %rbx
callq 0x43f0
jmp 0x5eb1
movq %rax, %rdi
callq 0x49c1
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x63b4
movq %rbx, %rdi
callq 0x4430
nop