// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2190
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x18bd7
jmp 0x18a96
cmpq $0x100, -0x40(%rbp)     # imm = 0x100
jae 0x18b2c
movq $0x100, -0x40(%rbp)     # imm = 0x100
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq $0x2, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq $0x4, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq $0x8, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq $0x10, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
shlq $0x5, %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0xb100
movq %rax, -0x38(%rbp)
jmp 0x18b2e
jmp 0x18b30
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x18b7a
cmpq $0x0, -0x40(%rbp)
je 0x18b4e
movq -0x40(%rbp), %rax
shlq %rax
movq %rax, -0x60(%rbp)
jmp 0x18b59
movl $0x2, %eax
movq %rax, -0x60(%rbp)
jmp 0x18b59
movq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
shlq $0x5, %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0xb100
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rbp)
shlq $0x5, %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, (%rax)
movq 0x18(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x20(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x28(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movslq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2190
jmp 0x18bd9
movq -0x50(%rbp), %rdi
callq 0x15ac0
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
jl 0x18d5e
movq -0x50(%rbp), %rax
cmpq $0x7fffffff, 0x30(%rax) # imm = 0x7FFFFFFF
ja 0x18bfe
jmp 0x18c1d
leaq 0x8f9e(%rip), %rdi      # 0x21ba3
leaq 0x8fae(%rip), %rsi      # 0x21bba
movl $0x44, %edx
leaq 0x8fa9(%rip), %rcx      # 0x21bc1
callq 0x2180
cmpq $0x0, -0x40(%rbp)
jne 0x18cc4
jmp 0x18c2a
cmpq $0x100, -0x40(%rbp)     # imm = 0x100
jae 0x18cc0
movq $0x100, -0x40(%rbp)     # imm = 0x100
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq $0x2, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq $0x4, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq $0x8, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shrq $0x10, %rax
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
shlq $0x5, %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0xb100
movq %rax, -0x38(%rbp)
jmp 0x18cc2
jmp 0x18cc4
jmp 0x18cc6
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x18d10
cmpq $0x0, -0x40(%rbp)
je 0x18ce4
movq -0x40(%rbp), %rax
shlq %rax
movq %rax, -0x68(%rbp)
jmp 0x18cef
movl $0x2, %eax
movq %rax, -0x68(%rbp)
jmp 0x18cef
movq -0x68(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
shlq $0x5, %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0xb100
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rbp)
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x18dd0
movq -0x58(%rbp), %rax
movslq (%rax), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x10(%rbp), %rax
jl 0x18d59
jmp 0x18d5e
jmp 0x18bd9
cmpl $-0x1, -0x2c(%rbp)
jge 0x18db6
cmpq $0x0, -0x48(%rbp)
je 0x18d9c
movq 0xd286(%rip), %rax      # 0x25ff8
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
subq $0x1, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
leaq 0x8e6e(%rip), %rsi      # 0x21c01
movb $0x0, %al
callq 0x21f0
jmp 0x18db4
movq 0xd255(%rip), %rax      # 0x25ff8
movq (%rax), %rdi
leaq 0x8eb0(%rip), %rsi      # 0x21c5d
movb $0x0, %al
callq 0x21f0
jmp 0x18db6
movq -0x48(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)