// File: /workspace/github_c_makefile_star2_O3/lh3[P]fermi-lite/bfc.c
// Function: worker_count
static void worker_count(void *_data, long k, int tid)
{
	cnt_step_t *cs = (cnt_step_t*)_data;
	const bseq1_t *s = &cs->seqs[k];
	int i, l;
	bfc_kmer_t x = bfc_kmer_null;
	uint64_t qmer = 0, mask = (1ULL<<cs->k) - 1;
	for (i = l = 0; i < s->l_seq; ++i) {
		int c = seq_nt6_table[(uint8_t)s->seq[i]] - 1;
		if (c < 4) {
			bfc_kmer_append(cs->k, x.x, c);
			qmer = (qmer<<1 | (s->qual == 0 || s->qual[i] - 33 >= cs->q)) & mask;
			if (++l >= cs->k) bfc_kmer_insert(cs, &x, (qmer == mask), tid);
		} else l = 0, qmer = 0, x = bfc_kmer_null;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edx, 0xc(%rsp)
movq 0x10(%rdi), %rax
movups 0x187d1(%rip), %xmm0    # 0x1d290
movaps %xmm0, 0x20(%rsp)
movups 0x187b5(%rip), %xmm0    # 0x1d280
movaps %xmm0, 0x10(%rsp)
movb (%rdi), %cl
movq $-0x1, %r11
shlq %cl, %r11
leaq (%rsi,%rsi,2), %rcx
movl (%rax,%rcx,8), %esi
testl %esi, %esi
jle 0x4d6d
movq %rdi, %r14
leaq (%rax,%rcx,8), %r13
notq %r11
movslq 0xc(%rsp), %rax
movq %rax, 0x48(%rsp)
xorl %r15d, %r15d
leaq 0x18667(%rip), %rbp     # 0x1d170
xorl %r12d, %r12d
xorl %ebx, %ebx
movq %r11, 0x50(%rsp)
movq 0x8(%r13), %rax
movzbl (%rax,%r15), %eax
movzbl (%rbp,%rax), %r8d
cmpl $0x4, %r8d
ja 0x4bc0
movl (%r14), %eax
movq $-0x1, %rdx
movl %eax, %ecx
shlq %cl, %rdx
decl %r8d
notq %rdx
movl %r8d, %r9d
andl $0x1, %r9d
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdi
leaq (%r9,%rcx,2), %rcx
andq %rdx, %rcx
movq %rcx, 0x10(%rsp)
addq %rdi, %rdi
sarl %r8d
movslq %r8d, %r8
orq %r8, %rdi
andq %rdx, %rdi
movq %rdi, 0x18(%rsp)
movq 0x20(%rsp), %r10
shrq %r10
xorq $0x1, %r9
leal -0x1(%rax), %ecx
shlq %cl, %r9
orq %r10, %r9
movq %r9, 0x20(%rsp)
movq 0x28(%rsp), %r9
shrq %r9
xorq $0x1, %r8
shlq %cl, %r8
orq %r9, %r8
movq %r8, 0x28(%rsp)
movq 0x10(%r13), %rcx
testq %rcx, %rcx
je 0x4be2
movsbl (%rcx,%r15), %r9d
addl $-0x21, %r9d
xorl %ecx, %ecx
cmpl 0x4(%r14), %r9d
setge %cl
jmp 0x4be7
movups 0x186c9(%rip), %xmm0    # 0x1d290
movaps %xmm0, 0x20(%rsp)
movups 0x186ad(%rip), %xmm0    # 0x1d280
movaps %xmm0, 0x10(%rsp)
xorl %ebx, %ebx
xorl %r12d, %r12d
jmp 0x4d5e
movl $0x1, %ecx
addq %rbx, %rbx
orq %rcx, %rbx
andq %r11, %rbx
incl %r12d
cmpl %eax, %r12d
jl 0x4d5e
xorl %ebp, %ebp
cmpq %r11, %rbx
sete %bpl
shrl %eax
xorl %ecx, %ecx
btq %rax, %rdi
setb %cl
btq %rax, %r8
sbbl $0x0, %ecx
seta %al
movzbl %al, %ecx
shll $0x4, %ecx
movq 0x18(%rsp,%rcx), %rax
movq 0x10(%rsp,%rcx), %rcx
addq %rax, %rcx
andq %rdx, %rcx
movq %rcx, %rsi
notq %rsi
shlq $0x15, %rcx
addq %rsi, %rcx
andq %rdx, %rcx
movq %rcx, %rsi
shrq $0x18, %rsi
xorq %rcx, %rsi
imulq $0x109, %rsi, %rcx      # imm = 0x109
andq %rdx, %rcx
movq %rcx, %rsi
shrq $0xe, %rsi
xorq %rcx, %rsi
leaq (%rsi,%rsi,4), %rcx
leaq (%rsi,%rcx,4), %rsi
andq %rdx, %rsi
movq %rsi, %rcx
shrq $0x1c, %rcx
xorq %rsi, %rcx
movl $0x80000001, %edi       # imm = 0x80000001
imulq %rdi, %rcx
andq %rdx, %rcx
xorq %rcx, %rax
movq %rax, %rsi
notq %rsi
shlq $0x15, %rax
addq %rsi, %rax
andq %rdx, %rax
movq %rax, %rsi
shrq $0x18, %rsi
xorq %rax, %rsi
imulq $0x109, %rsi, %rax      # imm = 0x109
andq %rdx, %rax
movq %rax, %rsi
shrq $0xe, %rsi
xorq %rax, %rsi
leaq (%rsi,%rsi,4), %rax
leaq (%rsi,%rax,4), %rax
andq %rdx, %rax
movq %rax, %rsi
shrq $0x1c, %rsi
xorq %rax, %rsi
imulq %rdi, %rsi
andq %rdx, %rsi
movq %rsi, 0x38(%rsp)
addq %rcx, %rsi
andq %rdx, %rsi
movq %rsi, 0x30(%rsp)
movq 0x18(%r14), %rdi
leaq 0x30(%rsp), %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x1498f
testl %eax, %eax
jns 0x4d4e
movq %r14, %rdi
xorl %esi, %esi
movl 0xc(%rsp), %edx
callq 0x7643
cmpl $0x100, %eax            # imm = 0x100
jne 0x4d18
movq %r14, %rdi
movl $0x1, %esi
movl 0xc(%rsp), %edx
callq 0x7643
movq 0x20(%r14), %rax
movq 0x28(%r14), %rcx
movq 0x48(%rsp), %rdi
movq (%rcx,%rdi,8), %rcx
movslq (%rax,%rdi,4), %rdx
leal 0x1(%rdx), %esi
movl %esi, (%rax,%rdi,4)
leaq (%rdx,%rdx,2), %rax
movq 0x30(%rsp), %rdx
movq %rdx, (%rcx,%rax,8)
movq 0x38(%rsp), %rdx
movq %rdx, 0x8(%rcx,%rax,8)
movl %ebp, 0x10(%rcx,%rax,8)
movl (%r13), %esi
movq 0x50(%rsp), %r11
leaq 0x18412(%rip), %rbp     # 0x1d170
incq %r15
movslq %esi, %rax
cmpq %rax, %r15
jl 0x4b13
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq