// File: /workspace/github_c_makefile_star2_O3/lh3[P]miniprot/bseq.c
// Function: mp_bseq_read
mp_bseq1_t *mp_bseq_read(mp_bseq_file_t *fp, int64_t chunk_size, int with_comment, int *n_)
{
	int64_t size = 0;
	int ret;
	kvec_t(mp_bseq1_t) a = {0,0,0};
	kseq_t *ks = fp->ks;
	*n_ = 0;
	if (fp->s.seq) {
		kv_resize(mp_bseq1_t, 0, a, 256);
		kv_push(mp_bseq1_t, 0, a, fp->s);
		size = fp->s.l_seq;
		memset(&fp->s, 0, sizeof(mp_bseq1_t));
	}
	while ((ret = kseq_read(ks)) >= 0) {
		mp_bseq1_t *s;
		assert(ks->seq.l <= INT32_MAX);
		if (a.m == 0) kv_resize(mp_bseq1_t, 0, a, 256);
		kv_pushp(mp_bseq1_t, 0, a, &s);
		kseq2bseq(ks, s, with_comment);
		size += s->l_seq;
		if (size >= chunk_size)
			break;
	}
	if (ret < -1) {
		if (a.n) fprintf(stderr, "[WARNING]\033[1;31m failed to parse the FASTA/FASTQ record next to '%s'. Continue anyway.\033[0m\n", a.a[a.n-1].name);
		else fprintf(stderr, "[WARNING]\033[1;31m failed to parse the first FASTA/FASTQ record. Continue anyway.\033[0m\n");
	}
	*n_ = a.n;
	return a.a;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edx, 0xc(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x8(%rdi), %r12
movq %rcx, 0x30(%rsp)
movl $0x0, (%rcx)
cmpq $0x0, 0x20(%rdi)
je 0xdb32
movq %rdi, %r13
movl $0x2000, %edx           # imm = 0x2000
xorl %edi, %edi
xorl %esi, %esi
callq 0x85ad
movq %rax, %r15
movups 0x10(%r13), %xmm0
movups 0x20(%r13), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movslq 0x10(%r13), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r13)
movups %xmm0, 0x10(%r13)
movl $0x1, %ebx
movl $0x100, %ebp            # imm = 0x100
jmp 0xdb3c
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %r14d, %r14d
movl %ebx, %eax
shll $0x5, %eax
movq %rax, (%rsp)
leal (%rbx,%rbx), %eax
movl %ebx, %ecx
shll $0x6, %ecx
movq %rcx, 0x10(%rsp)
movq %r12, %r13
movq %rax, %r12
movq %r13, %rdi
callq 0xbf80
testl %eax, %eax
js 0xdcef
movq 0x30(%r13), %rax
shrq $0x1f, %rax
jne 0xdd3e
testq %rbp, %rbp
jne 0xdb92
movl $0x2000, %edx           # imm = 0x2000
xorl %edi, %edi
movq %r15, %rsi
callq 0x85ad
movq %rax, %r15
movl $0x100, %ebp            # imm = 0x100
cmpq %rbp, %rbx
movq %rbx, 0x50(%rsp)
jne 0xdbb1
xorl %edi, %edi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
callq 0x85ad
movq %rax, %r15
movq %r12, %rbp
movq %r12, 0x18(%rsp)
movq %rbp, 0x48(%rsp)
movq %r14, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movq (%r13), %rbx
testq %rbx, %rbx
je 0xdcc6
movq 0x10(%r13), %rbp
incq %rbx
movq %rbx, %rdi
callq 0x2220
movq %rax, %r15
movq %rax, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x21e0
movq 0x28(%rsp), %r14
movq (%rsp), %r12
movq %r15, 0x8(%r14,%r12)
movq 0x30(%r13), %rax
movq 0x40(%r13), %rbx
movq %rax, 0x40(%rsp)
leaq 0x1(%rax), %r15
movq %r15, %rdi
callq 0x2220
movq %rax, %rbp
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %r15
callq 0x21e0
movq %rbp, 0x10(%r14,%r12)
cmpl $0x0, 0xc(%rsp)
je 0xdc73
movq 0x18(%r13), %rbx
testq %rbx, %rbx
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %r12
je 0xdc81
movq 0x28(%r13), %r15
incq %rbx
movq %rbx, %rdi
callq 0x2220
movq %rax, %rbp
movq %rax, %rdi
movq %r15, %rsi
movq 0x28(%rsp), %r15
movq %rbx, %rdx
callq 0x21e0
jmp 0xdc83
xorl %ebp, %ebp
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %r12
jmp 0xdc83
xorl %ebp, %ebp
movq (%rsp), %rcx
movq %rbp, 0x18(%r15,%rcx)
movq 0x40(%rsp), %rax
movl %eax, (%r15,%rcx)
cltq
addq %rax, %r14
addq $0x20, %rcx
movq %rcx, (%rsp)
addq $0x2, %r12
addq $0x40, 0x10(%rsp)
movq 0x50(%rsp), %rbx
incq %rbx
cmpq 0x38(%rsp), %r14
movq 0x48(%rsp), %rbp
jl 0xdb58
jmp 0xdcf4
movq 0xb323(%rip), %rax      # 0x18ff0
movq (%rax), %rcx
movl $0x37, %esi
movl $0x1, %edx
leaq 0x73d5(%rip), %rdi      # 0x150b6
callq 0x22e0
movq (%r13), %rbx
jmp 0xdbd2
cmpl $-0x1, %eax
jne 0xdd0d
movq 0x30(%rsp), %rax
movl %ebx, (%rax)
movq %r15, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xb2dc(%rip), %rax      # 0x18ff0
movq (%rax), %rdi
testq %rbx, %rbx
jne 0xdd25
callq 0x2cd9
xorl %ebx, %ebx
jmp 0xdcf4
movq (%rsp), %rax
movq -0x18(%r15,%rax), %rdx
leaq 0x72d0(%rip), %rsi      # 0x15005
xorl %eax, %eax
callq 0x21d0
jmp 0xdcf4
leaq 0x7262(%rip), %rdi      # 0x14fa7
leaq 0x7272(%rip), %rsi      # 0x14fbe
leaq 0x7272(%rip), %rcx      # 0x14fc5
movl $0x44, %edx
callq 0x2150
nopl (%rax)