// File: /workspace/github_c_makefile_star2_O0/rikuu[P]kermit/miniasm/hit.c
// Function: ma_hit_cut
size_t ma_hit_cut(const ma_sub_t *reg, int min_span, size_t n, ma_hit_t *a)
{
	size_t i, m;
	for (i = m = 0; i < n; ++i) {
		ma_hit_t *p = &a[i];
		const ma_sub_t *rq = &reg[p->qns>>32], *rt = &reg[p->tn];
		int qs, qe, ts, te;
		if (rq->del || rt->del) continue;
		if (p->rev) {
			qs = p->te < rt->e? (uint32_t)p->qns : (uint32_t)p->qns + (p->te - rt->e);
			qe = p->ts > rt->s? p->qe : p->qe - (rt->s - p->ts);
			ts = p->qe < rq->e? p->ts : p->ts + (p->qe - rq->e);
			te = (uint32_t)p->qns > rq->s? p->te : p->te - (rq->s - (uint32_t)p->qns);
		} else {
			qs = p->ts > rt->s? (uint32_t)p->qns : (uint32_t)p->qns + (rt->s - p->ts);
			qe = p->te < rt->e? p->qe : p->qe - (p->te - rt->e);
			ts = (uint32_t)p->qns > rq->s? p->ts : p->ts + (rq->s - (uint32_t)p->qns);
			te = p->qe < rq->e? p->te : p->te - (p->qe - rq->e);
		}
		qs = (qs > rq->s? qs : rq->s) - rq->s;
		qe = (qe < rq->e? qe : rq->e) - rq->s;
		ts = (ts > rt->s? ts : rt->s) - rt->s;
		te = (te < rt->e? te : rt->e) - rt->s;
		if (qe - qs >= min_span && te - ts >= min_span) {
			p->qns = p->qns>>32<<32 | qs, p->qe = qe, p->ts = ts, p->te = te;
			a[m++] = *p;
		}
	}
	if (ma_verbose >= 3)
		fprintf(stderr, "[M::%s::%s] %ld hits remain after cut\n", __func__, sys_timestamp(), m);
	return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x73a2
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movl 0xc(%rcx), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x6fd7
movq -0x48(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x6fdc
jmp 0x7391
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
cmpl $0x0, %eax
je 0x7104
movq -0x38(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x48(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x7011
movq -0x38(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x5c(%rbp)
jmp 0x702b
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movl 0x14(%rcx), %ecx
movq -0x48(%rbp), %rdx
subl 0x4(%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jbe 0x7054
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x60(%rbp)
jmp 0x7073
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x38(%rbp), %rdx
subl 0x10(%rdx), %ecx
subl %ecx, %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x40(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x7095
movq -0x38(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x64(%rbp)
jmp 0x70af
movq -0x38(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x38(%rbp), %rcx
movl 0x8(%rcx), %ecx
movq -0x40(%rbp), %rdx
subl 0x4(%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jbe 0x70d8
movq -0x38(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x68(%rbp)
jmp 0x70f9
movq -0x38(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x40(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x38(%rbp), %rdx
movq (%rdx), %rdx
subl %edx, %ecx
subl %ecx, %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x58(%rbp)
jmp 0x720e
movq -0x38(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jbe 0x7127
movq -0x38(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x6c(%rbp)
jmp 0x7146
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x38(%rbp), %rdx
subl 0x10(%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x48(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x7168
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x70(%rbp)
jmp 0x7182
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x38(%rbp), %rcx
movl 0x14(%rcx), %ecx
movq -0x48(%rbp), %rdx
subl 0x4(%rdx), %ecx
subl %ecx, %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jbe 0x71ab
movq -0x38(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x74(%rbp)
jmp 0x71cc
movq -0x38(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x40(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x38(%rbp), %rdx
movq (%rdx), %rdx
subl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x40(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x71ee
movq -0x38(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x78(%rbp)
jmp 0x7208
movq -0x38(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x38(%rbp), %rcx
movl 0x8(%rcx), %ecx
movq -0x40(%rbp), %rdx
subl 0x4(%rdx), %ecx
subl %ecx, %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x4c(%rbp), %eax
movq -0x40(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jle 0x7229
movl -0x4c(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x7237
movq -0x40(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq -0x40(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl %ecx, %eax
movl %eax, -0x4c(%rbp)
movl -0x50(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x725f
movl -0x50(%rbp), %eax
movl %eax, -0x80(%rbp)
jmp 0x7269
movq -0x40(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
movq -0x40(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl %ecx, %eax
movl %eax, -0x50(%rbp)
movl -0x54(%rbp), %eax
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jle 0x729b
movl -0x54(%rbp), %eax
movl %eax, -0x84(%rbp)
jmp 0x72ac
movq -0x48(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl %ecx, %eax
movl %eax, -0x54(%rbp)
movl -0x58(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x72da
movl -0x58(%rbp), %eax
movl %eax, -0x88(%rbp)
jmp 0x72e7
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x88(%rbp)
movl -0x88(%rbp), %eax
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl %ecx, %eax
movl %eax, -0x58(%rbp)
movl -0x50(%rbp), %eax
subl -0x4c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jl 0x738f
movl -0x58(%rbp), %eax
subl -0x54(%rbp), %eax
cmpl -0xc(%rbp), %eax
jl 0x738f
movq -0x38(%rbp), %rax
movq (%rax), %rcx
shrq $0x20, %rcx
shlq $0x20, %rcx
movslq -0x4c(%rbp), %rax
orq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movl -0x50(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x54(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x58(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
shlq $0x5, %rcx
addq %rcx, %rax
movq -0x38(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
jmp 0x7391
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x6f6a
leaq 0xbd87(%rip), %rax      # 0x13130
cmpl $0x3, (%rax)
jl 0x73e9
movq 0xbc43(%rip), %rax      # 0x12ff8
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movb $0x0, %al
callq 0x1430
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movq -0x30(%rbp), %r8
leaq 0x8051(%rip), %rsi      # 0xf42c
leaq 0x8071(%rip), %rdx      # 0xf453
movb $0x0, %al
callq 0x1110
movq -0x30(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)