// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/misc/wgsim.c
// Function: main
int main(int argc, char *argv[])
{
	int64_t N;
	int dist, std_dev, c, size_l, size_r, is_hap = 0;
	FILE *fpout1, *fpout2, *fp_fa;

	N = 1000000; dist = 500; std_dev = 50;
	size_l = size_r = 70;
	while ((c = getopt(argc, argv, "e:d:s:N:1:2:r:R:hX:cC")) >= 0) {
		switch (c) {
		case 'd': dist = atoi(optarg); break;
		case 's': std_dev = atoi(optarg); break;
		case 'N': N = atoi(optarg); break;
		case '1': size_l = atoi(optarg); break;
		case '2': size_r = atoi(optarg); break;
		case 'e': ERR_RATE = atof(optarg); break;
		case 'r': MUT_RATE = atof(optarg); break;
		case 'R': INDEL_FRAC = atof(optarg); break;
		case 'X': INDEL_EXTEND = atof(optarg); break;
		case 'c': IS_SOLID = 1; break;
		case 'C': SHOW_MM_INFO = 0; break;
		case 'h': is_hap = 1; break;
		}
	}
	if (argc - optind < 3) return simu_usage();
	fp_fa = (strcmp(argv[optind+0], "-") == 0)? stdin : xopen(argv[optind+0], "r");
	fpout1 = xopen(argv[optind+1], "w");
	fpout2 = xopen(argv[optind+2], "w");
	wgsim_core(fpout1, fpout2, fp_fa, is_hap, N, dist, std_dev, size_l, size_r);

	fclose(fpout1); fclose(fpout2); fclose(fp_fa);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movl %edi, %r12d
leaq 0x131b(%rip), %rdx      # 0x434a
callq 0x1190
testl %eax, %eax
js 0x31b9
movl $0x32, %ecx
movq %rcx, 0x8(%rsp)
movl $0x46, %ecx
movq %rcx, 0x20(%rsp)
movl $0x0, 0x4(%rsp)
movl $0x1f4, %r15d           # imm = 0x1F4
movl $0xf4240, %ecx          # imm = 0xF4240
movq %rcx, 0x18(%rsp)
movq 0x2f69(%rip), %r14      # 0x5fd8
leaq 0x12d4(%rip), %r13      # 0x434a
leaq 0xff3(%rip), %rbp       # 0x4070
movl $0x46, %ecx
movq %rcx, 0x10(%rsp)
cmpl $0x62, %eax
jg 0x30b8
cmpl $0x4d, %eax
jg 0x30d6
cmpl $0x31, %eax
je 0x3150
cmpl $0x32, %eax
je 0x3170
cmpl $0x43, %eax
jne 0x31a1
movb $0x1, 0x3099(%rip)      # 0x614c
jmp 0x31a1
leal -0x63(%rax), %ecx
cmpl $0x5, %ecx
ja 0x3106
movslq (%rbp,%rcx,4), %rax
addq %rbp, %rax
jmpq *%rax
movb $0x1, 0x3077(%rip)      # 0x6148
jmp 0x31a1
cmpl $0x4e, %eax
je 0x315f
cmpl $0x52, %eax
je 0x317f
cmpl $0x58, %eax
jne 0x31a1
movq (%r14), %rdi
callq 0x1070
movsd %xmm0, 0x300f(%rip)     # 0x6110
jmp 0x31a1
cmpl $0x72, %eax
je 0x3191
cmpl $0x73, %eax
jne 0x31a1
movq (%r14), %rdi
callq 0x11a0
movq %rax, 0x8(%rsp)
jmp 0x31a1
movl $0x1, 0x4(%rsp)
jmp 0x31a1
movq (%r14), %rdi
callq 0x11a0
movl %eax, %r15d
jmp 0x31a1
movq (%r14), %rdi
callq 0x1070
movsd %xmm0, 0x2fda(%rip)     # 0x6128
jmp 0x31a1
movq (%r14), %rdi
callq 0x11a0
movq %rax, 0x10(%rsp)
jmp 0x31a1
movq (%r14), %rdi
callq 0x11a0
cltq
movq %rax, 0x18(%rsp)
jmp 0x31a1
movq (%r14), %rdi
callq 0x11a0
movq %rax, 0x20(%rsp)
jmp 0x31a1
movq (%r14), %rdi
callq 0x1070
movsd %xmm0, 0x2f91(%rip)     # 0x6120
jmp 0x31a1
movq (%r14), %rdi
callq 0x1070
movsd %xmm0, 0x2f77(%rip)     # 0x6118
movl %r12d, %edi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1190
testl %eax, %eax
jns 0x3087
jmp 0x31ef
movl $0xf4240, %eax          # imm = 0xF4240
movq %rax, 0x18(%rsp)
movl $0x1f4, %r15d           # imm = 0x1F4
movl $0x0, 0x4(%rsp)
movl $0x46, %eax
movq %rax, 0x10(%rsp)
movl $0x32, %eax
movq %rax, 0x8(%rsp)
movl $0x46, %eax
movq %rax, 0x20(%rsp)
movq 0x2dda(%rip), %r14      # 0x5fd0
movslq (%r14), %rax
subl %eax, %r12d
cmpl $0x2, %r12d
jg 0x3211
callq 0x240d
movl $0x1, %eax
jmp 0x32c5
movq (%rbx,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x322c
cmpb $0x0, 0x1(%rsi)
jne 0x322c
movq 0x2da1(%rip), %rcx      # 0x5fc8
movq (%rcx), %rbp
jmp 0x3245
leaq 0x112d(%rip), %rdi      # 0x4360
leaq 0xf96(%rip), %rdx       # 0x41d0
callq 0x29b9
movq %rax, %rbp
movslq (%r14), %rax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x110f(%rip), %r13      # 0x4360
leaq 0x110d(%rip), %rdx      # 0x4365
movq %r13, %rdi
callq 0x29b9
movq %rax, %r12
movslq (%r14), %rax
movq 0x10(%rbx,%rax,8), %rsi
movq %r13, %rdi
leaq 0x10f0(%rip), %rdx      # 0x4365
callq 0x29b9
movq %rax, %rbx
subq $0x8, %rsp
movq %r12, %rdi
movq %rax, %rsi
movq %rbp, %rdx
movl 0xc(%rsp), %ecx
movq 0x20(%rsp), %r8
movl %r15d, %r9d
pushq 0x28(%rsp)
pushq 0x20(%rsp)
pushq 0x20(%rsp)
callq 0x1200
addq $0x20, %rsp
movq %r12, %rdi
callq 0x1080
movq %rbx, %rdi
callq 0x1080
movq %rbp, %rdi
callq 0x1080
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq