// File: /workspace/github_c_makefile_star2_O1/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 0x13eb9
retq
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rsi), %eax
cmpl %eax, 0x1c(%rdi)
jge 0x13ed2
movl %eax, 0x1c(%rbx)
cmpl $0x2, 0x10(%r14)
jl 0x13ef4
movl $0x1, %ebp
incl %ebp
movl 0xc(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x1385e
cmpl 0x10(%r14), %ebp
jl 0x13ede
movl 0x20(%r14), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x119be
movl 0x1c(%rbx), %esi
cvtss2sd 0x30(%r14), %xmm0
movl 0xc(%r14), %edx
movl 0x10(%r14), %ecx
movq %rbx, %rdi
callq 0x13aee
movl 0x20(%r14), %edx
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x119be
cmpl $0x2, 0x10(%r14)
jl 0x13f4e
incl %ebp
movl 0xc(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x1385e
cmpl 0x10(%r14), %ebp
jl 0x13f38
movl 0x20(%r14), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x119be
testb $0x20, (%r14)
je 0x13f89
callq 0x5117
movsd %xmm0, 0x8(%rsp)
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x17fe4
leaq 0x102e0(%rip), %rax     # 0x24260
cmpl $0x3, (%rax)
jge 0x1406e
testb $-0x80, (%r14)
jne 0x13fba
callq 0x5117
movsd %xmm0, 0x8(%rsp)
movl 0x18(%r14), %edx
movl 0x1c(%r14), %esi
movq %rbx, %rdi
callq 0x1756b
leaq 0x102af(%rip), %rax     # 0x24260
cmpl $0x3, (%rax)
jge 0x1407e
movss 0x34(%r14), %xmm0
movss 0x38(%r14), %xmm1
movl (%r14), %edx
movl 0x20(%r14), %esi
andl $0x20, %edx
movq %rbx, %rdi
callq 0x17a42
movl 0xc(%r14), %esi
movl 0x14(%r14), %edx
movl 0x1c(%rbx), %ecx
movq %rbx, %rdi
callq 0x139b0
movl 0x1c(%rbx), %esi
xorps %xmm0, %xmm0
cvtss2sd 0x30(%r14), %xmm0
movl 0xc(%r14), %edx
movl 0x10(%r14), %ecx
movq %rbx, %rdi
callq 0x13aee
movl 0x20(%r14), %edx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x119be
movl 0xc(%r14), %esi
movl 0x10(%r14), %edx
movq %rbx, %rdi
callq 0x1385e
movl 0x20(%r14), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x119be
testb $0x20, (%r14)
je 0x14048
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x17fe4
movl 0xc(%r14), %esi
movl 0x10(%r14), %edx
movq %rbx, %rdi
callq 0x1385e
movl 0x20(%r14), %edx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x119be
movsd 0x8(%rsp), %xmm0
callq 0x2e55
jmp 0x13f89
movsd 0x8(%rsp), %xmm0
callq 0x2e92
jmp 0x13fba