// File: /workspace/github_cpp_makefile_star2_O3/drarwood[P]gags/Main.cpp
// Function: main
int main(int argc, char** argv) {

    // 1. Show header
    ShowHeader();
    
    // 2. Parse command line
    ARGS theseArgs;
    ParseCommand(argc, argv, &theseArgs);
    if(!theseArgs.ok) {
        ShowOptions();
        exit(EXIT_FAILURE);
    }
    cout << "Arguments: " << endl;
    cout << "        --pheno      -p " << theseArgs.phenoString << endl;
    cout << "        --ns         -n " << theseArgs.nsString << endl;
    cout << "        --means      -m " << theseArgs.meansString << endl;
    cout << "        --sd         -s " << theseArgs.sdsString << endl;
    cout << "        --seed       -r " << theseArgs.seed << endl;
    cout << "        --mrate      -y " << theseArgs.mRate << endl;
    cout << "        --popsize    -z " << theseArgs.popsize << endl;
    cout << "        --exclusions -e " << theseArgs.exclusionsString << endl;
    cout << "        --iterations -i " << theseArgs.iterations << endl;
    cout << "        --out        -o " << theseArgs.outString << endl << endl;    
    srand(theseArgs.seed);
    
    // Create vectors for list arguments
    vector<int> ns;
    SplitIntArgs(theseArgs.nsString, ns);
    vector<double> means;
    SplitDoubleArgs(theseArgs.meansString, means);
    vector<double> sds;
    SplitDoubleArgs(theseArgs.sdsString, sds);

    // Get required precision input by user
    vector<int> t1;
    DetermineDoubleArgsPrecision(theseArgs.meansString, t1);
    vector<int> t2;
    DetermineDoubleArgsPrecision(theseArgs.sdsString, t2);
    
    // read exclusions file    
    map<string,int> exclusions;
    if (theseArgs.exclusionsString.length() > 0) {
        ReadExclusionsFile(theseArgs.exclusionsString, exclusions);
    }

    // Load the phenotypes
    cout << "Reading phenotypes..." << endl;
    vector<string> idVector;
    vector<double> phenoVector;
    map<string,double> phenoMap;
    ReadPhenotypeFileMinusExclusions(theseArgs.phenoString, idVector, phenoVector, phenoMap, exclusions);    
        
    // Check number of individuals required to formulate the distribution is more than the number with pheneotype
    unsigned int total_n = 0;
    for (unsigned int i = 0; i<ns.size(); ++i) {
        total_n += ns[i];
    }
    //cout << total_n << endl;
    if (total_n > phenoVector.size()) {
        cout << "Unable to process this data as required sample sizes for distributions larger than N in phenotype file" << endl;
    }
    
    // At this point we want to order the Ns and adjust ordering of means and SDs in vecto
    vector<int>    nsSorted;  
    vector<double> meansSorted;
    vector<double> sdsSorted;
    vector<int>    meansPrecision;
    vector<int>    sdsPrecision;

    map<int,int>   jsUsed;

    nsSorted = ns;
    sort(nsSorted.begin(), nsSorted.end());
    for (unsigned int i = 0; i < nsSorted.size(); ++i) {
        for (unsigned int j = 0; j < ns.size(); ++j) {
            if (ns[j] == nsSorted[i] && jsUsed.find(j) == jsUsed.end()) {
                meansSorted.push_back(means[j]);
                sdsSorted.push_back(sds[j]);
                meansPrecision.push_back(t1[j]);
                sdsPrecision.push_back(t2[j]);
                jsUsed[j] = 0;
                break;
            }
        }
    }
    ns.clear();
    means.clear();
    sds.clear();
    
    // If the smallest N >= 10% of total_n then we carry on as usual
    bool solveIndependently;
    bool solveIndependentlyEverSet = false;
    int  independentGroupIndex = 0;
    int  smallestOffset = 0;
    int  nSubtract     = 0;
    int  n;
    
    
    do { 
        
        if ( ((double) nsSorted[smallestOffset] / (double) (total_n-nSubtract)) > 0.1 ) {
            solveIndependently = false;
            n = total_n-nSubtract;            
            for (unsigned int i = smallestOffset; i < nsSorted.size(); ++i) {
                ns.push_back(nsSorted[i]);
                means.push_back(meansSorted[i]);
                sds.push_back(sdsSorted[i]);
            }
        }
        // else we need to solve as seperate problem
        else {
            solveIndependently = true;
            solveIndependentlyEverSet = true;
            n = nsSorted[smallestOffset];
            ns.push_back(nsSorted[smallestOffset]);
            means.push_back(meansSorted[smallestOffset]);
            sds.push_back(sdsSorted[smallestOffset]);
            nSubtract += nsSorted[smallestOffset];
            smallestOffset++;
        }
 
        
        // 1. Initialise solutions
        cout << "Initialising solutions..." << endl;
        vector<vector<string> > population(theseArgs.popsize);
        cout << "Exclusion list size " << exclusions.size() << endl;
        InitializeSolutions(n, idVector, population, exclusions);
        
        // 2. Score solutions
        cout << "Scoring solutions..." << endl;
        vector<double> scores(theseArgs.popsize);
        //double thiscore;
        for (int i = 0; i < theseArgs.popsize; ++i) {
            scores[i] = ScoreSolution(population[i], phenoMap, ns, means, sds);
        }
        
        // 3. Determine the lowest (best) score  and solution with lowest score
        double lowestScore;
        int    bestSolutionIndex;
        DetermineBestSolution(scores, lowestScore, bestSolutionIndex);
        cout << "Best score and solution ID presently: " << lowestScore << " "  << bestSolutionIndex << endl;
        
        // 4. Determine if we have found a solution that is good enough by chance using the best one we have in the population
        bool solutionFound;
        solutionFound = TestBestSolution(population[bestSolutionIndex], phenoMap, ns, means, sds, meansPrecision, sdsPrecision);
        
        // 5. If solution found by chance then output it
        if (solutionFound) {
            cout << "Solution found" << endl;
            if (!solveIndependentlyEverSet) {
                independentGroupIndex++;
                OutputSolution(population[bestSolutionIndex], phenoMap, ns, theseArgs.outString, independentGroupIndex);
            }
            else {
                independentGroupIndex++;
                OutputIndependentSolution(population[bestSolutionIndex], phenoMap, ns, theseArgs.outString, independentGroupIndex);
                // add samples from last solution to exclusion list so we don't include them again
                for (vector<string>::iterator it = population[bestSolutionIndex].begin(); it != population[bestSolutionIndex].end(); ++it) {
                    exclusions[*it] = 0;
                }
            }
        }
        
        
        // 6. else we need tocyce up to max iterations to try and find solution
        else {
            
            // Determine highest (worst) score and solution with worst score
            bool   carryOn = true;
            double highestScore;
            int    worstSolutionIndex;
            DetermineWorstSolution(scores, highestScore, worstSolutionIndex);

            cout << "Iteration 1 ";
            
            // Iterate through for MAX iterations
            for (int i = 0; i < theseArgs.iterations; ++i) {
                
                int iter = (i+1)*100;
                if (100 % iter == 0) {
                    cout << iter << " ";
                }

                // [re]generate Roulette Wheel
                vector<double> rWheel;
                GenerateRouletteWheel(rWheel, scores);
                
                // Spin the wheel x2 to select solutions
                vector<int> randomIndicies;
                int ri1 = SpinWheel(rWheel);
                randomIndicies.push_back(ri1);
                int ri2;
                do {
                    ri2 = SpinWheel(rWheel);
                } while (ri1 == ri2);
                randomIndicies.push_back(ri2);
                
                // Crossover
                vector<vector<string> > chrXY(2);   
                map<string,int> chrXAlleles;
                map<string,int> chrYAlleles;
                CrossoverPMX(population, randomIndicies, idVector, chrXY, chrXAlleles, chrYAlleles);
                
                // Mutate
                Mutate(chrXY, ns, theseArgs.mRate, idVector, phenoMap, chrXAlleles, chrYAlleles, exclusions);
                
                // Identify the worst 2 scores in the population frist
                vector<int> worst2Solutions;
                DetermineX2LeastFit(worst2Solutions, scores);
                
                // 1.  First see if either provide us with a good enough solution //            
                for (int j = 0; j < 2; ++j) {
                    
                    // get score for current child
                    double thisScore = ScoreSolution(chrXY[j], phenoMap, ns, means, sds);
                    
                    // if this score lower (i.e. better) than lowest score in the population check whether solution good enough
                    if (thisScore < lowestScore) {
                    
                        lowestScore = thisScore;
                        
                        // check if we have found a solution
                        solutionFound = TestBestSolution(chrXY[j], phenoMap, ns, means, sds, meansPrecision, sdsPrecision);
                        
                        // if it is - print out and stop
                        if (solutionFound) {
                            
                            cout << thisScore << endl;
                            cout << "Solution found! " << endl;
                            
                            if (!solveIndependentlyEverSet) {
                                independentGroupIndex++;
                                OutputSolution(chrXY[j], phenoMap, ns, theseArgs.outString, independentGroupIndex);
                            }
                            else {
                                independentGroupIndex++;
                                OutputIndependentSolution(chrXY[j], phenoMap, ns, theseArgs.outString, independentGroupIndex);
                                // add samples from last solution to exclusion list so we don't include them again
                                for (vector<string>::iterator it = chrXY[j].begin(); it != chrXY[j].end(); ++it) {
                                    exclusions[*it] = 0;
                                }
                            }
                            
                            carryOn = false;
                            break;
                        }
                        else {
                            // place this solution in the population and update respective score
                            population[worst2Solutions[j]] = chrXY[j];
                            scores[worst2Solutions[j]] = thisScore;
                        }
                    }
                    else {
                        // place this solution in the population
                        population[worst2Solutions[j]] = chrXY[j];
                        scores[worst2Solutions[j]] = thisScore;
                    }
                }
                if (!carryOn) {
                    break;
                }
                // cout << lowestScore << endl;
                randomIndicies.clear();
            }  
        }
        
        // clear out the vectors
        ns.clear();
        means.clear();
        sds.clear();
        population.clear();
        scores.clear();
        
        if (!solutionFound) {
            cout << theseArgs.iterations << endl;
            cout << "Sorry - no solution not found this time." << endl;
            cout << "Error score: " << lowestScore << endl;
        }
                
    } while (solveIndependently);
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x498, %rsp            # imm = 0x498
movq %rsi, %rbx
movl %edi, %ebp
callq 0x95b8
leaq 0x210(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x230(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x250(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x270(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x290(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x2b0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x200(%rsp), %rdx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x9a71
cmpb $0x0, 0x2d8(%rsp)
je 0x5173
movq 0xd7ac(%rip), %rbx      # 0x10fd8
leaq 0x87ed(%rip), %rsi      # 0xc020
movl $0xb, %edx
movq %rbx, %rdi
callq 0x32c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xd77a(%rip), %rdi      # 0x10fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0xd766(%rip), %rdi      # 0x10fd8
leaq 0x87b3(%rip), %rsi      # 0xc02c
movl $0x18, %edx
callq 0x32c0
movq 0x200(%rsp), %rsi
movq 0x208(%rsp), %rdx
movq 0xd73e(%rip), %rdi      # 0x10fd8
callq 0x32c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0xd708(%rip), %rdi      # 0x10fd8
leaq 0x876e(%rip), %rsi      # 0xc045
movl $0x18, %edx
callq 0x32c0
movq 0x220(%rsp), %rsi
movq 0x228(%rsp), %rdx
movq 0xd6e0(%rip), %rdi      # 0x10fd8
callq 0x32c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0xd6aa(%rip), %rdi      # 0x10fd8
leaq 0x8729(%rip), %rsi      # 0xc05e
movl $0x18, %edx
callq 0x32c0
movq 0x240(%rsp), %rsi
movq 0x248(%rsp), %rdx
movq 0xd682(%rip), %rdi      # 0x10fd8
callq 0x32c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0xd64c(%rip), %rdi      # 0x10fd8
leaq 0x86e4(%rip), %rsi      # 0xc077
movl $0x18, %edx
callq 0x32c0
movq 0x260(%rsp), %rsi
movq 0x268(%rsp), %rdx
movq 0xd624(%rip), %rdi      # 0x10fd8
callq 0x32c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0xd5ee(%rip), %rdi      # 0x10fd8
leaq 0x869f(%rip), %rsi      # 0xc090
movl $0x18, %edx
callq 0x32c0
movl 0x2c0(%rsp), %esi
movq 0xd5cf(%rip), %rdi      # 0x10fd8
callq 0x3420
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0xd599(%rip), %rdi      # 0x10fd8
leaq 0x8663(%rip), %rsi      # 0xc0a9
movl $0x18, %edx
callq 0x32c0
movsd 0x2d0(%rsp), %xmm0
movq 0xd578(%rip), %rdi      # 0x10fd8
callq 0x33e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0xd542(%rip), %rdi      # 0x10fd8
leaq 0x8625(%rip), %rsi      # 0xc0c2
movl $0x18, %edx
callq 0x32c0
movl 0x2c4(%rsp), %esi
movq 0xd523(%rip), %rdi      # 0x10fd8
callq 0x3420
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0xd4ed(%rip), %rdi      # 0x10fd8
leaq 0x85e9(%rip), %rsi      # 0xc0db
movl $0x18, %edx
callq 0x32c0
movq 0x280(%rsp), %rsi
movq 0x288(%rsp), %rdx
movq 0xd4c5(%rip), %rdi      # 0x10fd8
callq 0x32c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0xd48f(%rip), %rdi      # 0x10fd8
leaq 0x85a4(%rip), %rsi      # 0xc0f4
movl $0x18, %edx
callq 0x32c0
movl 0x2c8(%rsp), %esi
movq 0xd470(%rip), %rdi      # 0x10fd8
callq 0x3420
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0xd43a(%rip), %rdi      # 0x10fd8
leaq 0x8568(%rip), %rsi      # 0xc10d
movl $0x18, %edx
callq 0x32c0
movq 0x2a0(%rsp), %rsi
movq 0x2a8(%rsp), %rdx
movq 0xd412(%rip), %rdi      # 0x10fd8
callq 0x32c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
leaq 0x220(%rsp), %rbx
movl 0xa0(%rbx), %edi
callq 0x3250
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0xacd2
leaq 0x240(%rsp), %rbx
leaq 0x50(%rsp), %rsi
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0xab67
leaq 0x260(%rsp), %r14
xorpd %xmm0, %xmm0
leaq 0x30(%rsp), %rsi
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %r14, %rdi
callq 0xab67
leaq 0x380(%rsp), %rsi
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0xae42
xorpd %xmm0, %xmm0
leaq 0x360(%rsp), %rsi
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %r14, %rdi
callq 0xae42
leaq 0x408(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq 0x288(%rsp), %rdx
testq %rdx, %rdx
je 0x3d5c
leaq 0x3d8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x280(%rsp), %rsi
addq %rsi, %rdx
leaq 0x3c8(%rsp), %rdi
callq 0x5c48
leaq 0x3c8(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x6b4c
movq 0x3c8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3d5c
movq 0x3d8(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0xd275(%rip), %rbx      # 0x10fd8
leaq 0x83bc(%rip), %rsi      # 0xc126
movl $0x15, %edx
movq %rbx, %rdi
callq 0x32c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xd243(%rip), %rdi      # 0x10fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x1c0(%rsp)
xorl %eax, %eax
movq %rax, 0x1d0(%rsp)
movq %rax, 0x1f0(%rsp)
movapd %xmm0, 0x1e0(%rsp)
leaq 0x338(%rsp), %rcx
movl $0x0, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x3b8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x200(%rsp), %rsi
movq 0x208(%rsp), %rdx
addq %rsi, %rdx
leaq 0x3a8(%rsp), %rdi
callq 0x5c48
leaq 0x3a8(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
leaq 0x1e0(%rsp), %rdx
leaq 0x330(%rsp), %rcx
leaq 0x400(%rsp), %r8
callq 0xb178
movq 0x3a8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3e5e
movq 0x3b8(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
je 0x3e84
sarq $0x2, %rcx
xorl %edx, %edx
xorl %edi, %edi
addl (%rax,%rdx,4), %edi
incq %rdx
movl %edx, %esi
cmpq %rsi, %rcx
ja 0x3e75
jmp 0x3e86
xorl %edi, %edi
movl %edi, 0x198(%rsp)
movl %edi, %eax
movq 0x1e8(%rsp), %rcx
subq 0x1e0(%rsp), %rcx
sarq $0x3, %rcx
cmpq %rax, %rcx
jae 0x3eee
movq 0xd129(%rip), %rbx      # 0x10fd8
leaq 0x8286(%rip), %rsi      # 0xc13c
movl $0x66, %edx
movq %rbx, %rdi
callq 0x32c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xd0f7(%rip), %rdi      # 0x10fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
xorpd %xmm0, %xmm0
leaq 0x90(%rsp), %rdi
movapd %xmm0, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movq %rax, 0x170(%rsp)
movapd %xmm0, 0x160(%rsp)
movq %rax, 0x150(%rsp)
movapd %xmm0, 0x140(%rsp)
movq %rax, 0x130(%rsp)
movapd %xmm0, 0x120(%rsp)
movq %rax, 0x110(%rsp)
movapd %xmm0, 0x100(%rsp)
leaq 0x470(%rsp), %r15
movl $0x0, (%r15)
movq %rax, 0x8(%r15)
movq %r15, 0x10(%r15)
movq %r15, 0x18(%r15)
movq %rax, 0x20(%r15)
leaq 0x10(%rsp), %rsi
callq 0x556e
movq 0x90(%rsp), %rbx
movq 0x98(%rsp), %r14
cmpq %r14, %rbx
je 0x419a
movq %r14, %rax
subq %rbx, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5d37
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5e1a
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
cmpq %rax, %rcx
je 0x419a
xorl %r12d, %r12d
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rsi
subq %rdx, %rsi
je 0x4184
sarq $0x2, %rsi
movl (%rax,%r12,4), %edi
xorl %r13d, %r13d
movq 0x478(%rsp), %r8
xorl %ebx, %ebx
cmpl %edi, (%rdx,%r13,4)
jne 0x4042
testq %r8, %r8
je 0x4051
movq %r8, %r10
movq %r15, %r14
movq %r14, %r9
movq %r10, %rbp
movl 0x20(%r10), %r11d
xorl %r10d, %r10d
cmpl %ebx, %r11d
setl %r10b
movq %rbp, %r14
cmovlq %r9, %r14
movq 0x10(%rbp,%r10,8), %r10
testq %r10, %r10
jne 0x400c
cmpq %r15, %r14
je 0x4051
cmpl %ebx, %r11d
cmovlq %r9, %rbp
cmpl 0x20(%rbp), %ebx
jl 0x4051
incl %ebx
movq %rbx, %r13
cmpq %rbx, %rsi
ja 0x3ffb
jmp 0x4184
leaq (,%r13,8), %r14
movq 0x50(%rsp), %rdx
addq %r14, %rdx
movq 0x168(%rsp), %rsi
cmpq 0x170(%rsp), %rsi
je 0x4089
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x168(%rsp)
jmp 0x4096
leaq 0x160(%rsp), %rdi
callq 0x6066
addq 0x30(%rsp), %r14
movq 0x148(%rsp), %rsi
cmpq 0x150(%rsp), %rsi
je 0x40c4
movsd (%r14), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x148(%rsp)
jmp 0x40d4
leaq 0x140(%rsp), %rdi
movq %r14, %rdx
callq 0x6066
shlq $0x2, %r13
movq 0x380(%rsp), %rdx
addq %r13, %rdx
movq 0x128(%rsp), %rsi
cmpq 0x130(%rsp), %rsi
je 0x4107
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x128(%rsp)
jmp 0x4114
leaq 0x120(%rsp), %rdi
callq 0x61a6
addq 0x360(%rsp), %r13
movq 0x108(%rsp), %rsi
cmpq 0x110(%rsp), %rsi
je 0x4142
movl (%r13), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x108(%rsp)
jmp 0x4152
leaq 0x100(%rsp), %rdi
movq %r13, %rdx
callq 0x61a6
movl %ebx, 0x300(%rsp)
leaq 0x468(%rsp), %rdi
leaq 0x300(%rsp), %rsi
callq 0x5652
movl $0x0, (%rax)
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
incl %r12d
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
ja 0x3fd3
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x41ab
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rax
cmpq %rax, 0x58(%rsp)
je 0x41bc
movq %rax, 0x58(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x41cd
movq %rax, 0x38(%rsp)
leaq 0x8(%rsp), %rax
movl $0x0, (%rax)
movsd 0x7e28(%rip), %xmm1     # 0xc008
leaq 0x300(%rsp), %r13
movq $0x0, 0x188(%rsp)
xorl %edx, %edx
movl $0x0, 0x6c(%rsp)
movslq %edx, %r15
movq 0x90(%rsp), %rax
movl (%rax,%r15,4), %ebp
cvtsi2sd %ebp, %xmm2
movl 0x198(%rsp), %ecx
movl %ecx, %r14d
subl 0x6c(%rsp), %r14d
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x398(%rsp)
ucomisd %xmm1, %xmm2
movq %rdx, 0x180(%rsp)
ja 0x426b
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x4351
movl %ebp, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
leaq 0x1c0(%rsp), %r14
jmp 0x4367
movl %edx, %ebx
movq 0x98(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbx, %rcx
jbe 0x4341
leal 0x1(%rdx), %ebp
leaq (%rax,%rbx,4), %rdx
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x42a7
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x42b1
leaq 0x10(%rsp), %rdi
callq 0x61a6
shlq $0x3, %rbx
movq 0x160(%rsp), %rdx
addq %rbx, %rdx
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x42df
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x58(%rsp)
jmp 0x42e9
leaq 0x50(%rsp), %rdi
callq 0x6066
addq 0x140(%rsp), %rbx
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x4310
movsd (%rbx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x431d
leaq 0x30(%rsp), %rdi
movq %rbx, %rdx
callq 0x6066
movl %ebp, %ebx
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
incl %ebp
cmpq %rbx, %rcx
ja 0x4288
movl %r14d, %ebp
leaq 0x1c0(%rsp), %r14
jmp 0x4407
leaq (%rax,%r15,4), %rdx
leaq 0x10(%rsp), %rdi
callq 0x61a6
leaq 0x1c0(%rsp), %r14
leaq (,%r15,8), %rbx
movq 0x160(%rsp), %rdx
addq %rbx, %rdx
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x4399
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x58(%rsp)
jmp 0x43a3
leaq 0x50(%rsp), %rdi
callq 0x6066
addq 0x140(%rsp), %rbx
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x43ca
movsd (%rbx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x43d7
leaq 0x30(%rsp), %rdi
movq %rbx, %rdx
callq 0x6066
movq 0x90(%rsp), %rax
movl 0x6c(%rsp), %ecx
addl (%rax,%r15,4), %ecx
movl %ecx, 0x6c(%rsp)
movq 0x180(%rsp), %rax
incl %eax
movq %rax, 0x180(%rsp)
movb $0x1, %al
movq %rax, 0x188(%rsp)
movl $0x19, %edx
movq 0xcbc5(%rip), %rdi      # 0x10fd8
leaq 0x7d89(%rip), %rsi      # 0xc1a3
callq 0x32c0
movq 0xcbb2(%rip), %rcx      # 0x10fd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xcb94(%rip), %rdi      # 0x10fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movslq 0x2c4(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
movq %r13, %rdx
callq 0x56b8
movl $0x14, %edx
movq 0xcb63(%rip), %rdi      # 0x10fd8
leaq 0x7d41(%rip), %rsi      # 0xc1bd
callq 0x32c0
movq 0x428(%rsp), %rsi
movq 0xcb48(%rip), %rdi      # 0x10fd8
callq 0x31a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movl %ebp, %edi
movq %r14, %rsi
leaq 0xe8(%rsp), %rdx
leaq 0x400(%rsp), %rcx
callq 0x76c8
movl $0x14, %edx
movq 0xcaf3(%rip), %rdi      # 0x10fd8
leaq 0x7ce6(%rip), %rsi      # 0xc1d2
callq 0x32c0
movq 0xcae0(%rip), %rcx      # 0x10fd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xcac2(%rip), %rdi      # 0x10fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movslq 0x2c4(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
movq %r13, %rdx
callq 0x5736
cmpl $0x0, 0x2c4(%rsp)
jle 0x4593
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0xe8(%rsp), %rdi
addq %rbx, %rdi
leaq 0x330(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rcx
leaq 0x30(%rsp), %r8
callq 0x782f
movq 0xd0(%rsp), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
movslq 0x2c4(%rsp), %rax
addq $0x18, %rbx
cmpq %rax, %r14
jl 0x454a
leaq 0xd0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x7a07
movl $0x26, %edx
movq 0xca1f(%rip), %rdi      # 0x10fd8
leaq 0x7c27(%rip), %rsi      # 0xc1e7
callq 0x32c0
movsd 0xc8(%rsp), %xmm0
movq 0xca03(%rip), %rdi      # 0x10fd8
callq 0x33e0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7e7a(%rip), %rsi      # 0xc466
callq 0x32c0
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0x3420
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movslq 0xc(%rsp), %rax
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
addq 0xe8(%rsp), %rdi
leaq 0x100(%rsp), %rax
movq %rax, (%rsp)
leaq 0x330(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x120(%rsp), %r9
callq 0x7a59
testb %al, %al
je 0x4754
movl $0xe, %edx
movq 0xc958(%rip), %rdi      # 0x10fd8
leaq 0x7b87(%rip), %rsi      # 0xc20e
callq 0x32c0
movq 0xc945(%rip), %rcx      # 0x10fd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xc927(%rip), %rdi      # 0x10fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
incl 0x8(%rsp)
movslq 0xc(%rsp), %rax
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
addq 0xe8(%rsp), %rdi
testb $0x1, 0x188(%rsp)
je 0x4d43
leaq 0x330(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x2a0(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x6f58
movslq 0xc(%rsp), %rax
movq 0xe8(%rsp), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rbx
movb $0x1, %r14b
cmpq 0x8(%rcx,%rax,8), %rbx
je 0x4d65
leaq 0x400(%rsp), %rdi
movq %rbx, %rsi
callq 0x57c4
movl $0x0, (%rax)
addq $0x20, %rbx
movslq 0xc(%rsp), %rax
movq 0xe8(%rsp), %rcx
leaq (%rax,%rax,2), %rax
jmp 0x471c
leaq 0xd0(%rsp), %rdi
leaq 0x460(%rsp), %rsi
leaq 0x3a4(%rsp), %rdx
callq 0x7f33
movl $0xc, %edx
movq 0xc85b(%rip), %rdi      # 0x10fd8
leaq 0x7a99(%rip), %rsi      # 0xc21d
callq 0x32c0
xorl %r14d, %r14d
xorl %r12d, %r12d
cmpl 0x2c8(%rsp), %r12d
jge 0x4d65
incl %r12d
imull $0x64, %r12d, %eax
cmpl $0x64, %eax
jne 0x47ce
movq 0xc828(%rip), %rdi      # 0x10fd8
movl $0x64, %esi
callq 0x3420
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7c9d(%rip), %rsi      # 0xc466
callq 0x32c0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x2e0(%rsp)
movq $0x0, 0x2f0(%rsp)
leaq 0x2e0(%rsp), %rbx
movq %rbx, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x7cf4
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movq %rbx, %rdi
callq 0x7ee8
movl %eax, 0x8c(%rsp)
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0x4840
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x78(%rsp)
jmp 0x4852
leaq 0x70(%rsp), %rdi
leaq 0x8c(%rsp), %rdx
callq 0x61a6
leaq 0x2e0(%rsp), %rdi
callq 0x7ee8
movl %eax, 0x19c(%rsp)
cmpl %eax, 0x8c(%rsp)
je 0x4852
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0x488b
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x78(%rsp)
jmp 0x489d
leaq 0x70(%rsp), %rdi
leaq 0x19c(%rsp), %rdx
callq 0x61a6
xorpd %xmm0, %xmm0
movapd %xmm0, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
movl $0x30, %edi
callq 0x3270
movq %rax, 0xb0(%rsp)
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, 0xc0(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movq %rcx, 0xb8(%rsp)
xorl %ecx, %ecx
movl %ecx, 0x308(%rsp)
movq %rcx, 0x310(%rsp)
leaq 0x308(%rsp), %rax
movq %rax, 0x318(%rsp)
movq %rax, 0x320(%rsp)
movq %rcx, 0x328(%rsp)
movl %ecx, 0x438(%rsp)
movq %rcx, 0x440(%rsp)
leaq 0x438(%rsp), %rax
movq %rax, 0x448(%rsp)
movq %rax, 0x450(%rsp)
movq %rcx, 0x458(%rsp)
leaq 0xe8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x1c0(%rsp), %rbx
movq %rbx, %rdx
leaq 0xb0(%rsp), %r15
movq %r15, %rcx
movq %r13, %r8
leaq 0x430(%rsp), %rbp
movq %rbp, %r9
callq 0x7f7d
movsd 0x2d0(%rsp), %xmm0
leaq 0x400(%rsp), %rax
movq %rax, (%rsp)
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
leaq 0x330(%rsp), %rcx
movq %r13, %r8
movq %rbp, %r9
callq 0x8504
xorpd %xmm0, %xmm0
movapd %xmm0, 0x1a0(%rsp)
movq $0x0, 0x1b0(%rsp)
leaq 0x3e8(%rsp), %rbx
movq %rbx, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x5840
leaq 0x1a0(%rsp), %rdi
movq %rbx, %rsi
callq 0x89ef
movq 0x3e8(%rsp), %rdi
testq %rdi, %rdi
je 0x4a18
movq 0x3f8(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movb $0x1, %r15b
xorl %r13d, %r13d
leaq (,%r13,2), %rbp
addq %r13, %rbp
leaq (,%rbp,8), %rbx
movq 0xb0(%rsp), %rdi
addq %rbx, %rdi
leaq 0x330(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rcx
leaq 0x30(%rsp), %r8
callq 0x782f
movsd 0xc8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movsd %xmm0, 0x190(%rsp)
jbe 0x4b1b
movsd %xmm0, 0xc8(%rsp)
movq 0xb0(%rsp), %rdi
addq %rbx, %rdi
leaq 0x100(%rsp), %rax
movq %rax, (%rsp)
leaq 0x330(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x120(%rsp), %r9
callq 0x7a59
movsd 0x190(%rsp), %xmm0
testb %al, %al
jne 0x4ba2
addq 0xb0(%rsp), %rbx
movq 0x1a0(%rsp), %rax
movslq (%rax,%r13,4), %rax
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
addq 0xe8(%rsp), %rdi
movq %rbx, %rsi
callq 0x58c0
movsd 0x190(%rsp), %xmm0
movq 0x1a0(%rsp), %rax
movslq (%rax,%r13,4), %rax
shlq $0x3, %rax
addq 0xd0(%rsp), %rax
xorl %r14d, %r14d
jmp 0x4b68
addq 0xb0(%rsp), %rbx
movq 0x1a0(%rsp), %rax
movslq (%rax,%r13,4), %rax
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
addq 0xe8(%rsp), %rdi
movq %rbx, %rsi
callq 0x58c0
movsd 0x190(%rsp), %xmm0
movq 0x1a0(%rsp), %rax
movslq (%rax,%r13,4), %rax
shlq $0x3, %rax
addq 0xd0(%rsp), %rax
movsd %xmm0, (%rax)
movl $0x1, %r13d
testb $0x1, %r15b
movl $0x0, %r15d
jne 0x4a1e
movq 0x70(%rsp), %rax
movb $0x1, %bl
cmpq %rax, 0x78(%rsp)
je 0x4b95
movq %rax, 0x78(%rsp)
leaq 0x300(%rsp), %r13
jmp 0x4cc3
movq 0xc42f(%rip), %rdi      # 0x10fd8
callq 0x33e0
leaq 0x300(%rsp), %r13
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movl $0x10, %edx
movq 0xc3ec(%rip), %rdi      # 0x10fd8
leaq 0x7637(%rip), %rsi      # 0xc22a
callq 0x32c0
movq 0xc3d9(%rip), %rcx      # 0x10fd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xc3bb(%rip), %rdi      # 0x10fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
incl 0x8(%rsp)
addq 0xb0(%rsp), %rbx
testb $0x1, 0x188(%rsp)
je 0x4c9c
movq %rbx, %rdi
leaq 0x330(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x2a0(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x6f58
movq 0xb0(%rsp), %rax
movq (%rax,%rbp,8), %rbx
movb $0x1, %r14b
cmpq 0x8(%rax,%rbp,8), %rbx
je 0x4cc1
leaq 0x400(%rsp), %rdi
movq %rbx, %rsi
callq 0x57c4
movl $0x0, (%rax)
addq $0x20, %rbx
movq 0xb0(%rsp), %rax
jmp 0x4c71
movq %rbx, %rdi
leaq 0x330(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x2a0(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x6d0c
movb $0x1, %r14b
xorl %ebx, %ebx
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0x4ce0
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0x430(%rsp), %rdi
callq 0x5b08
movq %r13, %rdi
callq 0x5b08
leaq 0xb0(%rsp), %rdi
callq 0x5a56
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x4d1c
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x2e0(%rsp), %rdi
testq %rdi, %rdi
je 0x4d39
movq 0x2f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
testb %bl, %bl
jne 0x478f
jmp 0x4d65
movb $0x1, %r14b
leaq 0x330(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x2a0(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x6d0c
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x4d76
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rax
cmpq %rax, 0x58(%rsp)
je 0x4d87
movq %rax, 0x58(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x4d98
movq %rax, 0x38(%rsp)
movq 0xe8(%rsp), %r15
movq 0xf0(%rsp), %r13
cmpq %r15, %r13
je 0x4dc9
movq %r15, %rbx
movq %rbx, %rdi
callq 0x5a9e
addq $0x18, %rbx
cmpq %r13, %rbx
jne 0x4db0
movq %r15, 0xf0(%rsp)
movq 0xd0(%rsp), %rdi
cmpq %rdi, 0xd8(%rsp)
je 0x4de3
movq %rdi, 0xd8(%rsp)
testb $0x1, %r14b
leaq 0x300(%rsp), %r13
jne 0x4edb
movl 0x2c8(%rsp), %esi
movq 0xc1d5(%rip), %rdi      # 0x10fd8
callq 0x3420
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movl $0x28, %edx
movq 0xc19a(%rip), %rdi      # 0x10fd8
leaq 0x73f6(%rip), %rsi      # 0xc23b
callq 0x32c0
movq 0xc187(%rip), %rcx      # 0x10fd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xc169(%rip), %rdi      # 0x10fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movl $0xd, %edx
movq 0xc150(%rip), %rdi      # 0x10fd8
leaq 0x73d5(%rip), %rsi      # 0xc264
callq 0x32c0
movsd 0xc8(%rsp), %xmm0
movq 0xc134(%rip), %rdi      # 0x10fd8
callq 0x33e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x4ef0
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0xe8(%rsp), %rdi
callq 0x5a56
movsd 0x7103(%rip), %xmm1     # 0xc008
movsd 0x398(%rsp), %xmm0
ucomisd %xmm1, %xmm0
movq 0x180(%rsp), %rdx
jbe 0x41fe
leaq 0x468(%rsp), %rdi
callq 0x5b80
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x4f4a
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x4f67
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x4f84
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x4fa1
movq 0x170(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x4fbe
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0x330(%rsp), %rdi
callq 0x5bd0
movq 0x1e0(%rsp), %rdi
testq %rdi, %rdi
je 0x4fe8
movq 0x1f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0x1c0(%rsp), %rdi
callq 0x5a9e
leaq 0x400(%rsp), %rdi
callq 0x5b08
movq 0x360(%rsp), %rdi
testq %rdi, %rdi
je 0x501f
movq 0x370(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x380(%rsp), %rdi
testq %rdi, %rdi
je 0x503c
movq 0x390(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x5053
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x506a
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5081
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x2a0(%rsp), %rdi
leaq 0x2b0(%rsp), %rax
cmpq %rax, %rdi
je 0x50a6
movq 0x2b0(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x50cb
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x260(%rsp), %rdi
leaq 0x270(%rsp), %rax
cmpq %rax, %rdi
je 0x50f0
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x240(%rsp), %rdi
leaq 0x250(%rsp), %rax
cmpq %rax, %rdi
je 0x5115
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x220(%rsp), %rdi
leaq 0x230(%rsp), %rax
cmpq %rax, %rdi
je 0x513a
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x200(%rsp), %rdi
leaq 0x210(%rsp), %rax
cmpq %rax, %rdi
je 0x515f
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x3280
xorl %eax, %eax
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x97b8
movl $0x1, %edi
callq 0x32e0
movq %rax, %rbx
movq 0x3c8(%rsp), %rdi
cmpq %r14, %rdi
je 0x53fc
movq 0x3d8(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x53fc
movq %rax, %rbx
movq 0x3a8(%rsp), %rdi
cmpq %r14, %rdi
je 0x53c5
movq 0x3b8(%rsp), %rsi
incq %rsi
jmp 0x53c0
jmp 0x51f9
movq %rax, %rbx
jmp 0x5409
movq %rax, %rbx
jmp 0x5426
movq %rax, %rbx
jmp 0x5443
movq %rax, %rbx
jmp 0x545a
movq %rax, %rbx
jmp 0x5471
movq %rax, %rbx
jmp 0x53c5
jmp 0x5255
movq %rax, %rbx
jmp 0x53fc
jmp 0x5255
jmp 0x5255
jmp 0x526e
jmp 0x525f
jmp 0x5255
movq %rax, %rbx
jmp 0x5488
jmp 0x527a
jmp 0x5255
jmp 0x526e
jmp 0x527f
jmp 0x527a
movq %rax, %rbx
movq 0x3e8(%rsp), %rdi
testq %rdi, %rdi
je 0x5282
movq 0x3f8(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
jmp 0x5282
movq %rax, %rbx
jmp 0x52e0
jmp 0x526e
jmp 0x526e
movq %rax, %rbx
jmp 0x5327
jmp 0x526e
movq %rax, %rbx
jmp 0x531a
jmp 0x527a
movq %rax, %rbx
jmp 0x529f
movq %rax, %rbx
jmp 0x52fd
jmp 0x527f
jmp 0x527f
movq %rax, %rbx
jmp 0x52c6
movq %rax, %rbx
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0x529f
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0x430(%rsp), %rdi
callq 0x5b08
leaq 0x300(%rsp), %rdi
callq 0x5b08
leaq 0xb0(%rsp), %rdi
callq 0x5a56
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x52e0
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x2e0(%rsp), %rdi
testq %rdi, %rdi
je 0x52fd
movq 0x2f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x531a
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0xe8(%rsp), %rdi
callq 0x5a56
leaq 0x468(%rsp), %rdi
callq 0x5b80
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x5351
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x536e
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x538b
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x53a8
movq 0x170(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x53c5
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0x330(%rsp), %rdi
callq 0x5bd0
movq 0x1e0(%rsp), %rdi
testq %rdi, %rdi
je 0x53ef
movq 0x1f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0x1c0(%rsp), %rdi
callq 0x5a9e
leaq 0x400(%rsp), %rdi
callq 0x5b08
movq 0x360(%rsp), %rdi
testq %rdi, %rdi
je 0x5426
movq 0x370(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x380(%rsp), %rdi
testq %rdi, %rdi
je 0x5443
movq 0x390(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x545a
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x5471
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5488
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x2a0(%rsp), %rdi
leaq 0x2b0(%rsp), %rax
cmpq %rax, %rdi
je 0x54ad
movq 0x2b0(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x54d2
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x260(%rsp), %rdi
leaq 0x270(%rsp), %rax
cmpq %rax, %rdi
je 0x54f7
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x240(%rsp), %rdi
leaq 0x250(%rsp), %rax
cmpq %rax, %rdi
je 0x551c
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x220(%rsp), %rdi
leaq 0x230(%rsp), %rax
cmpq %rax, %rdi
je 0x5541
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x200(%rsp), %rdi
leaq 0x210(%rsp), %rax
cmpq %rax, %rdi
je 0x5566
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3450