// File: /workspace/github_c_makefile_star2_O1/lh3[P]miniprot/sketch.c
// Function: mp_sketch_clean_orf
void mp_sketch_clean_orf(void *km, const uint8_t *seq, int64_t st, int64_t en, int32_t kmer, int32_t mod_bit, int32_t bbit, int64_t boff, mp64_v *a)
{
	int64_t i;
	int32_t l;
	uint32_t x, y, mask_k = (1U<<kmer*MP_BITS_PER_AA) - 1, mask_mod = (1U<<mod_bit) - 1;
	for (i = st, l = 0, x = 0; i < en; i += 3) {
		uint8_t codon = seq[i]<<4 | seq[i+1]<<2 | seq[i+2];
		assert(seq[i] < 4 && seq[i+1] < 4 && seq[i+2] < 4);
		#if MP_BITS_PER_AA == 4
		x = (x<<MP_BITS_PER_AA | ns_tab_codon13[codon]) & mask_k;
		#else
		x = (x<<MP_BITS_PER_AA | ns_tab_codon13[codon]>>1) & mask_k;
		#endif
		if (++l >= kmer) {
			y = mp_hash32_mask(x, mask_k);
			assert(y <= mask_k);
			if ((y&mask_mod) == 0)
				kv_push(uint64_t, km, *a, (uint64_t)(y>>mod_bit)<<32 | (((i+2)>>bbit) + boff));
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r10
movq %rdi, 0x20(%rsp)
leal (,%r8,4), %ecx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
shll %cl, %ebx
movl %r9d, %ecx
shll %cl, %edi
cmpq %r10, %rdx
jge 0xd4af
movq %rdx, %r12
movq %rsi, %r13
movq 0x70(%rsp), %r11
notl %ebx
notl %edi
xorl %ebp, %ebp
movl $0x1, %r14d
leaq 0xb3c4(%rip), %rsi      # 0x18740
movl %r9d, 0xc(%rsp)
movq %r8, 0x18(%rsp)
movq %r10, 0x10(%rsp)
movl %edi, 0x8(%rsp)
movb (%r13,%r12), %al
cmpb $0x3, %al
ja 0xd4be
movb 0x1(%r13,%r12), %cl
cmpb $0x3, %cl
ja 0xd4be
movb 0x2(%r13,%r12), %dl
cmpb $0x4, %dl
jae 0xd4be
shlb $0x4, %al
shlb $0x2, %cl
orb %al, %cl
orb %dl, %cl
shll $0x4, %ebp
movzbl %cl, %eax
movzbl (%rsi,%rax), %eax
orl %eax, %ebp
andl %ebx, %ebp
cmpl %r8d, %r14d
jl 0xd49f
movl %ebp, %eax
shll $0xf, %eax
notl %eax
addl %ebp, %eax
andl %ebx, %eax
movl %eax, %ecx
shrl $0xa, %ecx
xorl %eax, %ecx
leal (%rcx,%rcx,8), %eax
andl %ebx, %eax
movl %eax, %ecx
shrl $0x6, %ecx
xorl %eax, %ecx
movl %ecx, %eax
shll $0xb, %eax
notl %eax
addl %ecx, %eax
andl %ebx, %eax
movl %eax, %r15d
shrl $0x10, %r15d
xorl %eax, %r15d
cmpl %ebx, %r15d
ja 0xd4dd
testl %edi, %r15d
jne 0xd49f
movl 0x4(%r11), %eax
cmpl %eax, (%r11)
jne 0xd469
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x2, %eax
cmovel %eax, %ecx
movl %ecx, 0x4(%r11)
movq 0x8(%r11), %rsi
movslq %ecx, %rdx
shlq $0x3, %rdx
movq 0x20(%rsp), %rdi
callq 0x81a4
movq 0x70(%rsp), %r11
movl 0x8(%rsp), %edi
movq 0x10(%rsp), %r10
movq 0x18(%rsp), %r8
movl 0xc(%rsp), %r9d
movq %rax, 0x8(%r11)
leaq 0x2(%r12), %rax
movl %r9d, %ecx
shrl %cl, %r15d
movl 0x60(%rsp), %ecx
sarq %cl, %rax
shlq $0x20, %r15
addq 0x68(%rsp), %rax
orq %r15, %rax
movq 0x8(%r11), %rcx
movslq (%r11), %rdx
leal 0x1(%rdx), %esi
movl %esi, (%r11)
movq %rax, (%rcx,%rdx,8)
leaq 0xb2a1(%rip), %rsi      # 0x18740
addq $0x3, %r12
incl %r14d
cmpq %r10, %r12
jl 0xd38f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x69e0(%rip), %rdi      # 0x13ea5
leaq 0x6a04(%rip), %rsi      # 0x13ed0
leaq 0x6a06(%rip), %rcx      # 0x13ed9
movl $0x2f, %edx
callq 0x2150
leaq 0x6a67(%rip), %rdi      # 0x13f4b
leaq 0x69e5(%rip), %rsi      # 0x13ed0
leaq 0x69e7(%rip), %rcx      # 0x13ed9
movl $0x37, %edx
callq 0x2150