// File: conchoecia[P]fasta_stats/src/fasta_stats.cc
// Function: main
int main(int argc, char **argv) {
	opt_n_cutoff = 9;
	opt_N_cutoff = -1;
	opt_big_size = 50;
	opt_min_length = 1000;
	opt_min_gap_length = -1;
	int c;
	while ((c = getopt(argc, argv, "b:g:l:N:n:")) != EOF) {
		switch (c) {
		    case 'b':
			opt_big_size = atol(optarg);
			break;
		    case 'g':
			opt_min_gap_length = atol(optarg);
			if (opt_min_gap_length < 0) {
				print_usage();
			}
			break;
		    case 'l':
			opt_min_length = atol(optarg);
			if (opt_min_length < 0) {
				print_usage();
			}
			break;
		    case 'N':
			opt_N_cutoff = atol(optarg);
			break;
		    case 'n':
			opt_n_cutoff = atol(optarg);
			if (opt_n_cutoff < 0) {
				print_usage();
			}
			break;
		    default:
			print_usage();
		}
	}
	opt_big_size *= 1000;
	if (optind + 1 != argc) {
		print_usage();
	}
	std::list<Scaffold> scaffolds;
	if (!read_file(argv[optind], scaffolds)) {
		return 1;
	}
	print_stats(scaffolds);
	printf("\n");
	print_coverage(scaffolds);
	if (opt_min_gap_length != -1) {
		printf("\n");
		print_captured_gaps(scaffolds);
	}
	return 0;
}

// Assembly:
subq $0x58, %rsp
movl $0x0, 0x54(%rsp)
movl %edi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq $0x9, 0x13c80(%rip) # 0x16260
movq $-0x1, 0x13c7d(%rip) # 0x16268
movq $0x32, 0x13c7a(%rip) # 0x16270
movq $0x3e8, 0x13c77(%rip) # imm = 0x3E8
movq $-0x1, 0x13c74(%rip) # 0x16280
movl 0x50(%rsp), %edi
movq 0x48(%rsp), %rsi
leaq 0xcb34(%rip), %rdx      # 0xf150
callq 0x2080
movl %eax, 0x44(%rsp)
cmpl $-0x1, %eax
je 0x270c
movl 0x44(%rsp), %eax
addl $-0x4e, %eax
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
subl $0x20, %eax
ja 0x2702
movq 0x10(%rsp), %rax
leaq 0xc9bf(%rip), %rcx      # 0xf010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x1395f(%rip), %rax     # 0x15fc0
movq (%rax), %rdi
callq 0x22d0
movq %rax, 0x13c00(%rip)     # 0x16270
jmp 0x2707
movq 0x13944(%rip), %rax     # 0x15fc0
movq (%rax), %rdi
callq 0x22d0
movq %rax, 0x13bf5(%rip)     # 0x16280
cmpq $0x0, 0x13bed(%rip)     # 0x16280
jge 0x269a
callq 0x2820
jmp 0x2707
movq 0x1391d(%rip), %rax     # 0x15fc0
movq (%rax), %rdi
callq 0x22d0
movq %rax, 0x13bc6(%rip)     # 0x16278
cmpq $0x0, 0x13bbe(%rip)     # 0x16278
jge 0x26c1
callq 0x2820
jmp 0x2707
movq 0x138f6(%rip), %rax     # 0x15fc0
movq (%rax), %rdi
callq 0x22d0
movq %rax, 0x13b8f(%rip)     # 0x16268
jmp 0x2707
movq 0x138de(%rip), %rax     # 0x15fc0
movq (%rax), %rdi
callq 0x22d0
movq %rax, 0x13b6f(%rip)     # 0x16260
cmpq $0x0, 0x13b67(%rip)     # 0x16260
jge 0x2700
callq 0x2820
jmp 0x2707
callq 0x2820
jmp 0x260c
imulq $0x3e8, 0x13b59(%rip), %rax # imm = 0x3E8
movq %rax, 0x13b52(%rip)     # 0x16270
movq 0x138b3(%rip), %rax     # 0x15fd8
movl (%rax), %eax
addl $0x1, %eax
cmpl 0x50(%rsp), %eax
je 0x2735
callq 0x2820
leaq 0x28(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x4920
movq (%rsp), %rsi
movq 0x48(%rsp), %rax
movq 0x13885(%rip), %rcx     # 0x15fd8
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x28c0
movl %eax, 0xc(%rsp)
jmp 0x2765
movl 0xc(%rsp), %eax
cmpl $0x0, %eax
jne 0x279a
movl $0x1, 0x54(%rsp)
movl $0x1, 0x18(%rsp)
jmp 0x27fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x4930
jmp 0x280d
leaq 0x28(%rsp), %rdi
callq 0x3300
jmp 0x27a6
leaq 0xcc2e(%rip), %rdi      # 0xf3db
xorl %eax, %eax
callq 0x2050
jmp 0x27b6
leaq 0x28(%rsp), %rdi
callq 0x3950
jmp 0x27c2
cmpq $-0x1, 0x13ab6(%rip)    # 0x16280
je 0x27ea
leaq 0xcc08(%rip), %rdi      # 0xf3db
xorl %eax, %eax
callq 0x2050
jmp 0x27dc
leaq 0x28(%rsp), %rdi
callq 0x3e90
jmp 0x27e8
jmp 0x27ea
movl $0x0, 0x54(%rsp)
movl $0x1, 0x18(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x4930
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x2420
nopw (%rax,%rax)