// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap/map.c
// Function: drop_rep
static void drop_rep(mm_tbuf_t *b, int min_cnt)
{
	int i, j, n, m;
	uint32_t thres;
	b->rep_aux.n = 0;
	for (i = 0; i < b->mini.n; ++i)
		if (b->mini.a[i].y>>32)
			kv_push(uint32_t, b->rep_aux, b->mini.a[i].y>>32);
	if (b->rep_aux.n < 3) return;
	thres = (uint32_t)(ks_ksmall_uint32_t(b->rep_aux.n, b->rep_aux.a, b->rep_aux.n>>1) * MM_DEREP_Q50 + .499);
	for (i = n = m = 0; i < b->reg.n; ++i) {
		int cnt = 0, all_cnt = b->reg.a[i].cnt;
		for (j = 0; j < all_cnt; ++j)
			if (b->mini.a[b->reg2mini.a[m + j]].y>>32 <= thres)
				++cnt;
		if (cnt >= min_cnt)
			b->reg.a[n++] = b->reg.a[i];
		m += all_cnt;
	}
//	printf("%ld=>%d\t%d\n", b->reg.n, n, thres);
	b->reg.n = n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x60(%rax)
movl $0x0, -0x10(%rbp)
movslq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x9260
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
cmpq $0x0, %rax
je 0x9250
jmp 0x91aa
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x68(%rcx), %rax
jne 0x9213
movq -0x8(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x91d8
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
shlq %rax
movq %rax, -0x30(%rbp)
jmp 0x91e3
movl $0x2, %eax
movq %rax, -0x30(%rbp)
jmp 0x91e3
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rsi
shlq $0x2, %rsi
callq 0x2200
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x60(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x60(%rsi)
movl %edx, (%rax,%rcx,4)
jmp 0x9250
jmp 0x9252
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x9172
movq -0x8(%rbp), %rax
cmpq $0x3, 0x60(%rax)
jae 0x9270
jmp 0x93d9
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
movq 0x70(%rax), %rsi
movq %rdi, %rdx
shrq %rdx
callq 0x3670
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd 0x35aa(%rip), %xmm1     # 0xc840
mulsd %xmm1, %xmm0
movsd 0x2d6e(%rip), %xmm1     # 0xc010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x10(%rbp)
movslq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0xa0(%rcx), %rax
jae 0x93ca
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rax
movslq -0x10(%rbp), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, -0x28(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x9359
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
movl -0x1c(%rbp), %edx
addl -0x14(%rbp), %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
movl -0x20(%rbp), %ecx
cmpq %rcx, %rax
ja 0x934c
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x934e
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x9308
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jl 0x93b3
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
movq 0xb0(%rcx), %rcx
movslq -0x10(%rbp), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
movl -0x28(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x92c3
movslq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xa0(%rax)
addq $0x30, %rsp
popq %rbp
retq
nop