// File: 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
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x4230
movq %rax, -0x18(%rbp)
callq 0x5150
jmp 0x99b9
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x9d20
jmp 0x99c7
jmp 0x9a5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x9d02
movq -0x28(%rbp), %rdi
callq 0x4120
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, %rsi
movq 0x1c5dc(%rip), %rdi     # 0x25fe8
callq 0x4330
movq %rax, -0x140(%rbp)
jmp 0x9a1a
movq -0x140(%rbp), %rdi
leaq 0x11ace(%rip), %rsi     # 0x1b4f6
callq 0x4330
jmp 0x9a2f
callq 0x5150
jmp 0x9a36
callq 0x9db0
jmp 0x9a3d
xorl %edi, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x4560
jmp 0x9a57
jmp 0x9d02
movq 0x1c55d(%rip), %rdi     # 0x25fc0
leaq 0x116b6(%rip), %rsi     # 0x1b120
callq 0x4330
movq %rax, -0x148(%rbp)
callq 0x5150
movq -0x148(%rbp), %rdi
movq %rax, %rsi
addq $0xc8, %rsi
callq 0x4320
movq %rax, %rdi
leaq 0x11a5b(%rip), %rsi     # 0x1b4f6
callq 0x4330
callq 0x17700
jmp 0x9aa7
jmp 0x9b2e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x9d02
movq -0x28(%rbp), %rdi
callq 0x4120
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, %rsi
movq 0x1c4fc(%rip), %rdi     # 0x25fe8
callq 0x4330
movq %rax, -0x150(%rbp)
jmp 0x9afa
movq -0x150(%rbp), %rdi
leaq 0x119ee(%rip), %rsi     # 0x1b4f6
callq 0x4330
jmp 0x9b0f
xorl %edi, %edi
callq 0x4400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x4560
jmp 0x9b29
jmp 0x9d02
callq 0x5150
movq %rax, %rsi
addq $0x68, %rsi
leaq -0x130(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x4140
movq -0x158(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x11520
jmp 0x9b62
leaq -0x130(%rbp), %rdi
callq 0x41e0
callq 0x5150
movq %rax, -0x160(%rbp)
jmp 0x9b7c
movq -0x160(%rbp), %rdi
addq $0xc8, %rdi
callq 0xa530
movq %rax, -0x168(%rbp)
jmp 0x9b98
movq -0x168(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
leaq -0x110(%rbp), %rsi
callq *%rax
jmp 0x9bbf
movq -0x138(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
leaq -0x110(%rbp), %rsi
callq *%rax
jmp 0x9bd8
movq -0x138(%rbp), %rax
movq %rax, -0x170(%rbp)
cmpq $0x0, %rax
je 0x9bf9
movq -0x170(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
callq 0x4230
movq %rax, -0x20(%rbp)
movq 0x1c3b7(%rip), %rdi     # 0x25fc0
leaq 0x1151c(%rip), %rsi     # 0x1b12c
callq 0x4330
movq %rax, -0x178(%rbp)
jmp 0x9c1e
movq -0x178(%rbp), %rdi
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x114d3(%rip), %xmm1    # 0x1b110
divsd %xmm1, %xmm0
callq 0x4660
movq %rax, -0x180(%rbp)
jmp 0x9c4f
movq -0x180(%rbp), %rdi
leaq 0x114e3(%rip), %rsi     # 0x1b140
callq 0x4330
movq %rax, -0x188(%rbp)
jmp 0x9c6b
callq 0x5150
movq %rax, -0x190(%rbp)
jmp 0x9c79
movq -0x188(%rbp), %rdi
movq -0x190(%rbp), %rsi
addq $0xa8, %rsi
callq 0x4320
movq %rax, -0x198(%rbp)
jmp 0x9c9c
movq -0x198(%rbp), %rdi
leaq 0x1184b(%rip), %rsi     # 0x1b4f5
callq 0x4330
jmp 0x9cb1
movl $0x0, -0x4(%rbp)
leaq -0x110(%rbp), %rdi
callq 0xa620
movl -0x4(%rbp), %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x41e0
jmp 0x9d02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0xa620
movq -0x28(%rbp), %rdi
callq 0x45e0
movq %rax, %rdi
callq 0x4fd0
nopw %cs:(%rax,%rax)
nopl (%rax)