// File: /workspace/github_c_makefile_star2_O2/lh3[P]fermi2/mag.c
// Function: mag_g_clean
void mag_g_clean(mag_t *g, const magopt_t *opt)
{
	double t;
	int j;

	if ((opt->flag & MAG_F_CLEAN) == 0) return;
	if (g->min_ovlp < opt->min_ovlp) g->min_ovlp = opt->min_ovlp;
	for (j = 2; j <= opt->min_ensr; ++j)
		mag_g_rm_vext(g, opt->min_elen, j);
	mag_g_merge(g, 0, opt->min_merge_len);
	mag_g_rm_edge(g, g->min_ovlp, opt->min_dratio1, opt->min_elen, opt->min_ensr);
	mag_g_merge(g, 1, opt->min_merge_len);
	for (j = 2; j <= opt->min_ensr; ++j)
		mag_g_rm_vext(g, opt->min_elen, j);
	mag_g_merge(g, 0, opt->min_merge_len);
	if (opt->flag & MAG_F_AGGRESSIVE) {
		t = cputime();
		mag_g_pop_open(g, opt->min_elen);
		if (fm_verbose >= 3)
			fprintf(stderr, "[M::%s] popped open bubbles in %.3f sec.\n", __func__, cputime() - t);
	}
	if (!(opt->flag & MAG_F_NO_SIMPL)) {
		t = cputime();
		mag_g_simplify_bubble(g, opt->max_bvtx, opt->max_bdist);
		if (fm_verbose >= 3)
			fprintf(stderr, "[M::%s] simplified complex bubbles in %.3f sec.\n", __func__, cputime() - t);
	}
	mag_g_pop_simple(g, opt->max_bcov, opt->max_bfrac, opt->min_merge_len, opt->flag & MAG_F_AGGRESSIVE);
	mag_g_rm_vint(g, opt->min_elen, opt->min_insr, g->min_ovlp);
	mag_g_rm_edge(g, g->min_ovlp, opt->min_dratio1, opt->min_elen, opt->min_ensr);
	mag_g_merge(g, 1, opt->min_merge_len);
	mag_g_rm_vext(g, opt->min_elen, opt->min_ensr);
	mag_g_merge(g, 0, opt->min_merge_len);
	if (opt->flag & MAG_F_AGGRESSIVE) mag_g_pop_open(g, opt->min_elen);
	mag_g_rm_vext(g, opt->min_elen, opt->min_ensr);
	mag_g_merge(g, 0, opt->min_merge_len);
}

// Assembly:
testb $0x10, (%rsi)
jne 0x11c5b
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rsi), %eax
cmpl %eax, 0x1c(%rdi)
jge 0x11c73
movl %eax, 0x1c(%rbx)
pushq $0x2
popq %rbp
cmpl 0x10(%r14), %ebp
jg 0x11c8e
movl 0xc(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x116c1
incl %ebp
jmp 0x11c76
movl 0x20(%r14), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xfae0
movl 0x1c(%rbx), %esi
cvtss2sd 0x30(%r14), %xmm0
movl 0xc(%r14), %edx
movl 0x10(%r14), %ecx
movq %rbx, %rdi
callq 0x11925
movl 0x20(%r14), %edx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xfae0
pushq $0x2
popq %rbp
cmpl 0x10(%r14), %ebp
jg 0x11cdf
movl 0xc(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x116c1
incl %ebp
jmp 0x11cc7
movl 0x20(%r14), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xfae0
testb $0x20, (%r14)
je 0x11d19
callq 0x3b2e
movsd %xmm0, (%rsp)
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x15af1
leaq 0x10550(%rip), %rax     # 0x22260
cmpl $0x3, (%rax)
jge 0x11dfa
testb $-0x80, (%r14)
jne 0x11d49
callq 0x3b2e
movsd %xmm0, (%rsp)
movl 0x18(%r14), %edx
movl 0x1c(%r14), %esi
movq %rbx, %rdi
callq 0x15156
leaq 0x10520(%rip), %rax     # 0x22260
cmpl $0x3, (%rax)
jge 0x11e2b
movss 0x34(%r14), %xmm0
movss 0x38(%r14), %xmm1
movl (%r14), %edx
movl 0x20(%r14), %esi
andl $0x20, %edx
movq %rbx, %rdi
callq 0x155ec
movl 0xc(%r14), %esi
movl 0x14(%r14), %edx
movl 0x1c(%rbx), %ecx
movq %rbx, %rdi
callq 0x117fe
movl 0x1c(%rbx), %esi
cvtss2sd 0x30(%r14), %xmm0
movl 0xc(%r14), %edx
movl 0x10(%r14), %ecx
movq %rbx, %rdi
callq 0x11925
movl 0x20(%r14), %edx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xfae0
movl 0xc(%r14), %esi
movl 0x10(%r14), %edx
movq %rbx, %rdi
callq 0x116c1
movl 0x20(%r14), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xfae0
testb $0x20, (%r14)
je 0x11dd2
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x15af1
movl 0xc(%r14), %esi
movl 0x10(%r14), %edx
movq %rbx, %rdi
callq 0x116c1
movl 0x20(%r14), %edx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xfae0
movq 0x101f7(%rip), %rax     # 0x21ff8
movq (%rax), %r15
callq 0x3b2e
subsd (%rsp), %xmm0
leaq 0x8674(%rip), %rsi      # 0x1a489
leaq 0x8697(%rip), %rdx      # 0x1a4b3
movq %r15, %rdi
movb $0x1, %al
callq 0x21c0
jmp 0x11d19
movq 0x101c6(%rip), %rax     # 0x21ff8
movq (%rax), %r15
callq 0x3b2e
subsd (%rsp), %xmm0
leaq 0x8679(%rip), %rsi      # 0x1a4bf
leaq 0x8666(%rip), %rdx      # 0x1a4b3
movq %r15, %rdi
movb $0x1, %al
callq 0x21c0
jmp 0x11d49