// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/map-algo.c
// Function: mm_filter_bad_seeds_alt
static void mm_filter_bad_seeds_alt(void *km, int as1, int cnt1, mg128_t *a, int min_gap, int max_ext)
{
	int n, k, *K;
	K = collect_long_gaps(km, as1, cnt1, a, min_gap, &n);
	if (K == 0) return;
	for (k = 0; k < n;) {
		int i = K[k], l;
		int gap1 = ((int32_t)a[as1 + i].y - (int32_t)a[as1 + i - 1].y) - ((int32_t)a[as1 + i].x - (int32_t)a[as1 + i - 1].x);
		int re1 = (int32_t)a[as1 + i].x;
		int qe1 = (int32_t)a[as1 + i].y;
		gap1 = gap1 > 0? gap1 : -gap1;
		for (l = k + 1; l < n; ++l) {
			int j = K[l], gap2, q_span_pre, rs2, qs2, m;
			if ((int32_t)a[as1 + j].y - qe1 > max_ext || (int32_t)a[as1 + j].x - re1 > max_ext) break;
			gap2 = ((int32_t)a[as1 + j].y - (int32_t)a[as1 + j - 1].y) - (int32_t)(a[as1 + j].x - a[as1 + j - 1].x);
			q_span_pre = a[as1 + j - 1].y >> 32 & 0xff;
			rs2 = (int32_t)a[as1 + j - 1].x + q_span_pre;
			qs2 = (int32_t)a[as1 + j - 1].y + q_span_pre;
			m = rs2 - re1 < qs2 - qe1? rs2 - re1 : qs2 - qe1;
			gap2 = gap2 > 0? gap2 : -gap2;
			if (m > gap1 + gap2) break;
			re1 = (int32_t)a[as1 + j].x;
			qe1 = (int32_t)a[as1 + j].y;
			gap1 = gap2;
		}
		if (l > k + 1) {
			int j, end = K[l - 1];
			for (j = K[k]; j < end; ++j)
				a[as1 + j].y |= MG_SEED_IGNORE;
			a[as1 + end].y |= MG_SEED_FIXED;
		}
		k = l;
	}
	kfree(km, K);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %r8d
leaq -0x24(%rbp), %r9
callq 0x2f570
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x2eec9
jmp 0x2f22a
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x2f21d
movq -0x30(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x34(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movl -0xc(%rbp), %edx
addl -0x34(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
subl %ecx, %eax
movq -0x18(%rbp), %rcx
movl -0xc(%rbp), %edx
addl -0x34(%rbp), %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movq -0x18(%rbp), %rdx
movl -0xc(%rbp), %esi
addl -0x34(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
shlq $0x4, %rsi
addq %rsi, %rdx
movq (%rdx), %rdx
subl %edx, %ecx
subl %ecx, %eax
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x34(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x34(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x3c(%rbp)
jle 0x2ef9a
movl -0x3c(%rbp), %eax
movl %eax, -0x68(%rbp)
jmp 0x2efa2
xorl %eax, %eax
subl -0x3c(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x2f181
movq -0x30(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x48(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
subl -0x44(%rbp), %eax
cmpl -0x20(%rbp), %eax
jg 0x2f00a
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x48(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
subl -0x40(%rbp), %eax
cmpl -0x20(%rbp), %eax
jle 0x2f00f
jmp 0x2f181
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x48(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movl -0xc(%rbp), %edx
addl -0x48(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
subl %ecx, %eax
movq -0x18(%rbp), %rcx
movl -0xc(%rbp), %edx
addl -0x48(%rbp), %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movq -0x18(%rbp), %rdx
movl -0xc(%rbp), %esi
addl -0x48(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
shlq $0x4, %rsi
addq %rsi, %rdx
subq (%rdx), %rcx
subl %ecx, %eax
movl %eax, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x48(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
movl %eax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x48(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
addl -0x50(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x48(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
addl -0x50(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x54(%rbp), %eax
subl -0x40(%rbp), %eax
movl -0x58(%rbp), %ecx
subl -0x44(%rbp), %ecx
cmpl %ecx, %eax
jge 0x2f0fe
movl -0x54(%rbp), %eax
subl -0x40(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x2f107
movl -0x58(%rbp), %eax
subl -0x44(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x4c(%rbp)
jle 0x2f11b
movl -0x4c(%rbp), %eax
movl %eax, -0x70(%rbp)
jmp 0x2f123
xorl %eax, %eax
subl -0x4c(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x5c(%rbp), %eax
movl -0x3c(%rbp), %ecx
addl -0x4c(%rbp), %ecx
cmpl %ecx, %eax
jle 0x2f138
jmp 0x2f181
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x48(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x48(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl %eax, -0x44(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2efb1
movl -0x38(%rbp), %eax
movl -0x28(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jle 0x2f212
movq -0x30(%rbp), %rax
movl -0x38(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x64(%rbp)
movq -0x30(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x64(%rbp), %eax
jge 0x2f1ec
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x60(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movabsq $0x20000000000, %rcx    # imm = 0x20000000000
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x2f1b3
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x64(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movabsq $0x80000000000, %rcx    # imm = 0x80000000000
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movl -0x38(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x2eed0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2670
addq $0x70, %rsp
popq %rbp
retq