// File: /workspace/github_cpp_makefile_star2_O3/bobverity[P]MavericK/mainMCMC.cpp
// Function: mainMCMC_admixture(globals&, int)
void mainMCMC_admixture(globals &globals, int Kindex) {
    int K = globals.Kmin+Kindex;
    
    // define temporary Qmatrix objects for calculating mean and sd over mainRepeats
    vector< vector< vector<double> > > Qmatrix_gene_allReps(globals.geneCopies, vector< vector<double> >(K, vector<double>(globals.mainRepeats)));
    vector< vector< vector<double> > > Qmatrix_ind_allReps(globals.n, vector< vector<double> >(K, vector<double>(globals.mainRepeats)));
    vector< vector< vector<double> > > Qmatrix_pop_allReps(globals.uniquePops.size(), vector< vector<double> >(K, vector<double>(globals.mainRepeats)));
    
    // define MCMC object
    MCMCobject_admixture mainMCMC(globals, Kindex, globals.mainBurnin, globals.mainSamples, globals.mainThinning, 1.0);
    
    // repeat analysis multiple times
    for (int mainRep=0; mainRep<globals.mainRepeats; mainRep++) {
        coutAndLog("  analysis "+to_string((long long)mainRep+1)+" of "+to_string((long long)globals.mainRepeats)+"\n", globals.outputLog_on, globals.outputLog_fileStream);
        
        // perform MCMC
        if (mainRep==0) {
            mainMCMC.reset(true);
        } else {
            mainMCMC.reset(false);
        }
		mainMCMC.perform_MCMC(globals, true, false, globals.fixLabels_on, globals.outputLikelihood_on, globals.outputPosteriorGrouping_on, mainRep);
        
        // save Qmatrix values
        if (globals.fixLabels_on) {
            for (int i=0; i<globals.geneCopies; i++) {
                for (int k=0; k<K; k++) {
                    Qmatrix_gene_allReps[i][k][mainRep] = mainMCMC.Qmatrix_gene[i][k];
                    /*
                    if (k!=0)
                        globals.junk_fileStream << "\t";
                    globals.junk_fileStream << mainMCMC.Qmatrix_gene[i][k];
                    */
                }
                //globals.junk_fileStream << "\n";
            }
            for (int i=0; i<globals.n; i++) {
                for (int k=0; k<K; k++) {
                    Qmatrix_ind_allReps[i][k][mainRep] = mainMCMC.Qmatrix_ind[i][k];
                }
            }
            if (globals.outputQmatrix_pop_on) {
                for (int i=0; i<int(globals.uniquePops.size()); i++) {
                    for (int k=0; k<K; k++) {
                        Qmatrix_pop_allReps[i][k][mainRep] = mainMCMC.Qmatrix_pop[i][k];
                    }
                }
            }
        }
        
        // save harmonic mean of marginal likelihoods
        globals.logEvidence_harmonic[Kindex][mainRep] = mainMCMC.harmonic;
        
        // calculate Structure estimator from joint likelihoods
        globals.structure_loglike_mean[Kindex][mainRep] = mainMCMC.logLikeJoint_sum/double(globals.mainSamples);
        globals.structure_loglike_var[Kindex][mainRep] = mainMCMC.logLikeJoint_sumSquared/double(globals.mainSamples) - globals.structure_loglike_mean[Kindex][mainRep]*globals.structure_loglike_mean[Kindex][mainRep];
        globals.logEvidence_structure[Kindex][mainRep] = globals.structure_loglike_mean[Kindex][mainRep] - 0.5*globals.structure_loglike_var[Kindex][mainRep];
        
        // calculate elements of Evanno's delta K for the *previous* iteration
        if (Kindex>0)
            globals.L_1[Kindex][mainRep] = globals.logEvidence_structure[Kindex][mainRep]-globals.logEvidence_structure[Kindex-1][mainRep];
        if (Kindex>1) {
            globals.L_2[Kindex-1][mainRep] = abs(globals.L_1[Kindex][mainRep]-globals.L_1[Kindex-1][mainRep]);
        }
        
    }
    
    // save Qmatrices
    if (globals.fixLabels_on) {
        for (int i=0; i<globals.geneCopies; i++) {
            for (int k=0; k<K; k++) {
                globals.Qmatrix_gene[Kindex][i][k] = mean(Qmatrix_gene_allReps[i][k]);
                globals.QmatrixError_gene[Kindex][i][k] = sqrt(var(Qmatrix_gene_allReps[i][k])/double(globals.mainRepeats));
            }
        }
        for (int i=0; i<globals.n; i++) {
            for (int k=0; k<K; k++) {
                globals.Qmatrix_ind[Kindex][i][k] = mean(Qmatrix_ind_allReps[i][k]);
                globals.QmatrixError_ind[Kindex][i][k] = sqrt(var(Qmatrix_ind_allReps[i][k]));
            }
        }
        if (globals.outputQmatrix_pop_on) {
            for (int i=0; i<int(globals.uniquePops.size()); i++) {
                for (int k=0; k<K; k++) {
                    globals.Qmatrix_pop[Kindex][i][k] = mean(Qmatrix_pop_allReps[i][k]);
                    globals.QmatrixError_pop[Kindex][i][k] = sqrt(var(Qmatrix_pop_allReps[i][k]));
                }
            }
        }
    }
    
    // calculate grand mean and standard error of harmonic mean estimator
    globals.logEvidence_harmonic_grandMean[Kindex] = mean(globals.logEvidence_harmonic[Kindex]);
    if (globals.mainRepeats>1) {
        globals.logEvidence_harmonic_grandSE[Kindex] = sqrt(var(globals.logEvidence_harmonic[Kindex], 0, true)/globals.mainRepeats);
    }
    
    // calculate grand mean and standard error of Structure estimator
    globals.logEvidence_structure_grandMean[Kindex] = mean(globals.logEvidence_structure[Kindex]);
    if (globals.mainRepeats>1) {
        globals.logEvidence_structure_grandSE[Kindex] = sqrt(var(globals.logEvidence_structure[Kindex], 0, true)/globals.mainRepeats);
    }
    
    // finalise calculation of Evanno's delta K for *previous* iteration
    if (Kindex>1) {
        globals.delta_K[Kindex-1] = mean(globals.L_2[Kindex-1])/sqrt(var(globals.logEvidence_structure[Kindex-1], 0, true));
    }
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x538, %rsp            # imm = 0x538
movl %esi, %ebp
movq %rdi, %r14
movl 0x2bc8(%rdi), %r12d
addl %esi, %r12d
movslq 0x2d50(%rdi), %rbx
movslq 0x2c0c(%rdi), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x588e
movslq %r12d, %rsi
leaq 0x150(%rsp), %rdi
leaq 0x20(%rsp), %rdx
leaq 0x80(%rsp), %rcx
movq %rsi, 0x18(%rsp)
callq 0x591c
leaq 0x138(%rsp), %rdi
leaq 0x150(%rsp), %rdx
leaq 0xa8(%rsp), %rcx
movq %rbx, %rsi
callq 0x1a4e4
leaq 0x150(%rsp), %rdi
callq 0x5ae8
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19515
callq 0x3310
movslq 0x2d18(%r14), %rbx
movslq 0x2c0c(%r14), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x588e
leaq 0x150(%rsp), %rdi
leaq 0x20(%rsp), %rdx
leaq 0x80(%rsp), %rcx
movq 0x18(%rsp), %rsi
callq 0x591c
leaq 0x120(%rsp), %rdi
leaq 0x150(%rsp), %rdx
leaq 0xa8(%rsp), %rcx
movq %rbx, %rsi
callq 0x1a4e4
leaq 0x150(%rsp), %rdi
callq 0x5ae8
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1958d
callq 0x3310
movq 0x2c90(%r14), %rbx
subq 0x2c88(%r14), %rbx
movslq 0x2c0c(%r14), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x588e
leaq 0x150(%rsp), %rdi
leaq 0x20(%rsp), %rdx
leaq 0x80(%rsp), %rcx
movq 0x18(%rsp), %rsi
callq 0x591c
sarq $0x5, %rbx
leaq 0x108(%rsp), %rdi
leaq 0x150(%rsp), %rdx
leaq 0xa8(%rsp), %rcx
movq %rbx, %rsi
callq 0x1a4e4
leaq 0x150(%rsp), %rdi
callq 0x5ae8
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19610
callq 0x3310
movl 0x2c10(%r14), %ecx
movl 0x2c14(%r14), %r8d
movl 0x2c18(%r14), %r9d
leaq 0x150(%rsp), %rdi
movsd 0x1cc2b(%rip), %xmm0    # 0x36260
movq %r14, %rsi
movl %ebp, %edx
callq 0x6f68
cmpl $0x0, 0x2c0c(%r14)
movslq %ebp, %rax
movq %rax, 0x8(%rsp)
movl %r12d, 0x14(%rsp)
jle 0x19d0f
leaq 0x970(%r14), %rax
movq %rax, 0xd8(%rsp)
movl %ebp, %eax
movq %rax, 0xd0(%rsp)
leal -0x1(%rbp), %eax
movl %r12d, %r15d
xorl %r13d, %r13d
shlq $0x3, %rax
movq %rax, 0xc8(%rsp)
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %rbp, 0xe0(%rsp)
leaq 0x1(%r13), %rsi
movl $0x1, %ebx
cmpq $0x9, %r13
leaq 0x90(%rsp), %r12
leaq 0xa8(%rsp), %rbp
jb 0x196fe
movl $0x4, %ebx
movq %rsi, %rcx
cmpq $0x63, %rcx
jbe 0x196f7
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x196fc
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x196fe
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %ebx
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x196c1
addl $-0x3, %ebx
jmp 0x196fe
addl $-0x2, %ebx
jmp 0x196fe
decl %ebx
movq %rsi, 0xa0(%rsp)
movl %ebx, %esi
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq %rbp, %rdi
movl $0x2d, %edx
callq 0x33a0
movq 0xa8(%rsp), %rdi
movl %ebx, %esi
movq 0xa0(%rsp), %rdx
callq 0x6d20
movl $0xb, %r8d
movq %rbp, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x1d450(%rip), %rcx     # 0x36ba0
callq 0x3370
movq %r12, 0x80(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x19781
movq %rdx, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
jmp 0x1978b
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
leaq 0x50(%rsp), %rbx
movq 0x8(%rax), %rdx
movq %rdx, 0x88(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x80(%rsp), %rdi
leaq 0x1d3f2(%rip), %rsi     # 0x36bac
callq 0x35e0
movq %rbx, 0x40(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movabsq $0x346dc5d63886594b, %rsi # imm = 0x346DC5D63886594B
je 0x197ec
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x197f4
movupd (%rcx), %xmm0
movupd %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movslq 0x2c0c(%r14), %rbp
movq %rbp, %r12
negq %r12
cmovsq %rbp, %r12
movl $0x1, %ebx
cmpq $0xa, %r12
jb 0x1986d
movl $0x4, %ebx
movq %r12, %rcx
cmpq $0x63, %rcx
jbe 0x19866
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x1986b
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x1986d
movq %rcx, %rax
mulq %rsi
shrq $0xb, %rdx
addl $0x4, %ebx
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x19830
addl $-0x3, %ebx
jmp 0x1986d
addl $-0x2, %ebx
jmp 0x1986d
decl %ebx
shrq $0x3f, %rbp
leal (%rbx,%rbp), %esi
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x60(%rsp), %rdi
movl $0x2d, %edx
callq 0x33a0
addq 0x60(%rsp), %rbp
movq %rbp, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x6d20
movq 0x40(%rsp), %rcx
movl $0xf, %edi
leaq 0x50(%rsp), %rax
cmpq %rax, %rcx
je 0x198b8
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
movq 0xe0(%rsp), %rbp
movl 0x14(%rsp), %r12d
leaq 0xf8(%rsp), %rbx
jbe 0x198fe
movl $0xf, %edi
leaq 0x70(%rsp), %r9
cmpq %r9, %rsi
je 0x198f9
movq 0x70(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x1990a
leaq 0x40(%rsp), %rdi
callq 0x30e0
jmp 0x19918
leaq 0x60(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3370
leaq 0x30(%rsp), %rsi
movq %rsi, 0x20(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x1993d
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x19945
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x20(%rsp), %rdi
leaq 0x1cfb4(%rip), %rsi     # 0x36922
callq 0x35e0
movq %rbx, 0xe8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1999f
movq %rdx, 0xe8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xf8(%rsp)
jmp 0x199a7
movupd (%rcx), %xmm0
movupd %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0xf0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movzbl 0x2c3c(%r14), %esi
leaq 0xe8(%rsp), %rdi
movq 0xd8(%rsp), %rdx
callq 0x1d7c5
movq 0xe8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x199f1
callq 0x3310
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
leaq 0x150(%rsp), %rbx
je 0x19a0d
callq 0x3310
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x19a21
callq 0x3310
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x19a35
callq 0x3310
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x19a4f
callq 0x3310
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x19a69
callq 0x3310
xorl %esi, %esi
testq %r13, %r13
sete %sil
movq %rbx, %rdi
callq 0x8336
movzbl 0x2c4f(%r14), %r8d
movzbl 0x2c3d(%r14), %r9d
movzbl 0x2c48(%r14), %eax
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
pushq %r13
pushq %rax
callq 0x8d48
addq $0x10, %rsp
movb 0x2c4f(%r14), %al
cmpb $0x1, %al
jne 0x19beb
movslq 0x2d50(%r14), %rcx
testq %rcx, %rcx
jle 0x19b17
movq 0x448(%rsp), %rdx
movq 0x138(%rsp), %rsi
xorl %edi, %edi
testl %r12d, %r12d
jle 0x19b0f
leaq (,%rdi,8), %r8
leaq (%r8,%r8,2), %r9
movq (%rdx,%r9), %r8
movq (%rsi,%r9), %r9
xorl %r10d, %r10d
movsd (%r8,%r10,8), %xmm0
movq (%r9), %r11
movsd %xmm0, (%r11,%r13,8)
incq %r10
addq $0x18, %r9
cmpq %r10, %r15
jne 0x19af4
incq %rdi
cmpq %rcx, %rdi
jne 0x19ad8
movslq 0x2d18(%r14), %rcx
testq %rcx, %rcx
jle 0x19b74
movq 0x460(%rsp), %rdx
movq 0x120(%rsp), %rsi
xorl %edi, %edi
testl %r12d, %r12d
jle 0x19b6c
leaq (,%rdi,8), %r8
leaq (%r8,%r8,2), %r9
movq (%rdx,%r9), %r8
movq (%rsi,%r9), %r9
xorl %r10d, %r10d
movsd (%r8,%r10,8), %xmm0
movq (%r9), %r11
movsd %xmm0, (%r11,%r13,8)
incq %r10
addq $0x18, %r9
cmpq %r10, %r15
jne 0x19b51
incq %rdi
cmpq %rcx, %rdi
jne 0x19b35
cmpb $0x1, 0x2c3f(%r14)
jne 0x19beb
movq 0x2c90(%r14), %rcx
subq 0x2c88(%r14), %rcx
shrq $0x5, %rcx
testl %ecx, %ecx
jle 0x19beb
movq 0x478(%rsp), %rdx
movq 0x108(%rsp), %rsi
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edi, %edi
testl %r12d, %r12d
jle 0x19be3
leaq (,%rdi,8), %r8
leaq (%r8,%r8,2), %r9
movq (%rdx,%r9), %r8
movq (%rsi,%r9), %r9
xorl %r10d, %r10d
movsd (%r8,%r10,8), %xmm0
movq (%r9), %r11
movsd %xmm0, (%r11,%r13,8)
incq %r10
addq $0x18, %r9
cmpq %r10, %r15
jne 0x19bc8
incq %rdi
cmpq %rcx, %rdi
jne 0x19bac
movq 0x8(%rsp), %rcx
leaq (,%rcx,8), %rcx
movsd 0x380(%rsp), %xmm0
movq 0x2e18(%r14), %rdx
leaq (%rcx,%rcx,2), %rsi
movq (%rdx,%rsi), %rcx
movsd %xmm0, (%rcx,%r13,8)
movsd 0x370(%rsp), %xmm1
cvtsi2sdl 0x2c14(%r14), %xmm2
divsd %xmm2, %xmm1
movq 0x2e60(%r14), %rcx
movq (%rcx,%rsi), %rcx
movsd %xmm1, (%rcx,%r13,8)
movsd 0x378(%rsp), %xmm0
divsd %xmm2, %xmm0
mulsd %xmm1, %xmm1
subsd %xmm1, %xmm0
movq 0x2e78(%r14), %rdx
movq (%rdx,%rsi), %rdx
movsd %xmm0, (%rdx,%r13,8)
mulsd 0x1ceed(%rip), %xmm0    # 0x36b58
addsd (%rcx,%r13,8), %xmm0
movq 0x2e90(%r14), %rcx
movq (%rcx,%rsi), %rdx
movsd %xmm0, (%rdx,%r13,8)
testl %ebp, %ebp
jle 0x19ceb
movq 0xd0(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdx
movq -0x18(%rcx,%rdx,8), %rcx
subsd (%rcx,%r13,8), %xmm0
movq 0x30d8(%r14), %rcx
movq 0x8(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx,8), %rdx
movsd %xmm0, (%rdx,%r13,8)
cmpl $0x1, %ebp
je 0x19ceb
movq 0xc8(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx), %rcx
subsd (%rcx,%r13,8), %xmm0
andpd 0x1ce96(%rip), %xmm0    # 0x36b70
movq 0x30f0(%r14), %rcx
movq (%rcx,%rdx), %rcx
movlpd %xmm0, (%rcx,%r13,8)
movslq 0x2c0c(%r14), %rcx
movq 0xa0(%rsp), %r13
cmpq %rcx, %r13
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
jl 0x1969a
jmp 0x19d16
movb 0x2c4f(%r14), %al
testb $0x1, %al
je 0x1a0b2
movl 0x2d50(%r14), %eax
testl %eax, %eax
jle 0x19e4a
xorl %ebx, %ebx
movq 0x8(%rsp), %rcx
leaq (%rcx,%rcx,2), %r15
testl %r12d, %r12d
jle 0x19e3b
leaq (%rbx,%rbx,2), %r12
xorl %r13d, %r13d
movq 0x138(%rsp), %rax
movq (%rax,%r12,8), %rax
leaq (,%r13,2), %rdx
addq %r13, %rdx
movq (%rax,%rdx,8), %rsi
movq 0x8(%rax,%rdx,8), %rcx
subq %rsi, %rcx
movq %rcx, %rdi
shrq $0x3, %rdi
testl %edi, %edi
jle 0x19d93
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
xorpd %xmm0, %xmm0
xorl %r8d, %r8d
addsd (%rsi,%r8,8), %xmm0
incq %r8
cmpq %r8, %rdi
jne 0x19d83
jmp 0x19d97
xorpd %xmm0, %xmm0
leaq (%rax,%rdx,8), %rdi
sarq $0x3, %rcx
movq %rcx, %xmm1
punpckldq 0x1cdd4(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1cddc(%rip), %xmm1    # 0x36b90
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq 0x2d70(%r14), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
xorpd %xmm0, %xmm0
movl $0x1, %esi
callq 0x1a574
xorps %xmm1, %xmm1
cvtsi2sdl 0x2c0c(%r14), %xmm1
divsd %xmm1, %xmm0
ucomisd 0x1c2a9(%rip), %xmm0    # 0x360a8
jb 0x19e07
sqrtsd %xmm0, %xmm0
jmp 0x19e0c
callq 0x3280
movq 0x2d88(%r14), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
cmpq 0x18(%rsp), %r13
jne 0x19d48
movl 0x2d50(%r14), %eax
movl 0x14(%rsp), %r12d
incq %rbx
movslq %eax, %rcx
cmpq %rcx, %rbx
jl 0x19d38
movl 0x2d18(%r14), %eax
testl %eax, %eax
jle 0x19f66
xorl %ebx, %ebx
movq 0x8(%rsp), %rcx
leaq (%rcx,%rcx,2), %r15
testl %r12d, %r12d
jle 0x19f57
leaq (%rbx,%rbx,2), %r12
xorl %r13d, %r13d
movq 0x120(%rsp), %rax
movq (%rax,%r12,8), %rax
leaq (,%r13,2), %rdx
addq %r13, %rdx
movq (%rax,%rdx,8), %rsi
movq 0x8(%rax,%rdx,8), %rcx
subq %rsi, %rcx
movq %rcx, %rdi
shrq $0x3, %rdi
testl %edi, %edi
jle 0x19ebf
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
xorpd %xmm0, %xmm0
xorl %r8d, %r8d
addsd (%rsi,%r8,8), %xmm0
incq %r8
cmpq %r8, %rdi
jne 0x19eaf
jmp 0x19ec3
xorpd %xmm0, %xmm0
leaq (%rax,%rdx,8), %rdi
sarq $0x3, %rcx
movq %rcx, %xmm1
punpckldq 0x1cca8(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1ccb0(%rip), %xmm1    # 0x36b90
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq 0x2da0(%r14), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
xorpd %xmm0, %xmm0
movl $0x1, %esi
callq 0x1a574
ucomisd 0x1c18d(%rip), %xmm0    # 0x360a8
jb 0x19f23
sqrtsd %xmm0, %xmm0
jmp 0x19f28
callq 0x3280
movq 0x2db8(%r14), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
cmpq 0x18(%rsp), %r13
jne 0x19e74
movl 0x2d18(%r14), %eax
movl 0x14(%rsp), %r12d
incq %rbx
movslq %eax, %rcx
cmpq %rcx, %rbx
jl 0x19e64
cmpb $0x1, 0x2c3f(%r14)
jne 0x1a0b2
movq 0x2c88(%r14), %rax
movq 0x2c90(%r14), %rcx
movq %rcx, %rdx
subq %rax, %rdx
shrq $0x5, %rdx
testl %edx, %edx
jle 0x1a0b2
xorl %ebx, %ebx
movq 0x8(%rsp), %rdx
leaq (%rdx,%rdx,2), %r15
testl %r12d, %r12d
jle 0x1a099
leaq (%rbx,%rbx,2), %r12
xorl %r13d, %r13d
movq 0x108(%rsp), %rax
movq (%rax,%r12,8), %rax
leaq (,%r13,2), %rdx
addq %r13, %rdx
movq (%rax,%rdx,8), %rsi
movq 0x8(%rax,%rdx,8), %rcx
subq %rsi, %rcx
movq %rcx, %rdi
shrq $0x3, %rdi
testl %edi, %edi
jle 0x19ffa
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
xorpd %xmm0, %xmm0
xorl %r8d, %r8d
addsd (%rsi,%r8,8), %xmm0
incq %r8
cmpq %r8, %rdi
jne 0x19fea
jmp 0x19ffe
xorpd %xmm0, %xmm0
leaq (%rax,%rdx,8), %rdi
sarq $0x3, %rcx
movq %rcx, %xmm1
punpckldq 0x1cb6d(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1cb75(%rip), %xmm1    # 0x36b90
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq 0x2dd0(%r14), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
xorpd %xmm0, %xmm0
movl $0x1, %esi
callq 0x1a574
ucomisd 0x1c052(%rip), %xmm0    # 0x360a8
jb 0x1a05e
sqrtsd %xmm0, %xmm0
jmp 0x1a063
callq 0x3280
movq 0x2de8(%r14), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
cmpq 0x18(%rsp), %r13
jne 0x19faf
movq 0x2c88(%r14), %rax
movq 0x2c90(%r14), %rcx
movl 0x14(%rsp), %r12d
incq %rbx
movq %rcx, %rdx
subq %rax, %rdx
shrq $0x5, %rdx
movslq %edx, %rdx
cmpq %rdx, %rbx
jl 0x19f9f
movq 0x2e18(%r14), %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rcx,2), %rbx
movq (%rax,%rbx,8), %rdx
movq 0x8(%rax,%rbx,8), %rcx
subq %rdx, %rcx
movq %rcx, %rsi
shrq $0x3, %rsi
testl %esi, %esi
jle 0x1a0f4
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
xorpd %xmm0, %xmm0
xorl %edi, %edi
addsd (%rdx,%rdi,8), %xmm0
incq %rdi
cmpq %rdi, %rsi
jne 0x1a0e5
jmp 0x1a0f8
xorpd %xmm0, %xmm0
sarq $0x3, %rcx
movq %rcx, %xmm1
punpckldq 0x1ca77(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1ca7f(%rip), %xmm1    # 0x36b90
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq 0x2e30(%r14), %rcx
movq 0x8(%rsp), %rdx
movsd %xmm0, (%rcx,%rdx,8)
cmpl $0x2, 0x2c0c(%r14)
jl 0x1a184
leaq (%rax,%rbx,8), %rdi
xorpd %xmm0, %xmm0
movl $0x1, %esi
callq 0x1a574
xorps %xmm1, %xmm1
cvtsi2sdl 0x2c0c(%r14), %xmm1
divsd %xmm1, %xmm0
ucomisd 0x1bf42(%rip), %xmm0    # 0x360a8
jb 0x1a16e
sqrtsd %xmm0, %xmm0
jmp 0x1a173
callq 0x3280
movq 0x2e48(%r14), %rax
movq 0x8(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x2e90(%r14), %rax
movq (%rax,%rbx,8), %rdx
movq 0x8(%rax,%rbx,8), %rcx
subq %rdx, %rcx
movq %rcx, %rsi
shrq $0x3, %rsi
testl %esi, %esi
jle 0x1a1bd
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
xorpd %xmm0, %xmm0
xorl %edi, %edi
addsd (%rdx,%rdi,8), %xmm0
incq %rdi
cmpq %rdi, %rsi
jne 0x1a1ae
jmp 0x1a1c1
xorpd %xmm0, %xmm0
sarq $0x3, %rcx
movq %rcx, %xmm1
punpckldq 0x1c9ae(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1c9b6(%rip), %xmm1    # 0x36b90
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq 0x2ea8(%r14), %rcx
movq 0x8(%rsp), %rdx
movsd %xmm0, (%rcx,%rdx,8)
cmpl $0x2, 0x2c0c(%r14)
jl 0x1a24d
leaq (%rax,%rbx,8), %rdi
xorpd %xmm0, %xmm0
movl $0x1, %esi
callq 0x1a574
xorps %xmm1, %xmm1
cvtsi2sdl 0x2c0c(%r14), %xmm1
divsd %xmm1, %xmm0
ucomisd 0x1be79(%rip), %xmm0    # 0x360a8
jb 0x1a237
sqrtsd %xmm0, %xmm0
jmp 0x1a23c
callq 0x3280
movq 0x2ec0(%r14), %rax
movq 0x8(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpl $0x2, %ebp
jl 0x1a30d
decl %ebp
movq 0x30f0(%r14), %rax
leaq (,%rbp,2), %rdi
addq %rbp, %rdi
movq (%rax,%rdi,8), %rcx
movq 0x8(%rax,%rdi,8), %rax
subq %rcx, %rax
movq %rax, %rdx
shrq $0x3, %rdx
xorpd %xmm2, %xmm2
testl %edx, %edx
jle 0x1a29a
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %esi, %esi
addsd (%rcx,%rsi,8), %xmm2
incq %rsi
cmpq %rsi, %rdx
jne 0x1a28d
sarq $0x3, %rax
movq %rax, %xmm0
punpckldq 0x1c8d5(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1c8dd(%rip), %xmm0    # 0x36b90
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm2
movsd %xmm2, 0x18(%rsp)
shlq $0x3, %rdi
addq 0x2e90(%r14), %rdi
xorpd %xmm0, %xmm0
movl $0x1, %esi
callq 0x1a574
ucomisd 0x1bdbe(%rip), %xmm0    # 0x360a8
jb 0x1a2f2
sqrtsd %xmm0, %xmm0
jmp 0x1a2f7
callq 0x3280
movsd 0x18(%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x3108(%r14), %rax
movsd %xmm1, (%rax,%rbp,8)
leaq 0x150(%rsp), %rdi
callq 0xf7e4
leaq 0x108(%rsp), %rdi
callq 0x5a2a
leaq 0x120(%rsp), %rdi
callq 0x5a2a
leaq 0x138(%rsp), %rdi
callq 0x5a2a
addq $0x538, %rsp            # imm = 0x538
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1a4b5
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x5ae8
jmp 0x1a370
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1a4c2
callq 0x3310
jmp 0x1a4c2
movq %rax, %rbx
jmp 0x1a4c2
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x5ae8
jmp 0x1a3a5
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1a4cf
callq 0x3310
jmp 0x1a4cf
movq %rax, %rbx
jmp 0x1a4cf
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x5ae8
jmp 0x1a3da
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1a4dc
callq 0x3310
jmp 0x1a4dc
movq %rax, %rbx
jmp 0x1a4dc
jmp 0x1a4a5
movq %rax, %rbx
jmp 0x1a489
movq %rax, %rbx
jmp 0x1a46f
movq %rax, %rbx
jmp 0x1a45b
movq %rax, %rbx
jmp 0x1a433
movq %rax, %rbx
jmp 0x1a447
movq %rbx, %rcx
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %rcx, %rdi
je 0x1a433
callq 0x3310
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x1a447
callq 0x3310
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x1a45b
callq 0x3310
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1a46f
callq 0x3310
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x1a489
callq 0x3310
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x1a4a8
callq 0x3310
jmp 0x1a4a8
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0xf7e4
leaq 0x108(%rsp), %rdi
callq 0x5a2a
leaq 0x120(%rsp), %rdi
callq 0x5a2a
leaq 0x138(%rsp), %rdi
callq 0x5a2a
movq %rbx, %rdi
callq 0x3580