// File: /workspace/github_c_makefile_star2_O0/aokad[P]sequeeze/seqtk.c
// Function: stk_hrun
int stk_hrun(int argc, char *argv[])
{
	gzFile fp;
	kseq_t *ks;
	int min_len = 7, l = 0, c = 0, beg = 0, i;
	if (argc == optind) {
		fprintf(stderr, "Usage: seqtk hrun <in.fa> [minLen=%d]\n", min_len);
		return 1;
	}
	if (argc == optind + 2) min_len = atoi(argv[optind+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 (kseq_read(ks) >= 0) {
		c = ks->seq.s[0]; l = 1; beg = 0;
		for (i = 1; i < ks->seq.l; ++i) {
			if (ks->seq.s[i] != c) {
				if (l >= min_len) printf("%s\t%d\t%d\t%c\n", ks->name.s, beg, beg + l, c);
				c = ks->seq.s[i]; l = 1; beg = i;
			} else ++l;
		}
	}
	if (l >= min_len) printf("%s\t%d\t%d\t%c\n", ks->name.s, beg, beg + l, c);
	kseq_destroy(ks);
	gzclose(fp);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x7, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x8(%rbp), %eax
movq 0xa5bb(%rip), %rcx      # 0x10fd0
cmpl (%rcx), %eax
jne 0x6a40
movq 0xa5d8(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
movl -0x24(%rbp), %edx
leaq 0x718a(%rip), %rsi      # 0xdbb7
movb $0x0, %al
callq 0x2190
movl $0x1, -0x4(%rbp)
jmp 0x6c28
movl -0x8(%rbp), %eax
movq 0xa586(%rip), %rcx      # 0x10fd0
movl (%rcx), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jne 0x6a72
movq -0x10(%rbp), %rax
movq 0xa572(%rip), %rcx      # 0x10fd0
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2250
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0xa553(%rip), %rcx      # 0x10fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x7a0b(%rip), %rsi      # 0xe496
callq 0x2170
cmpl $0x0, %eax
jne 0x6ab8
movq 0xa52c(%rip), %rax      # 0x10fc8
movq (%rax), %rdi
callq 0x21b0
movl %eax, %edi
leaq 0x67d3(%rip), %rsi      # 0xd280
callq 0x20b0
movq %rax, -0x40(%rbp)
jmp 0x6ada
movq -0x10(%rbp), %rax
movq 0xa50d(%rip), %rcx      # 0x10fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x67af(%rip), %rsi      # 0xd280
callq 0x2220
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x6b14
movq 0xa508(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x697f(%rip), %rsi      # 0xd479
leaq 0x70dd(%rip), %rdx      # 0xdbde
movb $0x0, %al
callq 0x2190
movl $0x1, -0x4(%rbp)
jmp 0x6c28
movq -0x18(%rbp), %rdi
callq 0x38f0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3930
cmpl $0x0, %eax
jl 0x6be4
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movsbl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x1, -0x28(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x1, -0x34(%rbp)
movslq -0x34(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jae 0x6bdf
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl -0x2c(%rbp), %eax
je 0x6bc6
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jl 0x6ba4
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x30(%rbp), %edx
movl -0x30(%rbp), %ecx
addl -0x28(%rbp), %ecx
movl -0x2c(%rbp), %r8d
leaq 0x704a(%rip), %rdi      # 0xdbe7
movb $0x0, %al
callq 0x20f0
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
movl $0x1, -0x28(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x6bcf
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x6bd1
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x6b56
jmp 0x6b21
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jl 0x6c0f
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x30(%rbp), %edx
movl -0x30(%rbp), %ecx
addl -0x28(%rbp), %ecx
movl -0x2c(%rbp), %r8d
leaq 0x6fdf(%rip), %rdi      # 0xdbe7
movb $0x0, %al
callq 0x20f0
movq -0x20(%rbp), %rdi
callq 0x3d40
movq -0x18(%rbp), %rdi
callq 0x2030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)