// File: /workspace/github_c_makefile_star2_O3/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 0xd6f7
movq %rdx, %r12
movq %rsi, %r13
movq 0x70(%rsp), %r11
notl %ebx
notl %edi
xorl %ebp, %ebp
movl $0x1, %r14d
leaq 0xc17e(%rip), %rsi      # 0x19740
movl %r9d, 0xc(%rsp)
movq %r8, 0x18(%rsp)
movq %r10, 0x10(%rsp)
movl %edi, 0x8(%rsp)
movb (%r13,%r12), %al
cmpb $0x3, %al
ja 0xd706
movb 0x1(%r13,%r12), %cl
cmpb $0x3, %cl
ja 0xd706
movb 0x2(%r13,%r12), %dl
cmpb $0x4, %dl
jae 0xd706
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 0xd6e7
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 0xd725
testl %edi, %r15d
jne 0xd6e7
movl (%r11), %edx
movq 0x8(%r11), %rax
cmpl 0x4(%r11), %edx
jne 0xd6b5
leal (%rdx,%rdx), %ecx
testl %edx, %edx
movl $0x2, %edx
cmovel %edx, %ecx
movl %ecx, 0x4(%r11)
movslq %ecx, %rdx
shlq $0x3, %rdx
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x85ad
movq 0x70(%rsp), %r11
movl 0x8(%rsp), %edi
movq 0x10(%rsp), %r10
movq 0x18(%rsp), %r8
movl 0xc(%rsp), %r9d
movq %rax, 0x8(%r11)
movl (%r11), %edx
leaq 0x2(%r12), %rsi
movl %r9d, %ecx
shrl %cl, %r15d
movl 0x60(%rsp), %ecx
sarq %cl, %rsi
shlq $0x20, %r15
addq 0x68(%rsp), %rsi
orq %r15, %rsi
leal 0x1(%rdx), %ecx
movl %ecx, (%r11)
movslq %edx, %rcx
movq %rsi, (%rax,%rcx,8)
leaq 0xc059(%rip), %rsi      # 0x19740
addq $0x3, %r12
incl %r14d
cmpq %r10, %r12
jl 0xd5d5
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x77e8(%rip), %rdi      # 0x14ef5
leaq 0x780c(%rip), %rsi      # 0x14f20
leaq 0x780e(%rip), %rcx      # 0x14f29
movl $0x2f, %edx
callq 0x2150
leaq 0x786f(%rip), %rdi      # 0x14f9b
leaq 0x77ed(%rip), %rsi      # 0x14f20
leaq 0x77ef(%rip), %rcx      # 0x14f29
movl $0x37, %edx
callq 0x2150