// File: bobverity[P]MavericK/EM_algorithm.cpp
// Function: EM_admix(globals&, int)
void EM_admix(globals &globals, int Kindex) {
    int K = globals.Kmin+Kindex;
    
    // create empty objects
    int geneCopies = sum(globals.ploidy_vec)*globals.loci;
    vector< vector<double> > logProbMat(geneCopies,vector<double>(K,-log(double(K))));
    double logProbSum;
    vector< vector< vector<double> > > logAlleleFreqs(K);
    double logAlleleFreqsSum;
    vector< vector<double> > logAdmixFreqs(globals.n,vector<double>(K));
    double logLike=0;
    double logLike_this_i=0;
    double logLike_this_ik=0;
    
    // initialise logAlleleFreqs and logAdmixFreqs and zero global maximum likelihood allele frequencies
    globals.max_alleleFreqs = vector< vector< vector<double> > >(K);
    globals.max_admixFreqs = vector< vector<double> >(globals.n,vector<double>(K));
    for (int k=0; k<K; k++) {
        logAlleleFreqs[k] = vector< vector<double> >(globals.loci);
        globals.max_alleleFreqs[k] = vector< vector<double> >(globals.loci);
        for (int l=0; l<globals.loci; l++) {
            logAlleleFreqs[k][l] = vector<double>(globals.J[l]);
            globals.max_alleleFreqs[k][l] = vector<double>(globals.J[l]);
        }
    }
    
    // repeat EM multiple times
    globals.maxLike = log(double(0));
    for (int EMrep=0; EMrep<globals.EMrepeats; EMrep++) {
        
        // initialise random allele frequencies
        for (int k=0; k<K; k++) {
            for (int l=0; l<globals.loci; l++) {
                logAlleleFreqsSum = log(double(0));
                for (int j=0; j<globals.J[l]; j++) {
                    logAlleleFreqs[k][l][j] = log(runif1(0.1,0.9));
                    logAlleleFreqsSum = logSum(logAlleleFreqsSum, logAlleleFreqs[k][l][j]);
                }
                for (int j=0; j<globals.J[l]; j++) {
                    logAlleleFreqs[k][l][j] -= logAlleleFreqsSum;
                }
            }
        }
        
        // EM iterations
        for (int EMiter=0; EMiter<globals.EMiterations; EMiter++) {
            
            // loop through all individuals
            int groupIndex = -1;
            for (int i=0; i<globals.n; i++) {
                
                // zero admixture freqs for this individual
                for (int k=0; k<K; k++) {
                    logAdmixFreqs[i][k] = log(double(0));
                }
                
                // calculate probability matrix and contribute to ML admixture freqs
                for (int l=0; l<globals.loci; l++) {
                    for (int p=0; p<globals.ploidy_vec[i]; p++) {
                        groupIndex++;
                        if (globals.data[i][l][p]!=0) {
                            logProbSum = log(double(0));
                            for (int k=0; k<K; k++) {
                                logProbMat[groupIndex][k] = logAlleleFreqs[k][l][globals.data[i][l][p]-1];
                                logProbSum = logSum(logProbSum,logProbMat[groupIndex][k]);
                            }
                            for (int k=0; k<K; k++) {
                                logProbMat[groupIndex][k] -= logProbSum;
                            }
                        }
                        for (int k=0; k<K; k++) {
                            logAdmixFreqs[i][k] = logSum(logAdmixFreqs[i][k],logProbMat[groupIndex][k]-log(double(globals.loci))-log(double(globals.ploidy_vec[i])));
                        }
                    }
                }
            } // i loop
            
            // zero allele frequencies
            for (int k=0; k<K; k++) {
                for (int l=0; l<globals.loci; l++) {
                    for (int j=0; j<globals.J[l]; j++) {
                        logAlleleFreqs[k][l][j] = log(double(0));
                    }
                }
            }
            
            // add contribution to allele frequencies
            groupIndex = -1;
            for (int i=0; i<globals.n; i++) {
                for (int l=0; l<globals.loci; l++) {
                    for (int p=0; p<globals.ploidy_vec[i]; p++) {
                        groupIndex++;
                        if (globals.data[i][l][p]!=0) {
                            for (int k=0; k<K; k++) {
                                logAlleleFreqs[k][l][globals.data[i][l][p]-1] = logSum(logAlleleFreqs[k][l][globals.data[i][l][p]-1], logAdmixFreqs[i][k]+logProbMat[groupIndex][k]);
                            }
                        }
                    }
                }
            }
            
            // normalise allele frequencies
            for (int k=0; k<K; k++) {
                for (int l=0; l<globals.loci; l++) {
                    logProbSum = log(double(0));
                    for (int j=0; j<globals.J[l]; j++) {
                        logProbSum = logSum(logProbSum, logAlleleFreqs[k][l][j]);
                    }
                    for (int j=0; j<globals.J[l]; j++) {
                        logAlleleFreqs[k][l][j] -= logProbSum;
                    }
                }
            }
            
        } // end of EM iterations loop
        
        
        logLike = 0;
        for (int i=0; i<globals.n; i++) {
            logLike_this_i = log(double(0));
            for (int k=0; k<K; k++) {
                logLike_this_ik = 0;
                for (int l=0; l<globals.loci; l++) {
                    for (int p=0; p<globals.ploidy_vec[i]; p++) {
                        if (globals.data[i][l][p]!=0) {
                            logLike_this_ik += logAlleleFreqs[k][l][globals.data[i][l][p]-1];
                        }
                    }
                }
                logLike_this_i = logSum(logLike_this_i, logLike_this_ik - log(double(K)));
            }
            logLike += logLike_this_i;
        }
        
        // calculate log-likelihood
        double logLike = 0;
        double temp;
        for (int i=0; i<globals.n; i++) {
            for (int l=0; l<globals.loci; l++) {
                for (int p=0; p<globals.ploidy; p++) {
                    if (globals.data[i][l][p]!=0) {
                        temp = log(double(0));
                        for (int k=0; k<K; k++) {
                            temp = logSum(temp, logAdmixFreqs[i][k]+logAlleleFreqs[k][l][globals.data[i][l][p]-1]);
                        }
                        logLike += temp;
                    }
                }
            }
        }
        
        // replace current values if more likely
        if (logLike>globals.maxLike) {
            globals.maxLike = logLike;
            for (int k=0; k<K; k++) {
                for (int l=0; l<globals.loci; l++) {
                    for (int j=0; j<globals.J[l]; j++) {
                        globals.max_alleleFreqs[k][l][j] = exp(logAlleleFreqs[k][l][j]);
                    }
                }
            }
            for (int i=0; i<globals.n; i++) {
                for (int k=0; k<K; k++) {
                    globals.max_admixFreqs[i][k] = exp(logAdmixFreqs[i][k]);
                }
            }
        }
        
    } // end of repeat EM loop
    
    // calculate model comparison statistics
    if (globals.outputComparisonStatistics_on) {
        
        int freeParameters = K*(sum(globals.J)-globals.loci) + globals.n*(K-1);
        globals.AIC[Kindex] = 2*freeParameters - 2*globals.maxLike;
        globals.BIC[Kindex] = freeParameters*log(double(globals.geneCopies)) - 2*globals.maxLike;
        globals.DIC_Spiegelhalter[Kindex] = -4*globals.structure_loglike_mean[Kindex][0] + 2*globals.maxLike;
        globals.DIC_Gelman[Kindex] = -2*globals.structure_loglike_mean[Kindex][0] + 2*globals.structure_loglike_var[Kindex][0];
        
    }
    
}

// Assembly:
subq $0x4e8, %rsp            # imm = 0x4E8
movq %rdi, 0x4e0(%rsp)
movl %esi, 0x4dc(%rsp)
movq 0x4e0(%rsp), %rax
movl 0x2bc8(%rax), %eax
movl 0x4dc(%rsp), %ecx
addl %ecx, %eax
movl %eax, 0x4d8(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2cd0, %rdi           # imm = 0x2CD0
callq 0x8c80
movq 0x4e0(%rsp), %rcx
movl 0x2d1c(%rcx), %ecx
imull %ecx, %eax
movl %eax, 0x4d4(%rsp)
movslq 0x4d4(%rsp), %rax
movq %rax, 0x268(%rsp)
movslq 0x4d8(%rsp), %rax
movq %rax, 0x270(%rsp)
cvtsi2sd %eax, %xmm0
callq 0x4390
movaps 0x55960(%rip), %xmm1    # 0x5c030
pxor %xmm1, %xmm0
movlpd %xmm0, 0x498(%rsp)
leaq 0x497(%rsp), %rdi
movq %rdi, 0x278(%rsp)
callq 0x8780
movq 0x270(%rsp), %rsi
movq 0x278(%rsp), %rcx
leaq 0x4a0(%rsp), %rdi
leaq 0x498(%rsp), %rdx
callq 0x8cf0
jmp 0x6719
leaq 0x483(%rsp), %rdi
movq %rdi, 0x260(%rsp)
callq 0x8810
movq 0x268(%rsp), %rsi
movq 0x260(%rsp), %rcx
leaq 0x4b8(%rsp), %rdi
leaq 0x4a0(%rsp), %rdx
callq 0x8820
jmp 0x6755
leaq 0x483(%rsp), %rdi
callq 0x88a0
leaq 0x4a0(%rsp), %rdi
callq 0x88b0
leaq 0x497(%rsp), %rdi
callq 0x8910
movslq 0x4d8(%rsp), %rax
movq %rax, 0x250(%rsp)
leaq 0x45f(%rsp), %rdi
movq %rdi, 0x258(%rsp)
callq 0x8920
movq 0x250(%rsp), %rsi
movq 0x258(%rsp), %rdx
leaq 0x460(%rsp), %rdi
callq 0x8930
jmp 0x67c0
leaq 0x45f(%rsp), %rdi
callq 0x89b0
movq 0x4e0(%rsp), %rax
movslq 0x2d18(%rax), %rax
movq %rax, 0x238(%rsp)
movslq 0x4d8(%rsp), %rax
movq %rax, 0x240(%rsp)
leaq 0x41f(%rsp), %rdi
movq %rdi, 0x248(%rsp)
callq 0x8780
movq 0x240(%rsp), %rsi
movq 0x248(%rsp), %rdx
leaq 0x420(%rsp), %rdi
callq 0x8790
jmp 0x6828
leaq 0x41e(%rsp), %rdi
movq %rdi, 0x230(%rsp)
callq 0x8810
movq 0x238(%rsp), %rsi
movq 0x230(%rsp), %rcx
leaq 0x438(%rsp), %rdi
leaq 0x420(%rsp), %rdx
callq 0x8820
jmp 0x6864
leaq 0x41e(%rsp), %rdi
callq 0x88a0
leaq 0x420(%rsp), %rdi
callq 0x88b0
leaq 0x41f(%rsp), %rdi
callq 0x8910
movq $0x0, 0x410(%rsp)
movq $0x0, 0x408(%rsp)
movq $0x0, 0x400(%rsp)
movslq 0x4d8(%rsp), %rax
movq %rax, 0x220(%rsp)
leaq 0x3e7(%rsp), %rdi
movq %rdi, 0x228(%rsp)
callq 0x8920
movq 0x220(%rsp), %rsi
movq 0x228(%rsp), %rdx
leaq 0x3e8(%rsp), %rdi
callq 0x8930
jmp 0x68f3
movq 0x4e0(%rsp), %rdi
addq $0x3048, %rdi           # imm = 0x3048
leaq 0x3e8(%rsp), %rsi
movq %rsi, 0x200(%rsp)
callq 0x89c0
movq 0x200(%rsp), %rdi
callq 0x8a00
leaq 0x3e7(%rsp), %rdi
callq 0x89b0
movq 0x4e0(%rsp), %rax
movslq 0x2d18(%rax), %rax
movq %rax, 0x208(%rsp)
movslq 0x4d8(%rsp), %rax
movq %rax, 0x210(%rsp)
leaq 0x3af(%rsp), %rdi
movq %rdi, 0x218(%rsp)
callq 0x8780
movq 0x210(%rsp), %rsi
movq 0x218(%rsp), %rdx
leaq 0x3b0(%rsp), %rdi
callq 0x8790
jmp 0x698c
leaq 0x3ae(%rsp), %rdi
movq %rdi, 0x1f8(%rsp)
callq 0x8810
movq 0x208(%rsp), %rsi
movq 0x1f8(%rsp), %rcx
leaq 0x3c8(%rsp), %rdi
leaq 0x3b0(%rsp), %rdx
callq 0x8820
jmp 0x69c8
movq 0x4e0(%rsp), %rdi
addq $0x3060, %rdi           # imm = 0x3060
leaq 0x3c8(%rsp), %rsi
callq 0x8b00
leaq 0x3c8(%rsp), %rdi
callq 0x8b40
leaq 0x3ae(%rsp), %rdi
callq 0x88a0
leaq 0x3b0(%rsp), %rdi
callq 0x88b0
leaq 0x3af(%rsp), %rdi
callq 0x8910
movl $0x0, 0x3a8(%rsp)
movl 0x3a8(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x6ef7
movq 0x4e0(%rsp), %rax
movslq 0x2d1c(%rax), %rax
movq %rax, 0x1e8(%rsp)
leaq 0x38f(%rsp), %rdi
movq %rdi, 0x1f0(%rsp)
callq 0x8810
movq 0x1e8(%rsp), %rsi
movq 0x1f0(%rsp), %rdx
leaq 0x390(%rsp), %rdi
callq 0x8a60
jmp 0x6a82
movslq 0x3a8(%rsp), %rsi
leaq 0x460(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
leaq 0x390(%rsp), %rsi
movq %rsi, 0x1d0(%rsp)
callq 0x8b00
movq 0x1d0(%rsp), %rdi
callq 0x8b40
leaq 0x38f(%rsp), %rdi
callq 0x88a0
movq 0x4e0(%rsp), %rax
movslq 0x2d1c(%rax), %rax
movq %rax, 0x1d8(%rsp)
leaq 0x36f(%rsp), %rdi
movq %rdi, 0x1e0(%rsp)
callq 0x8810
movq 0x1d8(%rsp), %rsi
movq 0x1e0(%rsp), %rdx
leaq 0x370(%rsp), %rdi
callq 0x8a60
jmp 0x6b14
movq 0x4e0(%rsp), %rdi
addq $0x3048, %rdi           # imm = 0x3048
movslq 0x3a8(%rsp), %rsi
callq 0x8ae0
movq %rax, %rdi
leaq 0x370(%rsp), %rsi
callq 0x8b00
leaq 0x370(%rsp), %rdi
callq 0x8b40
leaq 0x36f(%rsp), %rdi
callq 0x88a0
movl $0x0, 0x368(%rsp)
movl 0x368(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d1c(%rcx), %eax
jge 0x6edf
movq 0x4e0(%rsp), %rdi
addq $0x2d20, %rdi           # imm = 0x2D20
movslq 0x368(%rsp), %rsi
callq 0x8ba0
movslq (%rax), %rax
movq %rax, 0x1c0(%rsp)
leaq 0x34f(%rsp), %rdi
movq %rdi, 0x1c8(%rsp)
callq 0x8780
movq 0x1c0(%rsp), %rsi
movq 0x1c8(%rsp), %rdx
leaq 0x350(%rsp), %rdi
callq 0x8790
jmp 0x6bdb
movslq 0x3a8(%rsp), %rsi
leaq 0x460(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x368(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
leaq 0x350(%rsp), %rsi
movq %rsi, 0x1a8(%rsp)
callq 0x8be0
movq 0x1a8(%rsp), %rdi
callq 0x88b0
leaq 0x34f(%rsp), %rdi
callq 0x8910
movq 0x4e0(%rsp), %rdi
addq $0x2d20, %rdi           # imm = 0x2D20
movslq 0x368(%rsp), %rsi
callq 0x8ba0
movslq (%rax), %rax
movq %rax, 0x1b0(%rsp)
leaq 0x32f(%rsp), %rdi
movq %rdi, 0x1b8(%rsp)
callq 0x8780
movq 0x1b0(%rsp), %rsi
movq 0x1b8(%rsp), %rdx
leaq 0x330(%rsp), %rdi
callq 0x8790
jmp 0x6c8d
movq 0x4e0(%rsp), %rdi
addq $0x3048, %rdi           # imm = 0x3048
movslq 0x3a8(%rsp), %rsi
callq 0x8ae0
movq %rax, %rdi
movslq 0x368(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
leaq 0x330(%rsp), %rsi
callq 0x8be0
leaq 0x330(%rsp), %rdi
callq 0x88b0
leaq 0x32f(%rsp), %rdi
callq 0x8910
movl 0x368(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x368(%rsp)
jmp 0x6b65
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
jmp 0x6d3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
leaq 0x483(%rsp), %rdi
callq 0x88a0
leaq 0x4a0(%rsp), %rdi
callq 0x88b0
leaq 0x497(%rsp), %rdi
callq 0x8910
jmp 0x8769
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
leaq 0x45f(%rsp), %rdi
callq 0x89b0
jmp 0x875c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
jmp 0x6db9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
leaq 0x41e(%rsp), %rdi
callq 0x88a0
leaq 0x420(%rsp), %rdi
callq 0x88b0
leaq 0x41f(%rsp), %rdi
callq 0x8910
jmp 0x874f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
leaq 0x3e7(%rsp), %rdi
callq 0x89b0
jmp 0x8742
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
jmp 0x6e35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
leaq 0x3ae(%rsp), %rdi
callq 0x88a0
leaq 0x3b0(%rsp), %rdi
callq 0x88b0
leaq 0x3af(%rsp), %rdi
callq 0x8910
jmp 0x8742
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
leaq 0x38f(%rsp), %rdi
callq 0x88a0
jmp 0x8742
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
leaq 0x36f(%rsp), %rdi
callq 0x88a0
jmp 0x8742
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
leaq 0x34f(%rsp), %rdi
callq 0x8910
jmp 0x8742
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
leaq 0x32f(%rsp), %rdi
callq 0x8910
jmp 0x8742
jmp 0x6ee1
movl 0x3a8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3a8(%rsp)
jmp 0x6a23
xorps %xmm0, %xmm0
callq 0x4390
movq 0x4e0(%rsp), %rax
movsd %xmm0, 0x3040(%rax)
movl $0x0, 0x328(%rsp)
movl 0x328(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2c34(%rcx), %eax
jge 0x849b
movl $0x0, 0x324(%rsp)
movl 0x324(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x71dd
movl $0x0, 0x320(%rsp)
movl 0x320(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d1c(%rcx), %eax
jge 0x71c5
xorps %xmm0, %xmm0
callq 0x4390
movsd %xmm0, 0x450(%rsp)
movl $0x0, 0x31c(%rsp)
movl 0x31c(%rsp), %eax
movl %eax, 0x1a4(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d20, %rdi           # imm = 0x2D20
movslq 0x320(%rsp), %rsi
callq 0x8ba0
movq %rax, %rcx
movl 0x1a4(%rsp), %eax
cmpl (%rcx), %eax
jge 0x70f8
movsd 0x55046(%rip), %xmm0    # 0x5c020
movsd 0x55046(%rip), %xmm1    # 0x5c028
callq 0x39150
movsd %xmm0, 0x198(%rsp)
jmp 0x6ff2
movsd 0x198(%rsp), %xmm0
callq 0x4390
movsd %xmm0, 0x178(%rsp)
movslq 0x324(%rsp), %rsi
leaq 0x460(%rsp), %rdi
movq %rdi, 0x180(%rsp)
callq 0x8ae0
movq %rax, %rdi
movslq 0x320(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x31c(%rsp), %rsi
callq 0x8c20
movsd 0x178(%rsp), %xmm0
movq 0x180(%rsp), %rdi
movsd %xmm0, (%rax)
movsd 0x450(%rsp), %xmm0
movsd %xmm0, 0x188(%rsp)
movslq 0x324(%rsp), %rsi
callq 0x8ae0
movq %rax, %rdi
movslq 0x320(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x31c(%rsp), %rsi
callq 0x8c20
movsd 0x188(%rsp), %xmm0
movsd (%rax), %xmm1
callq 0x339b0
movsd %xmm0, 0x190(%rsp)
jmp 0x70b7
movsd 0x190(%rsp), %xmm0
movsd %xmm0, 0x450(%rsp)
movl 0x31c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x31c(%rsp)
jmp 0x6f96
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x488(%rsp)
movl %eax, 0x484(%rsp)
jmp 0x8742
movl $0x0, 0x318(%rsp)
movl 0x318(%rsp), %eax
movl %eax, 0x174(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d20, %rdi           # imm = 0x2D20
movslq 0x320(%rsp), %rsi
callq 0x8ba0
movq %rax, %rcx
movl 0x174(%rsp), %eax
cmpl (%rcx), %eax
jge 0x71ad
movsd 0x450(%rsp), %xmm0
movsd %xmm0, 0x168(%rsp)
movslq 0x324(%rsp), %rsi
leaq 0x460(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x320(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x318(%rsp), %rsi
callq 0x8c20
movsd 0x168(%rsp), %xmm1
movsd (%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movl 0x318(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x318(%rsp)
jmp 0x7103
jmp 0x71af
movl 0x320(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x320(%rsp)
jmp 0x6f5f
jmp 0x71c7
movl 0x324(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x324(%rsp)
jmp 0x6f40
movl $0x0, 0x314(%rsp)
movl 0x314(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2c38(%rcx), %eax
jge 0x7d33
movl $0xffffffff, 0x310(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x30c(%rsp)
movl 0x30c(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d18(%rcx), %eax
jge 0x76e3
movl $0x0, 0x308(%rsp)
movl 0x308(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x72a5
xorps %xmm0, %xmm0
callq 0x4390
movsd %xmm0, 0x160(%rsp)
movslq 0x30c(%rsp), %rsi
leaq 0x438(%rsp), %rdi
callq 0x8bc0
movq %rax, %rdi
movslq 0x308(%rsp), %rsi
callq 0x8c20
movsd 0x160(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x308(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x308(%rsp)
jmp 0x723f
movl $0x0, 0x304(%rsp)
movl 0x304(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d1c(%rcx), %eax
jge 0x76cb
movl $0x0, 0x300(%rsp)
movl 0x300(%rsp), %eax
movl %eax, 0x15c(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2cd0, %rdi           # imm = 0x2CD0
movslq 0x30c(%rsp), %rsi
callq 0x8ba0
movq %rax, %rcx
movl 0x15c(%rsp), %eax
cmpl (%rcx), %eax
jge 0x76b3
movl 0x310(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x310(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d00, %rdi           # imm = 0x2D00
movslq 0x30c(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x304(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movslq 0x300(%rsp), %rsi
callq 0x8ba0
cmpl $0x0, (%rax)
je 0x7554
xorps %xmm0, %xmm0
callq 0x4390
movsd %xmm0, 0x478(%rsp)
movl $0x0, 0x2fc(%rsp)
movl 0x2fc(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x74d8
movslq 0x2fc(%rsp), %rsi
leaq 0x460(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x304(%rsp), %rsi
callq 0x8bc0
movq %rax, 0x130(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d00, %rdi           # imm = 0x2D00
movslq 0x30c(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x304(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movslq 0x300(%rsp), %rsi
callq 0x8ba0
movq 0x130(%rsp), %rdi
movl (%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0x138(%rsp)
movslq 0x310(%rsp), %rsi
leaq 0x4b8(%rsp), %rdi
movq %rdi, 0x140(%rsp)
callq 0x8bc0
movq %rax, %rdi
movslq 0x2fc(%rsp), %rsi
callq 0x8c20
movsd 0x138(%rsp), %xmm0
movq 0x140(%rsp), %rdi
movsd %xmm0, (%rax)
movsd 0x478(%rsp), %xmm0
movsd %xmm0, 0x148(%rsp)
movslq 0x310(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x2fc(%rsp), %rsi
callq 0x8c20
movsd 0x148(%rsp), %xmm0
movsd (%rax), %xmm1
callq 0x339b0
movsd %xmm0, 0x150(%rsp)
jmp 0x74b0
movsd 0x150(%rsp), %xmm0
movsd %xmm0, 0x478(%rsp)
movl 0x2fc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2fc(%rsp)
jmp 0x7384
movl $0x0, 0x2f8(%rsp)
movl 0x2f8(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x7552
movsd 0x478(%rsp), %xmm0
movsd %xmm0, 0x128(%rsp)
movslq 0x310(%rsp), %rsi
leaq 0x4b8(%rsp), %rdi
callq 0x8bc0
movq %rax, %rdi
movslq 0x2f8(%rsp), %rsi
callq 0x8c20
movsd 0x128(%rsp), %xmm1
movsd (%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movl 0x2f8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2f8(%rsp)
jmp 0x74e3
jmp 0x7554
movl $0x0, 0x2f4(%rsp)
movl 0x2f4(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x769b
movslq 0x30c(%rsp), %rsi
leaq 0x438(%rsp), %rdi
callq 0x8bc0
movq %rax, %rdi
movslq 0x2f4(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0x118(%rsp)
movslq 0x310(%rsp), %rsi
leaq 0x4b8(%rsp), %rdi
callq 0x8bc0
movq %rax, %rdi
movslq 0x2f4(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0x108(%rsp)
movq 0x4e0(%rsp), %rax
cvtsi2sdl 0x2d1c(%rax), %xmm0
callq 0x4390
movaps %xmm0, %xmm1
movsd 0x108(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x110(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2cd0, %rdi           # imm = 0x2CD0
movslq 0x30c(%rsp), %rsi
callq 0x8ba0
cvtsi2sdl (%rax), %xmm0
callq 0x4390
movsd 0x110(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x118(%rsp), %xmm0
subsd %xmm2, %xmm1
callq 0x339b0
movsd %xmm0, 0x120(%rsp)
jmp 0x7653
movslq 0x30c(%rsp), %rsi
leaq 0x438(%rsp), %rdi
callq 0x8bc0
movq %rax, %rdi
movslq 0x2f4(%rsp), %rsi
callq 0x8c20
movsd 0x120(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x2f4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2f4(%rsp)
jmp 0x755f
jmp 0x769d
movl 0x300(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x300(%rsp)
jmp 0x72d6
jmp 0x76b5
movl 0x304(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x304(%rsp)
jmp 0x72b0
jmp 0x76cd
movl 0x30c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30c(%rsp)
jmp 0x7219
movl $0x0, 0x2f0(%rsp)
movl 0x2f0(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x7804
movl $0x0, 0x2ec(%rsp)
movl 0x2ec(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d1c(%rcx), %eax
jge 0x77ec
movl $0x0, 0x2e8(%rsp)
movl 0x2e8(%rsp), %eax
movl %eax, 0x104(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d20, %rdi           # imm = 0x2D20
movslq 0x2ec(%rsp), %rsi
callq 0x8ba0
movq %rax, %rcx
movl 0x104(%rsp), %eax
cmpl (%rcx), %eax
jge 0x77d4
xorps %xmm0, %xmm0
callq 0x4390
movsd %xmm0, 0xf8(%rsp)
movslq 0x2f0(%rsp), %rsi
leaq 0x460(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x2ec(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x2e8(%rsp), %rsi
callq 0x8c20
movsd 0xf8(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x2e8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2e8(%rsp)
jmp 0x7733
jmp 0x77d6
movl 0x2ec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2ec(%rsp)
jmp 0x770d
jmp 0x77ee
movl 0x2f0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2f0(%rsp)
jmp 0x76ee
movl $0xffffffff, 0x310(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x2e4(%rsp)
movl 0x2e4(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d18(%rcx), %eax
jge 0x7b0d
movl $0x0, 0x2e0(%rsp)
movl 0x2e0(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d1c(%rcx), %eax
jge 0x7af5
movl $0x0, 0x2dc(%rsp)
movl 0x2dc(%rsp), %eax
movl %eax, 0xf4(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2cd0, %rdi           # imm = 0x2CD0
movslq 0x2e4(%rsp), %rsi
callq 0x8ba0
movq %rax, %rcx
movl 0xf4(%rsp), %eax
cmpl (%rcx), %eax
jge 0x7add
movl 0x310(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x310(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d00, %rdi           # imm = 0x2D00
movslq 0x2e4(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x2e0(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movslq 0x2dc(%rsp), %rsi
callq 0x8ba0
cmpl $0x0, (%rax)
je 0x7ac5
movl $0x0, 0x2d8(%rsp)
movl 0x2d8(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x7ac3
movslq 0x2d8(%rsp), %rsi
leaq 0x460(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x2e0(%rsp), %rsi
callq 0x8bc0
movq %rax, 0xd0(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d00, %rdi           # imm = 0x2D00
movslq 0x2e4(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x2e0(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movslq 0x2dc(%rsp), %rsi
callq 0x8ba0
movq 0xd0(%rsp), %rdi
movl (%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0xe0(%rsp)
movslq 0x2e4(%rsp), %rsi
leaq 0x438(%rsp), %rdi
callq 0x8bc0
movq %rax, %rdi
movslq 0x2d8(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0xd8(%rsp)
movslq 0x310(%rsp), %rsi
leaq 0x4b8(%rsp), %rdi
callq 0x8bc0
movq %rax, %rdi
movslq 0x2d8(%rsp), %rsi
callq 0x8c20
movsd 0xd8(%rsp), %xmm1
movsd 0xe0(%rsp), %xmm0
movsd (%rax), %xmm2
addsd %xmm2, %xmm1
callq 0x339b0
movsd %xmm0, 0xe8(%rsp)
jmp 0x7a22
movslq 0x2d8(%rsp), %rsi
leaq 0x460(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x2e0(%rsp), %rsi
callq 0x8bc0
movq %rax, 0xc8(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d00, %rdi           # imm = 0x2D00
movslq 0x2e4(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x2e0(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movslq 0x2dc(%rsp), %rsi
callq 0x8ba0
movq 0xc8(%rsp), %rdi
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8c20
movsd 0xe8(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x2d8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2d8(%rsp)
jmp 0x7903
jmp 0x7ac5
jmp 0x7ac7
movl 0x2dc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2dc(%rsp)
jmp 0x7866
jmp 0x7adf
movl 0x2e0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2e0(%rsp)
jmp 0x7840
jmp 0x7af7
movl 0x2e4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2e4(%rsp)
jmp 0x781a
movl $0x0, 0x2d4(%rsp)
movl 0x2d4(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x7d1b
movl $0x0, 0x2d0(%rsp)
movl 0x2d0(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d1c(%rcx), %eax
jge 0x7d03
xorps %xmm0, %xmm0
callq 0x4390
movsd %xmm0, 0x478(%rsp)
movl $0x0, 0x2cc(%rsp)
movl 0x2cc(%rsp), %eax
movl %eax, 0xc4(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d20, %rdi           # imm = 0x2D20
movslq 0x2d0(%rsp), %rsi
callq 0x8ba0
movq %rax, %rcx
movl 0xc4(%rsp), %eax
cmpl (%rcx), %eax
jge 0x7c36
movsd 0x478(%rsp), %xmm0
movsd %xmm0, 0xb0(%rsp)
movslq 0x2d4(%rsp), %rsi
leaq 0x460(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x2d0(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x2cc(%rsp), %rsi
callq 0x8c20
movsd 0xb0(%rsp), %xmm0
movsd (%rax), %xmm1
callq 0x339b0
movsd %xmm0, 0xb8(%rsp)
jmp 0x7c0e
movsd 0xb8(%rsp), %xmm0
movsd %xmm0, 0x478(%rsp)
movl 0x2cc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2cc(%rsp)
jmp 0x7b6e
movl $0x0, 0x2c8(%rsp)
movl 0x2c8(%rsp), %eax
movl %eax, 0xac(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d20, %rdi           # imm = 0x2D20
movslq 0x2d0(%rsp), %rsi
callq 0x8ba0
movq %rax, %rcx
movl 0xac(%rsp), %eax
cmpl (%rcx), %eax
jge 0x7ceb
movsd 0x478(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movslq 0x2d4(%rsp), %rsi
leaq 0x460(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x2d0(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x2c8(%rsp), %rsi
callq 0x8c20
movsd 0xa0(%rsp), %xmm1
movsd (%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movl 0x2c8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c8(%rsp)
jmp 0x7c41
jmp 0x7ced
movl 0x2d0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2d0(%rsp)
jmp 0x7b37
jmp 0x7d05
movl 0x2d4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2d4(%rsp)
jmp 0x7b18
jmp 0x7d1d
movl 0x314(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x314(%rsp)
jmp 0x71e8
xorps %xmm0, %xmm0
movsd %xmm0, 0x410(%rsp)
movl $0x0, 0x2c4(%rsp)
movl 0x2c4(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d18(%rcx), %eax
jge 0x7fc5
xorps %xmm0, %xmm0
callq 0x4390
movsd %xmm0, 0x408(%rsp)
movl $0x0, 0x2c0(%rsp)
movl 0x2c0(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x7f94
xorps %xmm0, %xmm0
movsd %xmm0, 0x400(%rsp)
movl $0x0, 0x2bc(%rsp)
movl 0x2bc(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d1c(%rcx), %eax
jge 0x7f17
movl $0x0, 0x2b8(%rsp)
movl 0x2b8(%rsp), %eax
movl %eax, 0x9c(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2cd0, %rdi           # imm = 0x2CD0
movslq 0x2c4(%rsp), %rsi
callq 0x8ba0
movq %rax, %rcx
movl 0x9c(%rsp), %eax
cmpl (%rcx), %eax
jge 0x7eff
movq 0x4e0(%rsp), %rdi
addq $0x2d00, %rdi           # imm = 0x2D00
movslq 0x2c4(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x2bc(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movslq 0x2b8(%rsp), %rsi
callq 0x8ba0
cmpl $0x0, (%rax)
je 0x7ee7
movslq 0x2c0(%rsp), %rsi
leaq 0x460(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x2bc(%rsp), %rsi
callq 0x8bc0
movq %rax, 0x90(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d00, %rdi           # imm = 0x2D00
movslq 0x2c4(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x2bc(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movslq 0x2b8(%rsp), %rsi
callq 0x8ba0
movq 0x90(%rsp), %rdi
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8c20
movsd (%rax), %xmm0
addsd 0x400(%rsp), %xmm0
movsd %xmm0, 0x400(%rsp)
jmp 0x7ee9
movl 0x2b8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2b8(%rsp)
jmp 0x7dd2
jmp 0x7f01
movl 0x2bc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2bc(%rsp)
jmp 0x7dac
movsd 0x408(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x400(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
cvtsi2sdl 0x4d8(%rsp), %xmm0
callq 0x4390
movsd 0x78(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x80(%rsp), %xmm0
subsd %xmm2, %xmm1
callq 0x339b0
movsd %xmm0, 0x88(%rsp)
jmp 0x7f6c
movsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x408(%rsp)
movl 0x2c0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c0(%rsp)
jmp 0x7d81
movsd 0x408(%rsp), %xmm0
addsd 0x410(%rsp), %xmm0
movsd %xmm0, 0x410(%rsp)
movl 0x2c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c4(%rsp)
jmp 0x7d4a
xorps %xmm0, %xmm0
movsd %xmm0, 0x2b0(%rsp)
movl $0x0, 0x2a4(%rsp)
movl 0x2a4(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d18(%rcx), %eax
jge 0x8216
movl $0x0, 0x2a0(%rsp)
movl 0x2a0(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d1c(%rcx), %eax
jge 0x81fe
movl $0x0, 0x29c(%rsp)
movl 0x29c(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2ba4(%rcx), %eax
jge 0x81e6
movq 0x4e0(%rsp), %rdi
addq $0x2d00, %rdi           # imm = 0x2D00
movslq 0x2a4(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x2a0(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movslq 0x29c(%rsp), %rsi
callq 0x8ba0
cmpl $0x0, (%rax)
je 0x81ce
xorps %xmm0, %xmm0
callq 0x4390
movsd %xmm0, 0x2a8(%rsp)
movl $0x0, 0x298(%rsp)
movl 0x298(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x81b3
movsd 0x2a8(%rsp), %xmm0
movsd %xmm0, 0x68(%rsp)
movslq 0x2a4(%rsp), %rsi
leaq 0x438(%rsp), %rdi
callq 0x8bc0
movq %rax, %rdi
movslq 0x298(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0x60(%rsp)
movslq 0x298(%rsp), %rsi
leaq 0x460(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x2a0(%rsp), %rsi
callq 0x8bc0
movq %rax, 0x58(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d00, %rdi           # imm = 0x2D00
movslq 0x2a4(%rsp), %rsi
callq 0x8c40
movq %rax, %rdi
movslq 0x2a0(%rsp), %rsi
callq 0x8c60
movq %rax, %rdi
movslq 0x29c(%rsp), %rsi
callq 0x8ba0
movq 0x58(%rsp), %rdi
movl (%rax), %eax
decl %eax
movslq %eax, %rsi
callq 0x8c20
movsd 0x60(%rsp), %xmm1
movsd 0x68(%rsp), %xmm0
movsd (%rax), %xmm2
addsd %xmm2, %xmm1
callq 0x339b0
movsd %xmm0, 0x70(%rsp)
jmp 0x818e
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x2a8(%rsp)
movl 0x298(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x298(%rsp)
jmp 0x80a4
movsd 0x2a8(%rsp), %xmm0
addsd 0x2b0(%rsp), %xmm0
movsd %xmm0, 0x2b0(%rsp)
jmp 0x81d0
movl 0x29c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x29c(%rsp)
jmp 0x8028
jmp 0x81e8
movl 0x2a0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2a0(%rsp)
jmp 0x8002
jmp 0x8200
movl 0x2a4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2a4(%rsp)
jmp 0x7fdc
movsd 0x2b0(%rsp), %xmm0
movq 0x4e0(%rsp), %rax
ucomisd 0x3040(%rax), %xmm0
jbe 0x8483
movsd 0x2b0(%rsp), %xmm0
movq 0x4e0(%rsp), %rax
movsd %xmm0, 0x3040(%rax)
movl $0x0, 0x294(%rsp)
movl 0x294(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x83a4
movl $0x0, 0x290(%rsp)
movl 0x290(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d1c(%rcx), %eax
jge 0x838c
movl $0x0, 0x28c(%rsp)
movl 0x28c(%rsp), %eax
movl %eax, 0x54(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d20, %rdi           # imm = 0x2D20
movslq 0x290(%rsp), %rsi
callq 0x8ba0
movq %rax, %rcx
movl 0x54(%rsp), %eax
cmpl (%rcx), %eax
jge 0x8374
movslq 0x294(%rsp), %rsi
leaq 0x460(%rsp), %rdi
callq 0x8ae0
movq %rax, %rdi
movslq 0x290(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x28c(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
callq 0x4760
movsd %xmm0, 0x48(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x3048, %rdi           # imm = 0x3048
movslq 0x294(%rsp), %rsi
callq 0x8ae0
movq %rax, %rdi
movslq 0x290(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x28c(%rsp), %rsi
callq 0x8c20
movsd 0x48(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x28c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28c(%rsp)
jmp 0x829e
jmp 0x8376
movl 0x290(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x290(%rsp)
jmp 0x8278
jmp 0x838e
movl 0x294(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x294(%rsp)
jmp 0x8259
movl $0x0, 0x288(%rsp)
movl 0x288(%rsp), %eax
movq 0x4e0(%rsp), %rcx
cmpl 0x2d18(%rcx), %eax
jge 0x8481
movl $0x0, 0x284(%rsp)
movl 0x284(%rsp), %eax
cmpl 0x4d8(%rsp), %eax
jge 0x8469
movslq 0x288(%rsp), %rsi
leaq 0x438(%rsp), %rdi
callq 0x8bc0
movq %rax, %rdi
movslq 0x284(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
callq 0x4760
movsd %xmm0, 0x40(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x3060, %rdi           # imm = 0x3060
movslq 0x288(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x284(%rsp), %rsi
callq 0x8c20
movsd 0x40(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x284(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x284(%rsp)
jmp 0x83d5
jmp 0x846b
movl 0x288(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x288(%rsp)
jmp 0x83af
jmp 0x8483
jmp 0x8485
movl 0x328(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x328(%rsp)
jmp 0x6f1a
movq 0x4e0(%rsp), %rax
testb $0x1, 0x2c49(%rax)
je 0x8713
movl 0x4d8(%rsp), %eax
movl %eax, 0x38(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2d20, %rdi           # imm = 0x2D20
callq 0x8c80
movl %eax, 0x3c(%rsp)
jmp 0x84d5
movl 0x38(%rsp), %eax
movl 0x3c(%rsp), %ecx
movq 0x4e0(%rsp), %rdx
subl 0x2d1c(%rdx), %ecx
imull %ecx, %eax
movq 0x4e0(%rsp), %rcx
movl 0x2d18(%rcx), %ecx
movl 0x4d8(%rsp), %edx
subl $0x1, %edx
imull %edx, %ecx
addl %ecx, %eax
movl %eax, 0x280(%rsp)
movl 0x280(%rsp), %eax
shll %eax
cvtsi2sd %eax, %xmm0
movq 0x4e0(%rsp), %rax
movsd 0x3040(%rax), %xmm1
addsd %xmm1, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x3078, %rdi           # imm = 0x3078
movslq 0x4dc(%rsp), %rsi
callq 0x8c20
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
cvtsi2sdl 0x280(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x4e0(%rsp), %rax
cvtsi2sdl 0x2d50(%rax), %xmm0
callq 0x4390
movaps %xmm0, %xmm2
movsd 0x10(%rsp), %xmm0
movq 0x4e0(%rsp), %rax
movsd 0x53a68(%rip), %xmm1    # 0x5c008
mulsd 0x3040(%rax), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x3090, %rdi           # imm = 0x3090
movslq 0x4dc(%rsp), %rsi
callq 0x8c20
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x4e0(%rsp), %rdi
addq $0x2e60, %rdi           # imm = 0x2E60
movslq 0x4dc(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8c20
movsd (%rax), %xmm0
movq 0x4e0(%rsp), %rax
movsd 0x539d9(%rip), %xmm1    # 0x5c008
mulsd 0x3040(%rax), %xmm1
movsd 0x539d1(%rip), %xmm2    # 0x5c010
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x30a8, %rdi           # imm = 0x30A8
movslq 0x4dc(%rsp), %rsi
callq 0x8c20
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x4e0(%rsp), %rdi
addq $0x2e60, %rdi           # imm = 0x2E60
movslq 0x4dc(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8c20
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x2e78, %rdi           # imm = 0x2E78
movslq 0x4dc(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8c20
movsd 0x28(%rsp), %xmm1
movsd 0x5392d(%rip), %xmm0    # 0x5c008
mulsd (%rax), %xmm0
addsd %xmm1, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x4e0(%rsp), %rdi
addq $0x30c0, %rdi           # imm = 0x30C0
movslq 0x4dc(%rsp), %rsi
callq 0x8c20
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x438(%rsp), %rdi
callq 0x8b40
leaq 0x460(%rsp), %rdi
callq 0x8a00
leaq 0x4b8(%rsp), %rdi
callq 0x8b40
addq $0x4e8, %rsp            # imm = 0x4E8
retq
leaq 0x438(%rsp), %rdi
callq 0x8b40
leaq 0x460(%rsp), %rdi
callq 0x8a00
leaq 0x4b8(%rsp), %rdi
callq 0x8b40
movq 0x488(%rsp), %rdi
callq 0x4730
nopw %cs:(%rax,%rax)