// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/map-algo.c
// Function: collect_long_gaps
static int *collect_long_gaps(void *km, int as1, int cnt1, mg128_t *a, int min_gap, int *n_)
{
	int i, n, *K;
	*n_ = 0;
	for (i = 1, n = 0; i < cnt1; ++i) { // count the number of gaps longer than min_gap
		int gap = ((int32_t)a[as1 + i].y - a[as1 + i - 1].y) - ((int32_t)a[as1 + i].x - a[as1 + i - 1].x);
		if (gap < -min_gap || gap > min_gap) ++n;
	}
	if (n <= 1) return 0;
	K = (int*)kmalloc(km, n * sizeof(int));
	for (i = 1, n = 0; i < cnt1; ++i) { // store the positions of long gaps
		int gap = ((int32_t)a[as1 + i].y - a[as1 + i - 1].y) - ((int32_t)a[as1 + i].x - a[as1 + i - 1].x);
		if (gap < -min_gap || gap > min_gap)
			K[n++] = i;
	}
	*n_ = n;
	return K;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
movl $0x1, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x2f64e
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
addl -0x34(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
cltq
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %edx
addl -0x34(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
subq 0x8(%rcx), %rax
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %edx
addl -0x34(%rbp), %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movslq %ecx, %rcx
movq -0x20(%rbp), %rdx
movl -0x14(%rbp), %esi
addl -0x34(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
shlq $0x4, %rsi
addq %rsi, %rdx
subq (%rdx), %rcx
subq %rcx, %rax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
xorl %ecx, %ecx
subl -0x24(%rbp), %ecx
cmpl %ecx, %eax
jl 0x2f635
movl -0x44(%rbp), %eax
cmpl -0x24(%rbp), %eax
jle 0x2f63e
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2f640
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2f5a6
cmpl $0x1, -0x38(%rbp)
jg 0x2f661
movq $0x0, -0x8(%rbp)
jmp 0x2f74c
movq -0x10(%rbp), %rdi
movslq -0x38(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2890
movq %rax, -0x40(%rbp)
movl $0x1, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x2f73b
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
addl -0x34(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
cltq
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %edx
addl -0x34(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
subq 0x8(%rcx), %rax
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %edx
addl -0x34(%rbp), %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movslq %ecx, %rcx
movq -0x20(%rbp), %rdx
movl -0x14(%rbp), %esi
addl -0x34(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
shlq $0x4, %rsi
addq %rsi, %rdx
subq (%rdx), %rcx
subq %rcx, %rax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
xorl %ecx, %ecx
subl -0x24(%rbp), %ecx
cmpl %ecx, %eax
jl 0x2f713
movl -0x48(%rbp), %eax
cmpl -0x24(%rbp), %eax
jle 0x2f72b
movl -0x34(%rbp), %edx
movq -0x40(%rbp), %rax
movl -0x38(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x38(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x2f72d
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2f684
movl -0x38(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)