// File: /workspace/github_cpp_makefile_star2_O2/bobverity[P]MavericK/MCMCobject_noAdmixture.cpp
// Function: MCMCobject_noAdmixture::MCMCobject_noAdmixture(globals&, int, int, int, int, double)
MCMCobject_noAdmixture::MCMCobject_noAdmixture(globals &globals, int _Kindex, int _burnin, int _samples, int _thinning, double _beta) {
    
    // copy some values over from globals object
    outputQmatrix_pop_on = globals.outputQmatrix_pop_on;
    
    Kindex = _Kindex;
    K = globals.Kmin+Kindex;
    n = globals.n;
    loci = globals.loci;
    J = globals.J;
    ploidy_vec = globals.ploidy_vec;
    data = globals.data;
    lambda = globals.lambda;
    beta = _beta;
    uniquePops = globals.uniquePops;
    
    burnin = _burnin;
    samples = _samples;
    thinning = _thinning;
    
    group = vector<int>(n,1);
    
    // initialise allele counts and frequencies
    alleleCounts = vector< vector< vector<int> > >(K);
    alleleCountsTotals = vector< vector<int> >(K);
    alleleFreqs = vector< vector< vector<double> > >(K);
    for (int k=0; k<K; k++) {
        alleleCounts[k] = vector< vector<int> >(loci);
        alleleCountsTotals[k] = vector<int>(loci);
        alleleFreqs[k] = vector< vector<double> >(loci);
        for (int l=0; l<loci; l++) {
            alleleCounts[k][l] = vector<int>(J[l]);
            alleleFreqs[k][l] = vector<double>(J[l]);
        }
    }
    
    // initialise objects for calculating assignment probabilities
    logProbVec = vector<double>(K);
    logProbVecSum = 0;  // (used in Qmatrix calculation)
    logProbVecMax = 0;
    probVec = vector<double>(K);
    probVecSum = 0;
    
    // initialise Qmatrices
    logQmatrix_ind_old = vector< vector<double> >(n, vector<double>(K));
    logQmatrix_ind_new = vector< vector<double> >(n, vector<double>(K));
    logQmatrix_ind_running = vector< vector<double> >(n, vector<double>(K));
    
    logQmatrix_ind = vector< vector<double> >(n, vector<double>(K));
    Qmatrix_ind = vector< vector<double> >(n, vector<double>(K));
    Qmatrix_pop = vector< vector<double> >(uniquePops.size(), vector<double>(K));
    
    // initialise objects for Hungarian algorithm
    costMat = vector< vector<double> >(K, vector<double>(K));
    bestPermOrder = vector<int>(K);
    
    edgesLeft = vector<int>(K);
    edgesRight = vector<int>(K);
    blockedLeft = vector<int>(K);
    blockedRight = vector<int>(K);
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movsd %xmm0, 0x40(%rsp)
movl %r9d, 0x38(%rsp)
movl %r8d, 0x64(%rsp)
movl %ecx, 0x60(%rsp)
movl %edx, %r15d
movq %rsi, %r13
movq %rdi, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x28(%rdi), %rbx
leaq 0x40(%rdi), %rax
movq %rax, 0xe8(%rsp)
leaq 0x58(%rdi), %rax
movq %rax, 0xe0(%rsp)
addq $0x90, %rdi
leaq 0xa8(%r12), %rax
movq %rax, 0x58(%rsp)
leaq 0xc0(%r12), %rax
movq %rax, 0xd0(%rsp)
leaq 0xd8(%r12), %rax
movq %rax, 0x50(%rsp)
movups %xmm0, 0x130(%r12)
andq $0x0, 0x140(%r12)
leaq 0x170(%r12), %rax
movq %rax, 0xc8(%rsp)
movups %xmm0, 0x170(%r12)
andq $0x0, 0x180(%r12)
leaq 0x198(%r12), %rax
movq %rax, 0xc0(%rsp)
andq $0x0, 0x1a8(%r12)
movups %xmm0, 0x198(%r12)
movups %xmm0, 0x28(%r12)
movups %xmm0, 0x38(%r12)
movups %xmm0, 0x48(%r12)
movups %xmm0, 0x58(%r12)
andq $0x0, 0x68(%r12)
leaq 0x1b8(%r12), %r14
leaq 0x1d0(%r12), %rbp
leaq 0x1e8(%r12), %rax
movq %rax, 0xb0(%rsp)
leaq 0x200(%r12), %rax
movq %rax, 0xa8(%rsp)
leaq 0x218(%r12), %rax
movq %rax, 0xa0(%rsp)
leaq 0x230(%r12), %rax
movq %rax, 0x98(%rsp)
leaq 0x248(%r12), %rax
movq %rax, 0x88(%rsp)
leaq 0x278(%r12), %rax
movq %rax, 0x80(%rsp)
leaq 0x290(%r12), %rax
movq %rax, 0x78(%rsp)
leaq 0x2a8(%r12), %rax
movq %rax, 0x70(%rsp)
leaq 0x2c0(%r12), %rax
movq %rax, 0x90(%rsp)
leaq 0x2d8(%r12), %rax
movq %rax, 0x68(%rsp)
movl $0x90, %edx
movq %rdi, 0xd8(%rsp)
xorl %esi, %esi
callq 0x3200
movl $0x138, %edx            # imm = 0x138
movq %r14, 0xb8(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x3200
movb 0x2c3f(%r13), %al
movb %al, 0x80(%r12)
movl %r15d, 0x18(%r12)
addl 0x2bc8(%r13), %r15d
movl %r15d, 0x1c(%r12)
movq %rbx, %rdi
movq %rbx, 0xf0(%rsp)
movq 0x2d18(%r13), %rax
movq %rax, 0x20(%r12)
leaq 0x2d20(%r13), %rsi
callq 0x969e
leaq 0x2cd0(%r13), %rsi
movq 0xe8(%rsp), %rdi
callq 0x969e
leaq 0x2d00(%r13), %rsi
movq %r12, %rdi
callq 0x95d6
movsd 0x2c50(%r13), %xmm0
movsd %xmm0, 0x70(%r12)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x78(%r12)
addq $0x2c88, %r13           # imm = 0x2C88
movq 0xe0(%rsp), %rdi
movq %r13, %rsi
callq 0x9760
movl 0x60(%rsp), %eax
movl %eax, 0x84(%r12)
movl 0x64(%rsp), %eax
movl %eax, 0x88(%r12)
movl 0x38(%rsp), %eax
movl %eax, 0x8c(%r12)
movslq 0x20(%r12), %rsi
leaq 0x8(%rsp), %rdx
movl $0x1, (%rdx)
leaq 0x20(%rsp), %rdi
leaq 0x6(%rsp), %rcx
callq 0x5f08
leaq 0x20(%rsp), %r15
movq 0xd8(%rsp), %rdi
movq %r15, %rsi
callq 0x6266
movq %r15, %rdi
callq 0x61d0
movslq 0x1c(%r12), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x9820
leaq 0x20(%rsp), %r15
movq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0xa1dc
movq %r15, %rdi
callq 0x9872
movslq 0x1c(%r12), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x9894
movq %rbp, 0x38(%rsp)
leaq 0x20(%rsp), %r15
movq 0xd0(%rsp), %rdi
movq %r15, %rsi
callq 0xa27c
movq %r15, %rdi
callq 0x98e6
movslq 0x1c(%r12), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5014
leaq 0x20(%rsp), %r13
movq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x54e6
movq %r13, %rdi
callq 0x5066
xorl %ebx, %ebx
leaq 0x8(%rsp), %r15
movq %r12, 0x48(%rsp)
movq 0xf0(%rsp), %r14
movslq 0x1c(%r12), %rsi
cmpq %rsi, %rbx
jge 0xac38
movslq 0x24(%r12), %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x9894
imulq $0x18, %rbx, %rbp
movq 0xa8(%r12), %rdi
addq %rbp, %rdi
movq %r13, %rsi
callq 0xa27c
movq %r13, %rdi
callq 0x98e6
movslq 0x24(%r12), %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x5f7c
movq %rbx, 0x40(%rsp)
movq 0xc0(%r12), %rdi
addq %rbp, %rdi
movq %r13, %rsi
callq 0x6266
movq %r13, %rdi
callq 0x61d0
movslq 0x24(%r12), %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x5088
movq 0x50(%rsp), %rax
movq (%rax), %rdi
addq %rbp, %rdi
movq %r13, %rsi
callq 0x5566
movq %r13, %rdi
callq 0x50da
xorl %r12d, %r12d
xorl %ebx, %ebx
movq 0x48(%rsp), %rax
movslq 0x24(%rax), %rax
cmpq %rax, %rbx
jge 0xac26
movq (%r14), %rax
movslq (%rax,%rbx,4), %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x5f7c
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbp), %rdi
addq %r12, %rdi
movq %r13, %rsi
callq 0x6266
movq %r13, %rdi
callq 0x61d0
movq (%r14), %rax
movslq (%rax,%rbx,4), %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x4f6c
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbp), %rdi
addq %r12, %rdi
movq %r13, %rsi
callq 0x55b8
movq %r13, %rdi
callq 0x51a2
incq %rbx
addq $0x18, %r12
jmp 0xabad
movq 0x40(%rsp), %rbx
incq %rbx
movq 0x48(%rsp), %r12
jmp 0xab10
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq 0x38(%rsp), %rbp
callq 0x4f6c
leaq 0x20(%rsp), %r15
movq 0xc8(%rsp), %rdi
movq %r15, %rsi
callq 0x55b8
movq %r15, %rdi
callq 0x51a2
xorps %xmm0, %xmm0
movups %xmm0, 0x188(%r12)
movslq 0x1c(%r12), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x4f6c
leaq 0x20(%rsp), %r15
movq 0xc0(%rsp), %rdi
movq %r15, %rsi
callq 0x55b8
movq %r15, %rdi
callq 0x51a2
andq $0x0, 0x1b0(%r12)
movslq 0x20(%r12), %r15
movslq 0x1c(%r12), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x4f6c
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
movq %r15, %rsi
callq 0x4fbe
leaq 0x20(%rsp), %r15
movq 0xb8(%rsp), %rdi
movq %r15, %rsi
callq 0x5566
movq %r15, %rdi
callq 0x50da
leaq 0x8(%rsp), %rdi
callq 0x51a2
movslq 0x20(%r12), %r15
movslq 0x1c(%r12), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x4f6c
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
movq %r15, %rsi
callq 0x4fbe
leaq 0x20(%rsp), %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x5566
movq %r15, %rdi
callq 0x50da
leaq 0x8(%rsp), %rdi
callq 0x51a2
movslq 0x20(%r12), %r15
movslq 0x1c(%r12), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x4f6c
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
movq %r15, %rsi
callq 0x4fbe
leaq 0x20(%rsp), %r15
movq 0xb0(%rsp), %rdi
movq %r15, %rsi
callq 0x5566
movq %r15, %rdi
callq 0x50da
leaq 0x8(%rsp), %rdi
callq 0x51a2
movslq 0x20(%r12), %r15
movslq 0x1c(%r12), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x4f6c
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
movq %r15, %rsi
callq 0x4fbe
leaq 0x20(%rsp), %r15
movq 0xa8(%rsp), %rdi
movq %r15, %rsi
callq 0x5566
movq %r15, %rdi
callq 0x50da
leaq 0x8(%rsp), %rdi
callq 0x51a2
movslq 0x20(%r12), %r15
movslq 0x1c(%r12), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x4f6c
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
movq %r15, %rsi
callq 0x4fbe
leaq 0x20(%rsp), %r15
movq 0xa0(%rsp), %rdi
movq %r15, %rsi
callq 0x5566
movq %r15, %rdi
callq 0x50da
leaq 0x8(%rsp), %rdi
callq 0x51a2
movq 0x58(%r12), %rbx
movq 0x60(%r12), %r15
movslq 0x1c(%r12), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x4f6c
subq %rbx, %r15
sarq $0x5, %r15
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
movq %r15, %rsi
callq 0x4fbe
leaq 0x20(%rsp), %r15
movq 0x98(%rsp), %rdi
movq %r15, %rsi
callq 0x5566
movq %r15, %rdi
callq 0x50da
leaq 0x8(%rsp), %rdi
callq 0x51a2
movslq 0x1c(%r12), %r15
leaq 0x8(%rsp), %rdi
leaq 0x6(%rsp), %rdx
movq %r15, %rsi
movq 0x90(%rsp), %rbx
callq 0x4f6c
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x7(%rsp), %rcx
movq %r15, %rsi
callq 0x4fbe
leaq 0x20(%rsp), %r15
movq 0x88(%rsp), %rdi
movq %r15, %rsi
callq 0x5566
movq %r15, %rdi
callq 0x50da
leaq 0x8(%rsp), %rdi
callq 0x51a2
movslq 0x1c(%r12), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5f7c
leaq 0x20(%rsp), %r15
movq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0x6266
movq %r15, %rdi
callq 0x61d0
movslq 0x1c(%r12), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5f7c
leaq 0x20(%rsp), %r15
movq 0x78(%rsp), %rdi
movq %r15, %rsi
callq 0x6266
movq %r15, %rdi
callq 0x61d0
movslq 0x1c(%r12), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5f7c
leaq 0x20(%rsp), %r15
movq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0x6266
movq %r15, %rdi
callq 0x61d0
movslq 0x1c(%r12), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5f7c
leaq 0x20(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6266
movq %r15, %rdi
callq 0x61d0
movslq 0x1c(%r12), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5f7c
leaq 0x20(%rsp), %rbx
movq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x6266
movq %rbx, %rdi
callq 0x61d0
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb055
jmp 0xb055
jmp 0xb055
jmp 0xb055
jmp 0xb055
jmp 0xb038
jmp 0xb055
jmp 0xb038
jmp 0xb055
jmp 0xb038
jmp 0xb055
jmp 0xb038
jmp 0xb055
jmp 0xb038
jmp 0xb055
jmp 0xb038
jmp 0xb055
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x51a2
jmp 0xb072
jmp 0xb055
jmp 0xb055
jmp 0xb055
jmp 0xb05e
jmp 0xb055
jmp 0xb055
jmp 0xb055
movq %rax, %rbx
jmp 0xb072
jmp 0xb05e
jmp 0xb065
movq %rax, %rbx
jmp 0xb06d
jmp 0xb065
movq %rax, %rbx
movq 0x48(%rsp), %r12
movq 0x38(%rsp), %rbp
leaq 0x130(%r12), %r15
leaq 0x260(%r12), %r13
leaq 0x108(%r12), %rax
movq %rax, 0x40(%rsp)
leaq 0xf0(%r12), %r14
movq 0x68(%rsp), %rdi
callq 0x61d0
movq 0x90(%rsp), %rdi
callq 0x61d0
movq 0x70(%rsp), %rdi
callq 0x61d0
movq 0x78(%rsp), %rdi
callq 0x61d0
movq 0x80(%rsp), %rdi
callq 0x61d0
movq %r13, %rdi
callq 0x61d0
movq 0x88(%rsp), %rdi
callq 0x50da
movq 0x98(%rsp), %rdi
callq 0x50da
movq 0xa0(%rsp), %rdi
callq 0x50da
movq 0xa8(%rsp), %rdi
callq 0x50da
movq 0xb0(%rsp), %rdi
callq 0x50da
movq %rbp, %rdi
callq 0x50da
movq 0xb8(%rsp), %rdi
callq 0x50da
movq 0xc0(%rsp), %rdi
callq 0x51a2
movq 0xc8(%rsp), %rdi
callq 0x51a2
movq %r15, %rdi
callq 0x51a2
movq 0x40(%rsp), %rdi
callq 0x98e6
movq %r14, %rdi
callq 0x9872
movq 0x50(%rsp), %rdi
callq 0x5066
movq 0xd0(%rsp), %rdi
callq 0x98e6
movq 0x58(%rsp), %rdi
callq 0x9872
movq 0xd8(%rsp), %rdi
callq 0x61d0
movq 0xe0(%rsp), %rdi
callq 0x995e
movq 0xe8(%rsp), %rdi
callq 0x61d0
movq 0xf0(%rsp), %rdi
callq 0x61d0
movq %r12, %rdi
callq 0x9872
movq %rbx, %rdi
callq 0x35a0