// File: /workspace/github_c_makefile_star2_O1/lh3[P]minimap/bseq.c
// Function: bseq_read
bseq1_t *bseq_read(bseq_file_t *fp, int chunk_size, int *n_)
{
	int size = 0, m, n;
	bseq1_t *seqs;
	kseq_t *ks = fp->ks;
	m = n = 0; seqs = 0;
	while (kseq_read(ks) >= 0) {
		bseq1_t *s;
		assert(ks->seq.l <= INT32_MAX);
		if (n >= m) {
			m = m? m<<1 : 256;
			seqs = (bseq1_t*)realloc(seqs, m * sizeof(bseq1_t));
		}
		s = &seqs[n];
		s->name = strdup(ks->name.s);
		s->seq = strdup(ks->seq.s);
		s->l_seq = ks->seq.l;
		size += seqs[n++].l_seq;
		if (size >= chunk_size) break;
	}
	if (n == 0) fp->is_eof = 1;
	*n_ = n;
	return seqs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x28(%rsp)
movl %esi, 0x14(%rsp)
movq %rdi, 0x20(%rsp)
movq 0x10(%rdi), %r15
leaq 0x30(%r15), %rax
movq %rax, 0x18(%rsp)
leaq 0x20(%r15), %r13
leaq 0x10(%r15), %rax
movq %rax, 0x30(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
movq $0x0, 0x8(%rsp)
xorl %ebx, %ebx
movq 0x48(%r15), %r14
cmpl $0x0, 0x40(%r15)
jne 0x35d6
jmp 0x3555
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x35bb
movl 0x8(%r14), %edx
testb $0x3, %dl
je 0x356c
movl (%r14), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x4(%r14), %ecx
jge 0x35bb
movl (%r14), %eax
cmpl 0x4(%r14), %eax
jl 0x35aa
movl $0x0, (%r14)
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
sarl $0x2, %edx
callq 0x2170
movl %eax, 0x4(%r14)
movl 0x8(%r14), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x35a6
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%r14)
testl %eax, %eax
je 0x354e
movq 0x18(%r14), %rax
movslq (%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r14)
movzbl (%rax,%rcx), %eax
movl %eax, 0x4(%rsp)
cmpl $-0x1, %eax
je 0x384a
cmpl $0x40, %eax
je 0x35d2
cmpl $0x3e, %eax
jne 0x3555
movl %eax, 0x40(%r15)
xorl %eax, %eax
movl %eax, 0x30(%r15)
movl %eax, 0x20(%r15)
movl %eax, 0x10(%r15)
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
leaq 0x4(%rsp), %rcx
xorl %r8d, %r8d
callq 0x391b
testl %eax, %eax
js 0x36fc
cmpl $0xa, 0x4(%rsp)
je 0x361f
movq %r14, %rdi
movl $0x2, %esi
movq 0x30(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x391b
cmpq $0x0, 0x28(%r15)
jne 0x363c
movl $0x100, 0x24(%r15)      # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x21e0
movq %rax, 0x28(%r15)
movl 0x8(%r14), %edx
testb $0x3, %dl
je 0x3653
movl (%r14), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x4(%r14), %ecx
jge 0x36a2
movl (%r14), %eax
cmpl 0x4(%r14), %eax
jl 0x3691
movl $0x0, (%r14)
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
sarl $0x2, %edx
callq 0x2170
movl %eax, 0x4(%r14)
movl 0x8(%r14), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x368d
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%r14)
testl %eax, %eax
je 0x36f5
movq 0x18(%r14), %rax
movslq (%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r14)
movzbl (%rax,%rcx), %eax
movl %eax, 0x4(%rsp)
cmpl $0x2a, %eax
jg 0x36b7
cmpl $0xa, %eax
je 0x363c
cmpl $-0x1, %eax
jne 0x36c6
jmp 0x370a
cmpl $0x2b, %eax
je 0x370a
cmpl $0x3e, %eax
je 0x3706
cmpl $0x40, %eax
je 0x3706
movq 0x28(%r15), %rcx
movl 0x20(%r15), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x20(%r15)
movb %al, (%rcx,%rdx)
movq %r14, %rdi
movl $0x2, %esi
movq %r13, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x391b
jmp 0x363c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x36a2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x384a
movl %eax, 0x40(%r15)
movl 0x20(%r15), %eax
incl %eax
cmpl 0x24(%r15), %eax
jb 0x374b
movl %eax, %ecx
shrl %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x8, %eax
orl %ecx, %eax
movl %eax, %esi
shrl $0x10, %esi
orl %eax, %esi
incl %esi
movl %esi, 0x24(%r15)
movq 0x28(%r15), %rdi
callq 0x2200
movq %rax, 0x28(%r15)
movq 0x28(%r15), %rax
movl 0x20(%r15), %ecx
movb $0x0, (%rax,%rcx)
cmpl $0x2b, 0x4(%rsp)
jne 0x383f
movl 0x24(%r15), %esi
cmpl %esi, 0x34(%r15)
jae 0x3786
movl %esi, 0x34(%r15)
movq 0x38(%r15), %rdi
callq 0x2200
movq %rax, 0x38(%r15)
jmp 0x3786
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x37ec
movl 0x8(%r14), %edx
testb $0x3, %dl
je 0x379d
movl (%r14), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x4(%r14), %ecx
jge 0x37ec
movl (%r14), %eax
cmpl 0x4(%r14), %eax
jl 0x37db
movl $0x0, (%r14)
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
sarl $0x2, %edx
callq 0x2170
movl %eax, 0x4(%r14)
movl 0x8(%r14), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x37d7
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%r14)
testl %eax, %eax
je 0x377f
movq 0x18(%r14), %rax
movslq (%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r14)
movzbl (%rax,%rcx), %eax
movl %eax, 0x4(%rsp)
cmpl $-0x1, %eax
je 0x3845
cmpl $0xa, %eax
jne 0x3786
movq 0x18(%rsp), %rdx
movq %r14, %rdi
movl $0x2, %esi
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x391b
movq 0x18(%rsp), %rdx
testl %eax, %eax
js 0x3825
movl (%rdx), %eax
cmpl (%r13), %eax
jb 0x37ff
movl $0x0, 0x40(%r15)
movl 0x20(%r15), %eax
cmpl 0x30(%r15), %eax
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
cmovnel %ecx, %eax
jmp 0x384a
movl (%r13), %eax
jmp 0x384a
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
movq 0x8(%rsp), %rcx
testl %eax, %eax
js 0x38d1
cmpl $0x0, 0x20(%r15)
js 0x38f9
movslq %ecx, %rax
cmpq %rax, %rbp
jl 0x3893
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 %r12, %rdi
callq 0x2200
movq %rax, %r12
movl %r14d, %eax
movq %rax, 0x8(%rsp)
leaq (,%rbp,2), %r14
addq %rbp, %r14
movq 0x8(%r15), %rdi
callq 0x22c0
movq %rax, 0x8(%r12,%r14,8)
movq 0x28(%r15), %rdi
callq 0x22c0
movq %rax, 0x10(%r12,%r14,8)
movl 0x20(%r15), %eax
movl %eax, (%r12,%r14,8)
incq %rbp
addl %eax, %ebx
cmpl 0x14(%rsp), %ebx
jl 0x353d
testl %ebp, %ebp
jne 0x38e0
movq 0x20(%rsp), %rax
movl $0x1, (%rax)
movq 0x28(%rsp), %rax
movl %ebp, (%rax)
movq %r12, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4e2a(%rip), %rdi      # 0x872a
leaq 0x4e3a(%rip), %rsi      # 0x8741
leaq 0x4e3a(%rip), %rcx      # 0x8748
movl $0x2d, %edx
callq 0x2110