// File: /workspace/github_cpp_makefile_star2_O1/millanek[P]evo/evo_findDiscordantPairsFromSAM.cpp
// Function: DiscordPairsFromSAMMain(int, char**)
int DiscordPairsFromSAMMain(int argc, char** argv) {
    parseDiscordPairsFromSAMOptions(argc, argv);
    string line; // for reading the input files
    
    std::istream* hetsFile = createReader(opt::hetsFile.c_str());
    std::ifstream* samFile = new std::ifstream(opt::samFile.c_str());
    
    std::ofstream* phaseSwitchFile = new std::ofstream("switches" + opt::runName + ".txt");
    std::ofstream* recombFile = new std::ofstream("recombMap" + opt::runName + ".txt");
    
    std::map<int,PhaseInfo*> posToPhase;
    std::map<string,std::vector<int>> infoPairNameToPos;
    std::map<string,std::vector<string>> infoPairNameToStrands;
    std::vector<int> phaseBlockSNPnums;
    
    std::map<string,std::vector<RecombRead*>> samNameToReads;
    int numHetPairs = 0;
    std::unordered_map<string, ReadLinkSNPpair*> SNPpairs;
    
    
    std::cout << "1) Processing hets..." << std::endl;
    if (opt::hapcutFormat) {
        int blockNum = 0;
        // Parse the Hapcut blocks file
        while (getline(*hetsFile, line)) {
            if (line[0] == '*') {
            
            } else if (line[0] == 'B' && line[1] == 'L') { // New block - should in the future separate the hets by blocks
                blockNum++; phaseBlockSNPnums.push_back(0);
            } else {
                std::vector<string> phasedSNPdetails = split(line, '\t');
                int snpPos = atoi(phasedSNPdetails[4].c_str());
                int H1phase = atoi(phasedSNPdetails[1].c_str());
                int H2phase = atoi(phasedSNPdetails[2].c_str());
                //std::cout << "line: " << line << std::endl;
                // std::cout << "phasedSNPdetails[5]: " << phasedSNPdetails[5] << std::endl;
                assert(phasedSNPdetails[5].length() == 1); assert(phasedSNPdetails[6].length() == 1);
                char refBase = phasedSNPdetails[5][0];
                char altBase = phasedSNPdetails[6][0];
                double phaseQual = stringToDouble(phasedSNPdetails[10].c_str());
                int snpCoverage = atoi(phasedSNPdetails[11].c_str());
                std::vector<char> phasedVars;
                if (H1phase == 0 && H2phase == 1) {
                    phasedVars.push_back(refBase); phasedVars.push_back(altBase);
                } else if (H1phase == 1 && H2phase == 0) {
                    phasedVars.push_back(altBase); phasedVars.push_back(refBase);
                } else{
                    continue;
                }
                PhaseInfo* thisPhase = new PhaseInfo(snpPos,phaseQual,snpCoverage, phasedVars,blockNum);
                posToPhase[snpPos] = thisPhase;
                phaseBlockSNPnums[blockNum-1]++;
            }
        }
        //maxBlockIndex = (int)std::distance(phaseBlockSNPnums.begin(),std::max_element(phaseBlockSNPnums.begin(), phaseBlockSNPnums.end()));
    } else {
        while (getline(*hetsFile, line)) {
            std::vector<string> phasedSNPdetails = split(line, '\t');
            int snpPos = atoi(phasedSNPdetails[1].c_str());
            assert(phasedSNPdetails[2].length() == 1); assert(phasedSNPdetails[3].length() == 1);
            char refBase = phasedSNPdetails[2][0];
            char altBase = phasedSNPdetails[3][0];
            
            std::vector<char> phasedVars;
            phasedVars.push_back(refBase); phasedVars.push_back(altBase);
            double phaseQual = 0; int snpCoverage = 0;
            PhaseInfo* thisPhase = new PhaseInfo(snpPos,phaseQual,snpCoverage, phasedVars, 1);
            posToPhase[snpPos] = thisPhase;
        }
        numHetPairs = nChoosek((int)posToPhase.size(),2);
    }
    
    
    
    std::cout << std::endl;
    std::cout << "2) Loading read-pairs... " << std::endl;
    // Now parse the samtools file to find reads that match records from the pairstools file
    // and therefore  can be informative about the phasing and recombination
    int readN = 0;
    std::vector<RecombRead*> informativeReads;
    while (getline(*samFile,line)) {
        // std::cerr << line << std::endl;
        readN++;
        std::vector<string> samRecVec = split(line, '\t'); //assert(pairVec.size() == 8);
        RecombRead* thisRead = new RecombRead(samRecVec);
        informativeReads.push_back(thisRead);
    }
    
    std::cout << std::endl;
    std::cout << "3) Linking read-pairs and hets... " << std::endl;
    int num0het = 0; int num1het = 0; int num2plusHets = 0;
    int totalUsedLength = 0;
    std::vector<RecombReadPair*> informativeReadPairs;
    for (int r = 0; r < informativeReads.size(); r=r+2) {
        RecombReadPair* thisReadPair = new RecombReadPair(informativeReads[r], informativeReads[r+1]);
        thisReadPair->findAndCombinePairHets(posToPhase);
        thisReadPair->filterHetsByQuality(opt::minBQ);
        
        if (thisReadPair->hetSites.size() == 0) {
            num0het++;
        } else if (thisReadPair->hetSites.size() == 1) {
            num1het++;
        } else {
            num2plusHets++;
        }
        
        if (thisReadPair->hetSites.size() > 1) {
            for (std::map<int, std::vector<int>>::iterator it = thisReadPair->read1->BlockIDsToHetPos.begin();
                 it != thisReadPair->read1->BlockIDsToHetPos.end(); it++) {
                if (thisReadPair->read2->BlockIDsToHetPos.count(it->first) == 1) {
                    informativeReadPairs.push_back(thisReadPair);
                    totalUsedLength += thisReadPair->read1->usedLength;
                    totalUsedLength += thisReadPair->read2->usedLength;
                }
            }
        }
    }
    
    std::cout << "Initial Read Pairs.size(): " << informativeReads.size()/2.0 << std::endl;
    std::cout << "num0het: " << num0het << std::endl;
    std::cout << "num1het: " << num1het << std::endl;
    std::cout << "num2plusHets: " << num2plusHets << std::endl;
    std::cout << "informativeReadPairs.size(): " << informativeReadPairs.size() << std::endl;
    std::cout << std::endl;
    
    std::cout << "4) Categorising concordant-discordant read-pairs... " << std::endl;
    int numConcordant = 0; int numDiscordant = 0;
    int numMatch = 0; int numMismatch = 0; long long int totalEffectiveLength = 0;
    std::vector<double> matchBaseScores; std::vector<double> mismatchBaseScores;
    std::vector<double> concordantBaseScores; std::vector<double> discordantBaseScores;
    std::vector<PhaseSwitch*> phaseSwitches;
    std::vector<std::vector<int>> phaseConcordanceCoords;
        
    
    std::vector<int> coveredHetPos;
    if (opt::hapcutFormat) {
        int readPairsProcessed = 0;
        for (int r = 0; r < informativeReadPairs.size(); r++) {
            readPairsProcessed++;
            
           for (int i = 0; i < informativeReadPairs[r]->hetSites.size(); i++) {
                HetInfo* thisHet = informativeReadPairs[r]->hetSites[i];
                if (thisHet->readPhaseBaseMismatch) {
                    numMismatch++;
                    mismatchBaseScores.push_back(thisHet->thisBaseQuality);
                } else {
                    // std::cout << "Fine: " << std::endl;
                     matchBaseScores.push_back(thisHet->thisBaseQuality);
                     numMatch++;
                }
               coveredHetPos.push_back(thisHet->pos);
            }
            
            // Now consider all HiC pairs i that map to the chromosome and cover a het at each end - lets call the physical locations of the hets x_i, y_i ( x < y) and let Z_i = 1 if they are in phase, 0 if out of phase (recombined)
            
            // Prod_i ((1-Z_i)(G(y_i)-G(x_i)) + Z_i*(1 -(G(y_i)-G(x_i))
            
            // std::vector<PhaseSwitch*> thisPairSwitches;
            std::vector<int> switchPairI; std::vector<int> switchPairJ;
            std::vector<int> concordPairI; std::vector<int> concordPairJ;
            for (int i = 0; i < informativeReadPairs[r]->hetSites.size() - 1; i++) {
                for (int j = 1; j < informativeReadPairs[r]->hetSites.size(); j++) {
                    if (informativeReadPairs[r]->hetSites[i]->phaseBlock == informativeReadPairs[r]->hetSites[j]->phaseBlock) {
                        int phaseI = informativeReadPairs[r]->hetSites[i]->thisHetPhase01;
                        int phaseJ = informativeReadPairs[r]->hetSites[j]->thisHetPhase01;
                        int iPos = informativeReadPairs[r]->hetSites[i]->pos;
                        int jPos = informativeReadPairs[r]->hetSites[j]->pos;
                        if (phaseI != phaseJ && abs(jPos - iPos) > opt::minDist) {
                            switchPairI.push_back(i); switchPairJ.push_back(j);
                            //int iPos = informativeReadPairs[r]->hetSites[i]->pos;
                            //int jPos = informativeReadPairs[r]->hetSites[j]->pos;
                            //int iQual = informativeReadPairs[r]->hetSites[i]->thisPhaseQuality;
                            //int jQual = informativeReadPairs[r]->hetSites[j]->thisPhaseQuality;
                            // PhaseSwitch* thisSwitch = new PhaseSwitch(iPos, jPos, iQual, jQual);
                            // thisPairSwitches.push_back(thisSwitch);
                        } else {
                            concordPairI.push_back(i); concordPairJ.push_back(j);
                        }
                    }
                }
            }
            
            // TO DO:
            // Select the 'right' switch pair if there are multiple options:
            // The shortest one? Needs more thought....
            if (switchPairI.size() > 0) {
                numDiscordant++;
                int iPos = informativeReadPairs[r]->hetSites[switchPairI[0]]->pos;
                int jPos = informativeReadPairs[r]->hetSites[switchPairJ[0]]->pos;
                int iQual = informativeReadPairs[r]->hetSites[switchPairI[0]]->thisPhaseQuality;
                int jQual = informativeReadPairs[r]->hetSites[switchPairJ[0]]->thisPhaseQuality;
                if (jPos - iPos < 0) {
                    int tmp = iPos; iPos = jPos; jPos = tmp;
                    tmp = iQual; iQual = jQual; jQual = tmp;
                }
                PhaseSwitch* thisSwitch = new PhaseSwitch(iPos, jPos, iQual, jQual);
                phaseSwitches.push_back(thisSwitch);
                switchPairI.empty(); switchPairJ.empty();
                totalEffectiveLength = totalEffectiveLength + (jPos - iPos);
                
            } else {
                numConcordant++;
                std::vector<int> thisConcordantCoords;
                int maxD = 0; int maxDindex = 0;
                for (int i = 0; i != concordPairI.size(); i++) {
                    int iPos = informativeReadPairs[r]->hetSites[concordPairI[i]]->pos;
                    int jPos = informativeReadPairs[r]->hetSites[concordPairJ[i]]->pos;
                    if (abs(jPos - iPos) > maxD) {
                        maxDindex = i;
                    }
                }
                int iPosDindex = informativeReadPairs[r]->hetSites[concordPairI[maxDindex]]->pos;
                int jPosDindex = informativeReadPairs[r]->hetSites[concordPairJ[maxDindex]]->pos;
                if (jPosDindex - iPosDindex < 0) {
                    int tmp = iPosDindex; iPosDindex = jPosDindex; jPosDindex = tmp;
                }
                
                int concordantPairDist = jPosDindex - iPosDindex;
                totalEffectiveLength = totalEffectiveLength + concordantPairDist;
                thisConcordantCoords.push_back(iPosDindex);
                thisConcordantCoords.push_back(jPosDindex);
                thisConcordantCoords.push_back(concordantPairDist);
                phaseConcordanceCoords.push_back(thisConcordantCoords);
            }
          /*  if (readPairsProcessed % 10000 == 0) {
                std::cout << "readPairsProcessed: " << readPairsProcessed << std::endl;
               // std::cout << "informativeReadPairs[r]->hetSites.size(): " << informativeReadPairs[r]->hetSites.size() << std::endl;
                std::cout << "phaseSwitches.size(): " << phaseSwitches.size() << std::endl;
                std::cout << "Effective coverage (bp): " << totalEffectiveLength << std::endl;
                std::cout << std::endl;
            } */
        }
        
        std::cout << "Effective coverage (bp): " << totalEffectiveLength << std::endl;
        std::cout << "numConcordant: " << numConcordant << std::endl;
        std::cout << "numDiscordant: " << numDiscordant << std::endl;
        std::cout << "phaseConcordanceCoords.size(): " << phaseConcordanceCoords.size() << std::endl;
        
        std::cout << "numMatch: " << numMatch << std::endl;
        std::cout << "numMismatch: " << numMismatch << std::endl;
        std::cout << "Mean mismatchBaseScores: " << vector_average(mismatchBaseScores) << std::endl;
        std::cout << "Mean matchBaseScores: " << vector_average(matchBaseScores) << std::endl;
        
        for (int i = 0; i != phaseSwitches.size(); i++) {
            *phaseSwitchFile << phaseSwitches[i]->posLeft << "\t" << phaseSwitches[i]->posRight << "\t" << phaseSwitches[i]->dist << "\t" << phaseSwitches[i]->phaseQualLeft << "\t" << phaseSwitches[i]->phaseQualRight << std::endl;
        }
        
        
        
        std::cout << std::endl;
        std::cout << "5) Making a genetic map... " << std::endl;
        std::sort(coveredHetPos.begin(), coveredHetPos.end());
        std::vector<int>::iterator it = std::unique(coveredHetPos.begin(), coveredHetPos.end());
        coveredHetPos.resize(distance(coveredHetPos.begin(),it));
        std::cout << "coveredHetPos.size() " << coveredHetPos.size() << std::endl;
        
        double meanRecombinationRate = (double)numDiscordant/(double)totalEffectiveLength;
        std::cout << "meanRecombinationRate " << meanRecombinationRate << std::endl;
        std::vector<double> recombFractions(coveredHetPos.size()+1, meanRecombinationRate);
        
        int numProcessedHets = 0;
        for (int i = 0; i != coveredHetPos.size() - 1; i++) {
            int left = coveredHetPos[i];
            int right = coveredHetPos[i + 1];
            //int distSNPs = (right - left) + 1;
            
            int coveringReadPairs = 0;
            
            double totalRecombFractionPerBP = 0;
            for (int j = 0; j != phaseSwitches.size(); j++) {
                if(phaseSwitches[j]->posLeft <= left && phaseSwitches[j]->posRight >= right){
                    coveringReadPairs++;
                    double recombFractionPerBP = (double)1.0/(double)phaseSwitches[j]->dist;
                    totalRecombFractionPerBP += recombFractionPerBP;
                }
            }
          //  std::cout << "totalRecombFraction: " << totalRecombFraction << std::endl;
            
            double totalConcordantFraction = 0;
            for (int j = 0; j != phaseConcordanceCoords.size(); j++) {
                if(phaseConcordanceCoords[j][0] <= left && phaseConcordanceCoords[j][1] >= right){
                    coveringReadPairs++;
                    //double concordPairFraction = (double)distSNPs/(double)(phaseConcordanceCoords[j][2]);
                    totalConcordantFraction++;
                }
            }
           // std::cout << "totalConcordantFraction: " << totalConcordantFraction << std::endl;
            
            if (coveringReadPairs > 10) {
                recombFractions[i+1] = totalRecombFractionPerBP/totalConcordantFraction;
            }
            
            numProcessedHets++;
            if (numProcessedHets % 10000 == 0) {
                std::cout << "numProcessedHets: " << numProcessedHets << " ("<< (double)numProcessedHets/coveredHetPos.size() << "%)"<< std::endl;
                std::cout << "pos: " << left << "bp"<< std::endl;
                
            }
            
        }
        
        *recombFile << "0\t" << coveredHetPos[0] << "\t" << recombFractions[0] << std::endl;
        for (int i = 1; i != coveredHetPos.size(); i++) {
            *recombFile << coveredHetPos[i-1] << "\t" << coveredHetPos[i] << "\t" << recombFractions[i] << std::endl;
        }
        //int chrSize = 0;
        //*recombFile << coveredHetPos.back() << "\t" <<  << "\t" << recombFractions[i] << std::endl;
        //print_vector(coveredHetPos, std::cout);
        
        
    } else {
        for (int r = 0; r < informativeReadPairs.size(); r++) {
            if (informativeReadPairs[r]->hetSites.size() > 1) {
                for (int i = 0; i < informativeReadPairs[r]->hetSites.size() - 1; i++) {
                    for (int j = 1; j < informativeReadPairs[r]->hetSites.size(); j++) {
                        char readBase1 = informativeReadPairs[r]->hetSites[i]->thisBase;
                        char readBase2 = informativeReadPairs[r]->hetSites[j]->thisBase;
                        int pos1 = informativeReadPairs[r]->hetSites[i]->pos;
                        int pos2 = informativeReadPairs[r]->hetSites[j]->pos;
                        string pairIndex = numToString(pos1)+"_"+numToString(pos2);
                        if (!SNPpairs.count(pairIndex)) {
                            SNPpairs[pairIndex] = new ReadLinkSNPpair(pos1,pos2,readBase1,readBase2);
                        } else {
                            SNPpairs[pairIndex]->base1.push_back(readBase1);
                            SNPpairs[pairIndex]->base1.push_back(readBase2);
                        }
                    }
                }
            }
        }
        std::cout << "SNPpairs.size(): " << SNPpairs.size() << std::endl;
        std::cout << "totalUsedLength: " << totalUsedLength << std::endl;
        std::cout << "totalUsedLength/(goodReadPairs.size()*300): " << (double)totalUsedLength/(double)(informativeReadPairs.size()*300) << std::endl;
    }
    
    return 0;
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
callq 0xc8ebf
leaq 0x278(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x46f7c(%rip), %rsi     # 0x10d3c0
leaq 0x180(%rsp), %rdi
leaq 0x220(%rsp), %rdx
callq 0x286de
leaq 0x180(%rsp), %rdi
movl $0x8, %esi
callq 0x53224
movq %rax, %rbx
leaq 0x190(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0xc6490
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %r15
movq 0x46f3c(%rip), %rsi     # 0x10d3e0
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, %r14
leaq 0x23435(%rip), %rsi     # 0xe98fa
leaq 0x46f34(%rip), %rdx     # 0x10d400
leaq 0x220(%rsp), %rdi
callq 0x77abc
leaq 0x1e675(%rip), %rsi     # 0xe4b55
leaq 0x220(%rsp), %rdi
callq 0x88c0
movq %r12, 0x180(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc6519
movq %rdx, 0x180(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x190(%rsp)
jmp 0xc6523
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x180(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
movl $0x10, %edx
callq 0x88d0
movq %r14, 0x2b8(%rsp)
movq 0x180(%rsp), %rdi
cmpq %r12, %rdi
je 0xc6574
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x230(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0xc6595
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, 0x170(%rsp)
leaq 0x23c06(%rip), %rsi     # 0xea1b4
leaq 0x46e4b(%rip), %rdx     # 0x10d400
leaq 0x220(%rsp), %rdi
callq 0x77abc
leaq 0x1e58c(%rip), %rsi     # 0xe4b55
leaq 0x220(%rsp), %rdi
callq 0x88c0
movq %r12, 0x180(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc6602
movq %rdx, 0x180(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x190(%rsp)
jmp 0xc660c
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x180(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x170(%rsp), %rdi
movl $0x10, %edx
callq 0x88d0
movq 0x180(%rsp), %rdi
cmpq %r12, %rdi
je 0xc665a
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x220(%rsp), %rdi
cmpq %r13, %rdi
je 0xc6677
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x228(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x360(%rsp), %rax
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x330(%rsp), %rax
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rcx, 0x210(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x200(%rsp)
leaq 0x300(%rsp), %rax
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x1b0(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
movupd %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movupd %xmm0, -0x8(%rax)
movq 0x44896(%rip), %r14     # 0x10afb8
leaq 0x23a95(%rip), %rsi     # 0xea1be
movl $0x15, %edx
movq %r14, %rdi
callq 0x84e0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq 0x44864(%rip), %rdi     # 0x10afb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
cmpb $0x0, 0x46cb8(%rip)     # 0x10d420
movq %r15, 0xb8(%rsp)
movq %rbx, 0x38(%rsp)
je 0xc6a75
xorl %r15d, %r15d
leaq 0x268(%rsp), %r14
leaq 0x40(%rsp), %r12
movl %r15d, %r15d
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xc6be1
movq 0x268(%rsp), %rax
movzbl (%rax), %ecx
cmpl $0x42, %ecx
je 0xc67d9
cmpl $0x2a, %ecx
jne 0xc67e3
jmp 0xc678e
cmpb $0x4c, 0x1(%rax)
je 0xc6a2f
movq %r12, %rbx
movq %r12, %rdi
movq %r14, %r12
movq %r14, %rsi
movl $0x9, %edx
callq 0x50624
movq 0x40(%rsp), %r14
movq 0x80(%r14), %rdi
callq 0x86e0
movl %eax, 0x150(%rsp)
movq 0x20(%r14), %rdi
callq 0x86e0
movl %eax, %r13d
movq 0x40(%r14), %rdi
callq 0x86e0
cmpq $0x1, 0xa8(%r14)
jne 0xc89ad
cmpq $0x1, 0xc8(%r14)
jne 0xc89b6
movl %eax, %ebp
movq 0xa0(%r14), %rax
movb (%rax), %al
movb %al, 0xe0(%rsp)
movq 0xc0(%r14), %rax
movb (%rax), %al
movb %al, 0x110(%rsp)
movq 0x140(%r14), %rsi
leaq 0x2c0(%rsp), %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rdx
callq 0x286de
movq %r14, %rdi
callq 0x5054c
movsd %xmm0, 0x68(%rsp)
movq 0x2c0(%rsp), %rdi
leaq 0x2d0(%rsp), %rax
cmpq %rax, %rdi
je 0xc68b3
movq 0x2d0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x40(%rsp), %rax
movq 0x160(%rax), %rdi
callq 0x86e0
movl %eax, %r14d
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl %ebp, %eax
xorl $0x1, %eax
orl %r13d, %eax
jne 0xc6903
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xc6932
movb 0xe0(%rsp), %al
movb %al, (%rsi)
incq 0x18(%rsp)
movq %r15, %rbp
jmp 0xc6947
xorl $0x1, %r13d
orl %ebp, %r13d
jne 0xc692b
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xc6966
movb 0x110(%rsp), %al
movb %al, (%rsi)
incq 0x18(%rsp)
movq %r15, %rbp
jmp 0xc697b
xorl %ebp, %ebp
jmp 0xc69fd
leaq 0x10(%rsp), %rdi
leaq 0xe0(%rsp), %rdx
callq 0x6ed3c
movq %r15, %rbp
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xc695c
movb 0x110(%rsp), %al
jmp 0xc698e
leaq 0x110(%rsp), %rdx
jmp 0xc699f
leaq 0x10(%rsp), %rdi
leaq 0x110(%rsp), %rdx
callq 0x6ed3c
movq %r15, %rbp
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xc6997
movb 0xe0(%rsp), %al
movb %al, (%rsi)
incq 0x18(%rsp)
jmp 0xc69a9
leaq 0xe0(%rsp), %rdx
leaq 0x10(%rsp), %rdi
callq 0x6ed3c
movl $0x30, %edi
callq 0x8470
movq %rax, %r13
movl 0x150(%rsp), %esi
movq %rax, %rdi
movsd 0x68(%rsp), %xmm0
movl %r14d, %edx
leaq 0x10(%rsp), %rcx
movl %ebp, %r8d
callq 0xc2fb4
leaq 0x220(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0xc3016
movq %r13, (%rax)
movq 0x200(%rsp), %rax
incl -0x4(%rax,%rbp,4)
movb $0x1, %bpl
movq %r12, %r14
movq %rbx, %r12
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc6a1a
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq %r12, %rdi
callq 0x3123c
testb %bpl, %bpl
movq 0x38(%rsp), %rbx
jmp 0xc678e
movl $0x0, 0x40(%rsp)
movq 0x208(%rsp), %rsi
cmpq 0x210(%rsp), %rsi
je 0xc6a5d
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x208(%rsp)
jmp 0xc6a6d
leaq 0x200(%rsp), %rdi
movq %r12, %rdx
callq 0x35b1e
incl %r15d
jmp 0xc678b
leaq 0x268(%rsp), %r14
leaq 0x40(%rsp), %r12
leaq 0x10(%rsp), %r13
leaq 0xe0(%rsp), %r15
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xc6be1
movq %r12, %rdi
movq %r14, %rsi
movl $0x9, %edx
callq 0x50624
movq 0x40(%rsp), %rbp
movq 0x20(%rbp), %rdi
callq 0x86e0
movl %eax, 0x150(%rsp)
cmpq $0x1, 0x48(%rbp)
jne 0xc898e
cmpq $0x1, 0x68(%rbp)
jne 0xc8985
movq 0x40(%rbp), %rax
movb (%rax), %al
movb %al, 0xe0(%rsp)
movq 0x60(%rbp), %rcx
movb (%rcx), %cl
movb %cl, 0x110(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0xc6b3e
movb %al, (%rsi)
incq 0x18(%rsp)
jmp 0xc6b49
movq %r13, %rdi
movq %r15, %rdx
callq 0x6ed3c
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xc6b65
movb 0x110(%rsp), %al
movb %al, (%rsi)
incq 0x18(%rsp)
jmp 0xc6b75
movq %r13, %rdi
leaq 0x110(%rsp), %rdx
callq 0x6ed3c
movl $0x30, %edi
callq 0x8470
movq %rax, %rbp
movl 0x150(%rsp), %esi
xorpd %xmm0, %xmm0
movq %rax, %rdi
xorl %edx, %edx
movq %r13, %rcx
movl $0x1, %r8d
callq 0xc2fb4
leaq 0x220(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0xc3016
movq %rbp, (%rax)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc6bcf
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq %r12, %rdi
callq 0x3123c
movq 0x38(%rsp), %rbx
jmp 0xc6a8f
movq 0x443d0(%rip), %rdi     # 0x10afb8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x8450
movq 0xb8(%rsp), %r15
movsbl %al, %esi
movq 0x443ad(%rip), %rdi     # 0x10afb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x44399(%rip), %rbx     # 0x10afb8
leaq 0x235fb(%rip), %rsi     # 0xea221
movl $0x19, %edx
movq %rbx, %rdi
callq 0x84e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq 0x44367(%rip), %rdi     # 0x10afb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
xorpd %xmm0, %xmm0
leaq 0x110(%rsp), %r14
movapd %xmm0, (%r14)
movq $0x0, 0x10(%r14)
leaq 0x268(%rsp), %r12
leaq 0x40(%rsp), %r13
leaq 0x2e0(%rsp), %rbp
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xc6d36
movq %r13, %rdi
movq %r12, %rsi
movl $0x9, %edx
callq 0x50624
movl $0x150, %edi            # imm = 0x150
callq 0x8470
movq %rax, %rbx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3273a
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xc307a
movq %rbp, %rdi
callq 0x3123c
movq %rbx, 0x10(%rsp)
movq 0x118(%rsp), %rsi
cmpq 0x120(%rsp), %rsi
je 0xc6d1c
movq %rbx, (%rsi)
addq $0x8, 0x118(%rsp)
jmp 0xc6d29
movq %r14, %rdi
leaq 0x10(%rsp), %rdx
callq 0xc3e08
movq %r13, %rdi
callq 0x3123c
jmp 0xc6c8c
movq 0x4427b(%rip), %rdi     # 0x10afb8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq 0x44260(%rip), %rdi     # 0x10afb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x4424c(%rip), %rbx     # 0x10afb8
leaq 0x234c8(%rip), %rsi     # 0xea23b
movl $0x22, %edx
movq %rbx, %rdi
callq 0x84e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq 0x4421a(%rip), %rdi     # 0x10afb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
movq 0x110(%rsp), %rbx
cmpq %rbx, 0x118(%rsp)
je 0xc6f65
xorl %ebp, %ebp
movl $0x128, %r15d           # imm = 0x128
movl $0x120, %r14d           # imm = 0x120
leaq 0x90(%rsp), %r12
leaq 0x40(%rsp), %r13
movl $0x0, 0x38(%rsp)
movl $0x0, 0xb8(%rsp)
movl $0x0, 0x64(%rsp)
movl $0x0, 0x68(%rsp)
movl $0x30, %edi
callq 0x8470
movq (%rbx,%rbp,8), %rcx
movq 0x8(%rbx,%rbp,8), %rdx
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%rax)
cmpq %rdx, %rcx
movq %rdx, %rsi
cmovbq %rcx, %rsi
cmovbq %rdx, %rcx
movq $0x0, 0x28(%rax)
movq %rsi, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x40(%rsp)
movq %rax, %rdi
leaq 0x220(%rsp), %rsi
callq 0xc5cf6
movq 0x40(%rsp), %rdi
movl 0x4478b(%rip), %esi     # 0x10b5fc
callq 0xc5d86
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rcx
subq 0x18(%rax), %rcx
sarq $0x3, %rcx
cmpq $0x1, %rcx
je 0xc6e98
testq %rcx, %rcx
jne 0xc6ea1
incl 0x38(%rsp)
jmp 0xc6ea5
incl 0xb8(%rsp)
jmp 0xc6ea5
incl 0x64(%rsp)
cmpq $0x2, %rcx
jb 0xc6f3f
movq (%rax), %rax
movq 0x138(%rax), %rbx
movq 0x40(%rsp), %rax
movq (%rax), %rcx
addq %r15, %rcx
cmpq %rcx, %rbx
je 0xc6f3f
movq 0x8(%rax), %rdi
addq %r14, %rdi
leaq 0x20(%rbx), %rsi
callq 0xc91b0
cmpq $0x1, %rax
jne 0xc6f2f
movq 0x98(%rsp), %rsi
cmpq 0xa0(%rsp), %rsi
je 0xc6f04
movq 0x40(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x98(%rsp)
jmp 0xc6f0f
movq %r12, %rdi
movq %r13, %rdx
callq 0xc3f60
movq 0x40(%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movl 0x68(%rsp), %edx
addl 0x100(%rcx), %edx
addl 0x100(%rax), %edx
movl %edx, 0x68(%rsp)
movq %rbx, %rdi
callq 0x8310
movq %rax, %rbx
jmp 0xc6eb9
addq $0x2, %rbp
movq 0x110(%rsp), %rbx
movq 0x118(%rsp), %rax
subq %rbx, %rax
sarq $0x3, %rax
cmpq %rbp, %rax
ja 0xc6e18
jmp 0xc6f88
movl $0x0, 0x68(%rsp)
movl $0x0, 0x64(%rsp)
movl $0x0, 0xb8(%rsp)
movl $0x0, 0x38(%rsp)
movq 0x44029(%rip), %rdi     # 0x10afb8
leaq 0x232c8(%rip), %rsi     # 0xea25e
movl $0x1b, %edx
callq 0x84e0
movq 0x118(%rsp), %rax
subq 0x110(%rsp), %rax
sarq $0x3, %rax
movq %rax, %xmm1
punpckldq 0x31df(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x31e7(%rip), %xmm1     # 0xca1b0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x8473(%rip), %xmm0     # 0xcf450
movq 0x43fd4(%rip), %rdi     # 0x10afb8
callq 0x8730
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x43f9e(%rip), %rdi     # 0x10afb8
leaq 0x229e6(%rip), %rsi     # 0xe9a07
movl $0x9, %edx
callq 0x84e0
movq 0x43f86(%rip), %rdi     # 0x10afb8
movl 0x38(%rsp), %esi
callq 0x8810
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x43f4c(%rip), %rdi     # 0x10afb8
leaq 0x2299e(%rip), %rsi     # 0xe9a11
movl $0x9, %edx
callq 0x84e0
movq 0x43f34(%rip), %rdi     # 0x10afb8
movl 0xb8(%rsp), %esi
callq 0x8810
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x43ef7(%rip), %rdi     # 0x10afb8
leaq 0x22953(%rip), %rsi     # 0xe9a1b
movl $0xe, %edx
callq 0x84e0
movq 0x43edf(%rip), %rdi     # 0x10afb8
movl 0x64(%rsp), %esi
callq 0x8810
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x43ea5(%rip), %rdi     # 0x10afb8
leaq 0x23160(%rip), %rsi     # 0xea27a
movl $0x1d, %edx
callq 0x84e0
movq 0x98(%rsp), %rsi
subq 0x90(%rsp), %rsi
sarq $0x3, %rsi
movq 0x43e79(%rip), %rbx     # 0x10afb8
movq %rbx, %rdi
callq 0x82f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq 0x43e29(%rip), %rdi     # 0x10afb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x43e15(%rip), %rbx     # 0x10afb8
leaq 0x230ee(%rip), %rsi     # 0xea298
movl $0x34, %edx
movq %rbx, %rdi
callq 0x84e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq 0x43de3(%rip), %rdi     # 0x10afb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
xorpd %xmm0, %xmm0
movapd %xmm0, 0x1e0(%rsp)
xorl %eax, %eax
movq %rax, 0x1f0(%rsp)
movq %rax, 0x1d0(%rsp)
movapd %xmm0, 0x1c0(%rsp)
movq %rax, 0x140(%rsp)
movapd %xmm0, 0x130(%rsp)
movq %rax, 0x260(%rsp)
movapd %xmm0, 0x250(%rsp)
movq %rax, 0x80(%rsp)
movapd %xmm0, 0x70(%rsp)
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
cmpb $0x0, 0x461cf(%rip)     # 0x10d420
je 0xc78b4
cmpq %rax, %rcx
je 0xc7d95
leaq 0xe8(%rsp), %r13
leaq 0xc0(%rsp), %rbp
leaq 0xc(%rsp), %r14
xorl %r15d, %r15d
movl $0x0, 0x10c(%rsp)
movl $0x0, 0xb0(%rsp)
movl $0x0, 0x68(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x1b8(%rsp)
movq 0x90(%rsp), %rax
movq (%rax,%r15,8), %rcx
movq 0x18(%rcx), %rax
cmpq %rax, 0x20(%rcx)
je 0xc73c5
xorl %ebx, %ebx
movq (%rax,%rbx,8), %r12
cmpb $0x1, 0x24(%r12)
jne 0xc7307
xorps %xmm0, %xmm0
cvtsi2sdl 0xc(%r12), %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x1c8(%rsp), %rsi
cmpq 0x1d0(%rsp), %rsi
je 0xc733b
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x1c8(%rsp)
jmp 0xc734d
xorps %xmm0, %xmm0
cvtsi2sdl 0xc(%r12), %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x1e8(%rsp), %rsi
cmpq 0x1f0(%rsp), %rsi
je 0xc735b
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x1e8(%rsp)
jmp 0xc736d
leaq 0x1c0(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x33c70
movq 0x38(%rsp), %rax
incl %eax
movq %rax, 0x38(%rsp)
jmp 0xc7371
leaq 0x1e0(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x33c70
incl 0x68(%rsp)
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0xc7391
movl (%r12), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x78(%rsp)
jmp 0xc739e
leaq 0x70(%rsp), %rdi
movq %r12, %rdx
callq 0x4bc3a
incq %rbx
movq 0x90(%rsp), %rax
movq (%rax,%r15,8), %rcx
movq 0x18(%rcx), %rax
movq 0x20(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbx, %rcx
ja 0xc72c7
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
xorl %eax, %eax
movq %rax, 0x50(%rsp)
movq %rax, 0x20(%rsp)
movapd %xmm0, 0x10(%rsp)
movq %rax, 0x160(%rsp)
movapd %xmm0, 0x150(%rsp)
movq %rax, 0xf0(%rsp)
movapd %xmm0, 0xe0(%rsp)
movl $0x0, 0xc0(%rsp)
movq 0x90(%rsp), %rax
movq (%rax,%r15,8), %rdx
movq 0x18(%rdx), %rcx
movq 0x20(%rdx), %rdx
subq %rcx, %rdx
cmpq $0x8, %rdx
je 0xc75a9
movl $0x1, 0xc(%rsp)
movq 0x90(%rsp), %rax
movq (%rax,%r15,8), %rax
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
subq %rcx, %rax
cmpq $0x9, %rax
jb 0xc7570
movl $0x1, %edx
movslq 0xc0(%rsp), %rax
movq (%rcx,%rax,8), %rsi
movl 0x4(%rsi), %edi
movq (%rcx,%rdx,8), %rcx
cmpl 0x4(%rcx), %edi
jne 0xc7540
movl 0x20(%rsi), %edx
cmpl 0x20(%rcx), %edx
je 0xc74ad
movl (%rcx), %ecx
subl (%rsi), %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
cmpl 0x4416e(%rip), %edx     # 0x10b600
jle 0xc74ad
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0xc7506
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rsp)
jmp 0xc7513
movq 0x158(%rsp), %rsi
cmpq 0x160(%rsp), %rsi
je 0xc74cf
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x158(%rsp)
jmp 0xc74df
leaq 0x150(%rsp), %rdi
movq %rbp, %rdx
callq 0x4bc3a
movq 0xe8(%rsp), %rsi
cmpq 0xf0(%rsp), %rsi
je 0xc74fc
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
movq %r13, %rax
jmp 0xc752a
leaq 0xe0(%rsp), %rdi
jmp 0xc7538
leaq 0x40(%rsp), %rdi
movq %rbp, %rdx
callq 0x4bc3a
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xc7533
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
leaq 0x18(%rsp), %rax
addq $0x4, %rsi
movq %rsi, (%rax)
jmp 0xc7540
leaq 0x10(%rsp), %rdi
movq %r14, %rdx
callq 0x4bc3a
movslq 0xc(%rsp), %rdx
incq %rdx
movl %edx, 0xc(%rsp)
movq 0x90(%rsp), %rax
movq (%rax,%r15,8), %rax
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %rdx, %rax
ja 0xc745d
movslq 0xc0(%rsp), %rdx
incq %rdx
movl %edx, 0xc0(%rsp)
movq 0x90(%rsp), %rax
movq (%rax,%r15,8), %rsi
movq 0x18(%rsi), %rcx
movq 0x20(%rsi), %rsi
subq %rcx, %rsi
sarq $0x3, %rsi
decq %rsi
cmpq %rdx, %rsi
ja 0xc742f
movq 0x40(%rsp), %rdx
cmpq %rdx, 0x48(%rsp)
je 0xc75f1
movslq (%rdx), %rax
movq (%rcx,%rax,8), %rax
movl (%rax), %ebx
movq 0x10(%rsp), %rdx
movslq (%rdx), %rdx
movq (%rcx,%rdx,8), %rdx
movl (%rdx), %ecx
cvttsd2si 0x18(%rax), %r12d
cvttsd2si 0x18(%rdx), %eax
cmpl %ebx, %ecx
jge 0xc7666
movl %ebx, 0xb8(%rsp)
movl %ecx, %ebx
movl %eax, 0x64(%rsp)
jmp 0xc7675
movq 0x150(%rsp), %rcx
movq 0x158(%rsp), %rdx
xorpd %xmm0, %xmm0
movapd %xmm0, 0xc0(%rsp)
movq $0x0, 0xd0(%rsp)
subq %rcx, %rdx
je 0xc76f5
sarq $0x2, %rdx
movq (%rax,%r15,8), %rsi
movq 0x18(%rsi), %rsi
xorl %edi, %edi
movq 0xe0(%rsp), %r8
xorl %r9d, %r9d
movslq (%rcx,%rdi,4), %r10
movq (%rsi,%r10,8), %r10
movslq (%r8,%rdi,4), %r11
movq (%rsi,%r11,8), %r11
movl (%r11), %r11d
cmpl (%r10), %r11d
cmovnel %edi, %r9d
incq %rdi
cmpq %rdi, %rdx
jne 0xc763c
movslq %r9d, %rdx
jmp 0xc76f7
movl %ecx, 0xb8(%rsp)
movl %r12d, 0x64(%rsp)
movl %eax, %r12d
movl $0x20, %edi
callq 0x8470
xorps %xmm0, %xmm0
cvtsi2sdl 0x64(%rsp), %xmm0
cvtsi2sd %r12d, %xmm1
movl %ebx, (%rax)
movl 0xb8(%rsp), %edx
movl %edx, 0x4(%rax)
movsd %xmm0, 0x8(%rax)
movsd %xmm1, 0x10(%rax)
subl %ebx, %edx
movl %edx, %ecx
negl %ecx
movl %edx, %ebx
cmovsl %edx, %ecx
movl %ecx, 0x18(%rax)
movq %rax, 0xc0(%rsp)
movq 0x138(%rsp), %rsi
cmpq 0x140(%rsp), %rsi
je 0xc76d9
movq %rax, (%rsi)
addq $0x8, 0x138(%rsp)
jmp 0xc76e9
leaq 0x130(%rsp), %rdi
movq %rbp, %rdx
callq 0xc43fe
incl 0xb0(%rsp)
jmp 0xc781c
xorl %edx, %edx
movq (%rax,%r15,8), %rax
movslq (%rcx,%rdx,4), %rcx
movq 0x18(%rax), %rsi
movq (%rsi,%rcx,8), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movq 0xe0(%rsp), %rcx
movslq (%rcx,%rdx,4), %rcx
movq (%rsi,%rcx,8), %rcx
movl (%rcx), %ecx
movl %ecx, 0xb4(%rsp)
cmpl %eax, %ecx
jge 0xc7735
movl %ecx, 0xc(%rsp)
movl %eax, 0xb4(%rsp)
movl 0xb4(%rsp), %ebx
movl 0xc(%rsp), %eax
subl %eax, %ebx
movl %ebx, 0x17c(%rsp)
movq 0xc8(%rsp), %rsi
cmpq 0xd0(%rsp), %rsi
je 0xc776b
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xc8(%rsp)
jmp 0xc7776
movq %rbp, %rdi
movq %r14, %rdx
callq 0x4bc3a
movq 0xc8(%rsp), %rsi
cmpq 0xd0(%rsp), %rsi
je 0xc779f
movl 0xb4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xc8(%rsp)
jmp 0xc77af
movq %rbp, %rdi
leaq 0xb4(%rsp), %rdx
callq 0x4bc3a
movq 0xc8(%rsp), %rsi
cmpq 0xd0(%rsp), %rsi
je 0xc77d8
movl 0x17c(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xc8(%rsp)
jmp 0xc77e8
movq %rbp, %rdi
leaq 0x17c(%rsp), %rdx
callq 0x4bc3a
leaq 0x250(%rsp), %rdi
movq %rbp, %rsi
callq 0x4ae84
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0xc7815
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
incl 0x10c(%rsp)
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0xc7839
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x150(%rsp), %rdi
testq %rdi, %rdi
je 0xc7856
movq 0x160(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc786d
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xc7884
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movslq %ebx, %rax
addq %rax, 0x1b8(%rsp)
incq %r15
movq 0x98(%rsp), %rax
subq 0x90(%rsp), %rax
sarq $0x3, %rax
cmpq %r15, %rax
ja 0xc72ab
jmp 0xc7dc8
cmpq %rax, %rcx
je 0xc7c54
xorl %ebx, %ebx
leaq 0x150(%rsp), %r15
movq (%rax,%rbx,8), %rax
movq 0x20(%rax), %rcx
subq 0x18(%rax), %rcx
cmpq $0x9, %rcx
jb 0xc7c31
movq 0x90(%rsp), %rax
movq (%rax,%rbx,8), %rax
movq 0x20(%rax), %rcx
subq 0x18(%rax), %rcx
cmpq $0x8, %rcx
je 0xc7c31
movq $0x0, 0x38(%rsp)
movq 0x90(%rsp), %rax
movq (%rax,%rbx,8), %rcx
movq 0x18(%rcx), %rax
movq 0x20(%rcx), %rcx
subq %rax, %rcx
cmpq $0x9, %rcx
jb 0xc7c00
movl $0x1, %ebp
movq 0x38(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movb 0x8(%rcx), %dl
movb %dl, 0xc0(%rsp)
movq (%rax,%rbp,8), %rax
movb 0x8(%rax), %dl
movb %dl, 0xc(%rsp)
movl (%rcx), %r12d
movl (%rax), %r14d
movq %r15, %rdi
movl %r12d, %esi
callq 0x31297
movq %r15, %r13
movq %r15, %rdi
leaq 0x13bd6(%rip), %rsi     # 0xdb53c
callq 0x88c0
leaq 0x20(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc7993
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0xc799b
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xe0(%rsp), %rdi
movl %r14d, %esi
callq 0x31297
movq 0x10(%rsp), %rcx
movl $0xf, %esi
leaq 0x20(%rsp), %rax
cmpq %rax, %rcx
je 0xc79dc
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %r8
movq 0xe8(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0xc7a16
movl $0xf, %esi
leaq 0xf0(%rsp), %rdi
cmpq %rdi, 0xe0(%rsp)
je 0xc7a11
movq 0xf0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xc7a2a
movq 0xe0(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x8180
jmp 0xc7a3b
leaq 0xe0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x84d0
leaq 0x50(%rsp), %rsi
movq %rsi, 0x40(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0xc7a60
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0xc7a68
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0xc7aaa
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xc7ac6
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0xc7aeb
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x180(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xc453a
testq %rax, %rax
je 0xc7b30
leaq 0x180(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xc4636
movq (%rax), %rdi
movq 0x10(%rdi), %rsi
cmpq 0x18(%rdi), %rsi
je 0xc7b70
movb 0xc0(%rsp), %al
movb %al, (%rsi)
incq 0x10(%rdi)
jmp 0xc7b81
movl $0x38, %edi
callq 0x8470
movq %rax, %r15
movsbl 0xc0(%rsp), %ecx
movsbl 0xc(%rsp), %r8d
movq %rax, %rdi
movl %r12d, %esi
movl %r14d, %edx
callq 0xc34d2
leaq 0x180(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xc4636
movq %r15, (%rax)
jmp 0xc7bba
addq $0x8, %rdi
leaq 0xc0(%rsp), %rdx
callq 0x6ed3c
leaq 0x180(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xc4636
movq (%rax), %rdi
movq 0x10(%rdi), %rsi
cmpq 0x18(%rdi), %rsi
je 0xc7bac
movb 0xc(%rsp), %al
movb %al, (%rsi)
incq 0x10(%rdi)
jmp 0xc7bba
addq $0x8, %rdi
leaq 0xc(%rsp), %rdx
callq 0x6ed3c
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0xc7bd6
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
incq %rbp
movq 0x90(%rsp), %rax
movq (%rax,%rbx,8), %rcx
movq 0x18(%rcx), %rax
movq 0x20(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbp, %rcx
movq %r13, %r15
ja 0xc792a
movq 0x90(%rsp), %rax
movq (%rax,%rbx,8), %rax
movq 0x20(%rax), %rcx
subq 0x18(%rax), %rcx
movq 0x38(%rsp), %rdx
incq %rdx
sarq $0x3, %rcx
decq %rcx
movq %rdx, 0x38(%rsp)
cmpq %rdx, %rcx
ja 0xc7904
incq %rbx
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbx, %rcx
ja 0xc78c7
movq 0x4335d(%rip), %rdi     # 0x10afb8
leaq 0x21e32(%rip), %rsi     # 0xe9a94
movl $0x11, %edx
callq 0x84e0
movl 0x68(%rsp), %ebp
movq 0x198(%rsp), %rsi
movq 0x43339(%rip), %rdi     # 0x10afb8
callq 0x82f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x43303(%rip), %rdi     # 0x10afb8
leaq 0x21e03(%rip), %rsi     # 0xe9abf
movl $0x11, %edx
callq 0x84e0
movq 0x432eb(%rip), %rdi     # 0x10afb8
movl %ebp, %esi
callq 0x8810
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x432b3(%rip), %rdi     # 0x10afb8
leaq 0x21dc5(%rip), %rsi     # 0xe9ad1
movl $0x2c, %edx
callq 0x84e0
cvtsi2sd %ebp, %xmm0
movq 0x98(%rsp), %rax
subq 0x90(%rsp), %rax
sarq $0x3, %rax
imulq $0x12c, %rax, %rax      # imm = 0x12C
movq %rax, %xmm1
punpckldq 0x245e(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2466(%rip), %xmm1     # 0xca1b0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq 0x43257(%rip), %rdi     # 0x10afb8
callq 0x8730
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
jmp 0xc8836
movq $0x0, 0x38(%rsp)
movq $0x0, 0x1b8(%rsp)
movl $0x0, 0x68(%rsp)
movl $0x0, 0xb0(%rsp)
movl $0x0, 0x10c(%rsp)
movq 0x431e9(%rip), %rdi     # 0x10afb8
leaq 0x224f7(%rip), %rsi     # 0xea2cd
movl $0x19, %edx
callq 0x84e0
movq 0x2b8(%rsp), %r13
movq 0x1b8(%rsp), %rbp
movq 0x431c1(%rip), %rdi     # 0x10afb8
movq %rbp, %rsi
callq 0x81b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x43188(%rip), %rdi     # 0x10afb8
leaq 0x21bf3(%rip), %rsi     # 0xe9a2a
movl $0xf, %edx
callq 0x84e0
movq 0x43170(%rip), %rdi     # 0x10afb8
movl 0x10c(%rsp), %esi
callq 0x8810
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x43133(%rip), %rdi     # 0x10afb8
leaq 0x21bae(%rip), %rsi     # 0xe9a3a
movl $0xf, %edx
callq 0x84e0
movq 0x4311b(%rip), %rdi     # 0x10afb8
movl 0xb0(%rsp), %esi
callq 0x8810
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x430de(%rip), %rdi     # 0x10afb8
leaq 0x22406(%rip), %rsi     # 0xea2e7
movl $0x1f, %edx
callq 0x84e0
movq 0x258(%rsp), %rsi
subq 0x250(%rsp), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movq 0x430a4(%rip), %rdi     # 0x10afb8
callq 0x82f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x4306e(%rip), %rdi     # 0x10afb8
leaq 0x21af9(%rip), %rsi     # 0xe9a4a
movl $0xa, %edx
callq 0x84e0
movq 0x43056(%rip), %rdi     # 0x10afb8
movl 0x68(%rsp), %esi
callq 0x8810
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x4301c(%rip), %rdi     # 0x10afb8
leaq 0x21ab2(%rip), %rsi     # 0xe9a55
movl $0xd, %edx
callq 0x84e0
movq 0x43004(%rip), %rdi     # 0x10afb8
movq 0x38(%rsp), %rsi
callq 0x8810
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x42fc9(%rip), %rdi     # 0x10afb8
leaq 0x21a6d(%rip), %rsi     # 0xe9a63
movl $0x19, %edx
callq 0x84e0
leaq 0x2a0(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x3a864
movq 0x2a0(%rsp), %rcx
movq 0x2a8(%rsp), %rdx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %rcx, %rdx
je 0xc8054
cmpq $0x1, %rax
movq %rax, %rdx
adcq $0x0, %rdx
xorpd %xmm0, %xmm0
xorl %esi, %esi
addsd (%rcx,%rsi,8), %xmm0
incq %rsi
cmpq %rsi, %rdx
jne 0xc8045
jmp 0xc8058
xorpd %xmm0, %xmm0
movq %rax, %xmm1
punpckldq 0x213b(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2143(%rip), %xmm1     # 0xca1b0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq 0x42f34(%rip), %rdi     # 0x10afb8
callq 0x8730
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x2a0(%rsp), %rdi
testq %rdi, %rdi
je 0xc80d0
movq 0x2b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x42ee1(%rip), %rdi     # 0x10afb8
leaq 0x2199f(%rip), %rsi     # 0xe9a7d
movl $0x16, %edx
callq 0x84e0
leaq 0x288(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x3a864
movq 0x288(%rsp), %rcx
movq 0x290(%rsp), %rdx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %rcx, %rdx
je 0xc813c
cmpq $0x1, %rax
movq %rax, %rdx
adcq $0x0, %rdx
xorpd %xmm0, %xmm0
xorl %esi, %esi
addsd (%rcx,%rsi,8), %xmm0
incq %rsi
cmpq %rsi, %rdx
jne 0xc812d
jmp 0xc8140
xorpd %xmm0, %xmm0
movq %rax, %xmm1
punpckldq 0x2053(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x205b(%rip), %xmm1     # 0xca1b0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq 0x42e4c(%rip), %rbx     # 0x10afb8
movq %rbx, %rdi
callq 0x8730
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x288(%rsp), %rdi
testq %rdi, %rdi
je 0xc81bb
movq 0x298(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x130(%rsp), %rax
cmpq %rax, 0x138(%rsp)
je 0xc82e2
xorl %r12d, %r12d
leaq 0x9aa3(%rip), %r14      # 0xd1c7e
movq (%rax,%r12,8), %rax
movl (%rax), %esi
movq %r13, %rdi
callq 0x8810
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x84e0
movq 0x130(%rsp), %rax
movq (%rax,%r12,8), %rax
movl 0x4(%rax), %esi
movq %r15, %rdi
callq 0x8810
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x84e0
movq 0x130(%rsp), %rax
movq (%rax,%r12,8), %rax
movl 0x18(%rax), %esi
movq %r15, %rdi
callq 0x8810
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x84e0
movq 0x130(%rsp), %rax
movq (%rax,%r12,8), %rax
movsd 0x8(%rax), %xmm0
movq %r15, %rdi
callq 0x8730
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x84e0
movq 0x130(%rsp), %rax
movq (%rax,%r12,8), %rax
movsd 0x10(%rax), %xmm0
movq %r15, %rdi
callq 0x8730
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r15, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
incq %r12
movq 0x130(%rsp), %rax
movq 0x138(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r12
jne 0xc81db
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq 0x42cb8(%rip), %rdi     # 0x10afb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x42ca4(%rip), %rbx     # 0x10afb8
leaq 0x21fec(%rip), %rsi     # 0xea307
movl $0x1b, %edx
movq %rbx, %rdi
callq 0x84e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq 0x42c72(%rip), %rdi     # 0x10afb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x70(%rsp), %rbx
movq 0x78(%rsp), %r14
cmpq %r14, %rbx
je 0xc838f
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 0x56f2f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x57012
movq 0x70(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x57282
leaq 0x70(%rsp), %rdi
subq (%rdi), %rax
sarq $0x2, %rax
movq %rax, %rsi
callq 0x54d18
movq 0x42bff(%rip), %rdi     # 0x10afb8
leaq 0x21f63(%rip), %rsi     # 0xea323
movl $0x15, %edx
callq 0x84e0
movq 0x78(%rsp), %rsi
subq 0x70(%rsp), %rsi
sarq $0x2, %rsi
movq 0x42bd9(%rip), %rdi     # 0x10afb8
callq 0x82f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
cvtsi2sdl 0xb0(%rsp), %xmm0
cvtsi2sd %rbp, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x42b8b(%rip), %rdi     # 0x10afb8
leaq 0x21f05(%rip), %rsi     # 0xea339
movl $0x16, %edx
callq 0x84e0
movsd 0x10(%rsp), %xmm0
movq 0x42b6d(%rip), %rdi     # 0x10afb8
callq 0x8730
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x78(%rsp), %rsi
subq 0x70(%rsp), %rsi
sarq $0x2, %rsi
incq %rsi
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x150(%rsp), %rcx
callq 0x54ba6
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
je 0xc86d9
xorl %r15d, %r15d
movq 0x42af5(%rip), %rbx     # 0x10afb8
leaq 0x159ca(%rip), %rbp     # 0xdde94
movq 0x130(%rsp), %rdx
movq 0x138(%rsp), %rsi
movl (%rax,%r15,4), %r14d
movl 0x4(%rax,%r15,4), %eax
xorpd %xmm1, %xmm1
movl $0x0, %ecx
xorpd %xmm0, %xmm0
subq %rdx, %rsi
je 0xc852f
sarq $0x3, %rsi
xorl %edi, %edi
xorl %ecx, %ecx
movq (%rdx,%rdi,8), %r8
cmpl %r14d, (%r8)
jg 0xc8527
cmpl %eax, 0x4(%r8)
jl 0xc8527
xorps %xmm2, %xmm2
cvtsi2sdl 0x18(%r8), %xmm2
incl %ecx
movsd 0x6f21(%rip), %xmm3     # 0xcf440
divsd %xmm2, %xmm3
addsd %xmm3, %xmm0
incq %rdi
cmpq %rdi, %rsi
jne 0xc84fd
movq 0x250(%rsp), %rdx
movq 0x258(%rsp), %rsi
subq %rdx, %rsi
je 0xc857a
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %rsi
xorpd %xmm1, %xmm1
movq (%rdx), %rdi
cmpl %r14d, (%rdi)
jg 0xc8571
cmpl %eax, 0x4(%rdi)
jl 0xc8571
incl %ecx
addsd 0x6ecf(%rip), %xmm1     # 0xcf440
addq $0x18, %rdx
decq %rsi
jne 0xc855a
leaq 0x1(%r15), %r13
cmpl $0xa, %ecx
jle 0xc8592
divsd %xmm1, %xmm0
movq 0x40(%rsp), %rax
movsd %xmm0, (%rax,%r13,8)
imull $0x3afb7e91, %r13d, %eax # imm = 0x3AFB7E91
rorl $0x4, %eax
cmpl $0x68db8, %eax          # imm = 0x68DB8
ja 0xc86b8
movl $0x12, %edx
movq %rbx, %rdi
leaq 0x21d9a(%rip), %rsi     # 0xea350
callq 0x84e0
movq %rbx, %rdi
movl %r13d, %esi
callq 0x8810
movq %rax, %r12
movl $0x2, %edx
movq %rax, %rdi
leaq 0x10feb(%rip), %rsi     # 0xd95c3
callq 0x84e0
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movq 0x78(%rsp), %rax
subq 0x70(%rsp), %rax
sarq $0x2, %rax
movq %rax, %xmm1
punpckldq 0x1ba0(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1ba8(%rip), %xmm1     # 0xca1b0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq %r12, %rdi
callq 0x8730
movq %rax, %r12
movl $0x2, %edx
movq %rax, %rdi
leaq 0x17405(%rip), %rsi     # 0xdfa37
callq 0x84e0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r12, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movl $0x5, %edx
movq %rbx, %rdi
leaq 0xd76a(%rip), %rsi      # 0xd5dd8
callq 0x84e0
movq %rbx, %rdi
movl %r14d, %esi
callq 0x8810
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x84e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
addq $0x2, %r15
cmpq %r15, %rcx
movq %r13, %r15
jne 0xc84ca
leaq 0x1c4b4(%rip), %rsi     # 0xe4b94
movl $0x2, %edx
movq 0x170(%rsp), %rdi
callq 0x84e0
movq 0x70(%rsp), %rax
movl (%rax), %esi
movq 0x170(%rsp), %rdi
callq 0x8810
movq %rax, %rbx
leaq 0x956e(%rip), %rsi      # 0xd1c7e
movl $0x1, %edx
movq %rax, %rdi
callq 0x84e0
movq 0x40(%rsp), %rax
movsd (%rax), %xmm0
movq %rbx, %rdi
callq 0x8730
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
je 0xc881f
movl $0x1, %r15d
leaq 0x9502(%rip), %rbx      # 0xd1c7e
movl -0x4(%rax,%r15,4), %esi
movq 0x170(%rsp), %rdi
callq 0x8810
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x84e0
movq 0x70(%rsp), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
callq 0x8810
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x84e0
movq 0x40(%rsp), %rax
movsd (%rax,%r15,8), %xmm0
movq %r14, %rdi
callq 0x8730
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
incq %r15
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r15
jne 0xc877c
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xc8836
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xc8850
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x250(%rsp), %rdi
callq 0x4b0a4
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0xc887a
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0xc8897
movq 0x1d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x1e0(%rsp), %rdi
testq %rdi, %rdi
je 0xc88b4
movq 0x1f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xc88d1
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0xc88ee
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x180(%rsp), %rdi
callq 0xc3680
leaq 0x2f8(%rsp), %rdi
callq 0xc371e
movq 0x200(%rsp), %rdi
testq %rdi, %rdi
je 0xc8925
movq 0x210(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x328(%rsp), %rdi
callq 0x3f522
leaq 0x358(%rsp), %rdi
callq 0x4bbaa
leaq 0x220(%rsp), %rdi
callq 0xc37ae
movq 0x268(%rsp), %rdi
leaq 0x278(%rsp), %rax
cmpq %rax, %rdi
je 0xc8971
movq 0x278(%rsp), %rsi
incq %rsi
callq 0x8480
xorl %eax, %eax
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2102a(%rip), %rdi     # 0xe99b6
jmp 0xc8995
leaq 0x20fff(%rip), %rdi     # 0xe9994
leaq 0x21838(%rip), %rsi     # 0xea1d4
leaq 0x21854(%rip), %rcx     # 0xea1f7
movl $0x84, %edx
callq 0x82c0
leaq 0x20f5d(%rip), %rdi     # 0xe9911
jmp 0xc89bd
leaq 0x20fb5(%rip), %rdi     # 0xe9972
leaq 0x21810(%rip), %rsi     # 0xea1d4
leaq 0x2182c(%rip), %rcx     # 0xea1f7
movl $0x6d, %edx
callq 0x82c0
jmp 0xc8c1d
jmp 0xc8d1a
movq %rax, %r14
movq 0x180(%rsp), %rdi
cmpq %r12, %rdi
je 0xc8a04
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0xc8a04
movq %rax, %r14
movq 0x220(%rsp), %rdi
cmpq %r13, %rdi
je 0xc8a26
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0xc8a26
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq 0x170(%rsp), %rdi
jmp 0xc8acf
jmp 0xc8ad9
movq %r14, %rbx
movq %rax, %r14
movq 0x180(%rsp), %rdi
cmpq %r12, %rdi
je 0xc8a68
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0xc8a68
movq %r14, %rbx
movq %rax, %r14
leaq 0x230(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc8a91
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0xc8a91
movq %r14, %rbx
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
jmp 0xc8acf
jmp 0xc8ad9
movq %rax, %r14
movl $0x208, %esi            # imm = 0x208
movq %r15, %rdi
jmp 0xc8acf
jmp 0xc8ad9
movq %rax, %r14
leaq 0x190(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc8e92
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0xc8e92
movq %rax, %r14
jmp 0xc8e92
movq %rax, %r14
movq 0x288(%rsp), %rdi
testq %rdi, %rdi
je 0xc8d7c
movq 0x298(%rsp), %rsi
jmp 0xc8ce3
movq %rax, %r14
movq 0x2a0(%rsp), %rdi
testq %rdi, %rdi
je 0xc8d7c
movq 0x2b0(%rsp), %rsi
jmp 0xc8ce3
jmp 0xc8d1a
jmp 0xc8c45
jmp 0xc8d1a
jmp 0xc8c4d
jmp 0xc8d1a
movq %rax, %r14
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0xc8c7f
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
jmp 0xc8c7f
jmp 0xc8bf0
jmp 0xc8c7c
jmp 0xc8c1d
movq %rax, %r14
movl $0x30, %esi
movq %r13, %rdi
jmp 0xc8bba
jmp 0xc8bf0
movq %rax, %r14
movq 0x2c0(%rsp), %rdi
leaq 0x2d0(%rsp), %rax
cmpq %rax, %rdi
je 0xc8c0a
movq 0x2d0(%rsp), %rsi
incq %rsi
jmp 0xc8c05
movq %rax, %r14
jmp 0xc8c0a
jmp 0xc8c1d
movq %rax, %r14
movl $0x30, %esi
movq %rbp, %rdi
callq 0x8480
jmp 0xc8bf3
jmp 0xc8c1d
jmp 0xc8d1a
jmp 0xc8bf0
movq %rax, %r14
leaq 0x2e0(%rsp), %rdi
callq 0x3123c
jmp 0xc8bdf
movq %rax, %r14
movl $0x150, %esi            # imm = 0x150
movq %rbx, %rdi
callq 0x8480
jmp 0xc8c34
jmp 0xc8c4d
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc8c0a
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x40(%rsp), %rdi
callq 0x3123c
jmp 0xc8e34
jmp 0xc8c5f
jmp 0xc8c1d
movq %rax, %r14
jmp 0xc8e34
jmp 0xc8d1a
jmp 0xc8d1a
jmp 0xc8c45
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x3123c
jmp 0xc8e17
jmp 0xc8c5f
movq %rax, %r14
jmp 0xc8cd0
movq %rax, %r14
jmp 0xc8e17
jmp 0xc8d1a
jmp 0xc8d1a
movq %rax, %r14
jmp 0xc8dfa
movq %rax, %r14
movl $0x38, %esi
movq %r15, %rdi
callq 0x8480
jmp 0xc8d60
movq %rax, %r14
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0xc8c9c
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x150(%rsp), %rdi
testq %rdi, %rdi
je 0xc8cb9
movq 0x160(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc8cd0
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xc8d7c
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
jmp 0xc8d77
movq %rax, %r14
jmp 0xc8d3e
movq %rax, %r14
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0xc8d22
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0xc8d22
movq %rax, %r14
jmp 0xc8d7c
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xc8d3e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0xc8d7c
movq 0x160(%rsp), %rsi
jmp 0xc8d74
movq %rax, %r14
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0xc8d7c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xc8d96
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x250(%rsp), %rdi
callq 0x4b0a4
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0xc8dc0
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0xc8ddd
movq 0x1d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x1e0(%rsp), %rdi
testq %rdi, %rdi
je 0xc8dfa
movq 0x1f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xc8e17
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0xc8e34
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x180(%rsp), %rdi
callq 0xc3680
leaq 0x2f8(%rsp), %rdi
callq 0xc371e
movq 0x200(%rsp), %rdi
testq %rdi, %rdi
je 0xc8e6b
movq 0x210(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x328(%rsp), %rdi
callq 0x3f522
leaq 0x358(%rsp), %rdi
callq 0x4bbaa
leaq 0x220(%rsp), %rdi
callq 0xc37ae
movq 0x268(%rsp), %rdi
leaq 0x278(%rsp), %rax
cmpq %rax, %rdi
je 0xc8eb7
movq 0x278(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r14, %rdi
callq 0x8840