// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/map.c
// Function: mm_dust_minier
static int mm_dust_minier(void *km, int n, mm128_t *a, int l_seq, const char *seq, int sdust_thres)
{
	int n_dreg, j, k, u = 0;
	const uint64_t *dreg;
	sdust_buf_t *sdb;
	if (sdust_thres <= 0) return n;
	sdb = sdust_buf_init(km);
	dreg = sdust_core((const uint8_t*)seq, l_seq, sdust_thres, 64, &n_dreg, sdb);
	for (j = k = 0; j < n; ++j) { // squeeze out minimizers that significantly overlap with LCRs
		int32_t qpos = (uint32_t)a[j].y>>1, span = a[j].x&0xff;
		int32_t s = qpos - (span - 1), e = s + span;
		while (u < n_dreg && (int32_t)dreg[u] <= s) ++u;
		if (u < n_dreg && (int32_t)(dreg[u]>>32) < e) {
			int v, l = 0;
			for (v = u; v < n_dreg && (int32_t)(dreg[v]>>32) < e; ++v) { // iterate over LCRs overlapping this minimizer
				int ss = s > (int32_t)(dreg[v]>>32)? s : dreg[v]>>32;
				int ee = e < (int32_t)dreg[v]? e : (uint32_t)dreg[v];
				l += ee - ss;
			}
			if (l <= span>>1) a[k++] = a[j]; // keep the minimizer if less than half of it falls in masked region
		} else a[k++] = a[j];
	}
	sdust_buf_destroy(sdb);
	return k; // the new size
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movl $0x0, -0x44(%rbp)
cmpl $0x0, -0x34(%rbp)
jg 0x12ec9
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x13125
movq -0x10(%rbp), %rdi
callq 0x1d550
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x34(%rbp), %edx
movq -0x58(%rbp), %r9
movl $0x40, %ecx
leaq -0x38(%rbp), %r8
callq 0x1da10
movq %rax, -0x50(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x13116
movq -0x20(%rbp), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrl %eax
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
andq $0xff, %rax
movl %eax, -0x60(%rbp)
movl -0x5c(%rbp), %eax
movl -0x60(%rbp), %ecx
subl $0x1, %ecx
subl %ecx, %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
addl -0x60(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x44(%rbp), %ecx
xorl %eax, %eax
cmpl -0x38(%rbp), %ecx
movb %al, -0x79(%rbp)
jge 0x12f7c
movq -0x50(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl -0x64(%rbp), %eax
setle %al
movb %al, -0x79(%rbp)
movb -0x79(%rbp), %al
testb $0x1, %al
jne 0x12f85
jmp 0x12f90
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x12f5a
movl -0x44(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0x130d0
movq -0x50(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
cmpl -0x68(%rbp), %eax
jge 0x130d0
movl $0x0, -0x70(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %ecx
xorl %eax, %eax
cmpl -0x38(%rbp), %ecx
movb %al, -0x7a(%rbp)
jge 0x12fe8
movq -0x50(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
cmpl -0x68(%rbp), %eax
setl %al
movb %al, -0x7a(%rbp)
movb -0x7a(%rbp), %al
testb $0x1, %al
jne 0x12ff4
jmp 0x1308c
movl -0x64(%rbp), %eax
movq -0x50(%rbp), %rcx
movslq -0x6c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
cmpl %ecx, %eax
jle 0x13018
movslq -0x64(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x1302f
movq -0x50(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movl %eax, -0x74(%rbp)
movl -0x68(%rbp), %eax
movq -0x50(%rbp), %rcx
movslq -0x6c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl %ecx, %eax
jge 0x13057
movl -0x68(%rbp), %eax
movl %eax, -0x8c(%rbp)
jmp 0x13069
movq -0x50(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
subl -0x74(%rbp), %eax
addl -0x70(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x12fc2
movl -0x70(%rbp), %eax
movl -0x60(%rbp), %ecx
sarl %ecx
cmpl %ecx, %eax
jg 0x130ce
movq -0x20(%rbp), %rax
movl -0x40(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x40(%rbp)
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x20(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
jmp 0x13106
movq -0x20(%rbp), %rax
movl -0x40(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x40(%rbp)
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x20(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
jmp 0x13108
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x12f04
movq -0x58(%rbp), %rdi
callq 0x1d950
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)