// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movl -0x24(%rbp), %ecx
shll $0x2, %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x28(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x1849f
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %eax
shll $0x4, %eax
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rdx
movzbl 0x1(%rcx,%rdx), %ecx
shll $0x2, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rdx
movzbl 0x2(%rcx,%rdx), %ecx
orl %ecx, %eax
movb %al, -0x45(%rbp)
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x4, %eax
jge 0x1834c
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movzbl 0x1(%rax,%rcx), %eax
cmpl $0x4, %eax
jge 0x1834c
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movzbl 0x2(%rax,%rcx), %eax
cmpl $0x4, %eax
jge 0x1834c
jmp 0x1836b
leaq 0x979e(%rip), %rdi      # 0x21af1
leaq 0x97c2(%rip), %rsi      # 0x21b1c
movl $0x2f, %edx
leaq 0x97bf(%rip), %rcx      # 0x21b25
callq 0x2180
movl -0x38(%rbp), %eax
shll $0x4, %eax
movzbl -0x45(%rbp), %ecx
movl %ecx, %edx
leaq 0xe6b2(%rip), %rcx      # 0x26a30
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
andl -0x40(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
cmpl -0x24(%rbp), %eax
jl 0x1848c
movl -0x38(%rbp), %edi
movl -0x40(%rbp), %esi
callq 0x18200
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
ja 0x183b4
jmp 0x183d3
leaq 0x97dc(%rip), %rdi      # 0x21b97
leaq 0x975a(%rip), %rsi      # 0x21b1c
movl $0x37, %edx
leaq 0x9757(%rip), %rcx      # 0x21b25
callq 0x2180
movl -0x3c(%rbp), %eax
andl -0x44(%rbp), %eax
cmpl $0x0, %eax
jne 0x1848a
jmp 0x183e4
movq 0x20(%rbp), %rax
movl (%rax), %eax
movq 0x20(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x18447
movq 0x20(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x1840b
movq 0x20(%rbp), %rax
movl 0x4(%rax), %eax
shll %eax
movl %eax, -0x4c(%rbp)
jmp 0x18415
movl $0x2, %eax
movl %eax, -0x4c(%rbp)
jmp 0x18415
movl -0x4c(%rbp), %ecx
movq 0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rdi
movq 0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rbp), %rax
movslq 0x4(%rax), %rdx
shlq $0x3, %rdx
callq 0xb100
movq %rax, %rcx
movq 0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x3c(%rbp), %eax
movl -0x28(%rbp), %ecx
shrl %cl, %eax
movl %eax, %eax
movl %eax, %edx
shlq $0x20, %rdx
movq -0x30(%rbp), %rax
addq $0x2, %rax
movl 0x10(%rbp), %ecx
sarq %cl, %rax
addq 0x18(%rbp), %rax
orq %rax, %rdx
movq 0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rbp), %rsi
movl (%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x1848a
jmp 0x1848c
jmp 0x1848e
movq -0x30(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x30(%rbp)
jmp 0x182d4
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)