// File: /workspace/github_cpp_makefile_star2_O1/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 0x1484(%rip), %rdx      # 0x434a
callq 0x11a0
testl %eax, %eax
js 0x3050
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 0x30d2(%rip), %r14      # 0x5fd8
leaq 0x143d(%rip), %r13      # 0x434a
leaq 0x115c(%rip), %rbp      # 0x4070
movl $0x46, %ecx
movq %rcx, 0x10(%rsp)
cmpl $0x62, %eax
jg 0x2f4f
cmpl $0x4d, %eax
jg 0x2f6d
cmpl $0x31, %eax
je 0x2fe7
cmpl $0x32, %eax
je 0x3007
cmpl $0x43, %eax
jne 0x3038
movb $0x1, 0x320a(%rip)      # 0x6154
jmp 0x3038
leal -0x63(%rax), %ecx
cmpl $0x5, %ecx
ja 0x2f9d
movslq (%rbp,%rcx,4), %rax
addq %rbp, %rax
jmpq *%rax
movb $0x1, 0x31e8(%rip)      # 0x6150
jmp 0x3038
cmpl $0x4e, %eax
je 0x2ff6
cmpl $0x52, %eax
je 0x3016
cmpl $0x58, %eax
jne 0x3038
movq (%r14), %rdi
callq 0x1070
movsd %xmm0, 0x3180(%rip)     # 0x6118
jmp 0x3038
cmpl $0x72, %eax
je 0x3028
cmpl $0x73, %eax
jne 0x3038
movq (%r14), %rdi
callq 0x11b0
movq %rax, 0x8(%rsp)
jmp 0x3038
movl $0x1, 0x4(%rsp)
jmp 0x3038
movq (%r14), %rdi
callq 0x11b0
movl %eax, %r15d
jmp 0x3038
movq (%r14), %rdi
callq 0x1070
movsd %xmm0, 0x314b(%rip)     # 0x6130
jmp 0x3038
movq (%r14), %rdi
callq 0x11b0
movq %rax, 0x10(%rsp)
jmp 0x3038
movq (%r14), %rdi
callq 0x11b0
cltq
movq %rax, 0x18(%rsp)
jmp 0x3038
movq (%r14), %rdi
callq 0x11b0
movq %rax, 0x20(%rsp)
jmp 0x3038
movq (%r14), %rdi
callq 0x1070
movsd %xmm0, 0x3102(%rip)     # 0x6128
jmp 0x3038
movq (%r14), %rdi
callq 0x1070
movsd %xmm0, 0x30e8(%rip)     # 0x6120
movl %r12d, %edi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x11a0
testl %eax, %eax
jns 0x2f1e
jmp 0x3086
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 0x2f43(%rip), %r14      # 0x5fd0
movslq (%r14), %rax
subl %eax, %r12d
cmpl $0x2, %r12d
jg 0x30a8
callq 0x22a9
movl $0x1, %eax
jmp 0x3167
movq (%rbx,%rax,8), %r12
leaq 0x1640(%rip), %rsi      # 0x46f3
movq %r12, %rdi
callq 0x1120
testl %eax, %eax
jne 0x30cb
movq 0x2f02(%rip), %rax      # 0x5fc8
movq (%rax), %rbp
jmp 0x30e4
leaq 0x128e(%rip), %rdi      # 0x4360
leaq 0x10f7(%rip), %rdx      # 0x41d0
movq %r12, %rsi
callq 0x2848
movq %rax, %rbp
movslq (%r14), %rax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x126d(%rip), %r13      # 0x4360
leaq 0x126b(%rip), %rdx      # 0x4365
movq %r13, %rdi
callq 0x2848
movq %rax, %r12
movslq (%r14), %rax
movq 0x10(%rbx,%rax,8), %rsi
movq %r13, %rdi
leaq 0x124e(%rip), %rdx      # 0x4365
callq 0x2848
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 0x1210
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