// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/index.c
// Function: mm_idx_cal_max_occ
int32_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 INT32_MAX;
	for (i = 0; i < 1<<mi->b; ++i)
		if (mi->B[i].h) n += kh_size((idxhash_t*)mi->B[i].h);
	if (n == 0) return INT32_MAX;
	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 0x8db7
movl $0x7fffffff, -0x4(%rbp) # imm = 0x7FFFFFFF
jmp 0x8fa5
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 0x8e1d
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x28(%rax)
je 0x8e10
movq -0x10(%rbp), %rax
movq 0x30(%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 0x8e12
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x8dbe
cmpq $0x0, -0x20(%rbp)
jne 0x8e30
movl $0x7fffffff, -0x4(%rbp) # imm = 0x7FFFFFFF
jmp 0x8fa5
movq -0x20(%rbp), %rdi
shlq $0x2, %rdi
callq 0x22e0
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 0x8f3a
movq -0x10(%rbp), %rax
movq 0x30(%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 0x8e91
jmp 0x8f2c
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x8f2a
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 0x8ece
jmp 0x8f1c
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x34(%rbp), %ecx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x8ef1
movl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8f03
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 0x8e98
jmp 0x8f2c
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x8e50
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movss -0x14(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x4c0bd(%rip), %xmm0    # 0x55010
subsd %xmm1, %xmm0
movq %rdi, %xmm1
movaps 0x4dd9d(%rip), %xmm2    # 0x56d00
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x4dda1(%rip), %xmm2    # 0x56d10
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 0x6100
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
nop