// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/trim.c
// Function: bseq_read
bseq1_t *bseq_read(kseq_t *ks, int chunk_size, int *n_)
{
	int size = 0, m, n;
	bseq1_t *seqs;
	m = n = 0; seqs = 0;
	while (kseq_read(ks) >= 0) {
		bseq1_t *s;
		if (n >= m) {
			m = m? m<<1 : 256;
			seqs = realloc(seqs, m * sizeof(bseq1_t));
		}
		s = &seqs[n];
		s->name = strdup(ks->name.s);
		s->seq = strdup(ks->seq.s);
		s->qual = ks->qual.l? strdup(ks->qual.s) : 0;
		s->bc = 0;
		s->l_seq = ks->seq.l;
		s->dbl_bind = 0;
		s->type = AD_UNKNOWN;
		size += seqs[n++].l_seq;
		if (size >= chunk_size && (n&1) == 0) break;
	}
	*n_ = n;
	return seqs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x8(%rsp)
movl %esi, 0x14(%rsp)
movq %rdi, %r15
leaq 0x30(%rdi), %r12
leaq 0x20(%rdi), %r13
leaq 0x10(%rdi), %rax
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
movq $0x0, 0x18(%rsp)
xorl %r14d, %r14d
xorl %edx, %edx
movl %edx, 0x10(%rsp)
movq 0x48(%r15), %rbx
cmpl $0x0, 0x40(%r15)
je 0x3328
movl %ebp, 0x4(%rsp)
jmp 0x339c
movl 0x8(%rbx), %edx
movl (%rbx), %ecx
movl 0x4(%rbx), %eax
movl %ebp, 0x4(%rsp)
testb $0x3, %dl
je 0x3341
cmpl %eax, %ecx
jge 0x36ca
movq 0x18(%rbx), %rsi
cmpl %eax, %ecx
jl 0x3380
movl $0x0, (%rbx)
movq 0x10(%rbx), %rdi
sarl $0x2, %edx
callq 0x2130
movl %eax, 0x4(%rbx)
movl 0x8(%rbx), %edx
movl %edx, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jge 0x3372
andl $-0x4, %edx
incl %edx
movl %edx, 0x8(%rbx)
testl %eax, %eax
je 0x36ca
movl (%rbx), %ecx
movq 0x18(%rbx), %rsi
movslq %ecx, %rdi
incl %ecx
movl %ecx, (%rbx)
movzbl (%rsi,%rdi), %esi
movl %esi, (%rsp)
cmpl $0x40, %esi
je 0x3398
cmpl $0x3e, %esi
jne 0x3334
movl %esi, 0x40(%r15)
xorl %eax, %eax
movl %eax, 0x30(%r15)
movl %eax, 0x20(%r15)
movl %eax, 0x10(%r15)
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rsp, %rcx
xorl %r8d, %r8d
callq 0x5406
testl %eax, %eax
js 0x36ca
cmpl $0xa, (%rsp)
je 0x33e2
movq %rbx, %rdi
movl $0x2, %esi
movq 0x20(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5406
cmpq $0x0, 0x28(%r15)
jne 0x33ff
movl $0x100, 0x24(%r15)      # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x21b0
movq %rax, 0x28(%r15)
movl 0x8(%rbx), %edx
testb $0x3, %dl
sete %sil
movl (%rbx), %ecx
movl 0x4(%rbx), %eax
cmpl %eax, %ecx
setl %dil
orb %dil, %sil
testb $0x1, %sil
je 0x34e1
movq 0x18(%rbx), %rsi
testb $0x1, %dil
jne 0x3462
movl $0x0, (%rbx)
movq 0x10(%rbx), %rdi
sarl $0x2, %edx
callq 0x2130
movl %eax, 0x4(%rbx)
movl 0x8(%rbx), %edx
movl %edx, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jge 0x3454
andl $-0x4, %edx
incl %edx
movl %edx, 0x8(%rbx)
testl %eax, %eax
je 0x34e1
movl (%rbx), %ecx
movq 0x18(%rbx), %rsi
movslq %ecx, %rdi
incl %ecx
movl %ecx, (%rbx)
movb (%rsi,%rdi), %sil
movzbl %sil, %edi
movl %edi, (%rsp)
cmpl $0x2a, %edi
jg 0x3480
cmpl $0xa, %edi
je 0x34ca
jmp 0x3497
cmpl $0x2b, %edi
je 0x34e8
cmpl $0x3e, %edi
je 0x36c1
cmpl $0x40, %edi
je 0x36c1
movq 0x28(%r15), %rax
movl 0x20(%r15), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x20(%r15)
movb %sil, (%rax,%rcx)
movq %rbx, %rdi
movl $0x2, %esi
movq %r13, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x5406
movl 0x8(%rbx), %edx
movl (%rbx), %ecx
movl 0x4(%rbx), %eax
cmpl %eax, %ecx
setl %dil
testb $0x3, %dl
je 0x3421
cmpl %eax, %ecx
jl 0x3421
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
movl 0x20(%r15), %ecx
leal 0x1(%rcx), %edx
movq 0x28(%r15), %rax
cmpl 0x24(%r15), %edx
jb 0x3531
movl %edx, %ecx
shrl %ecx
orl %edx, %ecx
movl %ecx, %edx
shrl $0x2, %edx
orl %ecx, %edx
movl %edx, %ecx
shrl $0x4, %ecx
orl %edx, %ecx
movl %ecx, %edx
shrl $0x8, %edx
orl %ecx, %edx
movl %edx, %esi
shrl $0x10, %esi
orl %edx, %esi
incl %esi
movl %esi, 0x24(%r15)
movq %rax, %rdi
callq 0x21d0
movq %rax, 0x28(%r15)
movl 0x20(%r15), %ecx
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
cmpl $0x2b, (%rsp)
jne 0x35fc
movl 0x24(%r15), %esi
cmpl %esi, 0x34(%r15)
jae 0x355c
movl %esi, 0x34(%r15)
movq 0x38(%r15), %rdi
callq 0x21d0
movq %rax, 0x38(%r15)
movl 0x8(%rbx), %edx
movl (%rbx), %ecx
movl 0x4(%rbx), %eax
testb $0x3, %dl
je 0x3571
cmpl %eax, %ecx
jge 0x36ca
movq 0x18(%rbx), %rsi
cmpl %eax, %ecx
jl 0x35b0
movl $0x0, (%rbx)
movq 0x10(%rbx), %rdi
sarl $0x2, %edx
callq 0x2130
movl %eax, 0x4(%rbx)
movl 0x8(%rbx), %edx
movl %edx, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jge 0x35a2
andl $-0x4, %edx
incl %edx
movl %edx, 0x8(%rbx)
testl %eax, %eax
je 0x36ca
movl (%rbx), %ecx
movq 0x18(%rbx), %rsi
movslq %ecx, %rdi
incl %ecx
movl %ecx, (%rbx)
movzbl (%rsi,%rdi), %esi
movl %esi, (%rsp)
cmpl $0xa, %esi
jne 0x3564
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x5406
movl (%r13), %ecx
movl (%r12), %edx
testl %eax, %eax
js 0x35eb
cmpl %ecx, %edx
jb 0x35c3
movl $0x0, 0x40(%r15)
cmpl %edx, %ecx
je 0x3600
jmp 0x36ca
movl (%r13), %ecx
testl %ecx, %ecx
js 0x36ca
movq 0x18(%rsp), %rcx
movslq %ecx, %rax
cmpq %rax, %rbp
jl 0x363f
leal (%rcx,%rcx), %ebx
testl %ecx, %ecx
movl $0x100, %eax            # imm = 0x100
cmovel %eax, %ebx
movslq %ebx, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
movl %ebx, %eax
movq %rax, 0x18(%rsp)
leaq (,%rbp,2), %rbx
addq %rbp, %rbx
shlq $0x4, %rbx
movq 0x8(%r15), %rdi
callq 0x2260
movq %rax, 0x8(%r14,%rbx)
movq 0x28(%r15), %rdi
callq 0x2260
movq %rax, 0x10(%r14,%rbx)
cmpl $0x0, 0x30(%r15)
je 0x367c
movq 0x38(%r15), %rdi
callq 0x2260
jmp 0x367e
xorl %eax, %eax
movl 0x10(%rsp), %edx
addq %r14, %rbx
movq %rax, 0x18(%rbx)
movq $0x0, 0x20(%rbx)
movl (%r13), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
movl %eax, (%rbx)
movl $0x0, 0x4(%rbx)
incq %rbp
addl %eax, %edx
cmpl 0x14(%rsp), %edx
jl 0x3313
andl $0x1, 0x4(%rsp)
je 0x3313
jmp 0x36e7
movl %edi, 0x40(%r15)
jmp 0x34e8
movq 0x8(%rsp), %rax
movl 0x4(%rsp), %ecx
movl %ecx, (%rax)
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %ecx
movq 0x8(%rsp), %rax
jmp 0x36d3