// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap/index.c
// Function: mm_idx_cal_max_occ
uint32_t mm_idx_cal_max_occ(const mm_idx_t *mi, float f)
{
	int i;
	size_t n = 0;
	uint32_t thres;
	khint_t *a, k;
	if (f <= 0.) return UINT32_MAX;
	for (i = 0; i < 1<<mi->b; ++i)
		if (mi->B[i].h) n += kh_size((idxhash_t*)mi->B[i].h);
	a = (uint32_t*)malloc(n * 4);
	for (i = n = 0; i < 1<<mi->b; ++i) {
		idxhash_t *h = (idxhash_t*)mi->B[i].h;
		if (h == 0) continue;
		for (k = 0; k < kh_end(h); ++k) {
			if (!kh_exist(h, k)) continue;
			a[n++] = kh_key(h, k)&1? 1 : (uint32_t)kh_val(h, k);
		}
	}
	thres = ks_ksmall_uint32_t(n, a, (uint32_t)((1. - f) * n)) + 1;
	free(a);
	return thres;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movss %xmm0, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movss -0x14(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x4a77
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4c52
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
cmpl %ecx, %eax
jge 0x4add
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x28(%rax)
je 0x4ad0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rax
movl 0x4(%rax), %eax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x4ad2
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4a7e
movq -0x20(%rbp), %rdi
shlq $0x2, %rdi
callq 0x21e0
movq %rax, -0x30(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
cmpl %ecx, %eax
jge 0x4be7
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x4b3e
jmp 0x4bd9
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x4bd7
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl -0x34(%rbp), %ecx
andl $0xf, %ecx
shll %ecx
shrl %cl, %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x4b7b
jmp 0x4bc9
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x34(%rbp), %ecx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x4b9e
movl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x4bb0
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x34(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %edx
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x20(%rbp)
movl %edx, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x4b45
jmp 0x4bd9
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4afd
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movss -0x14(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x7aa8(%rip), %xmm0     # 0xc6a8
subsd %xmm1, %xmm0
movq %rdi, %xmm1
movaps 0x7ab0(%rip), %xmm2     # 0xc6c0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x7ab4(%rip), %xmm2     # 0xc6d0
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, %eax
movl %eax, %edx
callq 0x3670
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rdi
callq 0x2040
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)