// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %r14
movl %edi, %ebp
callq 0x4180
movq %rax, %rbx
callq 0x4f1c
movl %ebp, %edi
movq %r14, %rsi
callq 0x6688
movq 0xfb80(%rip), %r14      # 0x15fc0
leaq 0x9d31(%rip), %rsi      # 0x10178
movl $0xb, %edx
movq %r14, %rdi
callq 0x42a0
callq 0x4f1c
movq 0xc8(%rax), %rsi
movq 0xd0(%rax), %rdx
movq %r14, %rdi
callq 0x42a0
leaq 0xa0ae(%rip), %rsi      # 0x10524
movl $0x1, %edx
movq %rax, %rdi
callq 0x42a0
callq 0xde7c
callq 0x4f1c
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x68(%rax), %rsi
movq 0x70(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x5cca
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0xb084
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x64d2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4250
callq 0x4f1c
addq $0xc8, %rax
movq %rax, %rdi
callq 0x6d16
movq %rax, %r14
movq (%rax), %rax
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq *0x10(%rax)
movq (%r14), %rax
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq *0x18(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
callq 0x4180
movq %rax, %r14
movq 0xfaa4(%rip), %rdi      # 0x15fc0
leaq 0x9c61(%rip), %rsi      # 0x10184
movl $0x13, %edx
callq 0x42a0
subq %rbx, %r14
cvtsi2sd %r14, %xmm0
divsd 0x9c33(%rip), %xmm0     # 0x10170
movq 0xfa7c(%rip), %rdi      # 0x15fc0
callq 0x43c0
movq %rax, %rbx
leaq 0x9c45(%rip), %rsi      # 0x10198
movl $0x20, %edx
movq %rax, %rdi
callq 0x42a0
callq 0x4f1c
movq 0xa8(%rax), %rsi
movq 0xb0(%rax), %rdx
movq %rbx, %rdi
callq 0x42a0
leaq 0x9fa1(%rip), %rsi      # 0x10523
movl $0x2, %edx
movq %rax, %rdi
callq 0x42a0
leaq 0x28(%rsp), %rdi
callq 0x6dce
xorl %eax, %eax
addq $0xf8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x667f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4250
jmp 0x667f
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x667f
movq %rbx, %rdi
callq 0x40f0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0xf9f8(%rip), %rdi      # 0x15fe8
movq %rax, %rsi
callq 0x4230
leaq 0x9f25(%rip), %rsi      # 0x10524
movq %rax, %rdi
callq 0x4230
jmp 0x6659
movq %rax, %rbx
callq 0x43f0
jmp 0x667f
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x667f
movq %rbx, %rdi
callq 0x40f0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0xf9b5(%rip), %rdi      # 0x15fe8
movq %rax, %rsi
callq 0x4230
leaq 0x9ee2(%rip), %rsi      # 0x10524
movl $0x1, %edx
movq %rax, %rdi
callq 0x42a0
callq 0x4f1c
callq 0x66d6
xorl %edi, %edi
callq 0x42e0
movq %rax, %rbx
callq 0x43f0
jmp 0x667f
movq %rax, %rdi
callq 0x4f11
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x6dce
movq %rbx, %rdi
callq 0x4440
nop