// File: /workspace/github_c_makefile_star2_O1/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
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, (%r15)
movq $0x0, 0x10(%r15)
xorl %eax, %eax
callq 0xe533
movsd %xmm0, 0x8(%rsp)
movq (%rbx), %rcx
leaq 0x1b854(%rip), %rsi     # 0x27afb
leaq 0x18d9d(%rip), %rdx     # 0x2504b
movq %r15, %rdi
xorl %eax, %eax
callq 0xe91c
cmpl $0x2, %r14d
jl 0xc2eb
movl %r14d, %r13d
movl $0x1, %ebp
leaq 0x1bd74(%rip), %r15     # 0x28041
leaq 0x10(%rsp), %r12
movq (%rbx,%rbp,8), %rdx
movq %r12, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xe91c
incq %rbp
cmpq %rbp, %r13
jne 0xc2d2
movq 0x20(%rsp), %rax
leaq 0x24b79(%rip), %r13     # 0x30e70
movq %rax, (%r13)
cmpl $0x1, %r14d
jle 0xc40b
leaq 0x8(%rbx), %r15
movq 0x8(%rbx), %r12
leaq 0x190e1(%rip), %rsi     # 0x253f5
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xc3d3
leaq 0x1b7f6(%rip), %rsi     # 0x27b21
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xc3e1
leaq 0x19600(%rip), %rsi     # 0x25942
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xc3ef
leaq 0x1bfda(%rip), %rsi     # 0x28333
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xc3fd
leaq 0x18d73(%rip), %rsi     # 0x250e3
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xc417
leaq 0x1b7a2(%rip), %rsi     # 0x27b29
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xc425
leaq 0x1b795(%rip), %rsi     # 0x27b33
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
je 0xc433
leaq 0x1b6de(%rip), %rsi     # 0x27a93
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
jne 0xc489
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0xc115
jmp 0xc43f
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x5df3
jmp 0xc43f
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x6423
jmp 0xc43f
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x74e4
jmp 0xc43f
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x11112
jmp 0xc43f
callq 0x4076
movl $0x1, %ebp
jmp 0xc465
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x5b34
jmp 0xc43f
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x5ce1
jmp 0xc43f
leal -0x1(%r14), %edi
movq %r15, %rsi
callq 0x5d2b
movl %eax, %ebp
movq 0x23b60(%rip), %r15     # 0x2ffa8
movq (%r15), %rdi
callq 0xe3f3
movq (%r15), %rdi
callq 0xe490
testl %ebp, %ebp
je 0xc476
movq (%r13), %rdi
callq 0x3390
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r14d, %edi
movq %rbx, %rsi
movsd 0x8(%rsp), %xmm0
callq 0x4245
jmp 0xc45c
leaq 0x1b6aa(%rip), %rsi     # 0x27b3a
movq %r12, %rdi
callq 0x34d0
testl %eax, %eax
jne 0xc4a6
callq 0x41ca
jmp 0xc410
movq 0x23b23(%rip), %rax     # 0x2ffd0
movq (%rax), %rdi
leaq 0x1b68b(%rip), %rsi     # 0x27b42
movq %r12, %rdx
xorl %eax, %eax
callq 0x3500
jmp 0xc410
nop