// File: /workspace/github_c_makefile_star2_O2/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 0x11c16
movq %rax, %rbx
leaq 0x84d1(%rip), %r15      # 0x1a4f0
leaq 0x8052(%rip), %r12      # 0x1a078
leaq 0x7ffb(%rip), %r13      # 0x1a028
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x22f0
testl %eax, %eax
js 0x121cf
leal -0x41(%rax), %ecx
cmpl $0x13, %ecx
ja 0x12059
movslq (%r13,%rcx,4), %rax
addq %r13, %rax
jmpq *%rax
orb $0x20, (%rbx)
jmp 0x1202d
addl $-0x64, %eax
cmpl $0x13, %eax
ja 0x1202d
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movq 0xff67(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x20b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x2c(%rbx)
jmp 0x1202d
orb $0x1, (%rbx)
jmp 0x1202d
orb $0x41, (%rbx)
jmp 0x1202d
movq 0xff43(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x4(%rbx)
jmp 0x1202d
movq 0xff2f(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x21e0
movl %eax, 0x24(%rbx)
movq (%rsp), %rdi
movzbl (%rdi), %eax
cmpq $0x3b, %rax
ja 0x1202d
movabsq $0xc00100000000000, %rcx # imm = 0xC00100000000000
btq %rax, %rcx
jae 0x1202d
incq %rdi
movq %rsp, %rsi
pushq $0xa
popq %rdx
callq 0x21e0
movl %eax, 0x28(%rbx)
jmp 0x1202d
orb $0x10, (%rbx)
jmp 0x1202d
movq 0xfed4(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x20b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x30(%rbx)
jmp 0x1202d
orb $-0x80, (%rbx)
jmp 0x1202d
movq 0xfeaf(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x20(%rbx)
jmp 0x1202d
movq 0xfe98(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x14(%rbx)
jmp 0x1202d
movq 0xfe81(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0xc(%rbx)
jmp 0x1202d
movq 0xfe6a(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x20b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x34(%rbx)
jmp 0x1202d
movq 0xfe4d(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x10(%rbx)
jmp 0x1202d
movq 0xfe36(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x8(%rbx)
jmp 0x1202d
movq 0xfe1f(%rip), %rax      # 0x21fd8
movq (%rax), %rdi
callq 0x20b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x38(%rbx)
jmp 0x1202d
movq 0xfdfa(%rip), %rax      # 0x21fd0
movslq (%rax), %rax
cmpl %ebp, %eax
je 0x1222b
movq (%r14,%rax,8), %rdi
movq %rbx, %rsi
callq 0xf1eb
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x11c55
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11fb7
movq %r14, %rdi
callq 0xf15f
movq %r14, %rdi
callq 0xfc4e
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 0xfdc6(%rip), %r15      # 0x21ff8
movq (%r15), %rsi
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x2170
movq (%r15), %rcx
leaq 0x82c5(%rip), %rdi      # 0x1a50e
pushq $0x2d
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x2310
movq (%r15), %rdi
movl 0x4(%rbx), %edx
leaq 0x82d7(%rip), %rsi      # 0x1a53c
xorl %eax, %eax
callq 0x21c0
movq (%r15), %rcx
leaq 0x8308(%rip), %rdi      # 0x1a57e
pushq $0x3d
popq %rsi
movq %r14, %rdx
callq 0x2310
movq (%r15), %rcx
leaq 0x8331(%rip), %rdi      # 0x1a5bc
pushq $0x48
popq %rsi
movq %r14, %rdx
callq 0x2310
movq (%r15), %rdi
movl 0x20(%rbx), %edx
leaq 0x8362(%rip), %rsi      # 0x1a605
xorl %eax, %eax
callq 0x21c0
movq (%r15), %rdi
cvtss2sd 0x2c(%rbx), %xmm0
leaq 0x8383(%rip), %rsi      # 0x1a63c
movb $0x1, %al
callq 0x21c0
movq (%r15), %rcx
leaq 0x83c9(%rip), %rdi      # 0x1a693
pushq $0x28
popq %rsi
movq %r14, %rdx
callq 0x2310
movq (%r15), %rdi
movl 0xc(%rbx), %edx
leaq 0x83da(%rip), %rsi      # 0x1a6bc
xorl %eax, %eax
callq 0x21c0
movq (%r15), %rdi
movl 0x10(%rbx), %edx
leaq 0x83f7(%rip), %rsi      # 0x1a6ed
xorl %eax, %eax
callq 0x21c0
movq (%r15), %rdi
movl 0x14(%rbx), %edx
leaq 0x8418(%rip), %rsi      # 0x1a722
xorl %eax, %eax
callq 0x21c0
movq (%r15), %rdi
movl 0x8(%rbx), %edx
leaq 0x8445(%rip), %rsi      # 0x1a763
xorl %eax, %eax
callq 0x21c0
movq (%r15), %rdi
cvtss2sd 0x30(%rbx), %xmm0
leaq 0x845d(%rip), %rsi      # 0x1a791
movb $0x1, %al
callq 0x21c0
movq (%r15), %rcx
leaq 0x848b(%rip), %rdi      # 0x1a7d0
pushq $0x32
popq %rsi
movq %r14, %rdx
callq 0x2310
movq (%r15), %rcx
leaq 0x84a9(%rip), %rdi      # 0x1a803
pushq $0x33
popq %rsi
movq %r14, %rdx
callq 0x2310
movq (%r15), %rdi
cvtss2sd 0x34(%rbx), %xmm0
leaq 0x84c3(%rip), %rsi      # 0x1a837
movb $0x1, %al
callq 0x21c0
movq (%r15), %rdi
cvtss2sd 0x38(%rbx), %xmm0
leaq 0x84ef(%rip), %rsi      # 0x1a879
movb $0x1, %al
callq 0x21c0
movq (%r15), %rdi
movl 0x24(%rbx), %edx
movl 0x28(%rbx), %ecx
leaq 0x851b(%rip), %rsi      # 0x1a8bc
xorl %eax, %eax
callq 0x21c0
movq (%r15), %rsi
movl %ebp, %edi
callq 0x2170
pushq $0x1
popq %rax
jmp 0x1221c
nop