// File: gchen98[P]macs/simulator.cpp
// Function: Simulator::beginSimulation()
void Simulator::beginSimulation(){
    try{
        RandNumGenerator * rg = new RandNumGenerator(pConfig->iRandomSeed);
        cout<<SEED<<"\t"<<pConfig->iRandomSeed<<endl;
        for(unsigned int i=0;i<pConfig->iIterations;++i){
            if (pConfig->bDebug){
                cerr<<"Iteration: "<<i<<endl;
            }
            GraphBuilder graphBuilder = GraphBuilder(pConfig,rg);
            graphBuilder.build();
            graphBuilder.printHaplotypes();

        }
        delete rg;
    }catch(const char* message){
        cerr<<"Simulator caught exception with message:"<<endl<<message<<endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x158(%rbp)
movl $0x8, %edi
callq 0x42c0
movq %rax, -0x150(%rbp)
jmp 0xae5d
movq -0x150(%rbp), %rdi
movq -0x158(%rbp), %rax
movq (%rax), %rax
movq 0x40(%rax), %rsi
callq 0x5890
jmp 0xae79
movq -0x150(%rbp), %rax
movq %rax, -0x10(%rbp)
movq 0x3e145(%rip), %rdi     # 0x48fd0
leaq 0x3e496(%rip), %rsi     # 0x49328
callq 0x4280
movq %rax, -0x160(%rbp)
jmp 0xaea0
movq -0x160(%rbp), %rdi
leaq 0x27348(%rip), %rsi     # 0x321f6
callq 0x42b0
movq %rax, -0x168(%rbp)
jmp 0xaebc
movq -0x168(%rbp), %rdi
movq -0x158(%rbp), %rax
movq (%rax), %rax
movq 0x40(%rax), %rsi
callq 0x4540
movq %rax, -0x170(%rbp)
jmp 0xaedf
movq -0x170(%rbp), %rdi
movq 0x3e0c3(%rip), %rsi     # 0x48fb0
callq 0x4300
jmp 0xaef4
movl $0x0, -0x20(%rbp)
movq -0x158(%rbp), %rcx
movl -0x20(%rbp), %eax
movq (%rcx), %rcx
cmpl 0x34(%rcx), %eax
jae 0xb09d
movq -0x158(%rbp), %rax
movq (%rax), %rax
testb $0x1, 0x48(%rax)
je 0xaf9c
movq 0x3e0c8(%rip), %rdi     # 0x48ff0
leaq 0x28b71(%rip), %rsi     # 0x33aa0
callq 0x42b0
movq %rax, -0x178(%rbp)
jmp 0xaf3d
movq -0x178(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x43e0
movq %rax, -0x180(%rbp)
jmp 0xaf55
movq -0x180(%rbp), %rdi
movq 0x3e04d(%rip), %rsi     # 0x48fb0
callq 0x4300
jmp 0xaf6a
jmp 0xaf9c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0xb006
movq -0x150(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x8, %esi
callq 0x42d0
jmp 0xb006
movq -0x158(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
leaq -0x140(%rbp), %rdi
callq 0x284d0
jmp 0xafb8
leaq -0x140(%rbp), %rdi
callq 0x1d560
jmp 0xafc6
leaq -0x140(%rbp), %rdi
callq 0x2a920
jmp 0xafd4
leaq -0x140(%rbp), %rdi
callq 0x280e0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xaefb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x280e0
movl -0x1c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0xb0de
movq -0x18(%rbp), %rdi
callq 0x40e0
movq %rax, -0x148(%rbp)
movq 0x3dfc3(%rip), %rdi     # 0x48ff0
leaq 0x28a78(%rip), %rsi     # 0x33aac
callq 0x42b0
movq %rax, -0x188(%rbp)
jmp 0xb042
movq -0x188(%rbp), %rdi
movq 0x3df60(%rip), %rsi     # 0x48fb0
callq 0x4300
movq %rax, -0x190(%rbp)
jmp 0xb05e
movq -0x190(%rbp), %rdi
movq -0x148(%rbp), %rsi
callq 0x42b0
movq %rax, -0x198(%rbp)
jmp 0xb07a
movq -0x198(%rbp), %rdi
movq 0x3df28(%rip), %rsi     # 0x48fb0
callq 0x4300
jmp 0xb08f
callq 0x4490
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq -0x10(%rbp), %rax
movq %rax, -0x1a0(%rbp)
cmpq $0x0, %rax
je 0xb0cb
movq -0x1a0(%rbp), %rdi
callq 0x5940
movq -0x1a0(%rbp), %rdi
movl $0x8, %esi
callq 0x42d0
jmp 0xb094
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x4490
movq -0x18(%rbp), %rdi
callq 0x44e0
nopw (%rax,%rax)