// File: /workspace/github_c_makefile_star2_O2/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 $0x38, %rsp
movq %rsi, %rbx
andl $0x0, (%rsi)
testq %rdi, %rdi
je 0x3426
cmpb $0x2d, (%rdi)
jne 0x3418
cmpb $0x0, 0x1(%rdi)
je 0x3426
leaq 0x11027(%rip), %rsi     # 0x14446
callq 0x2210
jmp 0x3443
movq 0x17b9b(%rip), %rax     # 0x1afc8
movq (%rax), %rdi
callq 0x2180
leaq 0x1100a(%rip), %rsi     # 0x14446
movl %eax, %edi
callq 0x2080
movq %rax, %r13
xorl %r14d, %r14d
testq %rax, %rax
je 0x371f
movq %rbx, 0x18(%rsp)
pushq $0x1
popq %rbx
pushq $0x70
popq %rsi
movq %rbx, %rdi
callq 0x2130
movq %rax, %r15
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x2130
movq %rax, %r12
movq %r13, 0x20(%rsp)
movq %r13, 0x10(%rax)
movl $0x10000, 0x8(%rax)     # imm = 0x10000
movl $0x4000, %edi           # imm = 0x4000
callq 0x21a0
movq %rax, 0x18(%r12)
movq %r12, 0x68(%r15)
leaq 0x48(%r15), %r13
leaq 0x30(%r15), %rbp
leaq 0x18(%r15), %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x28(%rsp)
testl %r14d, %r14d
jne 0x34ed
movq %r12, %rdi
callq 0x3838
cmpl $-0x1, %eax
je 0x3707
cmpl $0x40, %eax
je 0x34e5
cmpl $0x3e, %eax
jne 0x34ca
movl %eax, 0x4(%rsp)
movl %eax, 0x60(%r15)
andq $0x0, 0x48(%r15)
andq $0x0, 0x30(%r15)
andq $0x0, 0x18(%r15)
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
leaq 0x4(%rsp), %rcx
callq 0x38ab
testl %eax, %eax
js 0x3723
cmpl $0xa, 0x4(%rsp)
pushq $0x2
popq %rbx
je 0x3531
movq %r12, %rdi
movl %ebx, %esi
movq 0x30(%rsp), %rdx
xorl %ecx, %ecx
callq 0x38ab
cmpq $0x0, 0x40(%r15)
jne 0x354e
movq $0x100, 0x38(%r15)      # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x21a0
movq %rax, 0x40(%r15)
movq %r12, %rdi
callq 0x3838
movl %eax, 0x4(%rsp)
cmpl $0xa, %eax
je 0x354e
cmpl $-0x1, %eax
je 0x359f
cmpl $0x2b, %eax
je 0x359f
cmpl $0x3e, %eax
je 0x359b
cmpl $0x40, %eax
je 0x359b
movq 0x30(%r15), %rcx
movq 0x40(%r15), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x30(%r15)
movb %al, (%rdx,%rcx)
movq %r12, %rdi
movl %ebx, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
pushq $0x1
popq %r8
callq 0x38b0
jmp 0x354e
movl %eax, 0x60(%r15)
movq 0x30(%r15), %r14
movq 0x38(%r15), %rbx
leaq 0x1(%r14), %rcx
movq 0x40(%r15), %rax
cmpq %rbx, %rcx
jb 0x35fb
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,%r14)
cmpl $0x2b, 0x4(%rsp)
jne 0x3670
cmpq %rbx, 0x50(%r15)
jae 0x3621
movq %rbx, 0x50(%r15)
movq 0x58(%r15), %rdi
movq %rbx, %rsi
callq 0x21c0
movq %rax, 0x58(%r15)
pushq $0x2
popq %rbx
movq %r12, %rdi
callq 0x3838
movl %eax, 0x4(%rsp)
cmpl $-0x1, %eax
je 0x3707
cmpl $0xa, %eax
jne 0x3624
movq %r12, %rdi
movl %ebx, %esi
movq %r13, %rdx
xorl %ecx, %ecx
pushq $0x1
popq %r8
callq 0x38b0
movq (%rbp), %r14
movq (%r13), %rcx
testl %eax, %eax
js 0x3662
cmpq %r14, %rcx
jb 0x363e
andl $0x0, 0x60(%r15)
cmpq %rcx, %r14
jne 0x3723
testl %r14d, %r14d
js 0x3723
movq 0x28(%rsp), %rcx
movslq %ecx, %rax
movq 0x10(%rsp), %r12
cmpq %rax, %r12
jge 0x3692
movq 0x8(%rsp), %r14
jmp 0x36ba
leal (%rcx,%rcx), %ebx
testl %ecx, %ecx
movl $0x100, %eax            # imm = 0x100
cmovel %eax, %ebx
movslq %ebx, %rax
imulq $0x18, %rax, %rsi
movq 0x8(%rsp), %rdi
callq 0x21c0
movq %rax, %r14
movl %ebx, %eax
movq %rax, 0x28(%rsp)
imulq $0x18, %r12, %rbx
movq 0x40(%r15), %rdi
callq 0x2280
movq %rax, 0x8(%r14,%rbx)
cmpq $0x0, 0x48(%r15)
je 0x36de
movq 0x58(%r15), %rdi
callq 0x2280
jmp 0x36e0
xorl %eax, %eax
movq %r14, 0x8(%rsp)
addq %r14, %rbx
movq %rax, 0x10(%rbx)
movl 0x30(%r15), %eax
movl %eax, (%rbx)
incq %r12
movq %r12, 0x10(%rsp)
movq 0x68(%r15), %r12
movl 0x60(%r15), %r14d
jmp 0x34c5
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movl %ecx, (%rax)
testq %r15, %r15
movq 0x20(%rsp), %r14
jne 0x3734
jmp 0x377a
xorl %eax, %eax
jmp 0x3787
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movl %ecx, (%rax)
movq 0x20(%rsp), %r14
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 0x3772
movq 0x18(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movq %r15, %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2030
movq 0x8(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq