// File: /workspace/github_c_makefile_star2_O3/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 $0x78, %rsp
cmpl $0x1, %edi
jne 0x8343
movq 0x7ca2(%rip), %rax      # 0xffc8
movq (%rax), %rdi
callq 0x21b0
movl %eax, %edi
callq 0x2090
testl %eax, %eax
je 0x8362
callq 0x2cad
jmp 0x854f
jle 0x8362
movq 0x8(%rsi), %rdi
cmpb $0x2d, (%rdi)
jne 0x8354
cmpb $0x0, 0x1(%rdi)
je 0x8362
leaq 0x2e4d(%rip), %rsi      # 0xb1a8
callq 0x2220
jmp 0x837f
movq 0x7c5f(%rip), %rax      # 0xffc8
movq (%rax), %rdi
callq 0x21b0
leaq 0x2e30(%rip), %rsi      # 0xb1a8
movl %eax, %edi
callq 0x20b0
movq %rax, %rbx
testq %rax, %rax
je 0x854a
movq %rbx, %rdi
callq 0x3edd
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x60(%rsp)
movq %rax, %rdi
callq 0x3f27
testl %eax, %eax
js 0x8529
movq %rsp, %r15
movq (%rsp), %rbp
testq %rbp, %rbp
je 0x843b
cmpq (%r14), %rbp
jne 0x843b
movq 0x10(%rsp), %r13
cmpq $0x2, %rbp
jbe 0x8425
cmpb $0x2f, -0x2(%r13,%rbp)
movq 0x10(%r14), %r12
jne 0x8429
cmpb $0x2f, -0x2(%r12,%rbp)
jne 0x8429
callq 0x2290
movq (%rax), %rax
movsbq -0x1(%r13,%rbp), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x8429
leaq -0x2(%rbp), %rcx
movsbq -0x1(%r12,%rbp), %rdx
testb $0x8, 0x1(%rax,%rdx,2)
cmovneq %rcx, %rbp
jmp 0x8429
movq 0x10(%r14), %r12
movslq %ebp, %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x2070
testl %eax, %eax
je 0x845b
movq %r15, %rdi
movq %r14, %rsi
callq 0x71ec
movq %r14, %rdi
callq 0x3f27
testl %eax, %eax
jns 0x83ce
jmp 0x8529
movq 0x48(%rsp), %rbp
xorl %eax, %eax
testq %rbp, %rbp
setne %al
leal 0x3e(,%rax,2), %edi
callq 0x2060
movq 0x7b45(%rip), %rax      # 0xffc0
movq (%rax), %rsi
movq %r13, %rdi
callq 0x2110
movl $0xa, %edi
callq 0x2060
movq 0x40(%rsp), %rdi
callq 0x2080
testq %rbp, %rbp
je 0x84bd
movl $0x2b, %edi
callq 0x2060
movl $0xa, %edi
callq 0x2060
movq 0x58(%rsp), %rdi
callq 0x2080
movq 0x48(%r14), %r13
xorl %eax, %eax
testq %r13, %r13
setne %al
leal 0x3e(,%rax,2), %edi
callq 0x2060
movq 0x7ae4(%rip), %rax      # 0xffc0
movq (%rax), %rsi
movq %r12, %rdi
callq 0x2110
movl $0xa, %edi
callq 0x2060
movq 0x40(%r14), %rdi
callq 0x2080
testq %r13, %r13
je 0x851c
movl $0x2b, %edi
callq 0x2060
movl $0xa, %edi
callq 0x2060
movq 0x58(%r14), %rdi
callq 0x2080
movq $0x0, (%rsp)
jmp 0x8446
movq %r14, %rdi
callq 0x428d
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2cc9
movl $0x1, %eax
jmp 0x853b