// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap/map.c
// Function: get_reg
static void get_reg(mm_tbuf_t *b, int radius, int k, int min_cnt, int max_gap, float merge_frac, int flag)
{
	const uint64_t v_kept = ~(1ULL<<31), v_dropped = 1ULL<<31;
	mm128_v *c = &b->coef;
	int i, j, start = 0, iso_dist = radius * 2;

	if (c->n < min_cnt) return;

	// drop isolated minimizer hits
	if (flag&MM_F_NO_ISO) {
		for (i = 0; i < c->n; ++i) c->a[i].y |= v_dropped;
		for (i = 1; i < c->n; ++i) {
			uint64_t x = c->a[i].x;
			int32_t rpos = (uint32_t)c->a[i].y;
			for (j = i - 1; j >= 0 && x - c->a[j].x < radius; --j) {
				int32_t y = c->a[j].y;
				if (abs(y - rpos) < iso_dist) {
					c->a[i].y &= v_kept, c->a[j].y &= v_kept;
					break;
				}
			}
		}
		for (i = j = 0; i < c->n; ++i) // squeeze out hits still marked as v_dropped
			if ((c->a[i].y&v_dropped) == 0)
				c->a[j++] = c->a[i];
		c->n = j;
	}

	// identify (possibly overlapping) intervals within _radius_; an interval is a cluster of hits
	b->intv.n = 0;
	for (i = 1; i < c->n; ++i) {
		if (c->a[i].x - c->a[start].x > radius) {
			if (i - start >= min_cnt) push_intv(&b->intv, start, i, merge_frac);
			for (++start; start < i && c->a[i].x - c->a[start].x > radius; ++start);
		}
	}
	if (i - start >= min_cnt) push_intv(&b->intv, start, i, merge_frac);

	// sort by the size of the interval
	radix_sort_128x(b->intv.a, b->intv.a + b->intv.n);

	// generate hits, starting from the largest interval
	b->reg2mini.n = 0;
	for (i = b->intv.n - 1; i >= 0; --i) proc_intv(b, i, k, min_cnt, max_gap);

	// post repeat removal
	if (!(flag&MM_F_WITH_REP)) drop_rep(b, min_cnt);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movss %xmm0, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
movabsq $-0x80000001, %rax      # imm = 0xFFFFFFFF7FFFFFFF
movq %rax, -0x28(%rbp)
movl $0x80000000, %eax       # imm = 0x80000000
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x44(%rbp)
movl -0xc(%rbp), %eax
shll %eax
movl %eax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
cmpq %rcx, %rax
jae 0x7bf9
jmp 0x7fa6
movl -0x20(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x7e0f
movl $0x0, -0x3c(%rbp)
movslq -0x3c(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x7c4c
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movabsq $0x80000000, %rcx       # imm = 0x80000000
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7c0f
movl $0x1, -0x3c(%rbp)
movslq -0x3c(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x7d77
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl %eax, -0x54(%rbp)
movl -0x3c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x40(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x40(%rbp)
movb %al, -0x59(%rbp)
jl 0x7cd3
movq -0x50(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x40(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
subq (%rcx), %rax
movslq -0xc(%rbp), %rcx
cmpq %rcx, %rax
setb %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x7cdf
jmp 0x7d67
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
subl -0x54(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl -0x48(%rbp), %eax
jge 0x7d57
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movabsq $-0x80000001, %rcx      # imm = 0xFFFFFFFF7FFFFFFF
andq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movabsq $-0x80000001, %rcx      # imm = 0xFFFFFFFF7FFFFFFF
andq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
jmp 0x7d67
jmp 0x7d59
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x7ca1
jmp 0x7d69
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7c53
movl $0x0, -0x40(%rbp)
movl $0x0, -0x3c(%rbp)
movslq -0x3c(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x7e04
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
movslq -0x3c(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movabsq $0x80000000, %rax       # imm = 0x80000000
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
jne 0x7df7
movq -0x38(%rbp), %rax
movq 0x10(%rax), %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 -0x38(%rbp), %rcx
movq 0x10(%rcx), %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 0x7df9
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7d85
movslq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x30(%rax)
movl $0x1, -0x3c(%rbp)
movslq -0x3c(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x7f06
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x44(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
subq (%rcx), %rax
movslq -0xc(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x7ef6
movl -0x3c(%rbp), %eax
subl -0x44(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x7e8f
movq -0x8(%rbp), %rdi
addq $0x30, %rdi
movl -0x44(%rbp), %esi
movl -0x3c(%rbp), %edx
movss -0x1c(%rbp), %xmm0
callq 0x84f0
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %ecx
xorl %eax, %eax
cmpl -0x3c(%rbp), %ecx
movb %al, -0x5a(%rbp)
jge 0x7ede
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x44(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
subq (%rcx), %rax
movslq -0xc(%rbp), %rcx
cmpq %rcx, %rax
seta %al
movb %al, -0x5a(%rbp)
movb -0x5a(%rbp), %al
testb $0x1, %al
jne 0x7ee7
jmp 0x7ef4
jmp 0x7ee9
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x7e98
jmp 0x7ef6
jmp 0x7ef8
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7e22
movl -0x3c(%rbp), %eax
subl -0x44(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x7f29
movq -0x8(%rbp), %rdi
addq $0x30, %rdi
movl -0x44(%rbp), %esi
movl -0x3c(%rbp), %edx
movss -0x1c(%rbp), %xmm0
callq 0x84f0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
shlq $0x4, %rax
addq %rax, %rsi
callq 0x33e0
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
subq $0x1, %rax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jl 0x7f8f
movq -0x8(%rbp), %rdi
movl -0x3c(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
callq 0x8670
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7f68
movl -0x20(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x7fa6
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x9150
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)