// File: /workspace/github_cpp_makefile_star2_O1/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 $0x78, %rsp
movl %esi, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x120(%rdi)
movslq 0x88(%rdi), %rsi
leaq 0x50(%rsp), %r14
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x5916
movq 0x130(%rbx), %rdi
movapd (%r14), %xmm0
movq 0x10(%r14), %rax
movq %rdi, (%r14)
movupd 0x138(%rbx), %xmm1
movupd %xmm0, 0x130(%rbx)
movq %rax, 0x140(%rbx)
movupd %xmm1, 0x8(%r14)
xorpd %xmm0, %xmm0
movapd %xmm0, (%r14)
movq $0x0, 0x10(%r14)
testq %rdi, %rdi
je 0xd38f
callq 0x3310
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xd39e
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 0x30(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x5916
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
leaq 0xe(%rsp), %rcx
movq %r14, %rsi
callq 0x59a0
xorpd %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movupd 0x1b8(%rbx), %xmm0
movq 0x1c8(%rbx), %rax
leaq 0x10(%rsp), %r14
movaps (%r14), %xmm1
movups %xmm1, 0x1b8(%rbx)
movq 0x10(%r14), %rcx
movq %rcx, 0x1c8(%rbx)
movq 0x10(%rdi), %rcx
movq %rax, 0x10(%rdi)
movapd (%rdi), %xmm1
movapd %xmm0, (%rdi)
movapd %xmm1, (%r14)
movq %rcx, 0x10(%r14)
callq 0x5b7a
movq %r14, %rdi
callq 0x5b7a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xd465
callq 0x3310
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %rsi
leaq 0x30(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x5916
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
leaq 0xe(%rsp), %rcx
movq %r14, %rsi
callq 0x59a0
xorpd %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movupd 0x1d0(%rbx), %xmm0
movq 0x1e0(%rbx), %rax
leaq 0x10(%rsp), %r14
movaps (%r14), %xmm1
movups %xmm1, 0x1d0(%rbx)
movq 0x10(%r14), %rcx
movq %rcx, 0x1e0(%rbx)
movq 0x10(%rdi), %rcx
movq %rax, 0x10(%rdi)
movapd (%rdi), %xmm1
movapd %xmm0, (%rdi)
movapd %xmm1, (%r14)
movq %rcx, 0x10(%r14)
callq 0x5b7a
movq %r14, %rdi
callq 0x5b7a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xd507
callq 0x3310
testb %bpl, %bpl
je 0xd5d3
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %r15
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
callq 0x3290
xorpd 0x29b13(%rip), %xmm0    # 0x37040
leaq 0x48(%rsp), %rdx
movlpd %xmm0, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rcx
movq %r15, %rsi
callq 0x5bba
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
leaq 0xf(%rsp), %rcx
movq %r14, %rsi
callq 0x59a0
xorpd %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movupd 0x1e8(%rbx), %xmm0
movq 0x1f8(%rbx), %rax
leaq 0x10(%rsp), %r14
movaps (%r14), %xmm1
movups %xmm1, 0x1e8(%rbx)
movq 0x10(%r14), %rcx
movq %rcx, 0x1f8(%rbx)
movq 0x10(%rdi), %rcx
movq %rax, 0x10(%rdi)
movapd (%rdi), %xmm1
movapd %xmm0, (%rdi)
movapd %xmm1, (%r14)
movq %rcx, 0x10(%r14)
callq 0x5b7a
movq %r14, %rdi
callq 0x5b7a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xd5d3
callq 0x3310
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %r15
xorpd %xmm0, %xmm0
callq 0x3290
leaq 0x48(%rsp), %rdx
movsd %xmm0, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rcx
movq %r15, %rsi
callq 0x5bba
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
leaq 0xf(%rsp), %rcx
movq %r14, %rsi
callq 0x59a0
xorpd %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movupd 0x200(%rbx), %xmm0
movq 0x210(%rbx), %rax
leaq 0x10(%rsp), %r14
movaps (%r14), %xmm1
movups %xmm1, 0x200(%rbx)
movq 0x10(%r14), %rcx
movq %rcx, 0x210(%rbx)
movq 0x10(%rdi), %rcx
movq %rax, 0x10(%rdi)
movapd (%rdi), %xmm1
movapd %xmm0, (%rdi)
movapd %xmm1, (%r14)
movq %rcx, 0x10(%r14)
callq 0x5b7a
movq %r14, %rdi
callq 0x5b7a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xd68a
callq 0x3310
movslq 0x20(%rbx), %r14
movslq 0x1c(%rbx), %rsi
leaq 0x30(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x5916
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
leaq 0xe(%rsp), %rcx
movq %r14, %rsi
callq 0x59a0
xorpd %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movupd 0x218(%rbx), %xmm0
movq 0x228(%rbx), %rax
leaq 0x10(%rsp), %r14
movaps (%r14), %xmm1
movups %xmm1, 0x218(%rbx)
movq 0x10(%r14), %rcx
movq %rcx, 0x228(%rbx)
movq 0x10(%rdi), %rcx
movq %rax, 0x10(%rdi)
movapd (%rdi), %xmm1
movapd %xmm0, (%rdi)
movapd %xmm1, (%r14)
movq %rcx, 0x10(%r14)
callq 0x5b7a
movq %r14, %rdi
callq 0x5b7a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xd72c
callq 0x3310
movq 0x58(%rbx), %r15
movq 0x60(%rbx), %r14
movslq 0x1c(%rbx), %rsi
leaq 0x30(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x5916
subq %r15, %r14
sarq $0x5, %r14
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
leaq 0xe(%rsp), %rcx
movq %r14, %rsi
callq 0x59a0
xorpd %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movups 0x230(%rbx), %xmm0
movq 0x240(%rbx), %rax
leaq 0x10(%rsp), %r14
movaps (%r14), %xmm1
movups %xmm1, 0x230(%rbx)
movq 0x10(%r14), %rcx
movq %rcx, 0x240(%rbx)
movq 0x10(%rdi), %rcx
movq %rax, 0x10(%rdi)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movaps %xmm1, (%r14)
movq %rcx, 0x10(%r14)
callq 0x5b7a
movq %r14, %rdi
callq 0x5b7a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xd7d5
callq 0x3310
movslq 0x1c(%rbx), %rsi
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd 0x29a78(%rip), %xmm1    # 0x37260
divsd %xmm0, %xmm1
leaq 0x10(%rsp), %rdx
movsd %xmm1, (%rdx)
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rcx
callq 0x5bba
cmpl $0x0, 0x20(%rbx)
jle 0xd839
xorl %r15d, %r15d
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movsd 0x29a43(%rip), %xmm0    # 0x37260
callq 0x1d629
movq 0x90(%rbx), %rcx
movl %eax, (%rcx,%r15,4)
incq %r15
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jl 0xd812
cmpl $0x0, 0x1c(%rbx)
jle 0xd973
xorl %r12d, %r12d
leaq 0x10(%rsp), %r14
leaq 0x30(%rsp), %r15
movslq 0x24(%rbx), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x6b04
movq 0xc0(%rbx), %rax
leaq (%r12,%r12,2), %r13
movq (%rax,%r13,8), %rdi
movapd 0x10(%rsp), %xmm0
movupd 0x8(%rax,%r13,8), %xmm1
movupd %xmm0, (%rax,%r13,8)
movq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rax,%r13,8)
movq %rdi, 0x10(%rsp)
movupd %xmm1, 0x18(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0xd8b3
callq 0x3310
movq %r12, 0x70(%rsp)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xd8c7
callq 0x3310
cmpl $0x0, 0x24(%rbx)
jle 0xd95e
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x28(%rbx), %rax
movslq (%rax,%r12,4), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x6b04
movq 0xa8(%rbx), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp), %rdi
movapd 0x10(%rsp), %xmm0
movupd 0x8(%rax,%rbp), %xmm1
movupd %xmm0, (%rax,%rbp)
movq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rax,%rbp)
movq %rdi, 0x10(%rsp)
movupd %xmm1, 0x18(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0xd93b
callq 0x3310
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xd94a
callq 0x3310
incq %r12
movslq 0x24(%rbx), %rax
addq $0x18, %rbp
cmpq %rax, %r12
jl 0xd8d6
movq 0x70(%rsp), %r12
incq %r12
movslq 0x1c(%rbx), %rax
cmpq %rax, %r12
jl 0xd850
cmpl $0x0, 0x20(%rbx)
jle 0xda21
movq 0x40(%rbx), %rax
xorl %ecx, %ecx
cmpl $0x0, 0x24(%rbx)
jle 0xda11
leaq (%rcx,%rcx,2), %rdx
shlq $0x3, %rdx
addq (%rbx), %rdx
xorl %esi, %esi
cmpl $0x0, (%rax,%rcx,4)
jle 0xda05
movq (%rdx), %r8
leaq (%rsi,%rsi,2), %rdi
movq (%r8,%rdi,8), %r8
movq 0x90(%rbx), %r9
movq 0xa8(%rbx), %r10
addq $-0x18, %r10
movq 0xc0(%rbx), %r11
addq $-0x18, %r11
xorl %r14d, %r14d
movslq (%r8,%r14,4), %r15
testq %r15, %r15
je 0xd9f9
movslq (%r9,%rcx,4), %r12
leaq (%r12,%r12,2), %r12
movq (%r10,%r12,8), %r12
movq (%r12,%rdi,8), %r12
incl -0x4(%r12,%r15,4)
movslq (%r9,%rcx,4), %r15
leaq (%r15,%r15,2), %r15
movq (%r11,%r15,8), %r15
incl (%r15,%rsi,4)
incq %r14
movslq (%rax,%rcx,4), %r15
cmpq %r15, %r14
jl 0xd9cb
incq %rsi
movslq 0x24(%rbx), %rdi
cmpq %rdi, %rsi
jl 0xd99a
incq %rcx
movslq 0x20(%rbx), %rdx
cmpq %rdx, %rcx
jl 0xd983
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xda30
callq 0x3310
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xda55
jmp 0xda5f
jmp 0xda5f
jmp 0xda55
jmp 0xda5f
jmp 0xda55
jmp 0xda5f
jmp 0xda55
jmp 0xda5f
jmp 0xda55
jmp 0xda5f
movq %rax, %rbx
movq 0x30(%rsp), %rdi
jmp 0xda70
movq %rax, %rbx
jmp 0xda7a
jmp 0xda68
jmp 0xda68
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xda7a
callq 0x3310
movq %rbx, %rdi
callq 0x3580