// File: /workspace/github_cpp_makefile_star2_O3/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 $0x68, %rsp
movl %esi, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x120(%rdi)
movslq 0x88(%rdi), %rsi
leaq 0x40(%rsp), %r14
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x588e
movq 0x130(%rbx), %rdi
movapd (%r14), %xmm0
movupd %xmm0, 0x130(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x140(%rbx)
xorpd %xmm0, %xmm0
movapd %xmm0, (%r14)
movq $0x0, 0x10(%r14)
testq %rdi, %rdi
je 0xcfbb
callq 0x3310
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xcfbb
callq 0x3310
xorpd %xmm0, %xmm0
movupd %xmm0, 0x158(%rbx)
movupd %xmm0, 0x148(%rbx)
xorpd %xmm0, %xmm0
callq 0x3290
movsd %xmm0, 0x168(%rbx)
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x588e
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x6(%rsp), %rcx
movq %r14, %rsi
callq 0x591c
movq 0x1c8(%rbx), %rax
leaq 0x20(%rsp), %r14
movapd (%r14), %xmm0
movq 0x10(%r14), %rcx
movq %rcx, 0x1c8(%rbx)
movupd 0x1b8(%rbx), %xmm1
movupd %xmm0, 0x1b8(%rbx)
leaq 0x40(%rsp), %rdi
movapd %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorpd %xmm0, %xmm0
movapd %xmm0, (%r14)
movq $0x0, 0x10(%r14)
callq 0x5ae8
movq %r14, %rdi
callq 0x5ae8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xd074
callq 0x3310
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x588e
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x6(%rsp), %rcx
movq %r14, %rsi
callq 0x591c
movq 0x1e0(%rbx), %rax
leaq 0x20(%rsp), %r14
movapd (%r14), %xmm0
movq 0x10(%r14), %rcx
movq %rcx, 0x1e0(%rbx)
movupd 0x1d0(%rbx), %xmm1
movupd %xmm0, 0x1d0(%rbx)
leaq 0x40(%rsp), %rdi
movapd %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorpd %xmm0, %xmm0
movapd %xmm0, (%r14)
movq $0x0, 0x10(%r14)
callq 0x5ae8
movq %r14, %rdi
callq 0x5ae8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xd108
callq 0x3310
testb %bpl, %bpl
je 0xd1c6
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %r15
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
callq 0x3290
xorpd 0x28f12(%rip), %xmm0    # 0x36040
leaq 0x38(%rsp), %rdx
movlpd %xmm0, (%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rcx
movq %r15, %rsi
callq 0x5b2e
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
movq %r14, %rsi
callq 0x591c
movq 0x1f8(%rbx), %rax
leaq 0x20(%rsp), %r14
movapd (%r14), %xmm0
movq 0x10(%r14), %rcx
movq %rcx, 0x1f8(%rbx)
movupd 0x1e8(%rbx), %xmm1
movupd %xmm0, 0x1e8(%rbx)
leaq 0x40(%rsp), %rdi
movapd %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorpd %xmm0, %xmm0
movapd %xmm0, (%r14)
movq $0x0, 0x10(%r14)
callq 0x5ae8
movq %r14, %rdi
callq 0x5ae8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xd1c6
callq 0x3310
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %r15
xorpd %xmm0, %xmm0
callq 0x3290
leaq 0x38(%rsp), %rdx
movsd %xmm0, (%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rcx
movq %r15, %rsi
callq 0x5b2e
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
movq %r14, %rsi
callq 0x591c
movq 0x210(%rbx), %rax
leaq 0x20(%rsp), %r14
movapd (%r14), %xmm0
movq 0x10(%r14), %rcx
movq %rcx, 0x210(%rbx)
movupd 0x200(%rbx), %xmm1
movupd %xmm0, 0x200(%rbx)
leaq 0x40(%rsp), %rdi
movapd %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorpd %xmm0, %xmm0
movapd %xmm0, (%r14)
movq $0x0, 0x10(%r14)
callq 0x5ae8
movq %r14, %rdi
callq 0x5ae8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xd26f
callq 0x3310
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x588e
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x6(%rsp), %rcx
movq %r14, %rsi
callq 0x591c
movq 0x228(%rbx), %rax
leaq 0x20(%rsp), %r14
movapd (%r14), %xmm0
movq 0x10(%r14), %rcx
movq %rcx, 0x228(%rbx)
movupd 0x218(%rbx), %xmm1
movupd %xmm0, 0x218(%rbx)
leaq 0x40(%rsp), %rdi
movapd %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorpd %xmm0, %xmm0
movapd %xmm0, (%r14)
movq $0x0, 0x10(%r14)
callq 0x5ae8
movq %r14, %rdi
callq 0x5ae8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xd303
callq 0x3310
movq 0x58(%rbx), %r15
movq 0x60(%rbx), %r14
movslq 0x1c(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x588e
subq %r15, %r14
sarq $0x5, %r14
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x6(%rsp), %rcx
movq %r14, %rsi
callq 0x591c
movq 0x240(%rbx), %rax
leaq 0x20(%rsp), %r14
movaps (%r14), %xmm0
movq 0x10(%r14), %rcx
movq %rcx, 0x240(%rbx)
movups 0x230(%rbx), %xmm1
movups %xmm0, 0x230(%rbx)
leaq 0x40(%rsp), %rdi
movaps %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
callq 0x5ae8
movq %r14, %rdi
callq 0x5ae8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xd39c
callq 0x3310
movslq 0x1c(%rbx), %rsi
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd 0x28eb1(%rip), %xmm1    # 0x36260
divsd %xmm0, %xmm1
leaq 0x20(%rsp), %rdx
movsd %xmm1, (%rdx)
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rcx
callq 0x5b2e
movl 0x20(%rbx), %edx
testl %edx, %edx
jle 0xd401
xorl %r15d, %r15d
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movsd 0x28e7b(%rip), %xmm0    # 0x36260
callq 0x1d2d5
movq 0x90(%rbx), %rcx
movl %eax, (%rcx,%r15,4)
incq %r15
movslq 0x20(%rbx), %rdx
cmpq %rdx, %r15
jl 0xd3da
cmpl $0x0, 0x1c(%rbx)
jle 0xd51a
movl 0x24(%rbx), %eax
xorl %r12d, %r12d
leaq 0x20(%rsp), %r14
leaq 0x8(%rsp), %r15
movslq %eax, %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x6a48
movq 0xc0(%rbx), %rax
leaq (%r12,%r12,2), %r13
movq (%rax,%r13,8), %rdi
movapd 0x20(%rsp), %xmm0
movupd %xmm0, (%rax,%r13,8)
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rax,%r13,8)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %rdi, %rdi
je 0xd47a
callq 0x3310
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd47a
callq 0x3310
movl 0x24(%rbx), %eax
testl %eax, %eax
jle 0xd507
movq %r12, 0x60(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x28(%rbx), %rax
movslq (%rax,%r12,4), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x6a48
movq 0xa8(%rbx), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp), %rdi
movapd 0x20(%rsp), %xmm0
movupd %xmm0, (%rax,%rbp)
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rax,%rbp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %rdi, %rdi
je 0xd4f2
callq 0x3310
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd4f2
callq 0x3310
incq %r12
movslq 0x24(%rbx), %rax
addq $0x18, %rbp
cmpq %rax, %r12
jl 0xd48f
movq 0x60(%rsp), %r12
incq %r12
movslq 0x1c(%rbx), %rcx
cmpq %rcx, %r12
jl 0xd41b
movl 0x20(%rbx), %edx
testl %edx, %edx
jle 0xd5d1
movq 0x40(%rbx), %rax
movl 0x24(%rbx), %esi
xorl %ecx, %ecx
testl %esi, %esi
jle 0xd5c2
leaq (%rcx,%rcx,2), %rdx
shlq $0x3, %rdx
addq (%rbx), %rdx
movl (%rax,%rcx,4), %r8d
xorl %edi, %edi
testl %r8d, %r8d
jle 0xd5b4
movq (%rdx), %r9
leaq (%rdi,%rdi,2), %rsi
movq (%r9,%rsi,8), %r9
movq 0x90(%rbx), %r10
movq 0xa8(%rbx), %r11
addq $-0x18, %r11
movq 0xc0(%rbx), %r14
addq $-0x18, %r14
xorl %r15d, %r15d
movslq (%r9,%r15,4), %r12
testq %r12, %r12
je 0xd5a6
movslq (%r10,%rcx,4), %r8
leaq (%r8,%r8,2), %r8
movq (%r11,%r8,8), %r8
movq (%r8,%rsi,8), %r8
incl -0x4(%r8,%r12,4)
movslq (%r10,%rcx,4), %r8
leaq (%r8,%r8,2), %r8
movq (%r14,%r8,8), %r8
incl (%r8,%rdi,4)
movl (%rax,%rcx,4), %r8d
incq %r15
movslq %r8d, %r12
cmpq %r12, %r15
jl 0xd574
movl 0x24(%rbx), %esi
incq %rdi
movslq %esi, %r9
cmpq %r9, %rdi
jl 0xd544
movl 0x20(%rbx), %edx
incq %rcx
movslq %edx, %rdi
cmpq %rdi, %rcx
jl 0xd52b
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xd5e0
callq 0x3310
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd605
jmp 0xd60f
jmp 0xd60f
jmp 0xd605
jmp 0xd60f
jmp 0xd605
jmp 0xd60f
jmp 0xd605
jmp 0xd60f
jmp 0xd605
jmp 0xd60f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
jmp 0xd620
movq %rax, %rbx
jmp 0xd62a
jmp 0xd618
jmp 0xd618
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xd62a
callq 0x3310
movq %rbx, %rdi
callq 0x3580