// File: /workspace/github_cpp_makefile_star2_O2/bobverity[P]MavericK/MCMCobject_noAdmixture.cpp
// Function: MCMCobject_noAdmixture::reset(bool)
void MCMCobject_noAdmixture::reset(bool reset_Qmatrix_running) {
    
    // reset likelihoods
    logLikeGroup = 0;
    logLikeGroup_sum = 0;
    logLikeGroup_store = vector<double>(samples);
    logLikeGroup_sumSquared = 0;
    logLikeJoint = 0;
    logLikeJoint_sum = 0;
    logLikeJoint_sumSquared = 0;
    harmonic = log(double(0));
    
    // reset Qmatrices
    logQmatrix_ind_old = vector< vector<double> >(n, vector<double>(K));
    logQmatrix_ind_new = vector< vector<double> >(n, vector<double>(K));
    if (reset_Qmatrix_running) {
        logQmatrix_ind_running = vector< vector<double> >(n, vector<double>(K,-log(double(K))));
    }
    
    logQmatrix_ind = vector< vector<double> >(n, vector<double>(K, log(double(0))));
    Qmatrix_ind = vector< vector<double> >(n, vector<double>(K));
    Qmatrix_pop = vector< vector<double> >(uniquePops.size(), vector<double>(K));
    
    // initialise group with random allocation
    vector<double> equalK(K,1/double(K));
    for (int i=0; i<n; i++) {
        group[i] = sample1(equalK,1.0);
    }
    
    // zero allele counts
    for (int k=0; k<K; k++) {
        alleleCountsTotals[k] = vector<int>(loci);
        for (int l=0; l<loci; l++) {
            alleleCounts[k][l] = vector<int>(J[l]);
        }
    }
    
    // populate allele counts
    for (int ind=0; ind<n; ind++) {
        for (int l=0; l<loci; l++) {
            for (int p=0; p<ploidy_vec[ind]; p++) {
                if (data[ind][l][p]!=0) {
                    alleleCounts[group[ind]-1][l][data[ind][l][p]-1]++;
                    alleleCountsTotals[group[ind]-1][l]++;
                }
            }
        }
    }
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebp
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, 0x120(%rdi)
movslq 0x88(%rdi), %rsi
leaq 0x28(%rsp), %r14
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x4f6c
leaq 0x130(%rbx), %rdi
movq %r14, %rsi
callq 0x55b8
movq %r14, %rdi
callq 0x51a2
xorpd %xmm0, %xmm0
movupd %xmm0, 0x158(%rbx)
movupd %xmm0, 0x148(%rbx)
xorpd %xmm0, %xmm0
callq 0x32d0
movsd %xmm0, 0x168(%rbx)
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x4f6c
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x6(%rsp), %rcx
movq %r14, %rsi
callq 0x4fbe
leaq 0x1b8(%rbx), %rdi
leaq 0x28(%rsp), %r14
movq %r14, %rsi
callq 0x5566
movq %r14, %rdi
callq 0x50da
leaq 0x8(%rsp), %rdi
callq 0x51a2
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x4f6c
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x6(%rsp), %rcx
movq %r14, %rsi
callq 0x4fbe
leaq 0x1d0(%rbx), %rdi
leaq 0x28(%rsp), %r14
movq %r14, %rsi
callq 0x5566
movq %r14, %rdi
callq 0x50da
leaq 0x8(%rsp), %rdi
callq 0x51a2
testb %bpl, %bpl
je 0xb359
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %r15
cvtsi2sd %r15d, %xmm0
callq 0x32d0
xorpd 0x1bd2f(%rip), %xmm0    # 0x27030
leaq 0x20(%rsp), %rdx
movlpd %xmm0, (%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rcx
movq %r15, %rsi
callq 0x5120
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
movq %r14, %rsi
callq 0x4fbe
leaq 0x1e8(%rbx), %rdi
leaq 0x28(%rsp), %r14
movq %r14, %rsi
callq 0x5566
movq %r14, %rdi
callq 0x50da
leaq 0x8(%rsp), %rdi
callq 0x51a2
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %r15
xorpd %xmm0, %xmm0
callq 0x32d0
leaq 0x20(%rsp), %rdx
movsd %xmm0, (%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rcx
movq %r15, %rsi
callq 0x5120
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
movq %r14, %rsi
callq 0x4fbe
leaq 0x200(%rbx), %rdi
leaq 0x28(%rsp), %r14
movq %r14, %rsi
callq 0x5566
movq %r14, %rdi
callq 0x50da
leaq 0x8(%rsp), %rdi
callq 0x51a2
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x4f6c
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x6(%rsp), %rcx
movq %r14, %rsi
callq 0x4fbe
leaq 0x218(%rbx), %rdi
leaq 0x28(%rsp), %r14
movq %r14, %rsi
callq 0x5566
movq %r14, %rdi
callq 0x50da
leaq 0x8(%rsp), %rdi
callq 0x51a2
movq 0x58(%rbx), %r15
movq 0x60(%rbx), %r14
movslq 0x1c(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x4f6c
subq %r15, %r14
sarq $0x5, %r14
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x6(%rsp), %rcx
movq %r14, %rsi
callq 0x4fbe
leaq 0x230(%rbx), %rdi
leaq 0x28(%rsp), %r14
movq %r14, %rsi
callq 0x5566
movq %r14, %rdi
callq 0x50da
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x51a2
movslq 0x1c(%rbx), %rsi
cvtsi2sd %esi, %xmm0
movsd 0x1bd88(%rip), %xmm1    # 0x27210
divsd %xmm0, %xmm1
movsd %xmm1, (%r14)
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x5120
xorl %r15d, %r15d
leaq 0x28(%rsp), %r14
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jge 0xb4d6
movq %r14, %rdi
movsd 0x1bd4f(%rip), %xmm0    # 0x27210
callq 0x17127
movq 0x90(%rbx), %rcx
movl %eax, (%rcx,%r15,4)
incq %r15
jmp 0xb4ad
xorl %r12d, %r12d
leaq 0x8(%rsp), %r14
leaq 0x20(%rsp), %r15
movslq 0x1c(%rbx), %rax
cmpq %rax, %r12
jge 0xb577
movslq 0x24(%rbx), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x5f7c
movq %r12, 0x40(%rsp)
imulq $0x18, %r12, %r13
movq 0xc0(%rbx), %rdi
addq %r13, %rdi
movq %r14, %rsi
callq 0x6266
movq %r14, %rdi
callq 0x61d0
xorl %ebp, %ebp
xorl %r12d, %r12d
movslq 0x24(%rbx), %rax
cmpq %rax, %r12
jge 0xb56a
movq 0x28(%rbx), %rax
movslq (%rax,%r12,4), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x5f7c
movq 0xa8(%rbx), %rax
movq (%rax,%r13), %rdi
addq %rbp, %rdi
movq %r14, %rsi
callq 0x6266
movq %r14, %rdi
callq 0x61d0
incq %r12
addq $0x18, %rbp
jmp 0xb527
movq 0x40(%rsp), %r12
incq %r12
jmp 0xb4e3
xorl %eax, %eax
movslq 0x20(%rbx), %rcx
cmpq %rcx, %rax
jge 0xb613
movq 0x40(%rbx), %rcx
imulq $0x18, %rax, %rdx
xorl %esi, %esi
movslq 0x24(%rbx), %rdi
cmpq %rdi, %rsi
jge 0xb60b
movq (%rbx), %rdi
addq %rdx, %rdi
movq 0x90(%rbx), %r8
movq 0xa8(%rbx), %r9
addq $-0x18, %r9
movq 0xc0(%rbx), %r10
addq $-0x18, %r10
imulq $0x18, %rsi, %r11
xorl %r14d, %r14d
movslq (%rcx,%rax,4), %r15
cmpq %r15, %r14
jge 0xb606
movq (%rdi), %r15
movq (%r15,%r11), %r15
movslq (%r15,%r14,4), %r15
testq %r15, %r15
je 0xb601
movslq (%r8,%rax,4), %r12
imulq $0x18, %r12, %r12
movq (%r9,%r12), %r12
movq (%r12,%r11), %r12
incl -0x4(%r12,%r15,4)
movslq (%r8,%rax,4), %r15
imulq $0x18, %r15, %r15
movq (%r10,%r15), %r15
incl (%r15,%rsi,4)
incq %r14
jmp 0xb5c3
incq %rsi
jmp 0xb590
incq %rax
jmp 0xb579
leaq 0x28(%rsp), %rdi
callq 0x51a2
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb642
jmp 0xb64c
jmp 0xb64c
jmp 0xb642
jmp 0xb64c
jmp 0xb642
jmp 0xb64c
jmp 0xb642
jmp 0xb64c
jmp 0xb642
jmp 0xb64c
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0xb65d
movq %rax, %rbx
jmp 0xb662
jmp 0xb655
jmp 0xb655
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x51a2
movq %rbx, %rdi
callq 0x35a0