// File: /workspace/github_c_makefile_star2_O3/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
subq $0x58, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movl $0x1, %edi
movl $0x3c, %esi
callq 0x2190
movq %rax, %r14
movabsq $0x20000000004, %rax    # imm = 0x20000000004
movq %rax, (%r14)
movl $0x6, 0x28(%r14)
movaps 0x973e(%rip), %xmm0     # 0x1e0a0
movups %xmm0, 0x2c(%r14)
movl $0x40, 0x1c(%r14)
movaps 0x973a(%rip), %xmm0     # 0x1e0b0
movups %xmm0, 0xc(%r14)
leaq 0x9c4e(%rip), %rdx      # 0x1e5d0
movl %ebp, %edi
movq %rbx, %rsi
callq 0x22f0
testl %eax, %eax
js 0x14c38
movl $0x200, 0x1c(%rsp)      # imm = 0x200
movss 0x9754(%rip), %xmm0     # 0x1e0f8
movss %xmm0, 0x30(%rsp)
movl $0x12c, 0x10(%rsp)      # imm = 0x12C
movl $0x4, 0x14(%rsp)
movl $0x3, 0x18(%rsp)
movss 0x9732(%rip), %xmm0     # 0x1e0fc
movss %xmm0, 0x38(%rsp)
movss 0x9728(%rip), %xmm0     # 0x1e100
movss %xmm0, 0x20(%rsp)
movss 0x971e(%rip), %xmm0     # 0x1e104
movss %xmm0, 0x28(%rsp)
movq $0x0, 0x48(%rsp)
movl $0x6, %ecx
movq %rcx, 0x40(%rsp)
leaq 0x9bca(%rip), %r13      # 0x1e5d0
leaq 0x96fb(%rip), %r15      # 0x1e108
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl $0x4, %r12d
leal -0x41(%rax), %ecx
cmpl $0x13, %ecx
ja 0x14a3d
movslq (%r15,%rcx,4), %rax
addq %r15, %rax
jmpq *%rax
orl $0x20, %r12d
jmp 0x14acd
addl $-0x64, %eax
cmpl $0x13, %eax
ja 0x14ad0
leaq 0x9708(%rip), %rcx      # 0x1e158
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10578(%rip), %rax     # 0x24fd8
movq (%rax), %rdi
callq 0x20b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x30(%rsp)
movss %xmm0, 0x2c(%r14)
jmp 0x14ad0
orl $0x80, %r12d
jmp 0x14acd
movq 0x1054e(%rip), %rax     # 0x24fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x1c(%rsp)
movl %eax, 0x4(%r14)
jmp 0x14ad0
orl $0x1, %r12d
jmp 0x14acd
orl $0x10, %r12d
jmp 0x14acd
movq 0x10529(%rip), %rax     # 0x24fd8
movq (%rax), %rdi
callq 0x20b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x38(%rsp)
movss %xmm0, 0x30(%r14)
jmp 0x14ad0
orl $0x41, %r12d
movl %r12d, (%r14)
movl %ebp, %edi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x22f0
testl %eax, %eax
jns 0x14a23
jmp 0x14c1b
movq 0x104e7(%rip), %rax     # 0x24fd8
movq (%rax), %rdi
leaq 0x50(%rsp), %rsi
movl $0xa, %edx
callq 0x21e0
movq %rax, 0x48(%rsp)
movl %eax, 0x24(%r14)
movq 0x50(%rsp), %rdi
movzbl (%rdi), %eax
cmpq $0x3b, %rax
ja 0x14ad0
movabsq $0xc00100000000000, %rcx # imm = 0xC00100000000000
btq %rax, %rcx
jae 0x14ad0
incq %rdi
leaq 0x50(%rsp), %rsi
movl $0xa, %edx
callq 0x21e0
movq %rax, 0x40(%rsp)
movl %eax, 0x28(%r14)
jmp 0x14ad0
movq 0x1048a(%rip), %rax     # 0x24fd8
movq (%rax), %rdi
callq 0x20b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x28(%rsp)
movss %xmm0, 0x38(%r14)
jmp 0x14ad0
movq 0x10466(%rip), %rax     # 0x24fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x10(%rsp)
movl %eax, 0xc(%r14)
jmp 0x14ad0
movq 0x1044a(%rip), %rax     # 0x24fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x8(%rsp)
movl %eax, 0x20(%r14)
jmp 0x14ad0
movq 0x1042e(%rip), %rax     # 0x24fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x14(%rsp)
movl %eax, 0x10(%r14)
jmp 0x14ad0
movq 0x10412(%rip), %rax     # 0x24fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0xc(%rsp)
movl %eax, 0x8(%r14)
jmp 0x14ad0
movq 0x103f6(%rip), %rax     # 0x24fd8
movq (%rax), %rdi
callq 0x2300
movl %eax, 0x18(%rsp)
movl %eax, 0x14(%r14)
jmp 0x14ad0
movq 0x103da(%rip), %rax     # 0x24fd8
movq (%rax), %rdi
callq 0x20b0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rsp)
movss %xmm0, 0x34(%r14)
jmp 0x14ad0
cvtss2sd 0x30(%rsp), %xmm3
cvtss2sd 0x38(%rsp), %xmm2
cvtss2sd 0x20(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtss2sd 0x28(%rsp), %xmm0
jmp 0x14c9b
movl $0x200, 0x1c(%rsp)      # imm = 0x200
movsd 0x9490(%rip), %xmm3     # 0x1e0d8
movl $0x12c, 0x10(%rsp)      # imm = 0x12C
movl $0x4, 0x14(%rsp)
movl $0x3, 0x18(%rsp)
movsd 0x9478(%rip), %xmm2     # 0x1e0e0
movsd 0x9478(%rip), %xmm1     # 0x1e0e8
movsd 0x9478(%rip), %xmm0     # 0x1e0f0
movq $0x0, 0x48(%rsp)
movl $0x6, %eax
movq %rax, 0x40(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movq 0x1032e(%rip), %rax     # 0x24fd0
movslq (%rax), %rax
cmpl %ebp, %eax
je 0x14cf7
movq (%rbx,%rax,8), %rdi
movq %r14, %rsi
callq 0x1176f
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x14597
movq %rbx, %rdi
movq %r14, %rsi
callq 0x148d4
movq %rbx, %rdi
callq 0x116da
movq %rbx, %rdi
callq 0x1226f
movq %r14, %rdi
callq 0x2040
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x102fa(%rip), %rbx     # 0x24ff8
movq (%rbx), %rsi
movl $0xa, %edi
movsd %xmm0, 0x38(%rsp)
movsd %xmm1, 0x30(%rsp)
movsd %xmm2, 0x28(%rsp)
movsd %xmm3, 0x20(%rsp)
callq 0x2170
movq (%rbx), %rcx
leaq 0x98c1(%rip), %rdi      # 0x1e5ee
movl $0x2d, %esi
movl $0x1, %edx
callq 0x2310
movq (%rbx), %rdi
leaq 0x98d6(%rip), %rsi      # 0x1e61c
movl 0x1c(%rsp), %edx
xorl %eax, %eax
callq 0x21c0
movq (%rbx), %rcx
leaq 0x9903(%rip), %rdi      # 0x1e65e
movl $0x3d, %esi
movl $0x1, %edx
callq 0x2310
movq (%rbx), %rcx
leaq 0x9928(%rip), %rdi      # 0x1e69c
movl $0x48, %esi
movl $0x1, %edx
callq 0x2310
movq (%rbx), %rdi
leaq 0x9958(%rip), %rsi      # 0x1e6e5
movl 0x8(%rsp), %edx
xorl %eax, %eax
callq 0x21c0
movq (%rbx), %rdi
leaq 0x997a(%rip), %rsi      # 0x1e71c
movsd 0x20(%rsp), %xmm0
movb $0x1, %al
callq 0x21c0
movq (%rbx), %rcx
leaq 0x99ba(%rip), %rdi      # 0x1e773
movl $0x28, %esi
movl $0x1, %edx
callq 0x2310
movq (%rbx), %rdi
leaq 0x99ca(%rip), %rsi      # 0x1e79c
movl 0x10(%rsp), %edx
xorl %eax, %eax
callq 0x21c0
movq (%rbx), %rdi
leaq 0x99e6(%rip), %rsi      # 0x1e7cd
movl 0x14(%rsp), %edx
xorl %eax, %eax
callq 0x21c0
movq (%rbx), %rdi
leaq 0x9a06(%rip), %rsi      # 0x1e802
movl 0x18(%rsp), %edx
xorl %eax, %eax
callq 0x21c0
movq (%rbx), %rdi
leaq 0x9a32(%rip), %rsi      # 0x1e843
movl 0xc(%rsp), %edx
xorl %eax, %eax
callq 0x21c0
movq (%rbx), %rdi
leaq 0x9a4b(%rip), %rsi      # 0x1e871
movsd 0x28(%rsp), %xmm0
movb $0x1, %al
callq 0x21c0
movq (%rbx), %rcx
leaq 0x9a73(%rip), %rdi      # 0x1e8b0
movl $0x32, %esi
movl $0x1, %edx
callq 0x2310
movq (%rbx), %rcx
leaq 0x9a8d(%rip), %rdi      # 0x1e8e3
movl $0x33, %esi
movl $0x1, %edx
callq 0x2310
movq (%rbx), %rdi
leaq 0x9aa8(%rip), %rsi      # 0x1e917
movsd 0x30(%rsp), %xmm0
movb $0x1, %al
callq 0x21c0
movq (%rbx), %rdi
leaq 0x9ad3(%rip), %rsi      # 0x1e959
movsd 0x38(%rsp), %xmm0
movb $0x1, %al
callq 0x21c0
movq (%rbx), %rdi
leaq 0x9aff(%rip), %rsi      # 0x1e99c
movq 0x48(%rsp), %rdx
movq 0x40(%rsp), %rcx
xorl %eax, %eax
callq 0x21c0
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x2170
movl $0x1, %eax
jmp 0x14ce8
nopl (%rax)