// File: /workspace/github_c_makefile_star2_O0/aokad[P]sequeeze/seqtk.c
// Function: stk_cutN
int stk_cutN(int argc, char *argv[])
{
	int c, l, gap_only = 0;
	gzFile fp;
	kseq_t *ks;
	while ((c = getopt(argc, argv, "n:p:g")) >= 0) {
		switch (c) {
		case 'n': cutN_min_N_tract = atoi(optarg); break;
		case 'p': cutN_nonN_penalty = atoi(optarg); break;
		case 'g': gap_only = 1; break;
		default: return 1;
		}
	}
	if (argc == optind) {
		fprintf(stderr, "\n");
		fprintf(stderr, "Usage:   seqtk cutN [options] <in.fa>\n\n");
		fprintf(stderr, "Options: -n INT    min size of N tract [%d]\n", cutN_min_N_tract);
		fprintf(stderr, "         -p INT    penalty for a non-N [%d]\n", cutN_nonN_penalty);
		fprintf(stderr, "         -g        print gaps only, no sequence\n\n");
		return 1;
	}
	fp = (strcmp(argv[optind], "-") == 0)? gzdopen(fileno(stdin), "r") : gzopen(argv[optind], "r");
	if (fp == 0) {
		fprintf(stderr, "[E::%s] failed to open the input file/stream.\n", __func__);
		return 1;
	}
	ks = kseq_init(fp);
	while ((l = kseq_read(ks)) >= 0) {
		int k = 0, begin = 0, end = 0;
		while (find_next_cut(ks, k, &begin, &end) >= 0) {
			if (begin != 0) {
				if (gap_only) printf("%s\t%d\t%d\n", ks->name.s, begin, end);
				else print_seq(stdout, ks, k, begin);
			}
			k = end;
		}
		if (!gap_only) print_seq(stdout, ks, k, l);
	}
	kseq_destroy(ks);
	gzclose(fp);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x7726(%rip), %rdx      # 0xdaea
callq 0x2240
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jl 0x643a
movl -0x14(%rbp), %eax
movl %eax, -0x40(%rbp)
subl $0x67, %eax
je 0x6420
jmp 0x63de
movl -0x40(%rbp), %eax
subl $0x6e, %eax
je 0x63f2
jmp 0x63e8
movl -0x40(%rbp), %eax
subl $0x70, %eax
je 0x6409
jmp 0x6429
movq 0xabdf(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
callq 0x2250
movl %eax, 0xb049(%rip)      # 0x11450
jmp 0x6435
movq 0xabc8(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
callq 0x2250
movl %eax, 0xb036(%rip)      # 0x11454
jmp 0x6435
movl $0x1, -0x1c(%rbp)
jmp 0x6435
movl $0x1, -0x4(%rbp)
jmp 0x6658
jmp 0x63b6
movl -0x8(%rbp), %eax
movq 0xab8c(%rip), %rcx      # 0x10fd0
cmpl (%rcx), %eax
jne 0x64dc
movq 0xaba5(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x72da(%rip), %rsi      # 0xd737
movb $0x0, %al
callq 0x2190
movq 0xab8d(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x767b(%rip), %rsi      # 0xdaf0
movb $0x0, %al
callq 0x2190
movq 0xab75(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
movl 0xafc4(%rip), %edx      # 0x11450
leaq 0x7685(%rip), %rsi      # 0xdb18
movb $0x0, %al
callq 0x2190
movq 0xab57(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
movl 0xafaa(%rip), %edx      # 0x11454
leaq 0x7694(%rip), %rsi      # 0xdb45
movb $0x0, %al
callq 0x2190
movq 0xab39(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x76a9(%rip), %rsi      # 0xdb72
movb $0x0, %al
callq 0x2190
movl $0x1, -0x4(%rbp)
jmp 0x6658
movq -0x10(%rbp), %rax
movq 0xaae9(%rip), %rcx      # 0x10fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7fa1(%rip), %rsi      # 0xe496
callq 0x2170
cmpl $0x0, %eax
jne 0x6522
movq 0xaac2(%rip), %rax      # 0x10fc8
movq (%rax), %rdi
callq 0x21b0
movl %eax, %edi
leaq 0x6d69(%rip), %rsi      # 0xd280
callq 0x20b0
movq %rax, -0x48(%rbp)
jmp 0x6544
movq -0x10(%rbp), %rax
movq 0xaaa3(%rip), %rcx      # 0x10fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x6d45(%rip), %rsi      # 0xd280
callq 0x2220
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x657e
movq 0xaa9e(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x6f15(%rip), %rsi      # 0xd479
leaq 0x7639(%rip), %rdx      # 0xdba4
movb $0x0, %al
callq 0x2190
movl $0x1, -0x4(%rbp)
jmp 0x6658
movq -0x28(%rbp), %rdi
callq 0x38f0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x3930
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
jl 0x663f
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
leaq -0x38(%rbp), %rdx
leaq -0x3c(%rbp), %rcx
callq 0x6670
cmpl $0x0, %eax
jl 0x661b
cmpl $0x0, -0x38(%rbp)
je 0x6613
cmpl $0x0, -0x1c(%rbp)
je 0x65f8
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x38(%rbp), %edx
movl -0x3c(%rbp), %ecx
leaq 0x75be(%rip), %rdi      # 0xdbad
movb $0x0, %al
callq 0x20f0
jmp 0x6611
movq 0xa9c1(%rip), %rax      # 0x10fc0
movq (%rax), %rdi
movq -0x30(%rbp), %rsi
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
callq 0x6850
jmp 0x6613
movl -0x3c(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x65b5
cmpl $0x0, -0x1c(%rbp)
jne 0x663a
movq 0xa998(%rip), %rax      # 0x10fc0
movq (%rax), %rdi
movq -0x30(%rbp), %rsi
movl -0x34(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x6850
jmp 0x658b
movq -0x30(%rbp), %rdi
callq 0x3d40
movq -0x28(%rbp), %rdi
callq 0x2030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)