// File: /workspace/github_c_makefile_star2_O3/lh3[P]fermi-lite/bseq.c
// Function: bseq_read
bseq1_t *bseq_read(const char *fn, int *n_)
{
	gzFile fp;
	bseq1_t *seqs;
	kseq_t *ks;
	int m, n;
	uint64_t size = 0;

	*n_ = 0;
	fp = fn && strcmp(fn, "-")? gzopen(fn, "r") : gzdopen(fileno(stdin), "r");
	if (fp == 0) return 0;
	ks = kseq_init(fp);

	m = n = 0; seqs = 0;
	while (kseq_read(ks) >= 0) {
		bseq1_t *s;
		if (n >= m) {
			m = m? m<<1 : 256;
			seqs = realloc(seqs, m * sizeof(bseq1_t));
		}
		s = &seqs[n];
		s->seq = strdup(ks->seq.s);
		s->qual = ks->qual.l? strdup(ks->qual.s) : 0;
		s->l_seq = ks->seq.l;
		size += seqs[n++].l_seq;
	}
	*n_ = n;

	kseq_destroy(ks);
	gzclose(fp);
	return seqs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movl $0x0, (%rsi)
testq %rdi, %rdi
je 0x4169
cmpb $0x2d, (%rdi)
jne 0x415b
cmpb $0x0, 0x1(%rdi)
je 0x4169
leaq 0x132e4(%rip), %rsi     # 0x17446
callq 0x2210
jmp 0x4186
movq 0x18e58(%rip), %rax     # 0x1cfc8
movq (%rax), %rdi
callq 0x2180
leaq 0x132c7(%rip), %rsi     # 0x17446
movl %eax, %edi
callq 0x2080
movq %rax, %rbx
testq %rax, %rax
je 0x4635
movq %r14, 0x20(%rsp)
movl $0x1, %edi
movl $0x70, %esi
callq 0x2130
movq %rax, %r15
movl $0x1, %edi
movl $0x20, %esi
callq 0x2130
movq %rax, %r14
movq %rbx, 0x28(%rsp)
movq %rbx, 0x10(%rax)
movl $0x10000, 0x8(%rax)     # imm = 0x10000
movl $0x4000, %edi           # imm = 0x4000
callq 0x21a0
movq %rax, 0x18(%r14)
movq %r14, 0x68(%r15)
leaq 0x48(%r15), %r13
leaq 0x30(%r15), %rax
movq %rax, 0x30(%rsp)
leaq 0x18(%r15), %rax
movq %rax, 0x38(%rsp)
xorl %eax, %eax
movq $0x0, 0x18(%rsp)
xorl %r12d, %r12d
xorl %ebp, %ebp
testl %eax, %eax
movq %rbp, 0x40(%rsp)
je 0x421b
movq %r12, 0x10(%rsp)
movq 0x30(%rsp), %rbp
jmp 0x429f
movl 0x8(%r14), %edx
movl (%r14), %ecx
movl 0x4(%r14), %eax
movq 0x30(%rsp), %rbp
testb $0x3, %dl
je 0x4238
cmpl %eax, %ecx
jge 0x45cf
movq 0x18(%r14), %rsi
cmpl %eax, %ecx
jl 0x427c
movl $0x0, (%r14)
movq 0x10(%r14), %rdi
sarl $0x2, %edx
callq 0x2140
movl %eax, 0x4(%r14)
movl 0x8(%r14), %edx
movl %edx, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jge 0x426d
andl $-0x4, %edx
incl %edx
movl %edx, 0x8(%r14)
testl %eax, %eax
je 0x45cf
movl (%r14), %ecx
movq 0x18(%r14), %rsi
movslq %ecx, %rdi
incl %ecx
movl %ecx, (%r14)
movzbl (%rsi,%rdi), %esi
movl %esi, 0xc(%rsp)
cmpl $0x40, %esi
je 0x4296
cmpl $0x3e, %esi
jne 0x422b
movq %r12, 0x10(%rsp)
movl %esi, 0x60(%r15)
xorl %eax, %eax
movq %rax, 0x48(%r15)
movq %rax, 0x30(%r15)
movq %rax, 0x18(%r15)
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
leaq 0xc(%rsp), %rcx
xorl %r8d, %r8d
callq 0x4709
testl %eax, %eax
js 0x464a
cmpl $0xa, 0xc(%rsp)
je 0x42e8
movq %r14, %rdi
movl $0x2, %esi
movq 0x38(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x4709
cmpq $0x0, 0x40(%r15)
jne 0x4305
movq $0x100, 0x38(%r15)      # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x21a0
movq %rax, 0x40(%r15)
movl 0x8(%r14), %edx
testb $0x3, %dl
sete %sil
movl (%r14), %ecx
movl 0x4(%r14), %eax
cmpl %eax, %ecx
setl %dil
orb %dil, %sil
testb $0x1, %sil
je 0x43f5
movq 0x18(%r14), %rsi
testb $0x1, %dil
jne 0x4370
movl $0x0, (%r14)
movq 0x10(%r14), %rdi
sarl $0x2, %edx
callq 0x2140
movl %eax, 0x4(%r14)
movl 0x8(%r14), %edx
movl %edx, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jge 0x4361
andl $-0x4, %edx
incl %edx
movl %edx, 0x8(%r14)
testl %eax, %eax
je 0x43f5
movl (%r14), %ecx
movq 0x18(%r14), %rsi
movslq %ecx, %rdi
incl %ecx
movl %ecx, (%r14)
movb (%rsi,%rdi), %sil
movzbl %sil, %edi
movl %edi, 0xc(%rsp)
cmpl $0x2a, %edi
jg 0x4390
cmpl $0xa, %edi
je 0x43de
jmp 0x43a7
cmpl $0x2b, %edi
je 0x43fd
cmpl $0x3e, %edi
je 0x45c6
cmpl $0x40, %edi
je 0x45c6
movq 0x30(%r15), %rax
movq 0x40(%r15), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x30(%r15)
movb %sil, (%rcx,%rax)
movq %r14, %rdi
movl $0x2, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x4709
movl 0x8(%r14), %edx
movl (%r14), %ecx
movl 0x4(%r14), %eax
cmpl %eax, %ecx
setl %dil
testb $0x3, %dl
je 0x432a
cmpl %eax, %ecx
jl 0x432a
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movq 0x30(%r15), %r12
movq 0x38(%r15), %rbx
leaq 0x1(%r12), %rcx
movq 0x40(%r15), %rax
cmpq %rbx, %rcx
jb 0x445a
movq %rcx, %rdx
shrq %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x2, %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x4, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x8, %rcx
orq %rdx, %rcx
movq %rcx, %rbx
shrq $0x10, %rbx
orq %rcx, %rbx
incq %rbx
movq %rbx, 0x38(%r15)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21c0
movq %rax, 0x40(%r15)
movb $0x0, (%rax,%r12)
cmpl $0x2b, 0xc(%rsp)
jne 0x4534
cmpq %rbx, 0x50(%r15)
jae 0x4484
movq %rbx, 0x50(%r15)
movq 0x58(%r15), %rdi
movq %rbx, %rsi
callq 0x21c0
movq %rax, 0x58(%r15)
movl 0x8(%r14), %edx
movl (%r14), %ecx
movl 0x4(%r14), %eax
movq 0x10(%rsp), %r12
testb $0x3, %dl
je 0x44a1
cmpl %eax, %ecx
jge 0x45cf
movq 0x18(%r14), %rsi
cmpl %eax, %ecx
jl 0x44e5
movl $0x0, (%r14)
movq 0x10(%r14), %rdi
sarl $0x2, %edx
callq 0x2140
movl %eax, 0x4(%r14)
movl 0x8(%r14), %edx
movl %edx, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jge 0x44d6
andl $-0x4, %edx
incl %edx
movl %edx, 0x8(%r14)
testl %eax, %eax
je 0x45cf
movl (%r14), %ecx
movq 0x18(%r14), %rsi
movslq %ecx, %rdi
incl %ecx
movl %ecx, (%r14)
movzbl (%rsi,%rdi), %esi
movl %esi, 0xc(%rsp)
cmpl $0xa, %esi
jne 0x4494
movq %r14, %rdi
movl $0x2, %esi
movq %r13, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x4709
movq (%rbp), %r12
movq (%r13), %rcx
testl %eax, %eax
js 0x4523
cmpq %r12, %rcx
jb 0x44fa
movl $0x0, 0x60(%r15)
cmpq %rcx, %r12
jne 0x464a
testl %r12d, %r12d
movq 0x10(%rsp), %r12
js 0x464f
movq 0x40(%rsp), %rbp
movslq %ebp, %rax
movq 0x18(%rsp), %r14
cmpq %rax, %r14
jl 0x457d
leal (,%rbp,2), %ebx
testl %ebp, %ebp
movl $0x100, %eax            # imm = 0x100
cmovel %eax, %ebx
movslq %ebx, %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
movq %r12, %rdi
callq 0x21c0
movq %rax, %r12
movl %ebx, %ebp
leaq (%r14,%r14,2), %rbx
movq 0x40(%r15), %rdi
callq 0x2280
movq %rax, 0x8(%r12,%rbx,8)
cmpq $0x0, 0x48(%r15)
je 0x45a1
movq 0x58(%r15), %rdi
callq 0x2280
jmp 0x45a3
xorl %eax, %eax
leaq (%r12,%rbx,8), %rcx
movq %rax, 0x10(%rcx)
movl 0x30(%r15), %eax
movl %eax, (%rcx)
incq %r14
movq %r14, 0x18(%rsp)
movq 0x68(%r15), %r14
movl 0x60(%r15), %eax
jmp 0x4203
movl %edi, 0x60(%r15)
jmp 0x43fd
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
movl %ecx, (%rax)
testq %r15, %r15
movq 0x28(%rsp), %r14
je 0x462b
movq 0x10(%r15), %rdi
callq 0x2040
movq 0x28(%r15), %rdi
callq 0x2040
movq 0x40(%r15), %rdi
callq 0x2040
movq 0x58(%r15), %rdi
callq 0x2040
movq 0x68(%r15), %rbx
testq %rbx, %rbx
je 0x4623
movq 0x18(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movq %r15, %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2030
jmp 0x4638
xorl %r12d, %r12d
movq %r12, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %r12
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
movl %ecx, (%rax)
movq 0x28(%rsp), %r14
jmp 0x45e5