// File: /workspace/github_c_makefile_star2_O3/lh3[P]minigraph/bseq.c
// Function: mg_bseq_read
mg_bseq1_t *mg_bseq_read(mg_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(mg_bseq1_t) a = {0,0,0};
	kseq_t *ks = fp->ks;
	*n_ = 0;
	if (fp->s.seq) {
		kv_resize(mg_bseq1_t, 0, a, 256);
		kv_push(mg_bseq1_t, 0, a, fp->s);
		size = fp->s.l_seq;
		memset(&fp->s, 0, sizeof(mg_bseq1_t));
	}
	while ((ret = kseq_read(ks)) >= 0) {
		mg_bseq1_t *s;
		assert(ks->seq.l <= INT32_MAX);
		if (a.m == 0) kv_resize(mg_bseq1_t, 0, a, 256);
		kv_pushp(mg_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 (kseq_read(ks) >= 0) {
					kseq2bseq(ks, &fp->s, with_qual, with_comment);
					if (mg_qname_same(fp->s.name, a.a[a.n-1].name)) {
						kv_push(mg_bseq1_t, 0, a, fp->s);
						memset(&fp->s, 0, sizeof(mg_bseq1_t));
					} else break;
				}
			}
			break;
		}
	}
	if (ret < -1)
		fprintf(stderr, "[WARNING]\033[1;31m wrong 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 $0x48, %rsp
movl %r8d, 0x30(%rsp)
movl %ecx, 0x24(%rsp)
movl %edx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x8(%rdi), %r12
movq %r9, 0x10(%rsp)
movl $0x0, (%r9)
leaq 0x10(%rdi), %r15
movq %rdi, 0x40(%rsp)
cmpq $0x0, 0x20(%rdi)
movq %r15, 0x28(%rsp)
je 0xf5ee
movl $0x2800, %edx           # imm = 0x2800
xorl %edi, %edi
xorl %esi, %esi
callq 0x31ed
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rax)
movq 0x20(%r15), %rcx
movq %rcx, 0x20(%rax)
movq %rax, (%rsp)
movups %xmm0, (%rax)
movslq (%r15), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
movups %xmm0, (%r15)
movq $0x0, 0x20(%r15)
movl $0x1, %ecx
movl $0x100, %eax            # imm = 0x100
movq %rax, 0x8(%rsp)
jmp 0xf604
movq $0x0, 0x8(%rsp)
movq $0x0, (%rsp)
xorl %ecx, %ecx
xorl %r14d, %r14d
leal (%rcx,%rcx), %ebx
leal (,%rcx,8), %eax
leaq (%rax,%rax,4), %r13
movq %rcx, %r15
movl %ecx, %eax
shll $0x4, %eax
leaq (%rax,%rax,4), %rbp
movq %r12, 0x38(%rsp)
movq %r12, %rdi
callq 0xf890
testl %eax, %eax
movl %eax, 0x34(%rsp)
js 0xf83b
cmpl $0x0, 0x20(%r12)
js 0xf871
movq 0x8(%rsp), %rcx
testq %rcx, %rcx
movq (%rsp), %rax
jne 0xf665
movl $0x2800, %edx           # imm = 0x2800
xorl %edi, %edi
movq %rax, %rsi
callq 0x31ed
movl $0x100, %ecx            # imm = 0x100
cmpq %rcx, %r15
jne 0xf67e
xorl %edi, %edi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x31ed
movq %rbx, 0x8(%rsp)
jmp 0xf683
movq %rcx, 0x8(%rsp)
incq %r15
leaq (%rax,%r13), %rsi
movq %r12, %rdi
movl 0x20(%rsp), %edx
movl 0x24(%rsp), %ecx
movq %rax, %r12
callq 0xfbc2
movq %r12, (%rsp)
movslq (%r12,%r13), %rax
movq 0x38(%rsp), %r12
addq %rax, %r14
addq $0x28, %r13
addq $0x2, %rbx
addq $0x50, %rbp
cmpq 0x18(%rsp), %r14
jl 0xf623
cmpl $0x0, 0x30(%rsp)
je 0xf84a
cmpl $0xf423f, %eax          # imm = 0xF423F
jg 0xf84a
movq %rbx, 0x18(%rsp)
movq %r12, %rdi
callq 0xf890
testl %eax, %eax
js 0xf84a
movq (%rsp), %r14
movq 0x28(%rsp), %rbp
movq %r12, %rdi
movq %rbp, %rsi
movl 0x20(%rsp), %edx
movl 0x24(%rsp), %ecx
callq 0xfbc2
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rbx
movq %r14, %r12
movq -0x20(%r14,%r13), %rbp
movq %rbx, %rdi
callq 0x2110
cmpl $0x3, %eax
jl 0xf748
movl %eax, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addl %edx, %ecx
movb (%rbx,%rcx), %cl
addb $-0x30, %cl
cmpb $0x9, %cl
ja 0xf748
leal -0x2(%rax), %r14d
cmpb $0x2f, (%rbx,%r14)
je 0xf74b
movl %eax, %r14d
movq %rbp, %rdi
callq 0x2110
cmpl $0x3, %eax
jl 0xf777
movl %eax, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addl %edx, %ecx
movb (%rbp,%rcx), %cl
addb $-0x30, %cl
cmpb $0x9, %cl
ja 0xf777
leal -0x2(%rax), %ecx
cmpb $0x2f, (%rbp,%rcx)
je 0xf779
movl %eax, %ecx
cmpl %ecx, %r14d
jne 0xf865
movslq %r14d, %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2070
testl %eax, %eax
jne 0xf865
cmpq 0x8(%rsp), %r15
jne 0xf7d8
testq %r15, %r15
movq 0x18(%rsp), %rbx
movq %rbx, %rax
movl $0x2, %ecx
cmoveq %rcx, %rax
movq %rax, 0x8(%rsp)
leaq (,%rax,8), %rax
leaq (%rax,%rax,4), %rdx
xorl %edi, %edi
movq %r12, %rsi
callq 0x31ed
movq %rax, %r14
movq 0x28(%rsp), %rbp
jmp 0xf7e5
movq %r12, %r14
movq 0x28(%rsp), %rbp
movq 0x18(%rsp), %rbx
incq %r15
movq 0x20(%rbp), %rax
movq %rax, 0x20(%r14,%r13)
movups (%rbp), %xmm0
movups 0x10(%rbp), %xmm1
movups %xmm1, 0x10(%r14,%r13)
movups %xmm0, (%r14,%r13)
xorps %xmm0, %xmm0
movups %xmm0, (%rbp)
movups %xmm0, 0x10(%rbp)
movq $0x0, 0x20(%rbp)
movq 0x38(%rsp), %r12
movq %r12, %rdi
callq 0xf890
addq $0x2, %rbx
movq %rbx, 0x18(%rsp)
addq $0x28, %r13
testl %eax, %eax
jns 0xf6f8
jmp 0xf83f
movq (%rsp), %r14
movq %r14, (%rsp)
cmpl $-0x2, 0x34(%rsp)
jle 0xf86a
movq 0x10(%rsp), %rax
movl %r15d, (%rax)
movq (%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %r14
jmp 0xf83f
callq 0x25e5
jmp 0xf84a
leaq 0x19133(%rip), %rdi     # 0x289ab
leaq 0x19143(%rip), %rsi     # 0x289c2
leaq 0x19143(%rip), %rcx     # 0x289c9
movl $0x4c, %edx
callq 0x2160