// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/bseq.c
// Function: mm_bseq_read3
mm_bseq1_t *mm_bseq_read3(mm_bseq_file_t *fp, int64_t chunk_size, int with_qual, int with_comment, int frag_mode, int *n_)
{
	int64_t size = 0;
	int ret;
	kvec_t(mm_bseq1_t) a = {0,0,0};
	kseq_t *ks = fp->ks;
	*n_ = 0;
	if (fp->s.seq) {
		kv_resize(mm_bseq1_t, 0, a, 256);
		kv_push(mm_bseq1_t, 0, a, fp->s);
		size = fp->s.l_seq;
		memset(&fp->s, 0, sizeof(mm_bseq1_t));
	}
	while ((ret = kseq_read(ks)) >= 0) {
		mm_bseq1_t *s;
		assert(ks->seq.l <= INT32_MAX);
		if (a.m == 0) kv_resize(mm_bseq1_t, 0, a, 256);
		kv_pushp(mm_bseq1_t, 0, a, &s);
		kseq2bseq(ks, s, with_qual, with_comment);
		size += s->l_seq;
		if (size >= chunk_size) {
			if (frag_mode && a.a[a.n-1].l_seq < CHECK_PAIR_THRES) {
				while ((ret = kseq_read(ks)) >= 0) {
					kseq2bseq(ks, &fp->s, with_qual, with_comment);
					if (mm_qname_same(fp->s.name, a.a[a.n-1].name)) {
						kv_push(mm_bseq1_t, 0, a, fp->s);
						memset(&fp->s, 0, sizeof(mm_bseq1_t));
					} else break;
				}
			}
			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 $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq %r9, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x21b0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1bd9a
jmp 0x1bc70
cmpq $0x100, -0x48(%rbp)     # imm = 0x100
jae 0x1bd03
movq $0x100, -0x48(%rbp)     # imm = 0x100
movq -0x48(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x2, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x4, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x8, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x10, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rsi
imulq $0x28, -0x48(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x1ad30
movq %rax, -0x40(%rbp)
jmp 0x1bd05
jmp 0x1bd07
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x1bd4e
cmpq $0x0, -0x48(%rbp)
je 0x1bd25
movq -0x48(%rbp), %rax
shlq %rax
movq %rax, -0x68(%rbp)
jmp 0x1bd30
movl $0x2, %eax
movq %rax, -0x68(%rbp)
jmp 0x1bd30
movq -0x68(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rsi
imulq $0x28, -0x48(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x1ad30
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x50(%rbp)
imulq $0x28, %rax, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x10, %rsi
movl $0x28, %edx
callq 0x2290
movq -0x8(%rbp), %rax
movslq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x21b0
jmp 0x1bd9c
movq -0x58(%rbp), %rdi
callq 0x1b620
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jl 0x1c03a
movq -0x58(%rbp), %rax
cmpq $0x7fffffff, 0x30(%rax) # imm = 0x7FFFFFFF
ja 0x1bdc1
jmp 0x1bde0
leaq 0x3bfb4(%rip), %rdi     # 0x57d7c
leaq 0x3bfc4(%rip), %rsi     # 0x57d93
movl $0x5f, %edx
leaq 0x3bfbf(%rip), %rcx     # 0x57d9a
callq 0x21a0
cmpq $0x0, -0x48(%rbp)
jne 0x1be84
jmp 0x1bded
cmpq $0x100, -0x48(%rbp)     # imm = 0x100
jae 0x1be80
movq $0x100, -0x48(%rbp)     # imm = 0x100
movq -0x48(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x2, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x4, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x8, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x10, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rsi
imulq $0x28, -0x48(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x1ad30
movq %rax, -0x40(%rbp)
jmp 0x1be82
jmp 0x1be84
jmp 0x1be86
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x1becd
cmpq $0x0, -0x48(%rbp)
je 0x1bea4
movq -0x48(%rbp), %rax
shlq %rax
movq %rax, -0x70(%rbp)
jmp 0x1beaf
movl $0x2, %eax
movq %rax, -0x70(%rbp)
jmp 0x1beaf
movq -0x70(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rsi
imulq $0x28, -0x48(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x1ad30
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x50(%rbp)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x1c0b0
movq -0x60(%rbp), %rax
movslq (%rax), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x10(%rbp), %rax
jl 0x1c035
cmpl $0x0, -0x1c(%rbp)
je 0x1c033
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rcx
subq $0x1, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpl $0xf4240, (%rax)        # imm = 0xF4240
jge 0x1c033
jmp 0x1bf46
movq -0x58(%rbp), %rdi
callq 0x1b620
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jl 0x1c031
movq -0x58(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x10, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x1c0b0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rcx
subq $0x1, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0x1c200
cmpl $0x0, %eax
je 0x1c02a
jmp 0x1bfa1
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x1bfe8
cmpq $0x0, -0x48(%rbp)
je 0x1bfbf
movq -0x48(%rbp), %rax
shlq %rax
movq %rax, -0x78(%rbp)
jmp 0x1bfca
movl $0x2, %eax
movq %rax, -0x78(%rbp)
jmp 0x1bfca
movq -0x78(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rsi
imulq $0x28, -0x48(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x1ad30
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x50(%rbp)
imulq $0x28, %rax, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x10, %rsi
movl $0x28, %edx
callq 0x2290
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x21b0
jmp 0x1c02c
jmp 0x1c031
jmp 0x1bf46
jmp 0x1c033
jmp 0x1c03a
jmp 0x1bd9c
cmpl $-0x1, -0x34(%rbp)
jge 0x1c092
cmpq $0x0, -0x50(%rbp)
je 0x1c078
movq 0x41faa(%rip), %rax     # 0x5dff8
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rcx
subq $0x1, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
leaq 0x3bd76(%rip), %rsi     # 0x57de5
movb $0x0, %al
callq 0x2250
jmp 0x1c090
movq 0x41f79(%rip), %rax     # 0x5dff8
movq (%rax), %rdi
leaq 0x3bdb8(%rip), %rsi     # 0x57e41
movb $0x0, %al
callq 0x2250
jmp 0x1c092
movq -0x50(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)