// File: /workspace/github_c_makefile_star2_O0/rikuu[P]kermit/miniasm/hit.c
// Function: ma_hit_contained
size_t ma_hit_contained(const ma_opt_t *opt, sdict_t *d, ma_sub_t *sub, size_t n, ma_hit_t *a)
{
	int32_t *map, r;
	size_t i, m, old_n_seq = d->n_seq;
	asg_arc_t t;
	for (i = m = 0; i < n; ++i) {
		ma_hit_t *h = &a[i];
		ma_sub_t *sq = &sub[h->qns>>32], *st = &sub[h->tn];
		r = ma_hit2arc(h, sq->e - sq->s, st->e - st->s, opt->max_hang, opt->int_frac, opt->min_ovlp, &t);
		if (r == MA_HT_QCONT) sq->del = 1;
		else if (r == MA_HT_TCONT) st->del = 1;
	}
	for (i = 0; i < d->n_seq; ++i)
		if (sub[i].del) d->seq[i].del = 1;
	ma_hit_mark_unused(d, n, a);
	map = sd_squeeze(d);
	for (i = 0; i < old_n_seq; ++i)
		if (map[i] >= 0) sub[map[i]] = sub[i];
	for (i = m = 0; i < n; ++i) {
		ma_hit_t *h = &a[i];
		int32_t qn = map[h->qns>>32], tn = map[h->tn];
		if (qn >= 0 && tn >= 0) {
			a[i].qns = (uint64_t)qn<<32 | (uint32_t)a[i].qns;
			a[i].tn = tn;
			a[m++] = a[i];
		}
	}
	free(map);
	if (ma_verbose >= 3)
		fprintf(stderr, "[M::%s::%s] %d sequences and %ld hits remain after containment removal\n", __func__, sys_timestamp(), d->n_seq, m);
	return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x7b75
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq -0x68(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rax
movq -0x68(%rbp), %rcx
movl 0xc(%rcx), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x68(%rbp), %rdi
movq -0x70(%rbp), %rax
movl 0x4(%rax), %esi
movq -0x70(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %esi
movq -0x78(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x78(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %edx
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
movq -0x8(%rbp), %rax
movl 0x14(%rax), %r8d
leaq -0x60(%rbp), %r9
callq 0x7730
movl %eax, -0x34(%rbp)
cmpl $-0x2, -0x34(%rbp)
jne 0x7b46
movq -0x70(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, (%rax)
jmp 0x7b62
cmpl $-0x3, -0x34(%rbp)
jne 0x7b60
movq -0x78(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, (%rax)
jmp 0x7b62
jmp 0x7b64
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x7a89
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
cmpq %rcx, %rax
jae 0x7bd4
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x7bc4
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
jmp 0x7bc6
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x7b7d
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x6060
movq -0x10(%rbp), %rdi
callq 0x1ca0
movq %rax, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x50(%rbp), %rax
jae 0x7c42
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jl 0x7c32
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq -0x18(%rbp), %rdx
movq -0x40(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x7c34
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x7bfa
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x7d5f
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
movq -0x80(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x84(%rbp)
movq -0x30(%rbp), %rax
movq -0x80(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x88(%rbp)
cmpl $0x0, -0x84(%rbp)
jl 0x7d4c
cmpl $0x0, -0x88(%rbp)
jl 0x7d4c
movslq -0x84(%rbp), %rcx
shlq $0x20, %rcx
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq (%rax), %rax
movl %eax, %eax
orq %rax, %rcx
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movl -0x88(%rbp), %ecx
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x28(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rbp)
shlq $0x5, %rcx
addq %rcx, %rax
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %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 0x7d4e
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x7c52
movq -0x30(%rbp), %rdi
callq 0x1040
leaq 0xb3c1(%rip), %rax      # 0x13130
cmpl $0x3, (%rax)
jl 0x7db6
movq 0xb27d(%rip), %rax      # 0x12ff8
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movb $0x0, %al
callq 0x1430
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movq -0x10(%rbp), %rax
movl (%rax), %r8d
movq -0x48(%rbp), %r9
leaq 0x7714(%rip), %rsi      # 0xf4bc
leaq 0x7755(%rip), %rdx      # 0xf504
movb $0x0, %al
callq 0x1110
movq -0x48(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)