// File: /workspace/github_cpp_makefile_star2_O1/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 0x95e0
leaq 0x200(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x220(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x240(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x260(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x280(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x2a0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x1f0(%rsp), %rdx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x9a99
cmpb $0x0, 0x2c8(%rsp)
je 0x5179
movq 0xe7ac(%rip), %rbx      # 0x11fd8
leaq 0x97ed(%rip), %rsi      # 0xd020
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 0xe77a(%rip), %rdi      # 0x11fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0xe766(%rip), %rdi      # 0x11fd8
leaq 0x97b3(%rip), %rsi      # 0xd02c
movl $0x18, %edx
callq 0x32c0
movq 0x1f0(%rsp), %rsi
movq 0x1f8(%rsp), %rdx
movq 0xe73e(%rip), %rdi      # 0x11fd8
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 0xe708(%rip), %rdi      # 0x11fd8
leaq 0x976e(%rip), %rsi      # 0xd045
movl $0x18, %edx
callq 0x32c0
movq 0x210(%rsp), %rsi
movq 0x218(%rsp), %rdx
movq 0xe6e0(%rip), %rdi      # 0x11fd8
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 0xe6aa(%rip), %rdi      # 0x11fd8
leaq 0x9729(%rip), %rsi      # 0xd05e
movl $0x18, %edx
callq 0x32c0
movq 0x230(%rsp), %rsi
movq 0x238(%rsp), %rdx
movq 0xe682(%rip), %rdi      # 0x11fd8
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 0xe64c(%rip), %rdi      # 0x11fd8
leaq 0x96e4(%rip), %rsi      # 0xd077
movl $0x18, %edx
callq 0x32c0
movq 0x250(%rsp), %rsi
movq 0x258(%rsp), %rdx
movq 0xe624(%rip), %rdi      # 0x11fd8
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 0xe5ee(%rip), %rdi      # 0x11fd8
leaq 0x969f(%rip), %rsi      # 0xd090
movl $0x18, %edx
callq 0x32c0
movl 0x2b0(%rsp), %esi
movq 0xe5cf(%rip), %rdi      # 0x11fd8
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 0xe599(%rip), %rdi      # 0x11fd8
leaq 0x9663(%rip), %rsi      # 0xd0a9
movl $0x18, %edx
callq 0x32c0
movsd 0x2c0(%rsp), %xmm0
movq 0xe578(%rip), %rdi      # 0x11fd8
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 0xe542(%rip), %rdi      # 0x11fd8
leaq 0x9625(%rip), %rsi      # 0xd0c2
movl $0x18, %edx
callq 0x32c0
movl 0x2b4(%rsp), %esi
movq 0xe523(%rip), %rdi      # 0x11fd8
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 0xe4ed(%rip), %rdi      # 0x11fd8
leaq 0x95e9(%rip), %rsi      # 0xd0db
movl $0x18, %edx
callq 0x32c0
movq 0x270(%rsp), %rsi
movq 0x278(%rsp), %rdx
movq 0xe4c5(%rip), %rdi      # 0x11fd8
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 0xe48f(%rip), %rdi      # 0x11fd8
leaq 0x95a4(%rip), %rsi      # 0xd0f4
movl $0x18, %edx
callq 0x32c0
movl 0x2b8(%rsp), %esi
movq 0xe470(%rip), %rdi      # 0x11fd8
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 0xe43a(%rip), %rdi      # 0x11fd8
leaq 0x9568(%rip), %rsi      # 0xd10d
movl $0x18, %edx
callq 0x32c0
movq 0x290(%rsp), %rsi
movq 0x298(%rsp), %rdx
movq 0xe412(%rip), %rdi      # 0x11fd8
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 0x210(%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 0xb196
leaq 0x230(%rsp), %rbx
leaq 0x50(%rsp), %rsi
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0xb02b
leaq 0x250(%rsp), %r14
xorpd %xmm0, %xmm0
leaq 0x30(%rsp), %rsi
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %r14, %rdi
callq 0xb02b
leaq 0x370(%rsp), %rsi
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0xb306
xorpd %xmm0, %xmm0
leaq 0x350(%rsp), %rsi
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %r14, %rdi
callq 0xb306
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 0x278(%rsp), %rdx
testq %rdx, %rdx
je 0x3d5c
leaq 0x3d8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x270(%rsp), %rsi
addq %rsi, %rdx
leaq 0x3c8(%rsp), %rdi
callq 0x5c1c
leaq 0x3c8(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x6b78
movq 0x3c8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3d5c
movq 0x3d8(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0xe275(%rip), %rbx      # 0x11fd8
leaq 0x93bc(%rip), %rsi      # 0xd126
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 0xe243(%rip), %rdi      # 0x11fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x1b0(%rsp)
xorl %eax, %eax
movq %rax, 0x1c0(%rsp)
movq %rax, 0x1e0(%rsp)
movapd %xmm0, 0x1d0(%rsp)
leaq 0x328(%rsp), %rcx
movl $0x0, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x3b8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x1f0(%rsp), %rsi
movq 0x1f8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x3a8(%rsp), %rdi
callq 0x5c1c
leaq 0x3a8(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
leaq 0x320(%rsp), %rcx
leaq 0x400(%rsp), %r8
callq 0xb634
movq 0x3a8(%rsp), %rdi
cmpq %r15, %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, 0x88(%rsp)
movl %edi, %eax
movq 0x1d8(%rsp), %rcx
subq 0x1d0(%rsp), %rcx
sarq $0x3, %rcx
cmpq %rax, %rcx
jae 0x3eee
movq 0xe129(%rip), %rbx      # 0x11fd8
leaq 0x9286(%rip), %rsi      # 0xd13c
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 0xe0f7(%rip), %rdi      # 0x11fd8
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), %r13
movl $0x0, (%r13)
movq %rax, 0x8(%r13)
movq %r13, 0x10(%r13)
movq %r13, 0x18(%r13)
movq %rax, 0x20(%r13)
leaq 0x10(%rsp), %rsi
callq 0x5572
movq 0x90(%rsp), %rbx
movq 0x98(%rsp), %r15
cmpq %r15, %rbx
je 0x3fb4
movq %r15, %rax
subq %rbx, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5d07
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5dea
movq 0x90(%rsp), %rdx
cmpq %rdx, 0x98(%rsp)
je 0x418f
xorl %ebp, %ebp
leaq 0x160(%rsp), %r14
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
je 0x416d
sarq $0x2, %rcx
movl (%rdx,%rbp,4), %edx
xorl %ebx, %ebx
movq 0x478(%rsp), %rsi
xorl %r15d, %r15d
cmpl %edx, (%rax,%rbx,4)
jne 0x403f
movq %r13, %rdi
testq %rsi, %rsi
je 0x4027
movq %rsi, %r8
movq %r13, %rdi
xorl %r9d, %r9d
cmpl %r15d, 0x20(%r8)
setl %r9b
cmovgeq %r8, %rdi
movq 0x10(%r8,%r9,8), %r8
testq %r8, %r8
jne 0x400e
movq %r13, %r8
cmpq %r13, %rdi
je 0x403a
cmpl 0x20(%rdi), %r15d
cmovlq %r13, %rdi
movq %rdi, %r8
cmpq %r13, %r8
je 0x404f
incl %r15d
movq %r15, %rbx
cmpq %r15, %rcx
ja 0x3ffb
jmp 0x416d
leaq (,%rbx,8), %r12
movq 0x50(%rsp), %rdx
addq %r12, %rdx
movq 0x168(%rsp), %rsi
cmpq 0x170(%rsp), %rsi
je 0x4087
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x168(%rsp)
jmp 0x408f
movq %r14, %rdi
callq 0x605a
addq 0x30(%rsp), %r12
movq 0x148(%rsp), %rsi
cmpq 0x150(%rsp), %rsi
je 0x40be
movsd (%r12), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x148(%rsp)
jmp 0x40ce
leaq 0x140(%rsp), %rdi
movq %r12, %rdx
callq 0x605a
shlq $0x2, %rbx
movq 0x370(%rsp), %rdx
addq %rbx, %rdx
movq 0x128(%rsp), %rsi
cmpq 0x130(%rsp), %rsi
je 0x4101
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x128(%rsp)
jmp 0x410e
leaq 0x120(%rsp), %rdi
callq 0x619a
addq 0x350(%rsp), %rbx
movq 0x108(%rsp), %rsi
cmpq 0x110(%rsp), %rsi
je 0x413a
movl (%rbx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x108(%rsp)
jmp 0x414a
leaq 0x100(%rsp), %rdi
movq %rbx, %rdx
callq 0x619a
movl %r15d, 0x2f0(%rsp)
leaq 0x468(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
callq 0x5648
movl $0x0, (%rax)
incl %ebp
movq 0x90(%rsp), %rdx
movq 0x98(%rsp), %rax
subq %rdx, %rax
sarq $0x2, %rax
cmpq %rbp, %rax
ja 0x3fd4
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x41a0
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rax
cmpq %rax, 0x58(%rsp)
movl 0x88(%rsp), %ebp
je 0x41b8
movq %rax, 0x58(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x41c9
movq %rax, 0x38(%rsp)
leaq 0x8(%rsp), %rax
movl $0x0, (%rax)
movsd 0x8e2c(%rip), %xmm1     # 0xd008
movq $0x0, 0x178(%rsp)
xorl %r13d, %r13d
movl $0x0, 0x6c(%rsp)
movslq %r13d, %r12
movq 0x90(%rsp), %rax
movl (%rax,%r12,4), %ebx
cvtsi2sd %ebx, %xmm2
movl %ebp, %r15d
subl 0x6c(%rsp), %r15d
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x398(%rsp)
ucomisd %xmm1, %xmm2
ja 0x4251
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x4341
movl %ebx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
leaq 0x1b0(%rsp), %r15
jmp 0x4357
movl %r13d, %ebx
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbx, %rcx
jbe 0x4331
leal 0x1(%r13), %ebp
leaq (%rax,%rbx,4), %rdx
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x4297
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x42a1
leaq 0x10(%rsp), %rdi
callq 0x619a
shlq $0x3, %rbx
movq 0x160(%rsp), %rdx
addq %rbx, %rdx
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x42cf
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x58(%rsp)
jmp 0x42d9
leaq 0x50(%rsp), %rdi
callq 0x605a
addq 0x140(%rsp), %rbx
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x4300
movsd (%rbx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x430d
leaq 0x30(%rsp), %rdi
movq %rbx, %rdx
callq 0x605a
movl %ebp, %ebx
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
incl %ebp
cmpq %rbx, %rcx
ja 0x4278
movl %r15d, %ebx
leaq 0x1b0(%rsp), %r15
jmp 0x43e9
leaq (%rax,%r12,4), %rdx
leaq 0x10(%rsp), %rdi
callq 0x619a
leaq 0x1b0(%rsp), %r15
leaq (,%r12,8), %rbp
movq 0x160(%rsp), %rdx
addq %rbp, %rdx
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x4389
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x58(%rsp)
jmp 0x4393
leaq 0x50(%rsp), %rdi
callq 0x605a
addq 0x140(%rsp), %rbp
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x43bb
movsd (%rbp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x43c8
leaq 0x30(%rsp), %rdi
movq %rbp, %rdx
callq 0x605a
movq 0x90(%rsp), %rax
movl 0x6c(%rsp), %ecx
addl (%rax,%r12,4), %ecx
movl %ecx, 0x6c(%rsp)
incl %r13d
movb $0x1, %al
movq %rax, 0x178(%rsp)
movl $0x19, %edx
movq 0xdbe3(%rip), %rdi      # 0x11fd8
leaq 0x8da7(%rip), %rsi      # 0xd1a3
callq 0x32c0
movq 0xdbd0(%rip), %rcx      # 0x11fd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xdbb2(%rip), %rdi      # 0x11fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movslq 0x2b4(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
leaq 0x2f0(%rsp), %rdx
callq 0x56ac
movl $0x14, %edx
movq 0xdb7c(%rip), %rdi      # 0x11fd8
leaq 0x8d5a(%rip), %rsi      # 0xd1bd
callq 0x32c0
movq 0x428(%rsp), %rsi
movq 0xdb61(%rip), %rdi      # 0x11fd8
callq 0x31a0
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbp, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movl %ebx, %edi
movq %r15, %rsi
leaq 0xe8(%rsp), %rdx
leaq 0x400(%rsp), %rcx
callq 0x76e8
movl $0x14, %edx
movq 0xdb0c(%rip), %rdi      # 0x11fd8
leaq 0x8cff(%rip), %rsi      # 0xd1d2
callq 0x32c0
movq 0xdaf9(%rip), %rcx      # 0x11fd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xdadb(%rip), %rdi      # 0x11fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movslq 0x2b4(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
leaq 0x2f0(%rsp), %rdx
callq 0x5734
cmpl $0x0, 0x2b4(%rsp)
jle 0x457f
xorl %ebx, %ebx
xorl %r15d, %r15d
movq 0xe8(%rsp), %rdi
addq %rbx, %rdi
leaq 0x320(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rcx
leaq 0x30(%rsp), %r8
callq 0x784f
movq 0xd0(%rsp), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
movslq 0x2b4(%rsp), %rax
addq $0x18, %rbx
cmpq %rax, %r15
jl 0x4536
leaq 0xd0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x7a35
movl $0x26, %edx
movq 0xda33(%rip), %rdi      # 0x11fd8
leaq 0x8c3b(%rip), %rsi      # 0xd1e7
callq 0x32c0
movsd 0xc8(%rsp), %xmm0
movq 0xda17(%rip), %rdi      # 0x11fd8
callq 0x33e0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8e8e(%rip), %rsi      # 0xd466
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 0x320(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x120(%rsp), %r9
callq 0x7a87
movl %eax, %ebx
testb %al, %al
movq %r13, 0x390(%rsp)
je 0x4747
movl $0xe, %edx
movq 0xd962(%rip), %rdi      # 0x11fd8
leaq 0x8b91(%rip), %rsi      # 0xd20e
callq 0x32c0
movq 0xd94f(%rip), %rcx      # 0x11fd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xd931(%rip), %rdi      # 0x11fd8
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, 0x178(%rsp)
je 0x4d4e
leaq 0x320(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x290(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x6f81
movslq 0xc(%rsp), %rax
movq 0xe8(%rsp), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rbp
cmpq 0x8(%rcx,%rax,8), %rbp
je 0x4d6d
leaq 0x400(%rsp), %rdi
movq %rbp, %rsi
callq 0x57be
movl $0x0, (%rax)
addq $0x20, %rbp
movslq 0xc(%rsp), %rax
movq 0xe8(%rsp), %rcx
leaq (%rax,%rax,2), %rax
jmp 0x470f
leaq 0xd0(%rsp), %rdi
leaq 0x460(%rsp), %rsi
leaq 0x3a4(%rsp), %rdx
callq 0x7f60
movl $0xc, %edx
movq 0xd868(%rip), %rdi      # 0x11fd8
leaq 0x8aa6(%rip), %rsi      # 0xd21d
callq 0x32c0
xorl %ebp, %ebp
movb $0x1, %r15b
leaq 0x2f0(%rsp), %r13
cmpl 0x2b8(%rsp), %ebp
jge 0x4d6d
incl %ebp
imull $0x64, %ebp, %esi
movl $0x64, %eax
xorl %edx, %edx
divl %esi
testl %edx, %edx
jne 0x47c8
movq 0xd829(%rip), %rdi      # 0x11fd8
callq 0x3420
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8ca3(%rip), %rsi      # 0xd466
callq 0x32c0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x2d0(%rsp)
movq $0x0, 0x2e0(%rsp)
leaq 0x2d0(%rsp), %r12
movq %r12, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x7d23
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movq %r12, %rdi
callq 0x7f15
movl %eax, 0x8c(%rsp)
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0x483a
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x78(%rsp)
jmp 0x484c
leaq 0x70(%rsp), %rdi
leaq 0x8c(%rsp), %rdx
callq 0x619a
leaq 0x2d0(%rsp), %rdi
callq 0x7f15
movl %eax, 0x18c(%rsp)
cmpl %eax, 0x8c(%rsp)
je 0x484c
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0x4885
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x78(%rsp)
jmp 0x4897
leaq 0x70(%rsp), %rdi
leaq 0x18c(%rsp), %rdx
callq 0x619a
xorpd %xmm0, %xmm0
movapd %xmm0, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
movl $0x30, %edi
callq 0x3270
movl %ebp, 0x188(%rsp)
movq %rax, 0xb0(%rsp)
movq %rax, 0xb8(%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, 0x2f8(%rsp)
movq %rcx, 0x300(%rsp)
leaq 0x2f8(%rsp), %rax
movq %rax, 0x308(%rsp)
movq %rax, 0x310(%rsp)
movq %rcx, 0x318(%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 0x1b0(%rsp), %r12
movq %r12, %rdx
leaq 0xb0(%rsp), %rbp
movq %rbp, %rcx
movq %r13, %r8
movq %r13, %r14
leaq 0x430(%rsp), %r13
movq %r13, %r9
callq 0x7faa
movsd 0x2c0(%rsp), %xmm0
leaq 0x400(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
movq %r12, %rdx
leaq 0x320(%rsp), %rcx
movq %r14, %r8
movq %r13, %r9
callq 0x8531
xorpd %xmm0, %xmm0
movapd %xmm0, 0x190(%rsp)
movq $0x0, 0x1a0(%rsp)
leaq 0x3e8(%rsp), %r12
movq %r12, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x583a
leaq 0x190(%rsp), %rdi
movq %r12, %rsi
callq 0x8a1c
movq 0x3e8(%rsp), %rdi
testq %rdi, %rdi
je 0x4a24
movq 0x3f8(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
xorl %r13d, %r13d
leaq (,%r13,2), %r12
addq %r13, %r12
leaq (,%r12,8), %rbp
movq 0xb0(%rsp), %rdi
addq %rbp, %rdi
leaq 0x320(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rcx
leaq 0x30(%rsp), %r8
callq 0x784f
movsd 0xc8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movsd %xmm0, 0x180(%rsp)
jbe 0x4bda
movsd %xmm0, 0xc8(%rsp)
movq 0xb0(%rsp), %rdi
addq %rbp, %rdi
leaq 0x100(%rsp), %rax
movq %rax, (%rsp)
leaq 0x320(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x120(%rsp), %r9
callq 0x7a87
movsd 0x180(%rsp), %xmm0
movl %eax, %ebx
testb %al, %al
je 0x4c11
movq 0xd4fd(%rip), %rdi      # 0x11fd8
callq 0x33e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movl $0x10, %edx
movq 0xd4c2(%rip), %rdi      # 0x11fd8
leaq 0x870d(%rip), %rsi      # 0xd22a
callq 0x32c0
movq 0xd4af(%rip), %rcx      # 0x11fd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xd491(%rip), %rdi      # 0x11fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
incl 0x8(%rsp)
addq 0xb0(%rsp), %rbp
testb $0x1, 0x178(%rsp)
je 0x4c7c
movq %rbp, %rdi
leaq 0x320(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x290(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x6f81
movq 0xb0(%rsp), %rax
movq (%rax,%r12,8), %rbp
cmpq 0x8(%rax,%r12,8), %rbp
je 0x4bcf
leaq 0x400(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
callq 0x57be
movl $0x0, (%rax)
addq $0x20, %rbp
movq 0xb0(%rsp), %rax
cmpq 0x8(%rax,%r12,8), %rbp
jne 0x4bab
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0x4c65
addq 0xb0(%rsp), %rbp
movq 0x190(%rsp), %rax
movslq (%rax,%r13,4), %rax
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
addq 0xe8(%rsp), %rdi
movq %rbp, %rsi
callq 0x58ba
movsd 0x180(%rsp), %xmm0
jmp 0x4c46
addq 0xb0(%rsp), %rbp
movq 0x190(%rsp), %rax
movslq (%rax,%r13,4), %rax
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
addq 0xe8(%rsp), %rdi
movq %rbp, %rsi
callq 0x58ba
movsd 0x180(%rsp), %xmm0
movq 0x190(%rsp), %rax
movslq (%rax,%r13,4), %rax
shlq $0x3, %rax
addq 0xd0(%rsp), %rax
movsd %xmm0, (%rax)
movb $0x1, %r12b
testb %r12b, %r12b
je 0x4ca6
leaq 0x1(%r13), %rax
testq %r13, %r13
movq %rax, %r13
je 0x4a27
jmp 0x4ca6
xorl %r12d, %r12d
movq %rbp, %rdi
leaq 0x320(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x290(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x6d38
xorl %r15d, %r15d
jmp 0x4c65
testb $0x1, %r15b
je 0x4cbd
movq 0x70(%rsp), %rax
cmpq %rax, 0x78(%rsp)
je 0x4cbd
movq %rax, 0x78(%rsp)
movq 0x190(%rsp), %rdi
testq %rdi, %rdi
leaq 0x2f0(%rsp), %r13
movl 0x188(%rsp), %ebp
je 0x4ce9
movq 0x1a0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0x430(%rsp), %rdi
callq 0x5adc
movq %r13, %rdi
callq 0x5adc
leaq 0xb0(%rsp), %rdi
callq 0x5a34
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x4d25
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x2d0(%rsp), %rdi
testq %rdi, %rdi
je 0x4d42
movq 0x2e0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
testb $0x1, %r15b
jne 0x4789
jmp 0x4d6d
leaq 0x320(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x290(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x6d38
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x4d7e
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rax
cmpq %rax, 0x58(%rsp)
je 0x4d8f
movq %rax, 0x58(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x4da0
movq %rax, 0x38(%rsp)
movq 0xe8(%rsp), %r12
movq 0xf0(%rsp), %r13
cmpq %r12, %r13
je 0x4dd1
movq %r12, %r15
movq %r15, %rdi
callq 0x5a76
addq $0x18, %r15
cmpq %r13, %r15
jne 0x4db8
movq %r12, 0xf0(%rsp)
movq 0xd0(%rsp), %rax
cmpq %rax, 0xd8(%rsp)
je 0x4deb
movq %rax, 0xd8(%rsp)
testb $0x1, %bl
movl 0x88(%rsp), %ebp
movq 0x390(%rsp), %r13
jne 0x4ee1
movl 0x2b8(%rsp), %esi
movq 0xd1c7(%rip), %rdi      # 0x11fd8
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 0xd18c(%rip), %rdi      # 0x11fd8
leaq 0x83e8(%rip), %rsi      # 0xd23b
callq 0x32c0
movq 0xd179(%rip), %rcx      # 0x11fd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq 0xd15b(%rip), %rdi      # 0x11fd8
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movl $0xd, %edx
movq 0xd142(%rip), %rdi      # 0x11fd8
leaq 0x83c7(%rip), %rsi      # 0xd264
callq 0x32c0
movsd 0xc8(%rsp), %xmm0
movq 0xd126(%rip), %rdi      # 0x11fd8
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 0x4efe
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0xe8(%rsp), %rdi
callq 0x5a34
movsd 0x80f5(%rip), %xmm1     # 0xd008
movsd 0x398(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x41f3
leaq 0x468(%rsp), %rdi
callq 0x5b54
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x4f50
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x4f6d
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x4f8a
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x4fa7
movq 0x170(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x4fc4
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0x320(%rsp), %rdi
callq 0x5ba4
movq 0x1d0(%rsp), %rdi
testq %rdi, %rdi
je 0x4fee
movq 0x1e0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0x1b0(%rsp), %rdi
callq 0x5a76
leaq 0x400(%rsp), %rdi
callq 0x5adc
movq 0x350(%rsp), %rdi
testq %rdi, %rdi
je 0x5025
movq 0x360(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x370(%rsp), %rdi
testq %rdi, %rdi
je 0x5042
movq 0x380(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x5059
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x5070
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5087
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x290(%rsp), %rdi
leaq 0x2a0(%rsp), %rax
cmpq %rax, %rdi
je 0x50ac
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x270(%rsp), %rdi
leaq 0x280(%rsp), %rax
cmpq %rax, %rdi
je 0x50d1
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x250(%rsp), %rdi
leaq 0x260(%rsp), %rax
cmpq %rax, %rdi
je 0x50f6
movq 0x260(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x230(%rsp), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
je 0x511b
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x5140
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0x5165
movq 0x200(%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 0x97e0
movl $0x1, %edi
callq 0x32e0
movq %rax, %rbx
movq 0x3c8(%rsp), %rdi
cmpq %r14, %rdi
je 0x5400
movq 0x3d8(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x5400
movq %rax, %rbx
movq 0x3a8(%rsp), %rdi
cmpq %r15, %rdi
je 0x53c9
movq 0x3b8(%rsp), %rsi
incq %rsi
jmp 0x53c4
jmp 0x51ff
movq %rax, %rbx
jmp 0x540d
movq %rax, %rbx
jmp 0x542a
movq %rax, %rbx
jmp 0x5447
movq %rax, %rbx
jmp 0x545e
movq %rax, %rbx
jmp 0x5475
movq %rax, %rbx
jmp 0x53c9
jmp 0x525b
jmp 0x525b
movq %rax, %rbx
jmp 0x5400
jmp 0x525b
jmp 0x5274
jmp 0x5265
jmp 0x525b
movq %rax, %rbx
jmp 0x548c
jmp 0x527c
jmp 0x525b
jmp 0x5274
jmp 0x5274
movq %rax, %rbx
movq 0x3e8(%rsp), %rdi
testq %rdi, %rdi
je 0x5286
movq 0x3f8(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
jmp 0x5286
jmp 0x527c
jmp 0x5283
movq %rax, %rbx
jmp 0x52e4
jmp 0x5274
movq %rax, %rbx
jmp 0x532b
jmp 0x5274
movq %rax, %rbx
jmp 0x531e
jmp 0x527c
movq %rax, %rbx
jmp 0x52a3
movq %rax, %rbx
jmp 0x5301
movq %rax, %rbx
jmp 0x52ca
jmp 0x5283
movq %rax, %rbx
movq 0x190(%rsp), %rdi
testq %rdi, %rdi
je 0x52a3
movq 0x1a0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0x430(%rsp), %rdi
callq 0x5adc
leaq 0x2f0(%rsp), %rdi
callq 0x5adc
leaq 0xb0(%rsp), %rdi
callq 0x5a34
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x52e4
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x2d0(%rsp), %rdi
testq %rdi, %rdi
je 0x5301
movq 0x2e0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x531e
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0xe8(%rsp), %rdi
callq 0x5a34
leaq 0x468(%rsp), %rdi
callq 0x5b54
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x5355
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x5372
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x538f
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x53ac
movq 0x170(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x53c9
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0x320(%rsp), %rdi
callq 0x5ba4
movq 0x1d0(%rsp), %rdi
testq %rdi, %rdi
je 0x53f3
movq 0x1e0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
leaq 0x1b0(%rsp), %rdi
callq 0x5a76
leaq 0x400(%rsp), %rdi
callq 0x5adc
movq 0x350(%rsp), %rdi
testq %rdi, %rdi
je 0x542a
movq 0x360(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x370(%rsp), %rdi
testq %rdi, %rdi
je 0x5447
movq 0x380(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x545e
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x5475
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x548c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq 0x290(%rsp), %rdi
leaq 0x2a0(%rsp), %rax
cmpq %rax, %rdi
je 0x54b1
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x270(%rsp), %rdi
leaq 0x280(%rsp), %rax
cmpq %rax, %rdi
je 0x54d6
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x250(%rsp), %rdi
leaq 0x260(%rsp), %rax
cmpq %rax, %rdi
je 0x54fb
movq 0x260(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x230(%rsp), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
je 0x5520
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x5545
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x1f0(%rsp), %rdi
leaq 0x200(%rsp), %rax
cmpq %rax, %rdi
je 0x556a
movq 0x200(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3450