// File: /workspace/github_c_makefile_star2_O1/aokad[P]sequeeze/seqtk.c
// Function: stk_dropse
int stk_dropse(int argc, char *argv[])
{
	gzFile fp;
	kseq_t *seq, last;

	if (argc == 1 && isatty(fileno(stdin))) {
		fprintf(stderr, "Usage: seqtk dropse <in.fq>\n");
		return 1;
	}
	fp = argc > 1 && strcmp(argv[1], "-")? gzopen(argv[1], "r") : gzdopen(fileno(stdin), "r");
	if (fp == 0) {
		fprintf(stderr, "[E::%s] failed to open the input file/stream.\n", __func__);
		return 1;
	}
	seq = kseq_init(fp);

	memset(&last, 0, sizeof(kseq_t));
	while (kseq_read(seq) >= 0) {
		if (last.name.l) {
			kstring_t *p = &last.name, *q = &seq->name;
			int is_diff;
			if (p->l == q->l) {
				int l = (p->l > 2 && p->s[p->l-2] == '/' && q->s[q->l-2] == '/' && isdigit(p->s[p->l-1]) && isdigit(q->s[q->l-1]))? p->l - 2 : p->l;
				is_diff = strncmp(p->s, q->s, l);
			} else is_diff = 1;
			if (!is_diff) {
				stk_printseq(&last, 0);
				stk_printseq(seq, 0);
				last.name.l = 0;
			} else cpy_kseq(&last, seq);
		} else cpy_kseq(&last, seq);
	}

	kseq_destroy(seq);
	gzclose(fp);
	// free last!
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movl %edi, %ebp
cmpl $0x1, %edi
jne 0x80a6
movq 0x7f39(%rip), %rax      # 0xffc8
movq (%rax), %rdi
callq 0x21b0
movl %eax, %edi
callq 0x2090
testl %eax, %eax
jne 0x82d0
cmpl $0x2, %ebp
jl 0x80d3
movq 0x8(%rbx), %rbx
leaq 0x42f8(%rip), %rsi      # 0xc3ae
movq %rbx, %rdi
callq 0x2170
testl %eax, %eax
je 0x80d3
leaq 0x30cf(%rip), %rsi      # 0xb198
movq %rbx, %rdi
callq 0x2220
jmp 0x80f0
movq 0x7eee(%rip), %rax      # 0xffc8
movq (%rax), %rdi
callq 0x21b0
leaq 0x30af(%rip), %rsi      # 0xb198
movl %eax, %edi
callq 0x20b0
testq %rax, %rax
je 0x82c9
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x3e57
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x70(%rsp)
movq %rax, %rdi
callq 0x3ea1
testl %eax, %eax
js 0x82a3
leaq 0x10(%rsp), %r15
movq 0x10(%rsp), %rbp
testq %rbp, %rbp
je 0x81b3
movq (%r14), %r12
cmpq %r12, %rbp
jne 0x81b3
cmpq $0x3, %rbp
jb 0x819b
movq 0x20(%rsp), %r13
cmpb $0x2f, -0x2(%r13,%rbp)
jne 0x819b
movq 0x10(%r14), %rbx
cmpb $0x2f, -0x2(%rbx,%r12)
jne 0x819b
callq 0x2290
movq (%rax), %rax
movsbq -0x1(%r13,%rbp), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x819b
movsbq -0x1(%rbx,%r12), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x819b
addq $-0x2, %rbp
movq 0x20(%rsp), %r12
movq 0x10(%r14), %rsi
movslq %ebp, %rdx
movq %r12, %rdi
callq 0x2070
testl %eax, %eax
je 0x81d3
movq %r15, %rdi
movq %r14, %rsi
callq 0x6ee7
movq %r14, %rdi
callq 0x3ea1
testl %eax, %eax
jns 0x8144
jmp 0x82a3
movq 0x58(%rsp), %rbx
xorl %eax, %eax
testq %rbx, %rbx
setne %al
leal 0x3e(,%rax,2), %edi
callq 0x2060
movq 0x7dcd(%rip), %rax      # 0xffc0
movq (%rax), %rsi
movq %r12, %rdi
callq 0x2110
movl $0xa, %edi
callq 0x2060
movq 0x50(%rsp), %rdi
callq 0x2080
testq %rbx, %rbx
je 0x8235
movl $0x2b, %edi
callq 0x2060
movl $0xa, %edi
callq 0x2060
movq 0x68(%rsp), %rdi
callq 0x2080
xorl %eax, %eax
cmpq $0x0, 0x48(%r14)
setne %al
leal 0x3e(,%rax,2), %edi
callq 0x2060
movq 0x10(%r14), %rdi
movq 0x7d6a(%rip), %rax      # 0xffc0
movq (%rax), %rsi
callq 0x2110
movl $0xa, %edi
callq 0x2060
movq 0x40(%r14), %rdi
callq 0x2080
cmpq $0x0, 0x48(%r14)
je 0x8295
movl $0x2b, %edi
callq 0x2060
movl $0xa, %edi
callq 0x2060
movq 0x58(%r14), %rdi
callq 0x2080
movq $0x0, 0x10(%rsp)
jmp 0x81be
movq %r14, %rdi
callq 0x4229
movq 0x8(%rsp), %rdi
callq 0x2040
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2cc9
jmp 0x82d5
callq 0x2cad
movl $0x1, %eax
jmp 0x82b7