// File: bobverity[P]MavericK/mainMCMC.cpp
// Function: mainMCMC_noAdmixture(globals&, int)
void mainMCMC_noAdmixture(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_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_noAdmixture 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.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.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])/double(globals.mainRepeats));
            }
        }
        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:
subq $0x5f8, %rsp            # imm = 0x5F8
movq %rdi, 0x5f0(%rsp)
movl %esi, 0x5ec(%rsp)
movq 0x5f0(%rsp), %rax
movl 0x2bc8(%rax), %eax
movl 0x5ec(%rsp), %ecx
addl %ecx, %eax
movl %eax, 0x5e8(%rsp)
movq 0x5f0(%rsp), %rax
movslq 0x2d18(%rax), %rcx
movq %rcx, 0x140(%rsp)
movslq 0x5e8(%rsp), %rcx
movq %rcx, 0x148(%rsp)
movslq 0x2c0c(%rax), %rax
movq %rax, 0x150(%rsp)
leaq 0x59f(%rsp), %rdi
movq %rdi, 0x158(%rsp)
callq 0x8780
movq 0x150(%rsp), %rsi
movq 0x158(%rsp), %rdx
leaq 0x5a0(%rsp), %rdi
callq 0x8790
jmp 0x3088e
leaq 0x58b(%rsp), %rdi
movq %rdi, 0x138(%rsp)
callq 0x8810
movq 0x148(%rsp), %rsi
movq 0x138(%rsp), %rcx
leaq 0x5b8(%rsp), %rdi
leaq 0x5a0(%rsp), %rdx
callq 0x8820
jmp 0x308ca
leaq 0x58a(%rsp), %rdi
movq %rdi, 0x130(%rsp)
callq 0x8920
movq 0x140(%rsp), %rsi
movq 0x130(%rsp), %rcx
leaq 0x5d0(%rsp), %rdi
leaq 0x5b8(%rsp), %rdx
callq 0x332e0
jmp 0x30906
leaq 0x58a(%rsp), %rdi
callq 0x89b0
leaq 0x5b8(%rsp), %rdi
callq 0x8b40
leaq 0x58b(%rsp), %rdi
callq 0x88a0
leaq 0x5a0(%rsp), %rdi
callq 0x88b0
leaq 0x59f(%rsp), %rdi
callq 0x8910
movq 0x5f0(%rsp), %rdi
addq $0x2c88, %rdi           # imm = 0x2C88
callq 0x16bb0
movq %rax, 0x110(%rsp)
movslq 0x5e8(%rsp), %rax
movq %rax, 0x118(%rsp)
movq 0x5f0(%rsp), %rax
movslq 0x2c0c(%rax), %rax
movq %rax, 0x120(%rsp)
leaq 0x53f(%rsp), %rdi
movq %rdi, 0x128(%rsp)
callq 0x8780
movq 0x120(%rsp), %rsi
movq 0x128(%rsp), %rdx
leaq 0x540(%rsp), %rdi
callq 0x8790
jmp 0x309be
leaq 0x53e(%rsp), %rdi
movq %rdi, 0x108(%rsp)
callq 0x8810
movq 0x118(%rsp), %rsi
movq 0x108(%rsp), %rcx
leaq 0x558(%rsp), %rdi
leaq 0x540(%rsp), %rdx
callq 0x8820
jmp 0x309fa
leaq 0x53d(%rsp), %rdi
movq %rdi, 0x100(%rsp)
callq 0x8920
movq 0x110(%rsp), %rsi
movq 0x100(%rsp), %rcx
leaq 0x570(%rsp), %rdi
leaq 0x558(%rsp), %rdx
callq 0x332e0
jmp 0x30a36
leaq 0x53d(%rsp), %rdi
callq 0x89b0
leaq 0x558(%rsp), %rdi
callq 0x8b40
leaq 0x53e(%rsp), %rdi
callq 0x88a0
leaq 0x540(%rsp), %rdi
callq 0x88b0
leaq 0x53f(%rsp), %rdi
callq 0x8910
movq 0x5f0(%rsp), %rsi
movl 0x5ec(%rsp), %edx
movl 0x2c10(%rsi), %ecx
movl 0x2c14(%rsi), %r8d
movl 0x2c18(%rsi), %r9d
leaq 0x248(%rsp), %rdi
movsd 0x2b756(%rip), %xmm0    # 0x5c200
callq 0x1c600
jmp 0x30ab1
movl $0x0, 0x244(%rsp)
movl 0x244(%rsp), %eax
movq 0x5f0(%rsp), %rcx
cmpl 0x2c0c(%rcx), %eax
jge 0x314eb
movslq 0x244(%rsp), %rsi
incq %rsi
leaq 0x1a0(%rsp), %rdi
callq 0xcb30
jmp 0x30af1
leaq 0x2c008(%rip), %rsi     # 0x5cb00
leaq 0x1c0(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
callq 0xcae0
jmp 0x30b0f
leaq 0x2bff6(%rip), %rdx     # 0x5cb0c
leaq 0x1e0(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x22900
jmp 0x30b2d
movq 0x5f0(%rsp), %rax
movslq 0x2c0c(%rax), %rsi
leaq 0x180(%rsp), %rdi
callq 0xcb30
jmp 0x30b4b
leaq 0x200(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
leaq 0x180(%rsp), %rdx
callq 0xc9f0
jmp 0x30b6a
leaq 0x2bd21(%rip), %rdx     # 0x5c892
leaq 0x220(%rsp), %rdi
leaq 0x200(%rsp), %rsi
callq 0x22900
jmp 0x30b88
movq 0x5f0(%rsp), %rax
movq %rax, %rdx
addq $0x970, %rdx            # imm = 0x970
movzbl 0x2c3c(%rax), %esi
andl $0x1, %esi
leaq 0x220(%rsp), %rdi
callq 0x3a160
jmp 0x30bb3
leaq 0x220(%rsp), %rdi
callq 0x4270
leaq 0x200(%rsp), %rdi
callq 0x4270
leaq 0x180(%rsp), %rdi
callq 0x4270
leaq 0x1e0(%rsp), %rdi
callq 0x4270
leaq 0x1c0(%rsp), %rdi
callq 0x4270
leaq 0x1a0(%rsp), %rdi
callq 0x4270
cmpl $0x0, 0x244(%rsp)
jne 0x30e41
leaq 0x248(%rsp), %rdi
movl $0x1, %esi
callq 0x1dfe0
jmp 0x30c23
jmp 0x30e54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
jmp 0x30c9c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
jmp 0x30c82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
leaq 0x58a(%rsp), %rdi
callq 0x89b0
leaq 0x5b8(%rsp), %rdi
callq 0x8b40
leaq 0x58b(%rsp), %rdi
callq 0x88a0
leaq 0x5a0(%rsp), %rdi
callq 0x88b0
leaq 0x59f(%rsp), %rdi
callq 0x8910
jmp 0x31b29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
jmp 0x30d22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
jmp 0x30d08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
leaq 0x53d(%rsp), %rdi
callq 0x89b0
leaq 0x558(%rsp), %rdi
callq 0x8b40
leaq 0x53e(%rsp), %rdi
callq 0x88a0
leaq 0x540(%rsp), %rdi
callq 0x88b0
leaq 0x53f(%rsp), %rdi
callq 0x8910
jmp 0x31b1c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
jmp 0x31b0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
jmp 0x31b02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
jmp 0x30e2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
jmp 0x30e22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
jmp 0x30e15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
jmp 0x30e08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
jmp 0x30dfb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x590(%rsp)
movl %eax, 0x58c(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x4270
leaq 0x200(%rsp), %rdi
callq 0x4270
leaq 0x180(%rsp), %rdi
callq 0x4270
leaq 0x1e0(%rsp), %rdi
callq 0x4270
leaq 0x1c0(%rsp), %rdi
callq 0x4270
leaq 0x1a0(%rsp), %rdi
callq 0x4270
jmp 0x31b02
leaq 0x248(%rsp), %rdi
xorl %esi, %esi
callq 0x1dfe0
jmp 0x30e52
jmp 0x30e54
movq 0x5f0(%rsp), %rsi
movl 0x244(%rsp), %edx
movzbl 0x2c3d(%rsi), %r9d
movzbl 0x2c4f(%rsi), %r8d
movzbl 0x2c48(%rsi), %ecx
movq %rsp, %rax
movl %edx, 0x8(%rax)
andl $0x1, %ecx
movl %ecx, (%rax)
andl $0x1, %r8d
andl $0x1, %r9d
leaq 0x248(%rsp), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x1edf0
jmp 0x30ea3
movq 0x5f0(%rsp), %rax
testb $0x1, 0x2c4f(%rax)
je 0x310c6
movl $0x0, 0x17c(%rsp)
movl 0x17c(%rsp), %eax
movq 0x5f0(%rsp), %rcx
cmpl 0x2d18(%rcx), %eax
jge 0x30fa6
movl $0x0, 0x178(%rsp)
movl 0x178(%rsp), %eax
cmpl 0x5e8(%rsp), %eax
jge 0x30f8e
leaq 0x248(%rsp), %rdi
addq $0x218, %rdi            # imm = 0x218
movslq 0x17c(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x178(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0xf8(%rsp)
movslq 0x17c(%rsp), %rsi
leaq 0x5d0(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x178(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd 0xf8(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x178(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x178(%rsp)
jmp 0x30ee9
jmp 0x30f90
movl 0x17c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x17c(%rsp)
jmp 0x30ec3
movq 0x5f0(%rsp), %rax
testb $0x1, 0x2c3f(%rax)
je 0x310c4
movl $0x0, 0x174(%rsp)
movl 0x174(%rsp), %eax
movl %eax, 0xf4(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2c88, %rdi           # imm = 0x2C88
callq 0x16bb0
movq %rax, %rcx
movl 0xf4(%rsp), %eax
cmpl %ecx, %eax
jge 0x310c2
movl $0x0, 0x170(%rsp)
movl 0x170(%rsp), %eax
cmpl 0x5e8(%rsp), %eax
jge 0x310aa
leaq 0x248(%rsp), %rdi
addq $0x230, %rdi            # imm = 0x230
movslq 0x174(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x170(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0xe8(%rsp)
movslq 0x174(%rsp), %rsi
leaq 0x570(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x170(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd 0xe8(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x170(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x170(%rsp)
jmp 0x31005
jmp 0x310ac
movl 0x174(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x174(%rsp)
jmp 0x30fc6
jmp 0x310c4
jmp 0x310c6
movsd 0x3b0(%rsp), %xmm0
movsd %xmm0, 0xb0(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2e18, %rdi           # imm = 0x2E18
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd 0xb0(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x3a0(%rsp), %xmm0
movq 0x5f0(%rsp), %rax
cvtsi2sdl 0x2c14(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xb8(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2e60, %rdi           # imm = 0x2E60
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd 0xb8(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x3a8(%rsp), %xmm0
movq 0x5f0(%rsp), %rax
cvtsi2sdl 0x2c14(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xc8(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2e60, %rdi           # imm = 0x2E60
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0xc0(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2e60, %rdi           # imm = 0x2E60
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd 0xc0(%rsp), %xmm0
movsd 0xc8(%rsp), %xmm1
movsd (%rax), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2e78, %rdi           # imm = 0x2E78
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x5f0(%rsp), %rdi
addq $0x2e60, %rdi           # imm = 0x2E60
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0xd8(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2e78, %rdi           # imm = 0x2E78
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd 0xd8(%rsp), %xmm1
movsd (%rax), %xmm0
movsd 0x2b7dc(%rip), %xmm2    # 0x5cac8
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xe0(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2e90, %rdi           # imm = 0x2E90
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd 0xe0(%rsp), %xmm0
movsd %xmm0, (%rax)
cmpl $0x0, 0x5ec(%rsp)
jle 0x313fd
movq 0x5f0(%rsp), %rdi
addq $0x2e90, %rdi           # imm = 0x2E90
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0xa0(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2e90, %rdi           # imm = 0x2E90
movl 0x5ec(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd 0xa0(%rsp), %xmm0
subsd (%rax), %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x30d8, %rdi           # imm = 0x30D8
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd 0xa8(%rsp), %xmm0
movsd %xmm0, (%rax)
cmpl $0x1, 0x5ec(%rsp)
jle 0x314d3
movq 0x5f0(%rsp), %rdi
addq $0x30d8, %rdi           # imm = 0x30D8
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x30d8, %rdi           # imm = 0x30D8
movl 0x5ec(%rsp), %eax
decl %eax
movslq %eax, %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd 0x90(%rsp), %xmm0
movsd (%rax), %xmm1
subsd %xmm1, %xmm0
callq 0x33360
movsd %xmm0, 0x98(%rsp)
jmp 0x31495
movq 0x5f0(%rsp), %rdi
addq $0x30f0, %rdi           # imm = 0x30F0
movl 0x5ec(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x244(%rsp), %rsi
callq 0x8c20
movsd 0x98(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x314d5
movl 0x244(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x244(%rsp)
jmp 0x30abc
movq 0x5f0(%rsp), %rax
testb $0x1, 0x2c4f(%rax)
je 0x31850
movl $0x0, 0x16c(%rsp)
movl 0x16c(%rsp), %eax
movq 0x5f0(%rsp), %rcx
cmpl 0x2d18(%rcx), %eax
jge 0x316a2
movl $0x0, 0x168(%rsp)
movl 0x168(%rsp), %eax
cmpl 0x5e8(%rsp), %eax
jge 0x3168a
movslq 0x16c(%rsp), %rsi
leaq 0x5d0(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x168(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
callq 0x33380
movsd %xmm0, 0x88(%rsp)
jmp 0x3157d
movq 0x5f0(%rsp), %rdi
addq $0x2da0, %rdi           # imm = 0x2DA0
movslq 0x5ec(%rsp), %rsi
callq 0x8ae0
movq %rax, %rdi
movslq 0x16c(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x168(%rsp), %rsi
callq 0x8c20
movsd 0x88(%rsp), %xmm0
movsd %xmm0, (%rax)
movslq 0x16c(%rsp), %rsi
leaq 0x5d0(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x168(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x333e0
movsd %xmm0, 0x80(%rsp)
jmp 0x31606
movsd 0x80(%rsp), %xmm0
movq 0x5f0(%rsp), %rax
cvtsi2sdl 0x2c0c(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x4370
movsd %xmm0, 0x78(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2db8, %rdi           # imm = 0x2DB8
movslq 0x5ec(%rsp), %rsi
callq 0x8ae0
movq %rax, %rdi
movslq 0x16c(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x168(%rsp), %rsi
callq 0x8c20
movsd 0x78(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x168(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x168(%rsp)
jmp 0x31531
jmp 0x3168c
movl 0x16c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x16c(%rsp)
jmp 0x3150b
movq 0x5f0(%rsp), %rax
testb $0x1, 0x2c3f(%rax)
je 0x3184e
movl $0x0, 0x164(%rsp)
movl 0x164(%rsp), %eax
movl %eax, 0x74(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2c88, %rdi           # imm = 0x2C88
callq 0x16bb0
movq %rax, %rcx
movl 0x74(%rsp), %eax
cmpl %ecx, %eax
jge 0x3184c
movl $0x0, 0x160(%rsp)
movl 0x160(%rsp), %eax
cmpl 0x5e8(%rsp), %eax
jge 0x31834
movslq 0x164(%rsp), %rsi
leaq 0x570(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x160(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
callq 0x33380
movsd %xmm0, 0x68(%rsp)
jmp 0x31744
movq 0x5f0(%rsp), %rdi
addq $0x2dd0, %rdi           # imm = 0x2DD0
movslq 0x5ec(%rsp), %rsi
callq 0x8ae0
movq %rax, %rdi
movslq 0x164(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x160(%rsp), %rsi
callq 0x8c20
movsd 0x68(%rsp), %xmm0
movsd %xmm0, (%rax)
movslq 0x164(%rsp), %rsi
leaq 0x570(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x160(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x333e0
movsd %xmm0, 0x60(%rsp)
jmp 0x317c7
movsd 0x60(%rsp), %xmm0
callq 0x4370
movsd %xmm0, 0x58(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2de8, %rdi           # imm = 0x2DE8
movslq 0x5ec(%rsp), %rsi
callq 0x8ae0
movq %rax, %rdi
movslq 0x164(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x160(%rsp), %rsi
callq 0x8c20
movsd 0x58(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x160(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x160(%rsp)
jmp 0x316fb
jmp 0x31836
movl 0x164(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x164(%rsp)
jmp 0x316c2
jmp 0x3184e
jmp 0x31850
movq 0x5f0(%rsp), %rdi
addq $0x2e18, %rdi           # imm = 0x2E18
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
callq 0x33380
movsd %xmm0, 0x50(%rsp)
jmp 0x3187c
movq 0x5f0(%rsp), %rdi
addq $0x2e30, %rdi           # imm = 0x2E30
movslq 0x5ec(%rsp), %rsi
callq 0x8c20
movsd 0x50(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x5f0(%rsp), %rax
cmpl $0x1, 0x2c0c(%rax)
jle 0x31932
movq 0x5f0(%rsp), %rdi
addq $0x2e18, %rdi           # imm = 0x2E18
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x333e0
movsd %xmm0, 0x48(%rsp)
jmp 0x318e7
movsd 0x48(%rsp), %xmm0
movq 0x5f0(%rsp), %rax
cvtsi2sdl 0x2c0c(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x4370
movsd %xmm0, 0x40(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2e48, %rdi           # imm = 0x2E48
movslq 0x5ec(%rsp), %rsi
callq 0x8c20
movsd 0x40(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x5f0(%rsp), %rdi
addq $0x2e90, %rdi           # imm = 0x2E90
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
callq 0x33380
movsd %xmm0, 0x38(%rsp)
jmp 0x3195e
movq 0x5f0(%rsp), %rdi
addq $0x2ea8, %rdi           # imm = 0x2EA8
movslq 0x5ec(%rsp), %rsi
callq 0x8c20
movsd 0x38(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x5f0(%rsp), %rax
cmpl $0x1, 0x2c0c(%rax)
jle 0x31a14
movq 0x5f0(%rsp), %rdi
addq $0x2e90, %rdi           # imm = 0x2E90
movslq 0x5ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x333e0
movsd %xmm0, 0x30(%rsp)
jmp 0x319c9
movsd 0x30(%rsp), %xmm0
movq 0x5f0(%rsp), %rax
cvtsi2sdl 0x2c0c(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x4370
movsd %xmm0, 0x28(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x2ec0, %rdi           # imm = 0x2EC0
movslq 0x5ec(%rsp), %rsi
callq 0x8c20
movsd 0x28(%rsp), %xmm0
movsd %xmm0, (%rax)
cmpl $0x1, 0x5ec(%rsp)
jle 0x31ad3
movq 0x5f0(%rsp), %rdi
addq $0x30f0, %rdi           # imm = 0x30F0
movl 0x5ec(%rsp), %eax
decl %eax
movslq %eax, %rsi
callq 0x8bc0
movq %rax, %rdi
callq 0x33380
movsd %xmm0, 0x20(%rsp)
jmp 0x31a52
movq 0x5f0(%rsp), %rdi
addq $0x2e90, %rdi           # imm = 0x2E90
movl 0x5ec(%rsp), %eax
decl %eax
movslq %eax, %rsi
callq 0x8bc0
movq %rax, %rdi
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x333e0
movsd %xmm0, 0x18(%rsp)
jmp 0x31a8a
movsd 0x18(%rsp), %xmm0
callq 0x4370
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x5f0(%rsp), %rdi
addq $0x3108, %rdi           # imm = 0x3108
movl 0x5ec(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8c20
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x248(%rsp), %rdi
callq 0x22a80
leaq 0x570(%rsp), %rdi
callq 0x8a00
leaq 0x5d0(%rsp), %rdi
callq 0x8a00
addq $0x5f8, %rsp            # imm = 0x5F8
retq
leaq 0x248(%rsp), %rdi
callq 0x22a80
leaq 0x570(%rsp), %rdi
callq 0x8a00
leaq 0x5d0(%rsp), %rdi
callq 0x8a00
movq 0x590(%rsp), %rdi
callq 0x4730
nopw %cs:(%rax,%rax)