// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/bseq.c
// Function: mg_bseq_read_frag
mg_bseq1_t *mg_bseq_read_frag(int n_fp, mg_bseq_file_t **fp, int64_t chunk_size, int with_qual, int with_comment, int *n_)
{
	int i;
	int64_t size = 0;
	kvec_t(mg_bseq1_t) a = {0,0,0};
	*n_ = 0;
	if (n_fp < 1) return 0;
	while (1) {
		int n_read = 0;
		for (i = 0; i < n_fp; ++i)
			if (kseq_read(fp[i]->ks) >= 0)
				++n_read;
		if (n_read < n_fp) {
			if (n_read > 0)
				fprintf(stderr, "[W::%s]\033[1;31m query files have different number of records; extra records skipped.\033[0m\n", __func__);
			break; // some file reaches the end
		}
		if (a.m == 0) kv_resize(mg_bseq1_t, 0, a, 256);
		for (i = 0; i < n_fp; ++i) {
			mg_bseq1_t *s;
			kv_pushp(mg_bseq1_t, 0, a, &s);
			kseq2bseq(fp[i]->ks, s, with_qual, with_comment);
			size += s->l_seq;
		}
		if (size >= chunk_size) break;
	}
	*n_ = a.n;
	return a.a;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2190
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
cmpl $0x1, -0xc(%rbp)
jge 0x16f43
movq $0x0, -0x8(%rbp)
jmp 0x1713c
jmp 0x16f45
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x16f8b
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
callq 0x16990
cmpl $0x0, %eax
jl 0x16f7e
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x16f80
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x16f53
movl -0x5c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x16fbd
cmpl $0x0, -0x5c(%rbp)
jle 0x16fb8
movq 0x2e058(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
leaq 0x25a87(%rip), %rsi     # 0x3ca31
leaq 0x25ad9(%rip), %rdx     # 0x3ca8a
movb $0x0, %al
callq 0x2210
jmp 0x17128
cmpq $0x0, -0x50(%rbp)
jne 0x17061
jmp 0x16fca
cmpq $0x100, -0x50(%rbp)     # imm = 0x100
jae 0x1705d
movq $0x100, -0x50(%rbp)     # imm = 0x100
movq -0x50(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
shrq %rax
orq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
shrq $0x2, %rax
orq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
shrq $0x4, %rax
orq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
shrq $0x8, %rax
orq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
shrq $0x10, %rax
orq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rsi
imulq $0x28, -0x50(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x2ae0
movq %rax, -0x48(%rbp)
jmp 0x1705f
jmp 0x17061
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x17117
jmp 0x17076
movq -0x58(%rbp), %rax
cmpq -0x50(%rbp), %rax
jne 0x170bd
cmpq $0x0, -0x50(%rbp)
je 0x17094
movq -0x50(%rbp), %rax
shlq %rax
movq %rax, -0x70(%rbp)
jmp 0x1709f
movl $0x2, %eax
movq %rax, -0x70(%rbp)
jmp 0x1709f
movq -0x70(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rsi
imulq $0x28, -0x50(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x2ae0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x58(%rbp)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
movq -0x68(%rbp), %rsi
movl -0x24(%rbp), %edx
movl -0x28(%rbp), %ecx
callq 0x16d40
movq -0x68(%rbp), %rax
movslq (%rax), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x17068
movq -0x40(%rbp), %rax
cmpq -0x20(%rbp), %rax
jl 0x17123
jmp 0x17128
jmp 0x16f45
movq -0x58(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)