// File: /workspace/github_c_makefile_star2_O3/lh3[P]fermi-lite/mag.c
// Function: mag_g_clean
void mag_g_clean(mag_t *g, const magopt_t *opt)
{
	int j;

	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) || (opt->flag & MAG_F_POPOPEN)) mag_g_pop_open(g, opt->min_elen);
	if (!(opt->flag & MAG_F_NO_SIMPL)) mag_g_simplify_bubble(g, opt->max_bvtx, opt->max_bdist);
	mag_g_pop_simple(g, opt->max_bcov, opt->max_bfrac, opt->min_merge_len, opt->max_bdiff, 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) || (opt->flag & MAG_F_POPOPEN)) 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:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rsi), %eax
cmpl %eax, 0x1c(%rdi)
jge 0x12393
movl %eax, 0x1c(%rbx)
cmpl $0x2, 0xc(%r14)
jl 0x123b5
movl $0x1, %ebp
incl %ebp
movl 0x8(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x11be1
cmpl 0xc(%r14), %ebp
jl 0x1239f
movl 0x20(%r14), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10723
movl 0x1c(%rbx), %esi
cvtss2sd 0x2c(%r14), %xmm0
movl 0x8(%r14), %edx
movl 0xc(%r14), %ecx
movq %rbx, %rdi
callq 0x11e5c
movl 0x20(%r14), %edx
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10723
cmpl $0x2, 0xc(%r14)
jl 0x1240f
incl %ebp
movl 0x8(%r14), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x11be1
cmpl 0xc(%r14), %ebp
jl 0x123f9
movl 0x20(%r14), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10723
movl (%r14), %ecx
testb $0x60, %cl
je 0x12434
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x138b2
movl (%r14), %ecx
testb %cl, %cl
js 0x1244b
movl 0x14(%r14), %edx
movl 0x1c(%r14), %esi
movq %rbx, %rdi
callq 0x12d7c
movl (%r14), %ecx
movss 0x30(%r14), %xmm0
movss 0x34(%r14), %xmm1
movl 0x18(%r14), %edx
movl 0x20(%r14), %esi
andl $0x20, %ecx
movq %rbx, %rdi
callq 0x13316
movl 0x8(%r14), %esi
movl 0x10(%r14), %edx
movl 0x1c(%rbx), %ecx
movq %rbx, %rdi
callq 0x11d21
movl 0x1c(%rbx), %esi
xorps %xmm0, %xmm0
cvtss2sd 0x2c(%r14), %xmm0
movl 0x8(%r14), %edx
movl 0xc(%r14), %ecx
movq %rbx, %rdi
callq 0x11e5c
movl 0x20(%r14), %edx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x10723
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
movq %rbx, %rdi
callq 0x11be1
movl 0x20(%r14), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10723
testb $0x60, (%r14)
je 0x124da
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x138b2
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
movq %rbx, %rdi
callq 0x11be1
movl 0x20(%r14), %edx
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x10723