// File: /workspace/github_cpp_makefile_star2_O1/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 0x6580
movq 0xfc88(%rip), %r14      # 0x15fc0
leaq 0x9e01(%rip), %rsi      # 0x10140
movl $0xb, %edx
movq %r14, %rdi
callq 0x42a0
callq 0x4f1c
movq 0xc8(%rax), %rsi
movq 0xd0(%rax), %rdx
movq %r14, %rdi
callq 0x42a0
leaq 0xa17e(%rip), %rsi      # 0x104ec
movl $0x1, %edx
movq %rax, %rdi
callq 0x42a0
callq 0xdc1c
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 0x5ccc
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0xaf20
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x63ca
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4250
callq 0x4f1c
addq $0xc8, %rax
movq %rax, %rdi
callq 0x6c0e
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 0xfbac(%rip), %rdi      # 0x15fc0
leaq 0x9d31(%rip), %rsi      # 0x1014c
movl $0x13, %edx
callq 0x42a0
subq %rbx, %r14
cvtsi2sd %r14, %xmm0
divsd 0x9d03(%rip), %xmm0     # 0x10138
movq 0xfb84(%rip), %rdi      # 0x15fc0
callq 0x43c0
movq %rax, %rbx
leaq 0x9d15(%rip), %rsi      # 0x10160
movl $0x20, %edx
movq %rax, %rdi
callq 0x42a0
callq 0x4f1c
movq 0xa8(%rax), %rsi
movq 0xb0(%rax), %rdx
movq %rbx, %rdi
callq 0x42a0
leaq 0xa071(%rip), %rsi      # 0x104eb
movl $0x2, %edx
movq %rax, %rdi
callq 0x42a0
leaq 0x28(%rsp), %rdi
callq 0x6cc8
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 0x6577
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4250
jmp 0x6577
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x6577
movq %rbx, %rdi
callq 0x40f0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0xfb00(%rip), %rdi      # 0x15fe8
movq %rax, %rsi
callq 0x4230
leaq 0x9ff5(%rip), %rsi      # 0x104ec
movq %rax, %rdi
callq 0x4230
jmp 0x6551
movq %rax, %rbx
callq 0x43f0
jmp 0x6577
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x6577
movq %rbx, %rdi
callq 0x40f0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0xfabd(%rip), %rdi      # 0x15fe8
movq %rax, %rsi
callq 0x4230
leaq 0x9fb2(%rip), %rsi      # 0x104ec
movl $0x1, %edx
movq %rax, %rdi
callq 0x42a0
callq 0x4f1c
callq 0x65ce
xorl %edi, %edi
callq 0x42e0
movq %rax, %rbx
callq 0x43f0
jmp 0x6577
movq %rax, %rdi
callq 0x4f11
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x6cc8
movq %rbx, %rdi
callq 0x4440
nop