// File: /workspace/github_c_makefile_star2_O1/lh3[P]fermi2/mag.c
// Function: main_simplify
int main_simplify(int argc, char *argv[])
{
	mag_t *g;
	int c;
	char *s;
	magopt_t *opt;
	opt = mag_init_opt();
	while ((c = getopt(argc, argv, "ON:d:CFAl:e:i:o:R:w:r:Sm:T:D:")) >= 0) {
		switch (c) {
		case 'F': opt->flag |= MAG_F_NO_AMEND | MAG_F_READ_ORI; break;
		case 'C': opt->flag |= MAG_F_CLEAN; break;
		case 'A': opt->flag |= MAG_F_AGGRESSIVE; break;
		case 'O': opt->flag |= MAG_F_READ_ORI; break;
		case 'S': opt->flag |= MAG_F_NO_SIMPL; break;
		case 'd': opt->min_dratio0 = atof(optarg); break;
		case 'N': opt->max_arc  = atoi(optarg); break;
		case 'l': opt->min_elen = atoi(optarg); break;
		case 'e': opt->min_ensr = atoi(optarg); break;
		case 'i': opt->min_insr = atoi(optarg); break;
		case 'o': opt->min_ovlp = atoi(optarg); break;
		case 'R': opt->min_dratio1 = atof(optarg); break;
		case 'w': opt->max_bcov = atof(optarg); break;
		case 'r': opt->max_bfrac= atof(optarg); break;
		case 'm': opt->min_merge_len = atoi(optarg); break;
		case 'T':
			opt->trim_len = strtol(optarg, &s, 10);
			if (*s == ',' || *s == ':' || *s == ';')
				opt->trim_depth = strtol(s + 1, &s, 10);
			break;
		}
	}
	if (argc == optind) {
		fprintf(stderr, "\n");
		fprintf(stderr, "Usage:   fermi2 simplify [options] <in.mag>\n\n");
		fprintf(stderr, "Options: -N INT         read maximum INT neighbors per node [%d]\n", opt->max_arc);
		fprintf(stderr, "         -O             read the graph without modifications\n");
		fprintf(stderr, "         -F             don't attempt to fix erroneous edges (force -O)\n");
		fprintf(stderr, "         -m INT         minimum overlap to merge [%d]\n", opt->min_merge_len);
		fprintf(stderr, "         -d FLOAT       drop a neighbor if relative overlap ratio below FLOAT [%.2f]\n\n", opt->min_dratio0); 
		fprintf(stderr, "         -C             clean the graph\n");
		fprintf(stderr, "         -l INT         minimum tip length [%d]\n", opt->min_elen);
		fprintf(stderr, "         -e INT         minimum tip read count [%d]\n", opt->min_ensr);
		fprintf(stderr, "         -i INT         minimum internal unitig read count [%d]\n", opt->min_insr);
		fprintf(stderr, "         -o INT         minimum overlap [%d]\n", opt->min_ovlp);
		fprintf(stderr, "         -R FLOAT       minimum relative overlap ratio [%.2f]\n", opt->min_dratio1);
		fprintf(stderr, "         -A             aggressive bubble popping\n");
		fprintf(stderr, "         -S             skip bubble simplification\n");
		fprintf(stderr, "         -w FLOAT       minimum coverage to keep a bubble [%.2f]\n", opt->max_bcov);
		fprintf(stderr, "         -r FLOAT       minimum fraction to keep a bubble [%.2f]\n\n", opt->max_bfrac);
		fprintf(stderr, "         -T INT1[,INT2] trim INT1-bp from an open end if DP below INT2 [%d,%d]\n", opt->trim_len, opt->trim_depth);
		fprintf(stderr, "\n");
		return 1;
	}
	g = mag_g_read(argv[optind], opt);
	mag_g_clean(g, opt);
	mag_g_trim_open(g, opt);
	mag_g_print(g);
	mag_g_destroy(g);
	free(opt);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
callq 0x13e3f
movq %rax, %rbx
leaq 0x91ad(%rip), %rdx      # 0x1d400
movl %ebp, %edi
movq %r14, %rsi
callq 0x22f0
testl %eax, %eax
js 0x1441c
leaq 0x8d1c(%rip), %r13      # 0x1cf88
leaq 0x918d(%rip), %r15      # 0x1d400
leaq 0x8cbe(%rip), %r12      # 0x1cf38
leal -0x41(%rax), %ecx
cmpl $0x13, %ecx
ja 0x14293
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
orb $0x20, (%rbx)
jmp 0x14407
addl $-0x64, %eax
cmpl $0x13, %eax
ja 0x14407
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movq 0xfd28(%rip), %rax      # 0x23fd8
movq (%rax), %rdi
callq 0x20b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x2c(%rbx)
jmp 0x14407
orb $-0x80, (%rbx)
jmp 0x14407
movq 0xfd03(%rip), %rax      # 0x23fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x4(%rbx)
jmp 0x14407
orb $0x1, (%rbx)
jmp 0x14407
orb $0x10, (%rbx)
jmp 0x14407
movq 0xfcdc(%rip), %rax      # 0x23fd8
movq (%rax), %rdi
callq 0x20b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x30(%rbx)
jmp 0x14407
orb $0x41, (%rbx)
jmp 0x14407
movq 0xfcb7(%rip), %rax      # 0x23fd8
movq (%rax), %rdi
movq %rsp, %rsi
movl $0xa, %edx
callq 0x21e0
movl %eax, 0x24(%rbx)
movq (%rsp), %rdi
movzbl (%rdi), %eax
cmpq $0x3b, %rax
ja 0x14407
movabsq $0xc00100000000000, %rcx # imm = 0xC00100000000000
btq %rax, %rcx
jae 0x14407
incq %rdi
movq %rsp, %rsi
movl $0xa, %edx
callq 0x21e0
movl %eax, 0x28(%rbx)
jmp 0x14407
movq 0xfc60(%rip), %rax      # 0x23fd8
movq (%rax), %rdi
callq 0x20b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x38(%rbx)
jmp 0x14407
movq 0xfc46(%rip), %rax      # 0x23fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0xc(%rbx)
jmp 0x14407
movq 0xfc32(%rip), %rax      # 0x23fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x20(%rbx)
jmp 0x14407
movq 0xfc1e(%rip), %rax      # 0x23fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x10(%rbx)
jmp 0x14407
movq 0xfc0a(%rip), %rax      # 0x23fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x8(%rbx)
jmp 0x14407
movq 0xfbf6(%rip), %rax      # 0x23fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x14(%rbx)
jmp 0x14407
movq 0xfbe2(%rip), %rax      # 0x23fd8
movq (%rax), %rdi
callq 0x20b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x34(%rbx)
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x22f0
testl %eax, %eax
jns 0x1427a
movq 0xfbad(%rip), %rax      # 0x23fd0
movslq (%rax), %rax
cmpl %ebp, %eax
je 0x14478
movq (%r14,%rax,8), %rdi
movq %rbx, %rsi
callq 0x110e1
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x13eb3
movq %r14, %rdi
movq %rbx, %rsi
callq 0x141e7
movq %r14, %rdi
callq 0x11055
movq %r14, %rdi
callq 0x11c01
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x2ecf
movl $0x1, %eax
jmp 0x14469
nop