// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/main.c
// Function: main
int main(int argc, char *argv[]) {
	extern char *bwa_pg;
	int i, ret;
	double t_real;
	kstring_t pg = {0,0,0};
	t_real = realtime();

	ksprintf(&pg, "@PG\tID:PALADIN\tPN:PALADIN\tVN:%s\tCL:%s", PACKAGE_VERSION, argv[0]);

	// Process command argument
	for (i = 1; i < argc; ++i) ksprintf(&pg, " %s", argv[i]);
	bwa_pg = pg.s;

	if (argc < 2) return renderMainUsage();
	if (strcmp(argv[1], "index") == 0) ret = command_index(argc-1, argv+1);
	else if (strcmp(argv[1], "prepare") == 0) ret = command_prepare(argc-1, argv+1);
	else if (strcmp(argv[1], "align") == 0) ret = command_align(argc-1, argv+1);
	else if (strcmp(argv[1], "fa2pac") == 0) ret = bwa_fa2pac(argc-1, argv+1);
	else if (strcmp(argv[1], "pac2bwt") == 0) ret = command_pac2bwt(argc-1, argv+1);
	else if (strcmp(argv[1], "bwtupdate") == 0) ret = command_bwtupdate(argc-1, argv+1);
	else if (strcmp(argv[1], "bwt2sa") == 0) ret = command_bwt2sa(argc-1, argv+1);
	else if (strcmp(argv[1], "shm") == 0) ret = main_shm(argc-1, argv+1);
	else if (strcmp(argv[1], "version") == 0) return renderVersion();
	else {
		fprintf(stderr, "[main] unrecognized command '%s'\n", argv[1]);
		return 1;
	}

	err_fflush(stdout);
	err_fclose(stdout);

	// If execution was successful, print time and CPU statistics
	if (ret == 0) {
		fprintf(stderr, "[%s] Version: %s\n", __func__, PACKAGE_VERSION);
		fprintf(stderr, "[%s] CMD:", __func__);
		for (i = 0; i < argc; ++i)
			fprintf(stderr, " %s", argv[i]);
		fprintf(stderr, "\n[%s] Real time: %.3f sec; CPU: %.3f sec\n", __func__, realtime() - t_real, cputime());
	}

	free(bwa_pg);

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movl %edi, %r14d
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movapd %xmm0, (%r15)
andq $0x0, 0x10(%r15)
xorl %eax, %eax
callq 0xd0be
movsd %xmm0, 0x8(%rsp)
movq (%rbx), %rcx
leaq 0x17da9(%rip), %rsi     # 0x22b2b
leaq 0x152c2(%rip), %rdx     # 0x2004b
movq %r15, %rdi
xorl %eax, %eax
callq 0xd490
movslq %r14d, %r13
pushq $0x1
popq %rbp
leaq 0x182d1(%rip), %r12     # 0x23071
cmpq %r13, %rbp
jge 0xadbb
movq (%rbx,%rbp,8), %rdx
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0xd490
incq %rbp
jmp 0xada0
movq 0x20(%rsp), %rax
leaq 0x220a9(%rip), %r13     # 0x2ce70
movq %rax, (%r13)
cmpl $0x1, %r14d
jg 0xadde
callq 0xb03d
pushq $0x1
popq %rbp
jmp 0xaf53
leaq 0x8(%rbx), %r15
movq 0x8(%rbx), %r12
leaq 0x15608(%rip), %rsi     # 0x203f5
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xaebf
leaq 0x17d4d(%rip), %rsi     # 0x22b51
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xaecd
leaq 0x15b27(%rip), %rsi     # 0x20942
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xaedb
leaq 0x18531(%rip), %rsi     # 0x23363
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xaee9
leaq 0x1529a(%rip), %rsi     # 0x200e3
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xaef7
leaq 0x17cf9(%rip), %rsi     # 0x22b59
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xaf05
leaq 0x17cec(%rip), %rsi     # 0x22b63
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xaf13
leaq 0x17c35(%rip), %rsi     # 0x22ac3
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xaf21
leaq 0x17cc5(%rip), %rsi     # 0x22b6a
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
jne 0xb01d
callq 0xb191
jmp 0xadd6
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x480e
jmp 0xaf2d
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x4f0d
jmp 0xaf2d
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x5fbc
jmp 0xaf2d
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0xf87c
jmp 0xaf2d
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x454b
jmp 0xaf2d
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x46f5
jmp 0xaf2d
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x4754
jmp 0xaf2d
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0xab4a
movl %eax, %ebp
movq 0x21072(%rip), %r15     # 0x2bfa8
movq (%r15), %rdi
callq 0xcf7e
movq (%r15), %rdi
callq 0xd01b
testl %ebp, %ebp
je 0xaf64
movq (%r13), %rdi
callq 0x3390
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x21065(%rip), %r12     # 0x2bfd0
movq (%r12), %rdi
leaq 0x17c1e(%rip), %rsi     # 0x22b94
leaq 0x15098(%rip), %r15     # 0x20015
leaq 0x150c7(%rip), %rcx     # 0x2004b
movq %r15, %rdx
xorl %eax, %eax
callq 0x3500
movq (%r12), %rdi
leaq 0x17c0d(%rip), %rsi     # 0x22ba6
movq %r15, %rdx
xorl %eax, %eax
callq 0x3500
movl %r14d, %r13d
leaq 0x180c4(%rip), %r15     # 0x23071
xorl %r12d, %r12d
movq 0x21019(%rip), %rax     # 0x2bfd0
movq (%rax), %r14
cmpq %r12, %r13
je 0xafd5
movq (%rbx,%r12,8), %rdx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3500
incq %r12
jmp 0xafb0
xorl %eax, %eax
callq 0xd0be
subsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %eax, %eax
callq 0xd07b
movapd %xmm0, %xmm1
leaq 0x17bb6(%rip), %rsi     # 0x22bb0
leaq 0x15014(%rip), %rdx     # 0x20015
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
movb $0x2, %al
callq 0x3500
leaq 0x21e58(%rip), %r13     # 0x2ce70
jmp 0xaf4a
movq 0x20fac(%rip), %rax     # 0x2bfd0
movq (%rax), %rdi
leaq 0x17b44(%rip), %rsi     # 0x22b72
movq %r12, %rdx
xorl %eax, %eax
callq 0x3500
jmp 0xadd6