// File: /workspace/github_c_makefile_star2_O0/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
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 0x2190
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 0x166ba
jmp 0x16590
cmpq $0x100, -0x48(%rbp)     # imm = 0x100
jae 0x16623
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 0x2ae0
movq %rax, -0x40(%rbp)
jmp 0x16625
jmp 0x16627
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x1666e
cmpq $0x0, -0x48(%rbp)
je 0x16645
movq -0x48(%rbp), %rax
shlq %rax
movq %rax, -0x68(%rbp)
jmp 0x16650
movl $0x2, %eax
movq %rax, -0x68(%rbp)
jmp 0x16650
movq -0x68(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rsi
imulq $0x28, -0x48(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x2ae0
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 0x2230
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 0x2190
jmp 0x166bc
movq -0x58(%rbp), %rdi
callq 0x16990
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jl 0x16956
movq -0x58(%rbp), %rax
cmpl $0x7fffffff, 0x20(%rax) # imm = 0x7FFFFFFF
ja 0x166e0
jmp 0x166ff
leaq 0x262a1(%rip), %rdi     # 0x3c988
leaq 0x262b1(%rip), %rsi     # 0x3c99f
movl $0x4c, %edx
leaq 0x262ac(%rip), %rcx     # 0x3c9a6
callq 0x2170
cmpq $0x0, -0x48(%rbp)
jne 0x167a3
jmp 0x1670c
cmpq $0x100, -0x48(%rbp)     # imm = 0x100
jae 0x1679f
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 0x2ae0
movq %rax, -0x40(%rbp)
jmp 0x167a1
jmp 0x167a3
jmp 0x167a5
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x167ec
cmpq $0x0, -0x48(%rbp)
je 0x167c3
movq -0x48(%rbp), %rax
shlq %rax
movq %rax, -0x70(%rbp)
jmp 0x167ce
movl $0x2, %eax
movq %rax, -0x70(%rbp)
jmp 0x167ce
movq -0x70(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rsi
imulq $0x28, -0x48(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x2ae0
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 0x16d40
movq -0x60(%rbp), %rax
movslq (%rax), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x10(%rbp), %rax
jl 0x16951
cmpl $0x0, -0x1c(%rbp)
je 0x1694f
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rcx
subq $0x1, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpl $0xf4240, (%rax)        # imm = 0xF4240
jge 0x1694f
jmp 0x16865
movq -0x58(%rbp), %rdi
callq 0x16990
cmpl $0x0, %eax
jl 0x1694d
movq -0x58(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x10, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x16d40
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 0x16e90
cmpl $0x0, %eax
je 0x16946
jmp 0x168bd
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jne 0x16904
cmpq $0x0, -0x48(%rbp)
je 0x168db
movq -0x48(%rbp), %rax
shlq %rax
movq %rax, -0x78(%rbp)
jmp 0x168e6
movl $0x2, %eax
movq %rax, -0x78(%rbp)
jmp 0x168e6
movq -0x78(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rsi
imulq $0x28, -0x48(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x2ae0
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 0x2230
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x2190
jmp 0x16948
jmp 0x1694d
jmp 0x16865
jmp 0x1694f
jmp 0x16956
jmp 0x166bc
cmpl $-0x1, -0x34(%rbp)
jge 0x16974
movq 0x2e695(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
leaq 0x26083(%rip), %rsi     # 0x3c9f0
movb $0x0, %al
callq 0x2210
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)