// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/hit.c
// Function: mm_select_sub
void mm_select_sub(void *km, float pri_ratio, int min_diff, int best_n, int check_strand, int min_strand_sc, int *n_, mm_reg1_t *r)
{
	if (pri_ratio > 0.0f && *n_ > 0) {
		int i, k, n = *n_, n_2nd = 0;
		for (i = k = 0; i < n; ++i) {
			int p = r[i].parent;
			if (p == i || r[i].inv) { // primary or inversion
				r[k++] = r[i];
			} else if ((r[i].score >= r[p].score * pri_ratio || r[i].score + min_diff >= r[p].score) && n_2nd < best_n) {
				if (!(r[i].qs == r[p].qs && r[i].qe == r[p].qe && r[i].rid == r[p].rid && r[i].rs == r[p].rs && r[i].re == r[p].re)) // not identical hits
					r[k++] = r[i], ++n_2nd;
				else if (r[i].p) free(r[i].p);
			} else if (check_strand && n_2nd < best_n && r[i].score > min_strand_sc && r[i].rev != r[p].rev) {
				r[i].strand_retained = 1;
				r[k++] = r[i], ++n_2nd;
			} else if (r[i].p) free(r[i].p);
		}
		if (k != n) mm_sync_regs(km, k, r); // removing hits requires sync()
		*n_ = k;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq %r9, -0x28(%rbp)
movss -0xc(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x2b3c3
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
jle 0x2b3c3
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x2b3a2
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
je 0x2b0c8
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x3c(%rax), %eax
shrl $0xb, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2b0fe
movq 0x10(%rbp), %rdi
movl -0x30(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x30(%rbp)
cltq
imulq $0x50, %rax, %rax
addq %rax, %rdi
movq 0x10(%rbp), %rsi
movslq -0x2c(%rbp), %rax
imulq $0x50, %rax, %rax
addq %rax, %rsi
movl $0x50, %edx
callq 0x2290
jmp 0x2b392
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
cvtsi2ssl 0xc(%rax), %xmm0
movq 0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
cvtsi2ssl 0xc(%rax), %xmm1
mulss -0xc(%rbp), %xmm1
ucomiss %xmm1, %xmm0
jae 0x2b15d
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
addl -0x10(%rbp), %eax
movq 0x10(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
imulq $0x50, %rdx, %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jl 0x2b29c
movl -0x38(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x2b29c
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq 0x10(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
imulq $0x50, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jne 0x2b22b
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq 0x10(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
imulq $0x50, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
jne 0x2b22b
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0x10(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
imulq $0x50, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jne 0x2b22b
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movq 0x10(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
imulq $0x50, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x18(%rcx), %eax
jne 0x2b22b
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movq 0x10(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
imulq $0x50, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x1c(%rcx), %eax
je 0x2b267
movq 0x10(%rbp), %rdi
movl -0x30(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x30(%rbp)
cltq
imulq $0x50, %rax, %rax
addq %rax, %rdi
movq 0x10(%rbp), %rsi
movslq -0x2c(%rbp), %rax
imulq $0x50, %rax, %rax
addq %rax, %rsi
movl $0x50, %edx
callq 0x2290
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2b297
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x48(%rax)
je 0x2b295
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rdi
callq 0x2040
jmp 0x2b297
jmp 0x2b390
cmpl $0x0, -0x18(%rbp)
je 0x2b35e
movl -0x38(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x2b35e
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
cmpl -0x1c(%rbp), %eax
jle 0x2b35e
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x3c(%rax), %eax
shrl $0xa, %eax
andl $0x1, %eax
movq 0x10(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
imulq $0x50, %rdx, %rdx
addq %rdx, %rcx
movl 0x3c(%rcx), %ecx
shrl $0xa, %ecx
andl $0x1, %ecx
cmpl %ecx, %eax
je 0x2b35e
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x3c(%rax), %ecx
andl $0xfbffffff, %ecx       # imm = 0xFBFFFFFF
orl $0x4000000, %ecx        # imm = 0x4000000
movl %ecx, 0x3c(%rax)
movq 0x10(%rbp), %rdi
movl -0x30(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x30(%rbp)
cltq
imulq $0x50, %rax, %rax
addq %rax, %rdi
movq 0x10(%rbp), %rsi
movslq -0x2c(%rbp), %rax
imulq $0x50, %rax, %rax
addq %rax, %rsi
movl $0x50, %edx
callq 0x2290
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2b38e
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x48(%rax)
je 0x2b38c
movq 0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rdi
callq 0x2040
jmp 0x2b38e
jmp 0x2b390
jmp 0x2b392
jmp 0x2b394
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2b082
movl -0x30(%rbp), %eax
cmpl -0x34(%rbp), %eax
je 0x2b3ba
movq -0x8(%rbp), %rdi
movl -0x30(%rbp), %esi
movq 0x10(%rbp), %rdx
callq 0x2ae60
movl -0x30(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)