// File: gchen98[P]macs/simulator.cpp
// Function: main
int main(int argc,char * argv[]){

    try{
        #ifdef DIAG
          cerr<<"Diagnostic mode is on\n";
        #endif
        Simulator simulator;
        if(argc<3){
            cerr<< "You did not specify any parameters. You must at least specify "<<
            "the number of chromosomes sampled and the sequence length."<<endl;
            simulator.printUsage();
        }
        cout<<COMMAND<<"\t";
        for (int i=0;i<argc;++i){
          if (i>0){
            cout<<" ";
          }
          cout<<argv[i];
        }
        cout<<endl;
        CommandArguments arguments;
        vector<string> subOption;
        // sample size
        subOption.push_back(string(argv[1]));
        // seq length
        subOption.push_back(string(argv[2]));
        arguments.push_back(subOption);
        subOption.clear();
        for (int i=3;i<argc;++i){
            subOption.push_back(string(argv[i]));
            if (i==argc-1 || (argv[i+1][0]=='-' && argv[i+1][1]>=65)){
                arguments.push_back(subOption);
                subOption.clear();
            }
        }

        simulator.readInputParameters(arguments);
        simulator.beginSimulation();
    }catch(const char* message){
      cerr<<"Exception at main:"<<endl<<message<<endl;
    }
	cerr<<"Program is complete\n";
	exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x18(%rbp), %rdi
callq 0xb0f0
jmp 0xb1a4
cmpl $0x3, -0x8(%rbp)
jge 0xb226
movq 0x3de3f(%rip), %rdi     # 0x48ff0
leaq 0x28933(%rip), %rsi     # 0x33aeb
callq 0x42b0
movq %rax, -0xf8(%rbp)
jmp 0xb1c6
movq -0xf8(%rbp), %rdi
leaq 0x28956(%rip), %rsi     # 0x33b2a
callq 0x42b0
movq %rax, -0x100(%rbp)
jmp 0xb1e2
movq -0x100(%rbp), %rdi
movq 0x3ddc0(%rip), %rsi     # 0x48fb0
callq 0x4300
jmp 0xb1f7
leaq -0x18(%rbp), %rdi
callq 0x59a0
jmp 0xb202
jmp 0xb226
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xb5f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xb5eb
movq 0x3dda3(%rip), %rdi     # 0x48fd0
leaq 0x3e0d4(%rip), %rsi     # 0x49308
callq 0x4280
movq %rax, -0x108(%rbp)
jmp 0xb242
movq -0x108(%rbp), %rdi
leaq 0x26fa6(%rip), %rsi     # 0x321f6
callq 0x42b0
jmp 0xb257
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0xb2aa
cmpl $0x0, -0x28(%rbp)
jle 0xb283
movq 0x3dd5d(%rip), %rdi     # 0x48fd0
leaq 0x27811(%rip), %rsi     # 0x32a8b
callq 0x42b0
jmp 0xb281
jmp 0xb283
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x3dd3a(%rip), %rdi     # 0x48fd0
callq 0x42b0
jmp 0xb29d
jmp 0xb29f
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xb25e
movq 0x3dd1f(%rip), %rdi     # 0x48fd0
movq 0x3dcf8(%rip), %rsi     # 0x48fb0
callq 0x4300
jmp 0xb2bf
leaq -0x40(%rbp), %rdi
callq 0xc6e0
leaq -0x58(%rbp), %rdi
callq 0xc700
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x118(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x44f0
movq -0x118(%rbp), %rsi
movq -0x110(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0xb6c0
jmp 0xb309
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xc720
jmp 0xb318
leaq -0x78(%rbp), %rdi
callq 0x4598
leaq -0x79(%rbp), %rdi
callq 0x4320
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x128(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x44f0
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0xb6c0
jmp 0xb368
leaq -0x58(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xc720
jmp 0xb37a
leaq -0xa0(%rbp), %rdi
callq 0x4598
leaq -0xa1(%rbp), %rdi
callq 0x4320
leaq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xc750
jmp 0xb3a1
leaq -0x58(%rbp), %rdi
callq 0xc7c0
movl $0x3, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0xb566
movq -0x10(%rbp), %rax
movslq -0xa8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x138(%rbp)
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x44f0
movq -0x138(%rbp), %rsi
movq -0x130(%rbp), %rdx
leaq -0xc8(%rbp), %rdi
callq 0xb6c0
jmp 0xb408
leaq -0x58(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xc720
jmp 0xb41a
leaq -0xc8(%rbp), %rdi
callq 0x4598
leaq -0xc9(%rbp), %rdi
callq 0x4320
movl -0xa8(%rbp), %eax
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0xb483
movq -0x10(%rbp), %rax
movl -0xa8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0xb550
movq -0x10(%rbp), %rax
movl -0xa8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
cmpl $0x41, %eax
jl 0xb550
leaq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xc750
jmp 0xb492
leaq -0x58(%rbp), %rdi
callq 0xc7c0
jmp 0xb550
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xb4c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4598
leaq -0x79(%rbp), %rdi
callq 0x4320
jmp 0xb5d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xb4f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x4598
leaq -0xa1(%rbp), %rdi
callq 0x4320
jmp 0xb5d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xb5d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xb53f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x4598
leaq -0xc9(%rbp), %rdi
callq 0x4320
jmp 0xb5d9
jmp 0xb552
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0xb3b4
leaq -0xe8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xc7e0
jmp 0xb578
leaq -0x18(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x6180
jmp 0xb58a
leaq -0xe8(%rbp), %rdi
callq 0xc8d0
leaq -0x18(%rbp), %rdi
callq 0xae30
jmp 0xb5a1
leaq -0x58(%rbp), %rdi
callq 0xc930
leaq -0x40(%rbp), %rdi
callq 0xc8d0
leaq -0x18(%rbp), %rdi
callq 0xb100
jmp 0xb682
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xc8d0
leaq -0x58(%rbp), %rdi
callq 0xc930
leaq -0x40(%rbp), %rdi
callq 0xc8d0
leaq -0x18(%rbp), %rdi
callq 0xb100
movl -0x24(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0xb6ad
movq -0x20(%rbp), %rdi
callq 0x40e0
movq %rax, -0xf0(%rbp)
movq 0x3d9d5(%rip), %rdi     # 0x48ff0
leaq 0x28543(%rip), %rsi     # 0x33b65
callq 0x42b0
movq %rax, -0x140(%rbp)
jmp 0xb630
movq -0x140(%rbp), %rdi
movq 0x3d972(%rip), %rsi     # 0x48fb0
callq 0x4300
movq %rax, -0x148(%rbp)
jmp 0xb64c
movq -0x148(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0x42b0
movq %rax, -0x150(%rbp)
jmp 0xb668
movq -0x150(%rbp), %rdi
movq 0x3d93a(%rip), %rsi     # 0x48fb0
callq 0x4300
jmp 0xb67d
callq 0x4490
movq 0x3d967(%rip), %rdi     # 0x48ff0
leaq 0x284e8(%rip), %rsi     # 0x33b78
callq 0x42b0
xorl %edi, %edi
callq 0x4390
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x4490
movq -0x20(%rbp), %rdi
callq 0x44e0
nopw %cs:(%rax,%rax)