// File: /workspace/github_c_makefile_star2_O1/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, %r15
movl $0x0, (%rsi)
testq %rdi, %rdi
je 0x3d18
movq %rdi, %rbx
leaq 0x13746(%rip), %rsi     # 0x17444
callq 0x2140
testl %eax, %eax
je 0x3d18
leaq 0x13738(%rip), %rsi     # 0x17446
movq %rbx, %rdi
callq 0x2220
jmp 0x3d35
movq 0x192a9(%rip), %rax     # 0x1cfc8
movq (%rax), %rdi
callq 0x2190
leaq 0x13718(%rip), %rsi     # 0x17446
movl %eax, %edi
callq 0x2080
movq %rax, %r14
testq %rax, %rax
je 0x41c6
movq %r15, 0x20(%rsp)
movl $0x1, %edi
movl $0x70, %esi
callq 0x2130
movq %rax, %r15
movl $0x1, %edi
movl $0x20, %esi
callq 0x2130
movq %rax, %rbx
movq %r14, 0x28(%rsp)
movq %r14, 0x10(%rax)
movl 0x8(%rax), %eax
andl $0x3, %eax
orl $0x10000, %eax          # imm = 0x10000
movl %eax, 0x8(%rbx)
movl $0x4000, %edi           # imm = 0x4000
callq 0x21b0
movq %rax, 0x18(%rbx)
movq %rbx, 0x68(%r15)
leaq 0x48(%r15), %r13
leaq 0x30(%r15), %rbp
leaq 0x18(%r15), %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x10(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x18(%rsp)
movq 0x68(%r15), %r14
cmpl $0x0, 0x60(%r15)
jne 0x3e5c
jmp 0x3dd1
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x3e39
movl 0x8(%r14), %edx
testb $0x3, %dl
je 0x3de9
movl (%r14), %eax
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl 0x4(%r14), %eax
jge 0x3e39
movl (%r14), %eax
cmpl 0x4(%r14), %eax
jl 0x3e27
movl $0x0, (%r14)
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
sarl $0x2, %edx
callq 0x2150
movl %eax, 0x4(%r14)
movl 0x8(%r14), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x3e23
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%r14)
testl %eax, %eax
je 0x3dc9
movq 0x18(%r14), %rax
movslq (%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r14)
movzbl (%rax,%rcx), %r12d
movl %r12d, 0xc(%rsp)
cmpl $-0x1, %r12d
je 0x40d9
cmpl $0x40, %r12d
je 0x3e58
cmpl $0x3e, %r12d
jne 0x3dd1
movl %r12d, 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 0x4282
testl %eax, %eax
js 0x3f83
cmpl $0xa, 0xc(%rsp)
je 0x3ea5
movq %r14, %rdi
movl $0x2, %esi
movq 0x30(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x4282
cmpq $0x0, 0x40(%r15)
jne 0x3ec2
movq $0x100, 0x38(%r15)      # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x21b0
movq %rax, 0x40(%r15)
movl 0x8(%r14), %edx
testb $0x3, %dl
je 0x3ed9
movl (%r14), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x4(%r14), %ecx
jge 0x3f28
movl (%r14), %eax
cmpl 0x4(%r14), %eax
jl 0x3f17
movl $0x0, (%r14)
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
sarl $0x2, %edx
callq 0x2150
movl %eax, 0x4(%r14)
movl 0x8(%r14), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x3f13
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%r14)
testl %eax, %eax
je 0x3f7c
movq 0x18(%r14), %rax
movslq (%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r14)
movzbl (%rax,%rcx), %eax
movl %eax, 0xc(%rsp)
cmpl $0x2a, %eax
jg 0x3f3d
cmpl $0xa, %eax
je 0x3ec2
cmpl $-0x1, %eax
jne 0x3f4c
jmp 0x3f92
cmpl $0x2b, %eax
je 0x3f92
cmpl $0x3e, %eax
je 0x3f8e
cmpl $0x40, %eax
je 0x3f8e
movq 0x30(%r15), %rcx
movq 0x40(%r15), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x30(%r15)
movb %al, (%rdx,%rcx)
movq %r14, %rdi
movl $0x2, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x4282
jmp 0x3ec2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3f28
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x40d9
movl %eax, 0x60(%r15)
movq 0x30(%r15), %r12
leaq 0x1(%r12), %rax
cmpq 0x38(%r15), %rax
jb 0x3fe6
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x38(%r15)
movq 0x40(%r15), %rdi
callq 0x21d0
movq %rax, 0x40(%r15)
movq 0x40(%r15), %rax
movb $0x0, (%rax,%r12)
cmpl $0x2b, 0xc(%rsp)
jne 0x40d9
movq 0x38(%r15), %rsi
cmpq %rsi, 0x50(%r15)
jae 0x4015
movq %rsi, 0x50(%r15)
movq 0x58(%r15), %rdi
callq 0x21d0
movq %rax, 0x58(%r15)
movl 0x8(%r14), %edx
testb $0x3, %dl
je 0x402c
movl (%r14), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x4(%r14), %ecx
jge 0x407b
movl (%r14), %eax
cmpl 0x4(%r14), %eax
jl 0x406a
movl $0x0, (%r14)
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
sarl $0x2, %edx
callq 0x2150
movl %eax, 0x4(%r14)
movl 0x8(%r14), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x4066
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%r14)
testl %eax, %eax
je 0x408b
movq 0x18(%r14), %rax
movslq (%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r14)
movzbl (%rax,%rcx), %eax
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x40d3
cmpl $0xa, %eax
jne 0x4015
jmp 0x4092
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x407b
movq %r14, %rdi
movl $0x2, %esi
movq %r13, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x4282
testl %eax, %eax
js 0x40b8
movq (%r13), %rax
cmpq (%rbp), %rax
jb 0x4092
movl $0x0, 0x60(%r15)
movq 0x30(%r15), %r12
cmpq 0x48(%r15), %r12
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmovnel %eax, %r12d
jmp 0x40d9
movl $0xfffffffe, %r12d      # imm = 0xFFFFFFFE
testl %r12d, %r12d
movq 0x18(%rsp), %rcx
js 0x415d
movslq %ecx, %rax
cmpq %rax, 0x10(%rsp)
jl 0x411a
leal (%rcx,%rcx), %r14d
testl %ecx, %ecx
movl $0x100, %eax            # imm = 0x100
cmovel %eax, %r14d
movslq %r14d, %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rbx
movl %r14d, %eax
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rax
leaq (%rax,%rax,2), %r14
movq 0x40(%r15), %rdi
callq 0x2290
movq %rax, 0x8(%rbx,%r14,8)
cmpq $0x0, 0x48(%r15)
je 0x4143
movq 0x58(%r15), %rdi
callq 0x2290
jmp 0x4145
xorl %eax, %eax
leaq (%rbx,%r14,8), %rcx
movq %rax, 0x10(%rcx)
movl 0x30(%r15), %eax
movl %eax, (%rcx)
incq 0x10(%rsp)
jmp 0x3db8
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movl %ecx, (%rax)
testq %r15, %r15
movq 0x28(%rsp), %r14
movq %rbx, %r12
je 0x41bc
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 0x41b4
movq 0x18(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movq %r15, %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2030
jmp 0x41c9
xorl %r12d, %r12d
movq %r12, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq