// File: /workspace/github_cpp_makefile_star2_O3/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 $0x378, %rsp            # imm = 0x378
callq 0xc80db
leaq 0x258(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x3ec40(%rip), %rsi     # 0x1043d0
leaq 0x168(%rsp), %rdi
leaq 0x200(%rsp), %rdx
callq 0x287de
leaq 0x168(%rsp), %rdi
movl $0x8, %esi
callq 0x500af
movq %rax, %rbx
leaq 0x178(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0xc57dc
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %r15
movq 0x3ec00(%rip), %rsi     # 0x1043f0
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, %r14
leaq 0x1b161(%rip), %rsi     # 0xe0972
leaq 0x3ebf8(%rip), %rdx     # 0x104410
leaq 0x200(%rsp), %rdi
callq 0x77736
leaq 0x17919(%rip), %rsi     # 0xdd145
leaq 0x200(%rsp), %rdi
callq 0x88c0
movq %r12, 0x168(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc5865
movq %rdx, 0x168(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x178(%rsp)
jmp 0xc586f
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x168(%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, 0x298(%rsp)
movq 0x168(%rsp), %rdi
cmpq %r12, %rdi
je 0xc58c0
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x210(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0xc58e1
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, 0x158(%rsp)
leaq 0x1b932(%rip), %rsi     # 0xe122c
leaq 0x3eb0f(%rip), %rdx     # 0x104410
leaq 0x200(%rsp), %rdi
callq 0x77736
leaq 0x17830(%rip), %rsi     # 0xdd145
leaq 0x200(%rsp), %rdi
callq 0x88c0
movq %r12, 0x168(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc594e
movq %rdx, 0x168(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x178(%rsp)
jmp 0xc5958
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x168(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x158(%rsp), %rdi
movl $0x10, %edx
callq 0x88d0
movq 0x168(%rsp), %rdi
cmpq %r12, %rdi
je 0xc59a6
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x200(%rsp), %rdi
cmpq %r13, %rdi
je 0xc59c3
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x208(%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 0x350(%rsp), %rax
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x320(%rsp), %rax
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rcx, 0x1f0(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x1e0(%rsp)
leaq 0x2f0(%rsp), %rax
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x198(%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 0x3c54a(%rip), %r14     # 0x101fb8
leaq 0x1b7c1(%rip), %rsi     # 0xe1236
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 0x3c518(%rip), %rdi     # 0x101fb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
cmpb $0x0, 0x3e97c(%rip)     # 0x104430
je 0xc5d6a
xorl %r13d, %r13d
movl %r13d, %r13d
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %rbx, %rdi
leaq 0x248(%rsp), %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xc5ebd
movq 0x248(%rsp), %rax
movzbl (%rax), %ecx
cmpl $0x42, %ecx
je 0xc5b10
cmpl $0x2a, %ecx
jne 0xc5b1a
jmp 0xc5ac0
cmpb $0x4c, 0x1(%rax)
je 0xc5d22
leaq 0x10(%rsp), %rdi
leaq 0x248(%rsp), %rsi
movl $0x9, %edx
callq 0x4d650
movq 0x10(%rsp), %r12
movq 0x80(%r12), %rdi
callq 0x86e0
movl %eax, 0x130(%rsp)
movq 0x20(%r12), %rdi
callq 0x86e0
movl %eax, %ebp
movq 0x40(%r12), %rdi
callq 0x86e0
cmpq $0x1, 0xa8(%r12)
jne 0xc7bc6
cmpq $0x1, 0xc8(%r12)
jne 0xc7bcf
movl %eax, %r14d
movq 0xa0(%r12), %rax
movb (%rax), %al
movb %al, 0xd0(%rsp)
movq 0xc0(%r12), %rax
movb (%rax), %al
movb %al, 0xf0(%rsp)
movq 0x140(%r12), %rsi
leaq 0x2a0(%rsp), %r12
movq %r12, %rdi
leaq 0x40(%rsp), %rdx
callq 0x287de
movq %r12, %rdi
callq 0x4d578
movsd %xmm0, 0x38(%rsp)
movq 0x2a0(%rsp), %rdi
leaq 0x2b0(%rsp), %rax
cmpq %rax, %rdi
je 0xc5bf3
movq 0x2b0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x10(%rsp), %rax
movq 0x160(%rax), %rdi
callq 0x86e0
movl %eax, %r12d
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movl %r14d, %eax
xorl $0x1, %eax
orl %ebp, %eax
je 0xc5c3b
xorl $0x1, %ebp
orl %r14d, %ebp
je 0xc5c64
leaq 0x10(%rsp), %rdi
callq 0x2e784
jmp 0xc5ac0
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
leaq 0xd0(%rsp), %rdx
callq 0x6ea22
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0xc5c94
movb 0xf0(%rsp), %al
jmp 0xc5c8b
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
leaq 0xf0(%rsp), %rdx
callq 0x6ea22
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0xc5c9e
movb 0xd0(%rsp), %al
movb %al, (%rsi)
incq 0x48(%rsp)
jmp 0xc5cb0
leaq 0xf0(%rsp), %rdx
jmp 0xc5ca6
leaq 0xd0(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x6ea22
movl $0x30, %edi
callq 0x8470
movq %rax, %rbp
movl 0x130(%rsp), %esi
movq %rax, %rdi
movsd 0x38(%rsp), %xmm0
movl %r12d, %edx
leaq 0x40(%rsp), %rcx
movl %r13d, %r8d
callq 0xc237e
leaq 0x200(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0xc23e0
movq %rbp, (%rax)
movq 0x1e0(%rsp), %rax
incl -0x4(%rax,%r13,4)
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xc5c2c
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
jmp 0xc5c2c
movl $0x0, 0x10(%rsp)
movq 0x1e8(%rsp), %rsi
cmpq 0x1f0(%rsp), %rsi
je 0xc5d50
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x1e8(%rsp)
jmp 0xc5d62
leaq 0x1e0(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x33074
incl %r13d
jmp 0xc5abd
leaq 0x248(%rsp), %r14
leaq 0x10(%rsp), %r12
leaq 0x40(%rsp), %r13
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 0xc5ebd
movq %r12, %rdi
movq %r14, %rsi
movl $0x9, %edx
callq 0x4d650
movq 0x10(%rsp), %rbp
movq 0x20(%rbp), %rdi
callq 0x86e0
movl %eax, 0x130(%rsp)
cmpq $0x1, 0x48(%rbp)
jne 0xc7ba7
cmpq $0x1, 0x68(%rbp)
jne 0xc7b9e
movq 0x40(%rbp), %rax
movb (%rax), %al
movb %al, 0xd0(%rsp)
movq 0x60(%rbp), %rax
movb (%rax), %al
movb %al, 0xf0(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq %r13, %rdi
xorl %esi, %esi
leaq 0xd0(%rsp), %rdx
callq 0x6ea22
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0xc5e46
movb 0xf0(%rsp), %al
movb %al, (%rsi)
incq 0x48(%rsp)
jmp 0xc5e56
movq %r13, %rdi
leaq 0xf0(%rsp), %rdx
callq 0x6ea22
movl $0x30, %edi
callq 0x8470
movq %rax, %rbp
movl 0x130(%rsp), %esi
xorpd %xmm0, %xmm0
movq %rax, %rdi
xorl %edx, %edx
movq %r13, %rcx
movl $0x1, %r8d
callq 0xc237e
leaq 0x200(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0xc23e0
movq %rbp, (%rax)
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xc5eb0
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq %r12, %rdi
callq 0x2e784
jmp 0xc5d7c
movq 0x3c0f4(%rip), %rdi     # 0x101fb8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq 0x3c0d9(%rip), %rdi     # 0x101fb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x3c0c5(%rip), %rbx     # 0x101fb8
leaq 0x1b39f(%rip), %rsi     # 0xe1299
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 0x3c093(%rip), %rdi     # 0x101fb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
xorpd %xmm0, %xmm0
leaq 0xf0(%rsp), %r14
movapd %xmm0, (%r14)
movq $0x0, 0x10(%r14)
leaq 0x248(%rsp), %r12
leaq 0x10(%rsp), %r13
leaq 0x2d0(%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 0xc600a
movq %r13, %rdi
movq %r12, %rsi
movl $0x9, %edx
callq 0x4d650
movl $0x150, %edi            # imm = 0x150
callq 0x8470
movq %rax, %rbx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2fc8e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xc2446
movq %rbp, %rdi
callq 0x2e784
movq %rbx, 0x40(%rsp)
movq 0xf8(%rsp), %rsi
cmpq 0x100(%rsp), %rsi
je 0xc5ff0
movq %rbx, (%rsi)
addq $0x8, 0xf8(%rsp)
jmp 0xc5ffd
movq %r14, %rdi
leaq 0x40(%rsp), %rdx
callq 0xc31d6
movq %r13, %rdi
callq 0x2e784
jmp 0xc5f60
movq 0x3bfa7(%rip), %rdi     # 0x101fb8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq 0x3bf8c(%rip), %rdi     # 0x101fb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x3bf78(%rip), %rbx     # 0x101fb8
leaq 0x1b26c(%rip), %rsi     # 0xe12b3
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 0x3bf46(%rip), %rdi     # 0x101fb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
xorpd %xmm0, %xmm0
movapd %xmm0, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
movq 0xf0(%rsp), %r12
cmpq %r12, 0xf8(%rsp)
je 0xc6246
xorl %r13d, %r13d
movl $0x120, %ebx            # imm = 0x120
xorl %r14d, %r14d
movl $0x0, 0x38(%rsp)
movl $0x0, 0x80(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x30, %edi
callq 0x8470
movq (%r12,%r13,8), %rcx
movq 0x8(%r12,%r13,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, 0x10(%rsp)
movq %rax, %rdi
leaq 0x200(%rsp), %rsi
callq 0xc5078
movq 0x10(%rsp), %rdi
movl 0x3c4cf(%rip), %esi     # 0x1025fc
callq 0xc5108
movq 0x10(%rsp), %rbp
movq 0x20(%rbp), %rax
subq 0x18(%rbp), %rax
sarq $0x3, %rax
cmpq $0x1, %rax
je 0xc6156
testq %rax, %rax
jne 0xc615f
incl %r14d
jmp 0xc6220
incl 0x38(%rsp)
jmp 0xc6220
incl 0x80(%rsp)
cmpq $0x2, %rax
jb 0xc6220
movq (%rbp), %rax
movq 0x138(%rax), %r12
addq $0x128, %rax            # imm = 0x128
cmpq %rax, %r12
je 0xc6220
movq 0x8(%rbp), %rdi
addq %rbx, %rdi
leaq 0x20(%r12), %rsi
callq 0xc83c6
cmpq $0x1, %rax
jne 0xc61c6
movq 0xb8(%rsp), %rsi
cmpq 0xc0(%rsp), %rsi
je 0xc61d1
movq 0x10(%rsp), %rbp
movq %rbp, (%rsi)
addq $0x8, 0xb8(%rsp)
jmp 0xc61e8
movq 0x10(%rsp), %rbp
movq (%rbp), %r15
jmp 0xc6205
leaq 0xb0(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0xc332e
movq 0x10(%rsp), %rbp
movq (%rbp), %r15
movq 0x8(%rbp), %rax
movl 0xc(%rsp), %ecx
addl 0x100(%r15), %ecx
addl 0x100(%rax), %ecx
movl %ecx, 0xc(%rsp)
movq %r12, %rdi
callq 0x8310
movq %rax, %r12
addq $0x128, %r15            # imm = 0x128
cmpq %r15, %rax
jne 0xc618a
addq $0x2, %r13
movq 0xf0(%rsp), %r12
movq 0xf8(%rsp), %rax
subq %r12, %rax
sarq $0x3, %rax
cmpq %r13, %rax
ja 0xc60d4
jmp 0xc6264
movl $0x0, 0xc(%rsp)
movl $0x0, 0x80(%rsp)
movl $0x0, 0x38(%rsp)
xorl %r14d, %r14d
movq 0x3bd4d(%rip), %rdi     # 0x101fb8
leaq 0x1b064(%rip), %rsi     # 0xe12d6
movl $0x1b, %edx
callq 0x84e0
movq 0xf8(%rsp), %rax
subq 0xf0(%rsp), %rax
sarq $0x3, %rax
movq %rax, %xmm1
punpckldq 0x2e13(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2e1b(%rip), %xmm1     # 0xc90c0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x6467(%rip), %xmm0     # 0xcc720
movq 0x3bcf8(%rip), %rdi     # 0x101fb8
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
movq 0x3bcc2(%rip), %rdi     # 0x101fb8
leaq 0x1a782(%rip), %rsi     # 0xe0a7f
movl $0x9, %edx
callq 0x84e0
movq 0x3bcaa(%rip), %rdi     # 0x101fb8
movl %r14d, %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 0x3bc71(%rip), %rdi     # 0x101fb8
leaq 0x1a73b(%rip), %rsi     # 0xe0a89
movl $0x9, %edx
callq 0x84e0
movq 0x3bc59(%rip), %rdi     # 0x101fb8
movl 0x38(%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 0x3bc1f(%rip), %rdi     # 0x101fb8
leaq 0x1a6f3(%rip), %rsi     # 0xe0a93
movl $0xe, %edx
callq 0x84e0
movq 0x3bc07(%rip), %rdi     # 0x101fb8
movl 0x80(%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 0x3bbca(%rip), %rdi     # 0x101fb8
leaq 0x1aefd(%rip), %rsi     # 0xe12f2
movl $0x1d, %edx
callq 0x84e0
movq 0xb8(%rsp), %rsi
subq 0xb0(%rsp), %rsi
sarq $0x3, %rsi
movq 0x3bb9e(%rip), %rbx     # 0x101fb8
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 0x3bb4e(%rip), %rdi     # 0x101fb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x3bb3a(%rip), %rbx     # 0x101fb8
leaq 0x1ae8b(%rip), %rsi     # 0xe1310
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 0x3bb08(%rip), %rdi     # 0x101fb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
xorpd %xmm0, %xmm0
movapd %xmm0, 0x1c0(%rsp)
xorl %eax, %eax
movq %rax, 0x1d0(%rsp)
movq %rax, 0x1b0(%rsp)
movapd %xmm0, 0x1a0(%rsp)
movq %rax, 0x120(%rsp)
movapd %xmm0, 0x110(%rsp)
movq %rax, 0x240(%rsp)
movapd %xmm0, 0x230(%rsp)
movq %rax, 0x70(%rsp)
movapd %xmm0, 0x60(%rsp)
movq 0xb0(%rsp), %rax
movq 0xb8(%rsp), %rdx
cmpb $0x0, 0x3df07(%rip)     # 0x104430
je 0xc6b1e
cmpq %rax, %rdx
je 0xc6fa8
leaq 0xd8(%rsp), %r13
leaq 0x90(%rsp), %rbp
leaq 0x8(%rsp), %r14
xorl %r15d, %r15d
movl $0x0, 0x88(%rsp)
movl $0x0, 0x7c(%rsp)
movl $0x0, 0xc(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x80(%rsp)
movq (%rax,%r15,8), %rdx
movq 0x18(%rdx), %rcx
cmpq %rcx, 0x20(%rdx)
je 0xc668f
xorl %ebx, %ebx
movq (%rcx,%rbx,8), %r12
cmpb $0x1, 0x24(%r12)
jne 0xc65d4
xorps %xmm0, %xmm0
cvtsi2sdl 0xc(%r12), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x1a8(%rsp), %rsi
cmpq 0x1b0(%rsp), %rsi
je 0xc6608
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x1a8(%rsp)
jmp 0xc661a
xorps %xmm0, %xmm0
cvtsi2sdl 0xc(%r12), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x1c8(%rsp), %rsi
cmpq 0x1d0(%rsp), %rsi
je 0xc6628
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x1c8(%rsp)
jmp 0xc663a
leaq 0x1a0(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x311fc
movq 0x38(%rsp), %rax
incl %eax
movq %rax, 0x38(%rsp)
jmp 0xc663e
leaq 0x1c0(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x311fc
incl 0xc(%rsp)
movq 0x68(%rsp), %rsi
cmpq 0x70(%rsp), %rsi
je 0xc665b
movl (%r12), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x68(%rsp)
jmp 0xc6668
leaq 0x60(%rsp), %rdi
movq %r12, %rdx
callq 0x48c2e
incq %rbx
movq 0xb0(%rsp), %rax
movq (%rax,%r15,8), %rdx
movq 0x18(%rdx), %rcx
movq 0x20(%rdx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rbx, %rdx
ja 0xc6594
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x20(%rsp)
movq %rcx, 0x50(%rsp)
movapd %xmm0, 0x40(%rsp)
movq %rcx, 0x140(%rsp)
movapd %xmm0, 0x130(%rsp)
movq %rcx, 0xe0(%rsp)
movapd %xmm0, 0xd0(%rsp)
movl $0x0, 0x90(%rsp)
movq (%rax,%r15,8), %rdx
movq 0x18(%rdx), %rcx
movq 0x20(%rdx), %rdx
movq %rdx, %rsi
subq %rcx, %rsi
cmpq $0x8, %rsi
je 0xc68fd
xorl %esi, %esi
movl $0x1, 0x8(%rsp)
movq %rdx, %rdi
subq %rcx, %rdi
cmpq $0x9, %rdi
jb 0xc6832
movl $0x1, %esi
movslq 0x90(%rsp), %rax
movq (%rcx,%rax,8), %rdx
movl 0x4(%rdx), %edi
movq (%rcx,%rsi,8), %rcx
cmpl 0x4(%rcx), %edi
jne 0xc67f6
movl 0x20(%rdx), %esi
cmpl 0x20(%rcx), %esi
je 0xc6763
movl (%rcx), %ecx
subl (%rdx), %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
cmpl 0x3beb8(%rip), %edx     # 0x102600
jle 0xc6763
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xc67bc
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0xc67c9
movq 0x138(%rsp), %rsi
cmpq 0x140(%rsp), %rsi
je 0xc6785
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x138(%rsp)
jmp 0xc6795
leaq 0x130(%rsp), %rdi
movq %rbp, %rdx
callq 0x48c2e
movq 0xd8(%rsp), %rsi
cmpq 0xe0(%rsp), %rsi
je 0xc67b2
movl 0x8(%rsp), %eax
movl %eax, (%rsi)
movq %r13, %rax
jmp 0xc67e0
leaq 0xd0(%rsp), %rdi
jmp 0xc67ee
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x48c2e
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0xc67e9
movl 0x8(%rsp), %eax
movl %eax, (%rsi)
leaq 0x48(%rsp), %rax
addq $0x4, %rsi
movq %rsi, (%rax)
jmp 0xc67f6
leaq 0x40(%rsp), %rdi
movq %r14, %rdx
callq 0x48c2e
movslq 0x8(%rsp), %rsi
incq %rsi
movl %esi, 0x8(%rsp)
movq 0xb0(%rsp), %rax
movq (%rax,%r15,8), %rdx
movq 0x18(%rdx), %rcx
movq 0x20(%rdx), %rdx
movq %rdx, %rdi
subq %rcx, %rdi
sarq $0x3, %rdi
cmpq %rsi, %rdi
ja 0xc6713
movl 0x90(%rsp), %esi
jmp 0xc6836
shrq $0x3, %rdi
incl %esi
movl %esi, 0x90(%rsp)
movslq %esi, %r8
decq %rdi
cmpq %r8, %rdi
ja 0xc66f6
movq 0x10(%rsp), %rdx
cmpq %rdx, 0x18(%rsp)
je 0xc68fd
movslq (%rdx), %rax
movq (%rcx,%rax,8), %rax
movl (%rax), %edx
movq 0x40(%rsp), %rsi
movslq (%rsi), %rsi
movq (%rcx,%rsi,8), %rcx
movl (%rcx), %r12d
movsd 0x18(%rcx), %xmm0
movhpd 0x18(%rax), %xmm0       # xmm0 = xmm0[0],mem[0]
cvttpd2dq %xmm0, %xmm0
movl %edx, %ebx
cmpl %edx, %r12d
cmovll %r12d, %ebx
cmovll %edx, %r12d
jl 0xc6898
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movdqa %xmm0, 0x2c0(%rsp)
movl $0x20, %edi
callq 0x8470
cvtdq2pd 0x2c0(%rsp), %xmm0
movl %ebx, (%rax)
movl %r12d, 0x4(%rax)
movdqu %xmm0, 0x8(%rax)
subl %ebx, %r12d
movl %r12d, %ecx
negl %ecx
cmovsl %r12d, %ecx
movl %ecx, 0x18(%rax)
movq %rax, 0x90(%rsp)
movq 0x118(%rsp), %rsi
cmpq 0x120(%rsp), %rsi
je 0xc6a6f
movq %rax, (%rsi)
addq $0x8, 0x118(%rsp)
jmp 0xc6a7f
movq 0x130(%rsp), %rcx
movq 0x138(%rsp), %rsi
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
movq (%rax,%r15,8), %rax
movq 0x18(%rax), %rax
movq 0xd0(%rsp), %rdx
subq %rcx, %rsi
je 0xc696b
sarq $0x2, %rsi
xorl %edi, %edi
xorl %r8d, %r8d
movslq (%rcx,%rdi,4), %r9
movq (%rax,%r9,8), %r9
movslq (%rdx,%rdi,4), %r10
movq (%rax,%r10,8), %r10
movl (%r10), %r10d
cmpl (%r9), %r10d
cmovnel %edi, %r8d
incq %rdi
cmpq %rdi, %rsi
jne 0xc6944
movslq %r8d, %rsi
jmp 0xc696d
xorl %esi, %esi
movslq (%rcx,%rsi,4), %rcx
movq (%rax,%rcx,8), %rcx
movl (%rcx), %r12d
movl %r12d, 0x8(%rsp)
movslq (%rdx,%rsi,4), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
movl %eax, 0x8c(%rsp)
cmpl %r12d, %eax
jge 0xc69a3
movl %eax, 0x8(%rsp)
movl %r12d, 0x8c(%rsp)
movl %eax, %ecx
jmp 0xc69a9
movl %r12d, %ecx
movl %eax, %r12d
subl %ecx, %r12d
movl %r12d, 0x164(%rsp)
movq %rbp, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x48c2e
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rax
cmpq %rax, %rsi
je 0xc69ed
movl 0x8c(%rsp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x98(%rsp)
jmp 0xc6a0d
movq %rbp, %rdi
leaq 0x8c(%rsp), %rdx
callq 0x48c2e
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rax
cmpq %rax, %rsi
je 0xc6a29
movl 0x164(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x98(%rsp)
jmp 0xc6a39
movq %rbp, %rdi
leaq 0x164(%rsp), %rdx
callq 0x48c2e
leaq 0x230(%rsp), %rdi
movq %rbp, %rsi
callq 0x47e6a
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xc6a66
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
incl 0x88(%rsp)
jmp 0xc6a83
leaq 0x110(%rsp), %rdi
movq %rbp, %rdx
callq 0xc37a8
incl 0x7c(%rsp)
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0xc6aa0
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0xc6abd
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xc6ad4
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc6aeb
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movslq %r12d, %rax
addq %rax, 0x80(%rsp)
incq %r15
movq 0xb0(%rsp), %rax
movq 0xb8(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0xc6580
jmp 0xc6fd8
cmpq %rax, %rdx
je 0xc6e67
leaq 0x50(%rsp), %rbx
xorl %r8d, %r8d
movq (%rax,%r8,8), %rsi
movq 0x18(%rsi), %rcx
movq 0x20(%rsi), %rsi
movq %rsi, %rdi
subq %rcx, %rdi
cmpq $0x9, %rdi
jb 0xc6e51
movq %r8, 0x38(%rsp)
xorl %r13d, %r13d
movq %rsi, %rdx
subq %rcx, %rdx
cmpq $0x9, %rdx
jb 0xc6e31
movl $0x1, %ebp
movq (%rcx,%r13,8), %rax
movb 0x8(%rax), %dl
movb %dl, 0x90(%rsp)
movq (%rcx,%rbp,8), %rcx
movb 0x8(%rcx), %dl
movb %dl, 0x8(%rsp)
movl (%rax), %r12d
movl (%rcx), %r14d
leaq 0x130(%rsp), %r15
movq %r15, %rdi
movl %r12d, %esi
callq 0x2e7e2
movq %r15, %rdi
leaq 0xe4d8(%rip), %rsi      # 0xd507c
callq 0x88c0
movq %rbx, 0x40(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc6bcc
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0xc6bd4
movupd (%rcx), %xmm0
movupd %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xd0(%rsp), %rdi
movl %r14d, %esi
callq 0x2e7e2
movq 0x40(%rsp), %rcx
movl $0xf, %edi
cmpq %rbx, %rcx
je 0xc6c10
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0xc6c4d
movl $0xf, %edi
leaq 0xe0(%rsp), %r9
cmpq %r9, %rsi
je 0xc6c48
movq 0xe0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0xc6c59
leaq 0x40(%rsp), %rdi
callq 0x8180
jmp 0xc6c6a
leaq 0xd0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x84d0
leaq 0x20(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0xc6c8f
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0xc6c97
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0xc6cd9
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x40(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc6cf0
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0xc6d15
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x168(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xc38e4
testq %rax, %rax
je 0xc6d5a
leaq 0x168(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xc39e0
movq (%rax), %rdi
movq 0x10(%rdi), %rsi
cmpq 0x18(%rdi), %rsi
je 0xc6d9a
movb 0x90(%rsp), %al
movb %al, (%rsi)
incq 0x10(%rdi)
jmp 0xc6dab
movl $0x38, %edi
callq 0x8470
movq %rax, %r15
movsbl 0x90(%rsp), %ecx
movsbl 0x8(%rsp), %r8d
movq %rax, %rdi
movl %r12d, %esi
movl %r14d, %edx
callq 0xc28a4
leaq 0x168(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xc39e0
movq %r15, (%rax)
jmp 0xc6de4
addq $0x8, %rdi
leaq 0x90(%rsp), %rdx
callq 0x6ea22
leaq 0x168(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xc39e0
movq (%rax), %rdi
movq 0x10(%rdi), %rsi
cmpq 0x18(%rdi), %rsi
je 0xc6dd6
movb 0x8(%rsp), %al
movb %al, (%rsi)
incq 0x10(%rdi)
jmp 0xc6de4
addq $0x8, %rdi
leaq 0x8(%rsp), %rdx
callq 0x6ea22
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xc6e00
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
incq %rbp
movq 0xb0(%rsp), %rax
movq 0x38(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x18(%rdx), %rcx
movq 0x20(%rdx), %rsi
movq %rsi, %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rbp, %rdx
ja 0xc6b68
jmp 0xc6e35
shrq $0x3, %rdx
incq %r13
decq %rdx
cmpq %r13, %rdx
ja 0xc6b53
movq 0xb8(%rsp), %rdx
movq 0x38(%rsp), %r8
incq %r8
movq %rdx, %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r8, %rcx
ja 0xc6b2f
movq 0x3b14a(%rip), %rdi     # 0x101fb8
leaq 0x19c97(%rip), %rsi     # 0xe0b0c
movl $0x11, %edx
callq 0x84e0
movq 0x180(%rsp), %rsi
movq 0x3b12a(%rip), %rdi     # 0x101fb8
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 0x3b0f4(%rip), %rdi     # 0x101fb8
leaq 0x19c6c(%rip), %rsi     # 0xe0b37
movl $0x11, %edx
callq 0x84e0
movq 0x3b0dc(%rip), %rdi     # 0x101fb8
movl 0xc(%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 0x3b0a2(%rip), %rdi     # 0x101fb8
leaq 0x19c2c(%rip), %rsi     # 0xe0b49
movl $0x2c, %edx
callq 0x84e0
cvtsi2sdl 0xc(%rsp), %xmm0
movq 0xb8(%rsp), %rax
subq 0xb0(%rsp), %rax
sarq $0x3, %rax
imulq $0x12c, %rax, %rax      # imm = 0x12C
movq %rax, %xmm1
punpckldq 0x215b(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2163(%rip), %xmm1     # 0xc90c0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq 0x3b044(%rip), %rdi     # 0x101fb8
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 0xc7a52
movq $0x0, 0x38(%rsp)
movq $0x0, 0x80(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x7c(%rsp)
movl $0x0, 0x88(%rsp)
movq 0x3afd9(%rip), %rdi     # 0x101fb8
leaq 0x1a35f(%rip), %rsi     # 0xe1345
movl $0x19, %edx
callq 0x84e0
movq 0x298(%rsp), %r13
movq 0x80(%rsp), %rbp
movq 0x3afb1(%rip), %rdi     # 0x101fb8
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 0x3af78(%rip), %rdi     # 0x101fb8
leaq 0x19a5b(%rip), %rsi     # 0xe0aa2
movl $0xf, %edx
callq 0x84e0
movq 0x3af60(%rip), %rdi     # 0x101fb8
movl 0x88(%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 0x3af23(%rip), %rdi     # 0x101fb8
leaq 0x19a16(%rip), %rsi     # 0xe0ab2
movl $0xf, %edx
callq 0x84e0
movq 0x3af0b(%rip), %rdi     # 0x101fb8
movl 0x7c(%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 0x3aed1(%rip), %rdi     # 0x101fb8
leaq 0x1a271(%rip), %rsi     # 0xe135f
movl $0x1f, %edx
callq 0x84e0
movq 0x238(%rsp), %rsi
subq 0x230(%rsp), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movq 0x3ae97(%rip), %rdi     # 0x101fb8
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 0x3ae61(%rip), %rdi     # 0x101fb8
leaq 0x19964(%rip), %rsi     # 0xe0ac2
movl $0xa, %edx
callq 0x84e0
movq 0x3ae49(%rip), %rdi     # 0x101fb8
movl 0xc(%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 0x3ae0f(%rip), %rdi     # 0x101fb8
leaq 0x1991d(%rip), %rsi     # 0xe0acd
movl $0xd, %edx
callq 0x84e0
movq 0x3adf7(%rip), %rdi     # 0x101fb8
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 0x3adbc(%rip), %rdi     # 0x101fb8
leaq 0x198d8(%rip), %rsi     # 0xe0adb
movl $0x19, %edx
callq 0x84e0
leaq 0x280(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x37978
movq 0x280(%rsp), %rcx
movq 0x288(%rsp), %rdx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %rcx, %rdx
je 0xc7261
cmpq $0x1, %rax
movq %rax, %rdx
adcq $0x0, %rdx
pxor %xmm0, %xmm0
xorl %esi, %esi
addsd (%rcx,%rsi,8), %xmm0
incq %rsi
cmpq %rsi, %rdx
jne 0xc7252
jmp 0xc7265
pxor %xmm0, %xmm0
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movq 0x3ad43(%rip), %rdi     # 0x101fb8
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 0x280(%rsp), %rdi
testq %rdi, %rdi
je 0xc72c1
movq 0x290(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x3acf0(%rip), %rdi     # 0x101fb8
leaq 0x19826(%rip), %rsi     # 0xe0af5
movl $0x16, %edx
callq 0x84e0
leaq 0x268(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x37978
movq 0x268(%rsp), %rcx
movq 0x270(%rsp), %rdx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %rcx, %rdx
je 0xc732d
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 0xc731e
jmp 0xc7331
xorpd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movq 0x3ac74(%rip), %rbx     # 0x101fb8
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 0x268(%rsp), %rdi
testq %rdi, %rdi
je 0xc7393
movq 0x278(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x110(%rsp), %rax
cmpq %rax, 0x118(%rsp)
je 0xc74ba
xorl %r12d, %r12d
leaq 0x6617(%rip), %r14      # 0xcd9ca
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 0x110(%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 0x110(%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 0x110(%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 0x110(%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 0x110(%rsp), %rax
movq 0x118(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r12
jne 0xc73b3
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq 0x3aae0(%rip), %rdi     # 0x101fb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x3aacc(%rip), %rbx     # 0x101fb8
leaq 0x19e8c(%rip), %rsi     # 0xe137f
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 0x3aa9a(%rip), %rdi     # 0x101fb8
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x60(%rsp), %rbx
movq 0x68(%rsp), %r14
cmpq %r14, %rbx
je 0xc75ab
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 0x57119
movq %rbx, %rdi
movq %r14, %rsi
callq 0x571fc
movq 0x60(%rsp), %rbx
movq 0x68(%rsp), %rsi
cmpq %rsi, %rbx
je 0xc75b7
leaq 0x4(%rbx), %rax
cmpq %rsi, %rax
je 0xc75b7
movl -0x4(%rax), %ecx
leaq 0x4(%rax), %rdx
cmpl (%rax), %ecx
movq %rdx, %rax
jne 0xc757a
leaq -0x8(%rdx), %rax
cmpq %rsi, %rdx
je 0xc75b0
movl %ecx, %edi
movl (%rdx), %ecx
cmpl %ecx, %edi
je 0xc75a5
movl %ecx, 0x4(%rax)
addq $0x4, %rax
addq $0x4, %rdx
jmp 0xc7591
movq %rbx, %rsi
jmp 0xc75b7
addq $0x4, %rax
movq %rax, %rsi
subq %rbx, %rsi
sarq $0x2, %rsi
leaq 0x60(%rsp), %rdi
callq 0x51d1c
movq 0x3a9e9(%rip), %rdi     # 0x101fb8
leaq 0x19dc5(%rip), %rsi     # 0xe139b
movl $0x15, %edx
callq 0x84e0
movq 0x68(%rsp), %rsi
subq 0x60(%rsp), %rsi
sarq $0x2, %rsi
movq 0x3a9c3(%rip), %rdi     # 0x101fb8
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 0x7c(%rsp), %xmm0
cvtsi2sd %rbp, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x3a978(%rip), %rdi     # 0x101fb8
leaq 0x19d6a(%rip), %rsi     # 0xe13b1
movl $0x16, %edx
callq 0x84e0
movsd 0x40(%rsp), %xmm0
movq 0x3a95a(%rip), %rdi     # 0x101fb8
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 0x68(%rsp), %rsi
subq 0x60(%rsp), %rsi
sarq $0x2, %rsi
incq %rsi
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rdx
leaq 0x130(%rsp), %rcx
callq 0x51a0c
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
cmpq $0x4, %rdx
je 0xc78f5
xorl %r15d, %r15d
movq 0x3a8df(%rip), %rbx     # 0x101fb8
leaq 0xf844(%rip), %rbp      # 0xd6f24
movq 0x110(%rsp), %rdi
movq 0x118(%rsp), %r8
movl (%rax,%r15,4), %r14d
movl 0x4(%rax,%r15,4), %edx
xorpd %xmm1, %xmm1
movl $0x0, %esi
xorpd %xmm0, %xmm0
subq %rdi, %r8
je 0xc7746
sarq $0x3, %r8
xorl %r9d, %r9d
xorl %esi, %esi
movq (%rdi,%r9,8), %r10
cmpl %r14d, (%r10)
jg 0xc773e
cmpl %edx, 0x4(%r10)
jl 0xc773e
xorps %xmm2, %xmm2
cvtsi2sdl 0x18(%r10), %xmm2
incl %esi
movsd 0x4fda(%rip), %xmm3     # 0xcc710
divsd %xmm2, %xmm3
addsd %xmm3, %xmm0
incq %r9
cmpq %r9, %r8
jne 0xc7714
movq 0x230(%rsp), %rdi
movq 0x238(%rsp), %r8
subq %rdi, %r8
je 0xc7792
sarq $0x3, %r8
movabsq $-0x5555555555555555, %r9 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r9, %r8
xorpd %xmm1, %xmm1
movq (%rdi), %r9
cmpl %r14d, (%r9)
jg 0xc7789
cmpl %edx, 0x4(%r9)
jl 0xc7789
incl %esi
addsd 0x4f87(%rip), %xmm1     # 0xcc710
addq $0x18, %rdi
decq %r8
jne 0xc7771
leaq 0x1(%r15), %r13
cmpl $0xa, %esi
jle 0xc77aa
divsd %xmm1, %xmm0
movq 0x10(%rsp), %rdx
movsd %xmm0, (%rdx,%r13,8)
imull $0x3afb7e91, %r13d, %edx # imm = 0x3AFB7E91
rorl $0x4, %edx
cmpl $0x68db8, %edx          # imm = 0x68DB8
ja 0xc78db
movl $0x12, %edx
movq %rbx, %rdi
leaq 0x19bf9(%rip), %rsi     # 0xe13c8
callq 0x84e0
movq %rbx, %rdi
movl %r13d, %esi
callq 0x8810
movq %rax, %r12
movl $0x2, %edx
movq %rax, %rdi
leaq 0xb912(%rip), %rsi      # 0xd3103
callq 0x84e0
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movq 0x68(%rsp), %rax
subq 0x60(%rsp), %rax
sarq $0x2, %rax
movq %rax, %xmm1
punpckldq 0x1897(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x189f(%rip), %xmm1     # 0xc90c0
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 0x107cc(%rip), %rsi     # 0xd8017
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 0x77bd(%rip), %rsi      # 0xcf044
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 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
addq $0x2, %r15
cmpq %r15, %rdx
movq %r13, %r15
jne 0xc76e0
leaq 0x15888(%rip), %rsi     # 0xdd184
movl $0x2, %edx
movq 0x158(%rsp), %rdi
callq 0x84e0
movq 0x60(%rsp), %rax
movl (%rax), %esi
movq 0x158(%rsp), %rdi
callq 0x8810
movq %rax, %rbx
leaq 0x609e(%rip), %rsi      # 0xcd9ca
movl $0x1, %edx
movq %rax, %rdi
callq 0x84e0
movq 0x10(%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 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
je 0xc7a3b
movl $0x1, %r15d
leaq 0x6032(%rip), %rbx      # 0xcd9ca
movl -0x4(%rax,%r15,4), %esi
movq 0x158(%rsp), %rdi
callq 0x8810
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x84e0
movq 0x60(%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 0x10(%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 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r15
jne 0xc7998
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc7a52
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xc7a69
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x230(%rsp), %rdi
callq 0x480b0
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0xc7a93
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0xc7ab0
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0xc7acd
movq 0x1d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xc7aea
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0xc7b07
movq 0x100(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x168(%rsp), %rdi
callq 0xc2a50
leaq 0x2e8(%rsp), %rdi
callq 0xc2aee
movq 0x1e0(%rsp), %rdi
testq %rdi, %rdi
je 0xc7b3e
movq 0x1f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x318(%rsp), %rdi
callq 0x3c602
leaq 0x348(%rsp), %rdi
callq 0x48b9e
leaq 0x200(%rsp), %rdi
callq 0xc2b7e
movq 0x248(%rsp), %rdi
leaq 0x258(%rsp), %rax
cmpq %rax, %rdi
je 0xc7b8a
movq 0x258(%rsp), %rsi
incq %rsi
callq 0x8480
xorl %eax, %eax
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18e89(%rip), %rdi     # 0xe0a2e
jmp 0xc7bae
leaq 0x18e5e(%rip), %rdi     # 0xe0a0c
leaq 0x19697(%rip), %rsi     # 0xe124c
leaq 0x196b3(%rip), %rcx     # 0xe126f
movl $0x84, %edx
callq 0x82c0
leaq 0x18dbc(%rip), %rdi     # 0xe0989
jmp 0xc7bd6
leaq 0x18e14(%rip), %rdi     # 0xe09ea
leaq 0x1966f(%rip), %rsi     # 0xe124c
leaq 0x1968b(%rip), %rcx     # 0xe126f
movl $0x6d, %edx
callq 0x82c0
jmp 0xc7e41
jmp 0xc7f3e
jmp 0xc7da7
movq %rax, %r14
movq 0x168(%rsp), %rdi
cmpq %r12, %rdi
je 0xc7c22
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0xc7c22
movq %rax, %r14
movq 0x200(%rsp), %rdi
cmpq %r13, %rdi
je 0xc7c44
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0xc7c44
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq 0x158(%rsp), %rdi
jmp 0xc7ced
jmp 0xc7cf7
movq %r14, %rbx
movq %rax, %r14
movq 0x168(%rsp), %rdi
cmpq %r12, %rdi
je 0xc7c86
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0xc7c86
movq %r14, %rbx
movq %rax, %r14
leaq 0x210(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc7caf
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0xc7caf
movq %r14, %rbx
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
jmp 0xc7ced
jmp 0xc7cf7
movq %rax, %r14
movl $0x208, %esi            # imm = 0x208
movq %r15, %rdi
jmp 0xc7ced
jmp 0xc7cf7
movq %rax, %r14
leaq 0x178(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc80ae
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0xc80ae
movq %rax, %r14
jmp 0xc80ae
jmp 0xc7e14
jmp 0xc7e14
movq %rax, %r14
movq 0x268(%rsp), %rdi
testq %rdi, %rdi
je 0xc7f9b
movq 0x278(%rsp), %rsi
jmp 0xc7f07
movq %rax, %r14
movq 0x280(%rsp), %rdi
testq %rdi, %rdi
je 0xc7f9b
movq 0x290(%rsp), %rsi
jmp 0xc7f07
jmp 0xc7f3e
jmp 0xc7f3e
jmp 0xc7e69
jmp 0xc7ea0
jmp 0xc7e71
jmp 0xc7f3e
jmp 0xc7e41
movq %rax, %r14
movq 0x2a0(%rsp), %rdi
leaq 0x2b0(%rsp), %rax
cmpq %rax, %rdi
je 0xc7e2e
movq 0x2b0(%rsp), %rsi
incq %rsi
jmp 0xc7e29
movq %rax, %r14
jmp 0xc7e2e
jmp 0xc7e41
movq %rax, %r14
movl $0x30, %esi
movq %rbp, %rdi
callq 0x8480
jmp 0xc7e17
jmp 0xc7e41
movq %rax, %r14
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xc7ea3
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
jmp 0xc7ea3
jmp 0xc7f3e
jmp 0xc7e14
movq %rax, %r14
leaq 0x2d0(%rsp), %rdi
callq 0x2e784
jmp 0xc7e03
movq %rax, %r14
movl $0x150, %esi            # imm = 0x150
movq %rbx, %rdi
callq 0x8480
jmp 0xc7e58
jmp 0xc7e71
movq %rax, %r14
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xc7e2e
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x10(%rsp), %rdi
callq 0x2e784
jmp 0xc8050
jmp 0xc7e7e
jmp 0xc7e41
movq %rax, %r14
jmp 0xc8050
jmp 0xc7f3e
jmp 0xc7f3e
jmp 0xc7e69
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x2e784
jmp 0xc8033
jmp 0xc7e7e
movq %rax, %r14
jmp 0xc7ef4
movq %rax, %r14
jmp 0xc8033
jmp 0xc7f3e
movq %rax, %r14
jmp 0xc8016
jmp 0xc7f3e
movq %rax, %r14
movl $0x38, %esi
movq %r15, %rdi
callq 0x8480
jmp 0xc7f7f
movq %rax, %r14
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0xc7ec0
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0xc7edd
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xc7ef4
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc7f9b
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
jmp 0xc7f96
movq %rax, %r14
jmp 0xc7f5d
movq %rax, %r14
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0xc7f46
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0xc7f46
movq %rax, %r14
jmp 0xc7f9b
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc7f5d
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0xc7f9b
movq 0x140(%rsp), %rsi
jmp 0xc7f93
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xc7f9b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xc7fb2
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x230(%rsp), %rdi
callq 0x480b0
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0xc7fdc
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0xc7ff9
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0xc8016
movq 0x1d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xc8033
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0xc8050
movq 0x100(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x168(%rsp), %rdi
callq 0xc2a50
leaq 0x2e8(%rsp), %rdi
callq 0xc2aee
movq 0x1e0(%rsp), %rdi
testq %rdi, %rdi
je 0xc8087
movq 0x1f0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x318(%rsp), %rdi
callq 0x3c602
leaq 0x348(%rsp), %rdi
callq 0x48b9e
leaq 0x200(%rsp), %rdi
callq 0xc2b7e
movq 0x248(%rsp), %rdi
leaq 0x258(%rsp), %rax
cmpq %rax, %rdi
je 0xc80d3
movq 0x258(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r14, %rdi
callq 0x8840