// File: /workspace/github_cpp_makefile_star2_O1/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 $0x528, %rsp            # imm = 0x528
movl %esi, %ebp
movq %rdi, %r14
movl 0x2bc8(%rdi), %r13d
addl %esi, %r13d
movslq 0x2d50(%rdi), %r12
movslq 0x2c0c(%rdi), %rsi
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x5916
movslq %r13d, %rsi
leaq 0x140(%rsp), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x78(%rsp), %rcx
movq %rsi, 0x8(%rsp)
callq 0x59a0
leaq 0x128(%rsp), %rdi
leaq 0x140(%rsp), %rdx
leaq 0x98(%rsp), %rcx
movq %r12, %rsi
callq 0x1a7de
leaq 0x140(%rsp), %rdi
callq 0x5b7a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19844
callq 0x3310
movslq 0x2d18(%r14), %r12
movslq 0x2c0c(%r14), %rsi
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x5916
leaq 0x140(%rsp), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x78(%rsp), %rcx
movq 0x8(%rsp), %rsi
callq 0x59a0
leaq 0x110(%rsp), %rdi
leaq 0x140(%rsp), %rdx
leaq 0x98(%rsp), %rcx
movq %r12, %rsi
callq 0x1a7de
leaq 0x140(%rsp), %rdi
callq 0x5b7a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x198b9
callq 0x3310
movq 0x2c90(%r14), %r12
subq 0x2c88(%r14), %r12
movslq 0x2c0c(%r14), %rsi
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x5916
leaq 0x140(%rsp), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x78(%rsp), %rcx
movq 0x8(%rsp), %rsi
callq 0x59a0
sarq $0x5, %r12
leaq 0xf8(%rsp), %rdi
leaq 0x140(%rsp), %rdx
leaq 0x98(%rsp), %rcx
movq %r12, %rsi
callq 0x1a7de
leaq 0x140(%rsp), %rdi
callq 0x5b7a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19939
callq 0x3310
movl 0x2c10(%r14), %ecx
movl 0x2c14(%r14), %r8d
movl 0x2c18(%r14), %r9d
leaq 0x140(%rsp), %rdi
movsd 0x1d902(%rip), %xmm0    # 0x37260
movq %r14, %rsi
movl %ebp, %edx
callq 0x701c
cmpl $0x0, 0x2c0c(%r14)
movslq %ebp, %rax
movq %rax, 0x30(%rsp)
movl %r13d, 0x4(%rsp)
jle 0x1a02c
leaq 0x970(%r14), %rax
movq %rax, 0xe8(%rsp)
movl %ebp, %eax
movq %rax, 0xe0(%rsp)
leal -0x1(%rbp), %eax
movl %r13d, %r15d
xorl %ebx, %ebx
shlq $0x3, %rax
movq %rax, 0xd8(%rsp)
movabsq $0x346dc5d63886594b, %rsi # imm = 0x346DC5D63886594B
movq %rbp, 0xf0(%rsp)
leaq 0x1(%rbx), %r12
movl $0x1, %ebp
cmpq $0x9, %rbx
leaq 0x98(%rsp), %r13
jb 0x19a1e
movl $0x4, %ebp
movq %r12, %rcx
cmpq $0x63, %rcx
jbe 0x19a17
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x19a1c
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x19a1e
movq %rcx, %rax
mulq %rsi
shrq $0xb, %rdx
addl $0x4, %ebp
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x199e1
addl $-0x3, %ebp
jmp 0x19a1e
addl $-0x2, %ebp
jmp 0x19a1e
decl %ebp
movl %ebp, %esi
leaq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq %r13, %rdi
movl $0x2d, %edx
callq 0x33a0
movq 0x98(%rsp), %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x6dda
movl $0xb, %r8d
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x1e13d(%rip), %rcx     # 0x37ba0
callq 0x3370
leaq 0x88(%rsp), %rsi
movq %rsi, 0x78(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x48(%rsp), %r12
je 0x19a9b
movq %rdx, 0x78(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x88(%rsp)
jmp 0x19aa3
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x80(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %rdi
leaq 0x1e0e2(%rip), %rsi     # 0x37bac
callq 0x35e0
movq %r12, 0x38(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movabsq $0x346dc5d63886594b, %rsi # imm = 0x346DC5D63886594B
je 0x19afc
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x19b06
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x40(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movslq 0x2c0c(%r14), %r13
movq %r13, %r12
negq %r12
cmovsq %r13, %r12
movl $0x1, %ebp
cmpq $0xa, %r12
jb 0x19b7f
movl $0x4, %ebp
movq %r12, %rcx
cmpq $0x63, %rcx
jbe 0x19b78
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x19b7d
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x19b7f
movq %rcx, %rax
mulq %rsi
shrq $0xb, %rdx
addl $0x4, %ebp
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x19b42
addl $-0x3, %ebp
jmp 0x19b7f
addl $-0x2, %ebp
jmp 0x19b7f
decl %ebp
shrq $0x3f, %r13
leal (%r13,%rbp), %esi
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x58(%rsp), %rdi
movl $0x2d, %edx
callq 0x33a0
addq 0x58(%rsp), %r13
movq %r13, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x6dda
movq 0x38(%rsp), %rcx
movl $0xf, %esi
leaq 0x48(%rsp), %rax
cmpq %rax, %rcx
je 0x19bcc
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %r8
movq 0x60(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
movq 0xf0(%rsp), %rbp
movl 0x4(%rsp), %r13d
jbe 0x19c07
movl $0xf, %esi
leaq 0x68(%rsp), %rdi
cmpq %rdi, 0x58(%rsp)
je 0x19c02
movq 0x68(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x19c18
movq 0x58(%rsp), %rsi
leaq 0x38(%rsp), %rdi
callq 0x30e0
jmp 0x19c26
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3370
leaq 0x20(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x19c4b
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x19c53
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x10(%rsp), %rdi
leaq 0x1dca6(%rip), %rsi     # 0x37922
callq 0x35e0
leaq 0xc8(%rsp), %rsi
movq %rsi, 0xb8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x19cb5
movq %rdx, 0xb8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc8(%rsp)
jmp 0x19cbd
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0xc0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movzbl 0x2c3c(%r14), %esi
leaq 0xb8(%rsp), %rdi
movq 0xe8(%rsp), %rdx
callq 0x1db19
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x19d0f
callq 0x3310
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x19d23
callq 0x3310
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x19d37
callq 0x3310
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x19d4b
callq 0x3310
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x19d62
callq 0x3310
movq %rbp, %r12
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x19d7f
callq 0x3310
xorl %esi, %esi
testq %rbx, %rbx
sete %sil
leaq 0x140(%rsp), %rbp
movq %rbp, %rdi
callq 0x85d8
movzbl 0x2c4f(%r14), %r8d
movzbl 0x2c3d(%r14), %r9d
movzbl 0x2c48(%r14), %eax
movq %rbp, %rdi
movq %r14, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
pushq %rbx
pushq %rax
callq 0x90b6
addq $0x10, %rsp
cmpb $0x1, 0x2c4f(%r14)
movq %r12, %rbp
movq 0x30(%rsp), %r11
jne 0x19f0e
movslq 0x2d50(%r14), %rax
testq %rax, %rax
jle 0x19e3b
movq 0x438(%rsp), %rcx
movq 0x128(%rsp), %rdx
xorl %esi, %esi
testl %r13d, %r13d
jle 0x19e33
leaq (,%rsi,8), %rdi
leaq (%rdi,%rdi,2), %r8
movq (%rcx,%r8), %rdi
movq (%rdx,%r8), %r8
xorl %r9d, %r9d
movsd (%rdi,%r9,8), %xmm0
movq (%r8), %r10
movsd %xmm0, (%r10,%rbx,8)
incq %r9
addq $0x18, %r8
cmpq %r9, %r15
jne 0x19e18
incq %rsi
cmpq %rax, %rsi
jne 0x19dfc
movslq 0x2d18(%r14), %rax
testq %rax, %rax
jle 0x19e98
movq 0x450(%rsp), %rcx
movq 0x110(%rsp), %rdx
xorl %esi, %esi
testl %r13d, %r13d
jle 0x19e90
leaq (,%rsi,8), %rdi
leaq (%rdi,%rdi,2), %r8
movq (%rcx,%r8), %rdi
movq (%rdx,%r8), %r8
xorl %r9d, %r9d
movsd (%rdi,%r9,8), %xmm0
movq (%r8), %r10
movsd %xmm0, (%r10,%rbx,8)
incq %r9
addq $0x18, %r8
cmpq %r9, %r15
jne 0x19e75
incq %rsi
cmpq %rax, %rsi
jne 0x19e59
cmpb $0x1, 0x2c3f(%r14)
jne 0x19f0e
movq 0x2c90(%r14), %rax
subq 0x2c88(%r14), %rax
shrq $0x5, %rax
testl %eax, %eax
jle 0x19f0e
movq 0x468(%rsp), %rcx
movq 0xf8(%rsp), %rdx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %esi, %esi
testl %r13d, %r13d
jle 0x19f06
leaq (,%rsi,8), %rdi
leaq (%rdi,%rdi,2), %r8
movq (%rcx,%r8), %rdi
movq (%rdx,%r8), %r8
xorl %r9d, %r9d
movsd (%rdi,%r9,8), %xmm0
movq (%r8), %r10
movsd %xmm0, (%r10,%rbx,8)
incq %r9
addq $0x18, %r8
cmpq %r9, %r15
jne 0x19eeb
incq %rsi
cmpq %rax, %rsi
jne 0x19ecf
leaq (,%r11,8), %rax
movsd 0x370(%rsp), %xmm0
movq 0x2e18(%r14), %rcx
leaq (%rax,%rax,2), %rdx
movq (%rcx,%rdx), %rax
movsd %xmm0, (%rax,%rbx,8)
movsd 0x360(%rsp), %xmm1
cvtsi2sdl 0x2c14(%r14), %xmm2
divsd %xmm2, %xmm1
movq 0x2e60(%r14), %rax
movq (%rax,%rdx), %rax
movsd %xmm1, (%rax,%rbx,8)
movsd 0x368(%rsp), %xmm0
divsd %xmm2, %xmm0
mulsd %xmm1, %xmm1
subsd %xmm1, %xmm0
movq 0x2e78(%r14), %rcx
movq (%rcx,%rdx), %rcx
movsd %xmm0, (%rcx,%rbx,8)
mulsd 0x1dbd2(%rip), %xmm0    # 0x37b58
addsd (%rax,%rbx,8), %xmm0
movq 0x2e90(%r14), %rax
movq (%rax,%rdx), %rcx
movsd %xmm0, (%rcx,%rbx,8)
testl %ebp, %ebp
jle 0x19fc9
movq 0xe0(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
movq -0x18(%rax,%rcx,8), %rax
subsd (%rax,%rbx,8), %xmm0
movq 0x30d8(%r14), %rax
leaq (%r11,%r11,2), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax,%rbx,8)
cmpl $0x2, %ebp
movabsq $0x346dc5d63886594b, %rsi # imm = 0x346DC5D63886594B
jl 0x1a019
leaq (%r11,%r11,2), %rax
movq 0x30d8(%r14), %rcx
movq (%rcx,%rax,8), %rax
movsd (%rax,%rbx,8), %xmm0
movq 0xd8(%rsp), %rax
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax), %rcx
subsd (%rcx,%rbx,8), %xmm0
movq 0x30f0(%r14), %rcx
andpd 0x1db60(%rip), %xmm0    # 0x37b70
movq (%rcx,%rax), %rax
movlpd %xmm0, (%rax,%rbx,8)
incq %rbx
movslq 0x2c0c(%r14), %rax
cmpq %rax, %rbx
jl 0x199c2
cmpb $0x1, 0x2c4f(%r14)
jne 0x1a3b9
cmpl $0x0, 0x2d50(%r14)
jle 0x1a162
xorl %ebx, %ebx
movq 0x30(%rsp), %rax
leaq (%rax,%rax,2), %r15
testl %r13d, %r13d
jle 0x1a14a
leaq (%rbx,%rbx,2), %r12
xorl %r13d, %r13d
movq 0x128(%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 0x1a0ae
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
xorpd %xmm0, %xmm0
xorl %r8d, %r8d
addsd (%rsi,%r8,8), %xmm0
incq %r8
cmpq %r8, %rdi
jne 0x1a09e
jmp 0x1a0b2
xorpd %xmm0, %xmm0
leaq (%rax,%rdx,8), %rdi
sarq $0x3, %rcx
movq %rcx, %xmm1
punpckldq 0x1dab9(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1dac1(%rip), %xmm1    # 0x37b90
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 0x1a86e
xorps %xmm1, %xmm1
cvtsi2sdl 0x2c0c(%r14), %xmm1
divsd %xmm1, %xmm0
ucomisd 0x1cf8e(%rip), %xmm0    # 0x370a8
jb 0x1a122
sqrtsd %xmm0, %xmm0
jmp 0x1a127
callq 0x3280
movq 0x2d88(%r14), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
cmpq 0x8(%rsp), %r13
jne 0x1a063
incq %rbx
movslq 0x2d50(%r14), %rax
cmpq %rax, %rbx
movl 0x4(%rsp), %r13d
jl 0x1a053
cmpl $0x0, 0x2d18(%r14)
jle 0x1a27a
xorl %ebx, %ebx
movq 0x30(%rsp), %rax
leaq (%rax,%rax,2), %r15
testl %r13d, %r13d
jle 0x1a262
leaq (%rbx,%rbx,2), %r12
xorl %r13d, %r13d
movq 0x110(%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 0x1a1d6
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
xorpd %xmm0, %xmm0
xorl %r8d, %r8d
addsd (%rsi,%r8,8), %xmm0
incq %r8
cmpq %r8, %rdi
jne 0x1a1c6
jmp 0x1a1da
xorpd %xmm0, %xmm0
leaq (%rax,%rdx,8), %rdi
sarq $0x3, %rcx
movq %rcx, %xmm1
punpckldq 0x1d991(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d999(%rip), %xmm1    # 0x37b90
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 0x1a86e
ucomisd 0x1ce76(%rip), %xmm0    # 0x370a8
jb 0x1a23a
sqrtsd %xmm0, %xmm0
jmp 0x1a23f
callq 0x3280
movq 0x2db8(%r14), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
cmpq 0x8(%rsp), %r13
jne 0x1a18b
incq %rbx
movslq 0x2d18(%r14), %rax
cmpq %rax, %rbx
movl 0x4(%rsp), %r13d
jl 0x1a17b
cmpb $0x1, 0x2c3f(%r14)
jne 0x1a3b9
movq 0x2c90(%r14), %rax
subq 0x2c88(%r14), %rax
shrq $0x5, %rax
testl %eax, %eax
jle 0x1a3b9
xorl %ebx, %ebx
movq 0x30(%rsp), %rax
leaq (%rax,%rax,2), %r15
testl %r13d, %r13d
jle 0x1a394
leaq (%rbx,%rbx,2), %r12
xorl %r13d, %r13d
movq 0xf8(%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 0x1a308
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
xorpd %xmm0, %xmm0
xorl %r8d, %r8d
addsd (%rsi,%r8,8), %xmm0
incq %r8
cmpq %r8, %rdi
jne 0x1a2f8
jmp 0x1a30c
xorpd %xmm0, %xmm0
leaq (%rax,%rdx,8), %rdi
sarq $0x3, %rcx
movq %rcx, %xmm1
punpckldq 0x1d85f(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d867(%rip), %xmm1    # 0x37b90
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 0x1a86e
ucomisd 0x1cd44(%rip), %xmm0    # 0x370a8
jb 0x1a36c
sqrtsd %xmm0, %xmm0
jmp 0x1a371
callq 0x3280
movq 0x2de8(%r14), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
cmpq 0x8(%rsp), %r13
jne 0x1a2bd
movq 0x2c90(%r14), %rax
subq 0x2c88(%r14), %rax
incq %rbx
shrq $0x5, %rax
cltq
cmpq %rax, %rbx
movl 0x4(%rsp), %r13d
jl 0x1a2ad
movq 0x2e18(%r14), %rax
movq 0x30(%rsp), %r15
leaq (%r15,%r15,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 0x1a3fb
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
xorpd %xmm0, %xmm0
xorl %edi, %edi
addsd (%rdx,%rdi,8), %xmm0
incq %rdi
cmpq %rdi, %rsi
jne 0x1a3ec
jmp 0x1a3ff
xorpd %xmm0, %xmm0
sarq $0x3, %rcx
movq %rcx, %xmm1
punpckldq 0x1d770(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d778(%rip), %xmm1    # 0x37b90
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq 0x2e30(%r14), %rcx
movsd %xmm0, (%rcx,%r15,8)
cmpl $0x2, 0x2c0c(%r14)
jl 0x1a483
leaq (%rax,%rbx,8), %rdi
xorpd %xmm0, %xmm0
movl $0x1, %esi
callq 0x1a86e
xorps %xmm1, %xmm1
cvtsi2sdl 0x2c0c(%r14), %xmm1
divsd %xmm1, %xmm0
ucomisd 0x1cc3f(%rip), %xmm0    # 0x370a8
jb 0x1a471
sqrtsd %xmm0, %xmm0
jmp 0x1a476
callq 0x3280
movq 0x2e48(%r14), %rax
movsd %xmm0, (%rax,%r15,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 0x1a4bc
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
xorpd %xmm0, %xmm0
xorl %edi, %edi
addsd (%rdx,%rdi,8), %xmm0
incq %rdi
cmpq %rdi, %rsi
jne 0x1a4ad
jmp 0x1a4c0
xorpd %xmm0, %xmm0
sarq $0x3, %rcx
movq %rcx, %xmm1
punpckldq 0x1d6af(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d6b7(%rip), %xmm1    # 0x37b90
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq 0x2ea8(%r14), %rcx
movsd %xmm0, (%rcx,%r15,8)
cmpl $0x2, 0x2c0c(%r14)
jl 0x1a544
leaq (%rax,%rbx,8), %rdi
xorpd %xmm0, %xmm0
movl $0x1, %esi
callq 0x1a86e
xorps %xmm1, %xmm1
cvtsi2sdl 0x2c0c(%r14), %xmm1
divsd %xmm1, %xmm0
ucomisd 0x1cb7e(%rip), %xmm0    # 0x370a8
jb 0x1a532
sqrtsd %xmm0, %xmm0
jmp 0x1a537
callq 0x3280
movq 0x2ec0(%r14), %rax
movsd %xmm0, (%rax,%r15,8)
cmpl $0x2, %ebp
jl 0x1a604
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 0x1a591
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %esi, %esi
addsd (%rcx,%rsi,8), %xmm2
incq %rsi
cmpq %rsi, %rdx
jne 0x1a584
sarq $0x3, %rax
movq %rax, %xmm0
punpckldq 0x1d5de(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1d5e6(%rip), %xmm0    # 0x37b90
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm2
movsd %xmm2, 0x8(%rsp)
shlq $0x3, %rdi
addq 0x2e90(%r14), %rdi
xorpd %xmm0, %xmm0
movl $0x1, %esi
callq 0x1a86e
ucomisd 0x1cac7(%rip), %xmm0    # 0x370a8
jb 0x1a5e9
sqrtsd %xmm0, %xmm0
jmp 0x1a5ee
callq 0x3280
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x3108(%r14), %rax
movsd %xmm1, (%rax,%rbp,8)
leaq 0x140(%rsp), %rdi
callq 0xfb72
leaq 0xf8(%rsp), %rdi
callq 0x5ab8
leaq 0x110(%rsp), %rdi
callq 0x5ab8
leaq 0x128(%rsp), %rdi
callq 0x5ab8
addq $0x528, %rsp            # imm = 0x528
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1a7ae
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x5b7a
jmp 0x1a667
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1a7bb
callq 0x3310
jmp 0x1a7bb
movq %rax, %rbx
jmp 0x1a7bb
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x5b7a
jmp 0x1a69c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1a7c8
callq 0x3310
jmp 0x1a7c8
movq %rax, %rbx
jmp 0x1a7c8
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x5b7a
jmp 0x1a6d1
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1a7d5
callq 0x3310
jmp 0x1a7d5
movq %rax, %rbx
jmp 0x1a7d5
jmp 0x1a79e
movq %rax, %rbx
jmp 0x1a782
movq %rax, %rbx
jmp 0x1a76b
movq %rax, %rbx
jmp 0x1a757
movq %rax, %rbx
jmp 0x1a72f
movq %rax, %rbx
jmp 0x1a743
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x1a72f
callq 0x3310
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1a743
callq 0x3310
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x1a757
callq 0x3310
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x1a76b
callq 0x3310
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x1a782
callq 0x3310
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x1a7a1
callq 0x3310
jmp 0x1a7a1
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0xfb72
leaq 0xf8(%rsp), %rdi
callq 0x5ab8
leaq 0x110(%rsp), %rdi
callq 0x5ab8
leaq 0x128(%rsp), %rdi
callq 0x5ab8
movq %rbx, %rdi
callq 0x3580
nop