// File: millanek[P]evo/evo_ABS.cpp
// Function: ABSmain(int, char**)
int ABSmain(int argc, char** argv) {
    parseABSoptions(argc, argv);
    string line; // for reading the input files
    
    // Load up the annotation file
    Annotation wgAnnotation; std::ifstream* annotFile;
    if (!opt::annotFile.empty()) {
        annotFile = new std::ifstream(opt::annotFile.c_str());
        Annotation Annot(annotFile, false); // Does not use transcripts annotated as 5' or 3' partial
        wgAnnotation = Annot;
    }
    
    std::istream* vcfFile = createReader(opt::vcfFile.c_str());
    std::ifstream* setsFile = new std::ifstream(opt::setsFile.c_str());
    std::ifstream* ABSquartetFile = new std::ifstream(opt::ABSquartetFile.c_str());
    
    std::map<string, std::vector<string>> popToIDsMap;
    std::map<string, string> IDsToPopMap;
    std::map<string, std::vector<size_t>> popToPosMap;
    std::map<size_t, string> posToPopMap;
    
    // Get the sample sets
    while (getline(*setsFile, line)) {
        // std::cerr << line << std::endl;
        std::vector<string> ID_Pop = split(line, '\t');
        popToIDsMap[ID_Pop[1]].push_back(ID_Pop[0]);
        IDsToPopMap[ID_Pop[0]] = ID_Pop[1];
        //std::cerr << ID_Species[1] << "\t" << ID_Species[0] << std::endl;
    }
    // Get a vector of set names (usually populations/species)
    std::vector<string> populations;
    for(std::map<string,std::vector<string>>::iterator it = popToIDsMap.begin(); it != popToIDsMap.end(); ++it) {
        populations.push_back(it->first);
        // std::cerr << it->first << std::endl;
    } std::cerr << "There are " << populations.size() << " populations " << std::endl;
    
    // Get the ABS quartets
    std::vector<std::ofstream*> outFiles;
    //std::vector<std::ofstream*> outFileGenes;
    std::vector<std::vector<string> > ABSquartets;
    while (getline(*ABSquartetFile,line)) {
        // std::cerr << line << std::endl;
        std::vector<string> fourPops = split(line, '\t'); assert(fourPops.size() == 4);
        ABSquartets.push_back(fourPops);
        std::ofstream* outFile = new std::ofstream(fourPops[0] + "_" + fourPops[1] + "_" + fourPops[2] + "_" + fourPops[3] + "_ABS_" + opt::runName + "_" + numToString(opt::windowSize) + "_" + numToString(opt::windowStep) + ".txt");
        *outFile << "chr\tpos1\tpos2\tABS\tABSalt" << std::endl;
        outFiles.push_back(outFile);
    }
    
    // And need to prepare the vectors to hold the ABS values and the coordinates:
    std::deque<double> initDeq(opt::windowSize,0.0); // deque to initialise per-site ABS values
    std::vector<std::deque<double>> initABSdeques(3,initDeq); // vector of per-site ABS deques - two for each quartet plus one for the coordinates
    std::vector<std::vector<std::deque<double>>> ABSresults(ABSquartets.size(),initABSdeques); // one set of deques for each quartet
    
    // if (!opt::annotFile.empty()) {
    //std::vector<std::vector<double>> initGeneVectors(9); // For the nine PBS columns in the _PBSGenes_ files
    //std::vector<std::vector<std::vector<double>>> PBSgeneResults(PBStrios.size(),initGeneVectors);
    //std::string currentGene = "";
    //}
    //std::deque<std::vector<double>> regionPBSnums; regionPBSnums.assign(opt::windowSize,init);
    //std::deque<std::vector<double>> regionPBSdenoms; regionPBSdenoms.assign(opt::windowSize,init);
    //std::vector<double> allPs(populations.size(),0.0);
    int totalVariantNumber = 0;
    std::vector<int> usedVars(ABSquartets.size(),0); // Will count the number of used variants for each quartet
    std::vector<string> sampleNames; std::vector<std::string> fields;
    int reportProgressEvery = 1000; string chr; string coord;
    std::clock_t start; std::clock_t startGettingCounts; std::clock_t startCalculation;
    double durationOverall; double durationGettingCounts; double durationCalculation;
    
    while (getline(*vcfFile, line)) {
        line.erase(std::remove(line.begin(), line.end(), '\r'), line.end()); // Deal with any left over \r from files prepared on Windows
        if (line[0] == '#' && line[1] == '#')
            continue;
        else if (line[0] == '#' && line[1] == 'C') {
            fields = split(line, '\t');
            std::vector<std::string> sampleNames(fields.begin()+NUM_NON_GENOTYPE_COLUMNS,fields.end());
            // print_vector_stream(sampleNames, std::cerr);
            for (std::vector<std::string>::size_type i = 0; i != sampleNames.size(); i++) {
                posToPopMap[i] = IDsToPopMap[sampleNames[i]];
            }
            // Iterate over all the keys in the map to find the samples in the VCF:
            // Give an error if no sample is found for a species:
            for(std::map<string, std::vector<string>>::iterator it = popToIDsMap.begin(); it != popToIDsMap.end(); ++it) {
                string sp =  it->first;
                //std::cerr << "sp " << sp << std::endl;
                std::vector<string> IDs = it->second;
                std::vector<size_t> spPos = locateSet(sampleNames, IDs);
                if (spPos.empty()) {
                    std::cerr << "Did not find any samples in the VCF for \"" << sp << "\"" << std::endl;
                    assert(!spPos.empty());
                }
                popToPosMap[sp] = spPos;
            }
            start = std::clock();
            //  std::cerr << " " << std::endl;
            //  std::cerr << "Outgroup at pos: "; print_vector_stream(speciesToPosMap["Outgroup"], std::cerr);
            //  std::cerr << "telvit at pos: "; print_vector_stream(speciesToPosMap["telvit"], std::cerr);
        } else {
            totalVariantNumber++;
            if (totalVariantNumber % reportProgressEvery == 0) {
                durationOverall = ( std::clock() - start ) / (double) CLOCKS_PER_SEC;
                std::cerr << "Processed " << totalVariantNumber << " variants in " << durationOverall << "secs" << std::endl;
                std::cerr << "GettingCounts " << durationGettingCounts << " calculation " << durationCalculation << "secs" << std::endl;
            }
            fields = split(line, '\t'); chr = fields[0]; coord = fields[1];
            std::vector<std::string> genotypes(fields.begin()+NUM_NON_GENOTYPE_COLUMNS,fields.end());
            //std::vector<std::string> info = split(fields[7], ';');
            // Only consider biallelic SNPs
            string refAllele = fields[3]; string altAllele = fields[4];
            if (refAllele.length() > 1 || altAllele.length() > 1 || altAllele == "*") {
                refAllele.clear(); refAllele.shrink_to_fit(); altAllele.clear(); altAllele.shrink_to_fit();
                genotypes.clear(); genotypes.shrink_to_fit(); continue;
            }
            startGettingCounts = std::clock();
            GeneralSetCounts* c = new GeneralSetCounts(popToPosMap, (int)genotypes.size());
            c->getSetVariantCountsSimple(genotypes, posToPopMap);
            genotypes.clear(); genotypes.shrink_to_fit();
            durationGettingCounts = ( std::clock() - startGettingCounts ) / (double) CLOCKS_PER_SEC;
            // std::cerr << "Here:" << totalVariantNumber << std::endl;
            
            startCalculation = std::clock();
            
            
            // for (std::vector<std::string>::size_type i = 0; i != populations.size(); i++) {
            //     allPs[i] = c->setAAFs.at(populations[i]);
            // }
            // durationFirstLoop = ( std::clock() - startCalculation ) / (double) CLOCKS_PER_SEC;
            
            // find if we are in a gene:
            std::vector<string> SNPgeneDetails = wgAnnotation.getSNPgeneDetails(chr, atoi(coord.c_str()));
            
            // std::cerr << coord << "\t";
            // print_vector_stream(SNPgeneDetails, std::cerr);
            // Now calculate the PBS stats:
            double pW; double pX; double pY; double pZ;
            for (int i = 0; i != ABSquartets.size(); i++) {
                pW = c->setAAFs.at(ABSquartets[i][0]);
                if (pW == -1) continue;  // If any member of the trio has entirely missing data, just move on to the next trio
                pX = c->setAAFs.at(ABSquartets[i][1]);
                if (pX == -1) continue;
                pY = c->setAAFs.at(ABSquartets[i][2]);
                if (pY == -1) continue;
                pZ = c->setAAFs.at(ABSquartets[i][3]);
                if (pZ == -1) continue;
                
                if (pW == 0 && pX == 0 && pY == 0 && pZ == 0) { continue; }
                if (pW == 1 && pX == 1 && pY == 1 && pZ == 1) { continue; }
                usedVars[i]++;
                
                std::vector<double> thisSNP_ABS = calculateABSfromAFs(pW,pX,pY,pZ,
                                                                      c->setAlleleCounts.at(ABSquartets[i][0]),
                                                                      c->setAlleleCounts.at(ABSquartets[i][1]),
                                                                      c->setAlleleCounts.at(ABSquartets[i][2]),
                                                                      c->setAlleleCounts.at(ABSquartets[i][3]));
                
                ABSresults[i][0].push_back(thisSNP_ABS[0]); ABSresults[i][1].push_back(thisSNP_ABS[1]); ABSresults[i][2].push_back(stringToDouble(coord));
                ABSresults[i][0].pop_front(); ABSresults[i][1].pop_front(); ABSresults[i][2].pop_front();
                
                /*if (!opt::annotFile.empty()) { if (SNPgeneDetails[0] != "") {
                    if (SNPgeneDetails[1] == "exon") {
                        PBSgeneResults[i][0].push_back(thisSNP_PBS[0]); PBSgeneResults[i][1].push_back(thisSNP_PBS[1]); PBSgeneResults[i][2].push_back(thisSNP_PBS[2]);
                    } PBSgeneResults[i][3].push_back(thisSNP_PBS[0]); PBSgeneResults[i][4].push_back(thisSNP_PBS[1]); PBSgeneResults[i][5].push_back(thisSNP_PBS[2]);
                    currentGene = SNPgeneDetails[0];
                }} */
                if (usedVars[i] > opt::windowSize && (usedVars[i] % opt::windowStep == 0)) {
                    // std::cerr << PBSresults[i][0][0] << std::endl;
                    *outFiles[i] << chr << "\t" << ABSresults[i][2][0] << "\t" << coord << "\t" << vector_average(ABSresults[i][0]) << "\t" << vector_average(ABSresults[i][1]) << std::endl;
                }
                // }
            }
            /*if (!opt::annotFile.empty()) { if (SNPgeneDetails[0] == "" && currentGene != "") {
                for (int i = 0; i != ABStrios.size(); i++) {
                    *outFilesGenes[i] << currentGene << "\t" << ABSgeneResults[i][0].size() << "\t" << PBSgeneResults[i][3].size() << "\t" << vector_average(PBSgeneResults[i][0]) << "\t" << vector_average(PBSgeneResults[i][1]) << "\t" << vector_average(PBSgeneResults[i][2]) << "\t" << vector_average(PBSgeneResults[i][3]) << "\t" << vector_average(PBSgeneResults[i][4]) << "\t" << vector_average(PBSgeneResults[i][5]) << std::endl;
                    for (int j = 0; j <= 5; j++) { PBSgeneResults[i][j].clear(); }
                }
                currentGene = "";
            }} */
            durationCalculation = ( std::clock() - startCalculation ) / (double) CLOCKS_PER_SEC;
            delete c;
        }
    }
    
    return 0;
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xcc0, %rsp            # imm = 0xCC0
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x10c2b0
leaq -0x30(%rbp), %rdi
callq 0xa820
leaq -0xf0(%rbp), %rdi
callq 0xe2ed0
jmp 0x109e25
leaq 0x9161c(%rip), %rdi     # 0x19b448
callq 0xaa70
testb $0x1, %al
jne 0x109f2f
movl $0x208, %edi            # imm = 0x208
callq 0xa5d0
movq %rax, -0x968(%rbp)
jmp 0x109e4c
leaq 0x915f5(%rip), %rdi     # 0x19b448
callq 0xa220
movq -0x968(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0xab90
jmp 0x109e6e
movq -0x968(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
xorl %edx, %edx
callq 0x58390
jmp 0x109e93
leaq -0xf0(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0xe2f20
jmp 0x109ea8
leaq -0x1c8(%rbp), %rdi
callq 0x588b0
jmp 0x109f2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10c29a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10c28e
movq -0x968(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
movl $0x208, %esi            # imm = 0x208
callq 0xa5e0
jmp 0x10c28e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x588b0
jmp 0x10c28e
leaq 0x914b2(%rip), %rdi     # 0x19b3e8
callq 0xa220
movq %rax, -0x978(%rbp)
leaq -0x1f1(%rbp), %rdi
movq %rdi, -0x970(%rbp)
callq 0xab60
movq -0x978(%rbp), %rsi
movq -0x970(%rbp), %rdx
leaq -0x1f0(%rbp), %rdi
callq 0x2d6c0
jmp 0x109f71
leaq -0x1f0(%rbp), %rdi
movl $0x8, %esi
callq 0x80e30
movq %rax, -0x980(%rbp)
jmp 0x109f8b
leaq -0x1f0(%rbp), %rdi
callq 0xac88
leaq -0x1f1(%rbp), %rdi
callq 0xa640
movq -0x980(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movl $0x208, %edi            # imm = 0x208
callq 0xa5d0
movq %rax, -0x988(%rbp)
jmp 0x109fc4
leaq 0x9143d(%rip), %rdi     # 0x19b408
callq 0xa220
movq -0x988(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0xab90
jmp 0x109fe6
movq -0x988(%rbp), %rax
movq %rax, -0x200(%rbp)
movl $0x208, %edi            # imm = 0x208
callq 0xa5d0
movq %rax, -0x990(%rbp)
jmp 0x10a007
leaq 0x9141a(%rip), %rdi     # 0x19b428
callq 0xa220
movq -0x990(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0xab90
jmp 0x10a029
movq -0x990(%rbp), %rax
movq %rax, -0x208(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x58920
leaq -0x268(%rbp), %rdi
callq 0x584b0
leaq -0x298(%rbp), %rdi
callq 0x951b0
leaq -0x2c8(%rbp), %rdi
callq 0x951d0
movq -0x200(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa0d0
movq %rax, -0x998(%rbp)
jmp 0x10a080
movq -0x998(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xa740
movb %al, -0x999(%rbp)
jmp 0x10a09e
movb -0x999(%rbp), %al
testb $0x1, %al
jne 0x10a0ad
jmp 0x10a248
leaq -0x2e0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x9, %edx
callq 0x7bbe0
jmp 0x10a0c4
leaq -0x2e0(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rsi
leaq -0x238(%rbp), %rdi
callq 0x6b400
movq %rax, -0x9a8(%rbp)
jmp 0x10a0ed
xorl %eax, %eax
movl %eax, %esi
leaq -0x2e0(%rbp), %rdi
callq 0x3d940
movq -0x9a8(%rbp), %rdi
movq %rax, %rsi
callq 0x48dc0
jmp 0x10a10e
leaq -0x2e0(%rbp), %rdi
movq %rdi, -0x9c0(%rbp)
movl $0x1, %esi
callq 0x3d940
movq -0x9c0(%rbp), %rdi
movq %rax, -0x9b8(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x3d940
movq %rax, %rsi
leaq -0x268(%rbp), %rdi
callq 0x584d0
movq %rax, -0x9b0(%rbp)
jmp 0x10a155
movq -0x9b8(%rbp), %rsi
movq -0x9b0(%rbp), %rdi
callq 0xa060
jmp 0x10a16a
leaq -0x2e0(%rbp), %rdi
callq 0x3dfa0
jmp 0x10a067
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a1ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0xac88
leaq -0x1f1(%rbp), %rdi
callq 0xa640
jmp 0x10c28e
movq -0x988(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
movl $0x208, %esi            # imm = 0x208
callq 0xa5e0
jmp 0x10c28e
movq -0x990(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
movl $0x208, %esi            # imm = 0x208
callq 0xa5e0
jmp 0x10c28e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10c25e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x3dfa0
jmp 0x10c25e
leaq -0x2f8(%rbp), %rdi
callq 0x48da0
leaq -0x238(%rbp), %rdi
callq 0x6c3d0
movq %rax, -0x300(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x6c430
movq %rax, -0x308(%rbp)
leaq -0x300(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x6c400
testb $0x1, %al
jne 0x10a293
jmp 0x10a2d7
leaq -0x300(%rbp), %rdi
callq 0x6c460
movq %rax, %rsi
leaq -0x2f8(%rbp), %rdi
callq 0x48dc0
jmp 0x10a2b0
jmp 0x10a2b2
leaq -0x300(%rbp), %rdi
callq 0x71fc0
jmp 0x10a267
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10c252
movq 0x8ed12(%rip), %rdi     # 0x198ff0
leaq 0x44718(%rip), %rsi     # 0x14e9fd
callq 0xa5c0
movq %rax, -0x9c8(%rbp)
jmp 0x10a2f3
leaq -0x2f8(%rbp), %rdi
callq 0x3ffd0
movq -0x9c8(%rbp), %rdi
movq %rax, %rsi
callq 0xa140
movq %rax, -0x9d0(%rbp)
jmp 0x10a317
movq -0x9d0(%rbp), %rdi
leaq 0x3244f(%rip), %rsi     # 0x13c774
callq 0xa5c0
movq %rax, -0x9d8(%rbp)
jmp 0x10a333
movq -0x9d8(%rbp), %rdi
movq 0x8ec47(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0x10a348
leaq -0x320(%rbp), %rdi
callq 0xffa70
leaq -0x338(%rbp), %rdi
callq 0x3f5f0
movq -0x208(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa0d0
movq %rax, -0x9e0(%rbp)
jmp 0x10a379
movq -0x9e0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xa740
movb %al, -0x9e1(%rbp)
jmp 0x10a397
movb -0x9e1(%rbp), %al
testb $0x1, %al
jne 0x10a3a6
jmp 0x10a990
leaq -0x350(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x9, %edx
callq 0x7bbe0
jmp 0x10a3bd
leaq -0x350(%rbp), %rdi
callq 0x3ffd0
cmpq $0x4, %rax
jne 0x10a3d1
jmp 0x10a407
leaq 0x42515(%rip), %rdi     # 0x14c8ed
leaq 0x42523(%rip), %rsi     # 0x14c902
movl $0x97, %edx
leaq 0x42523(%rip), %rcx     # 0x14c90e
callq 0xa390
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10c23a
leaq -0x338(%rbp), %rdi
leaq -0x350(%rbp), %rsi
callq 0x3f610
jmp 0x10a41c
movl $0x200, %edi            # imm = 0x200
callq 0xa5d0
movq %rax, -0x9f0(%rbp)
jmp 0x10a42f
movb $0x1, -0x539(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x350(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
leaq 0x35940(%rip), %rdx     # 0x13fd90
leaq -0x4f8(%rbp), %rdi
callq 0x3da80
jmp 0x10a45e
leaq -0x350(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rdx
leaq -0x4d8(%rbp), %rdi
leaq -0x4f8(%rbp), %rsi
callq 0x3da30
jmp 0x10a487
leaq 0x35902(%rip), %rdx     # 0x13fd90
leaq -0x4b8(%rbp), %rdi
leaq -0x4d8(%rbp), %rsi
callq 0x3e020
jmp 0x10a4a3
leaq -0x350(%rbp), %rdi
movl $0x2, %esi
callq 0x3d940
movq %rax, %rdx
leaq -0x498(%rbp), %rdi
leaq -0x4b8(%rbp), %rsi
callq 0x3da30
jmp 0x10a4cc
leaq 0x358bd(%rip), %rdx     # 0x13fd90
leaq -0x478(%rbp), %rdi
leaq -0x498(%rbp), %rsi
callq 0x3e020
jmp 0x10a4e8
leaq -0x350(%rbp), %rdi
movl $0x3, %esi
callq 0x3d940
movq %rax, %rdx
leaq -0x458(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x3da30
jmp 0x10a511
leaq 0x42410(%rip), %rdx     # 0x14c928
leaq -0x438(%rbp), %rdi
leaq -0x458(%rbp), %rsi
callq 0x3e020
jmp 0x10a52d
leaq 0x90f34(%rip), %rdx     # 0x19b468
leaq -0x418(%rbp), %rdi
leaq -0x438(%rbp), %rsi
callq 0x3da30
jmp 0x10a549
leaq 0x35840(%rip), %rdx     # 0x13fd90
leaq -0x3f8(%rbp), %rdi
leaq -0x418(%rbp), %rsi
callq 0x3e020
jmp 0x10a565
movl 0x8f4ad(%rip), %esi     # 0x199a18
leaq -0x518(%rbp), %rdi
callq 0x3e190
jmp 0x10a579
leaq -0x3d8(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
leaq -0x518(%rbp), %rdx
callq 0x3e070
jmp 0x10a595
leaq 0x357f4(%rip), %rdx     # 0x13fd90
leaq -0x3b8(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0x3e020
jmp 0x10a5b1
movl 0x8f465(%rip), %esi     # 0x199a1c
leaq -0x538(%rbp), %rdi
callq 0x3e190
jmp 0x10a5c5
leaq -0x398(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
leaq -0x538(%rbp), %rdx
callq 0x3e070
jmp 0x10a5e1
leaq 0x3efbf(%rip), %rdx     # 0x1495a7
leaq -0x378(%rbp), %rdi
leaq -0x398(%rbp), %rsi
callq 0x3e020
jmp 0x10a5fd
movq -0x9f0(%rbp), %rdi
leaq -0x378(%rbp), %rsi
movl $0x10, %edx
callq 0xac00
jmp 0x10a617
movb $0x0, -0x539(%rbp)
leaq -0x378(%rbp), %rdi
callq 0xac88
leaq -0x398(%rbp), %rdi
callq 0xac88
leaq -0x538(%rbp), %rdi
callq 0xac88
leaq -0x3b8(%rbp), %rdi
callq 0xac88
leaq -0x3d8(%rbp), %rdi
callq 0xac88
leaq -0x518(%rbp), %rdi
callq 0xac88
leaq -0x3f8(%rbp), %rdi
callq 0xac88
leaq -0x418(%rbp), %rdi
callq 0xac88
leaq -0x438(%rbp), %rdi
callq 0xac88
leaq -0x458(%rbp), %rdi
callq 0xac88
leaq -0x478(%rbp), %rdi
callq 0xac88
leaq -0x498(%rbp), %rdi
callq 0xac88
leaq -0x4b8(%rbp), %rdi
callq 0xac88
leaq -0x4d8(%rbp), %rdi
callq 0xac88
leaq -0x4f8(%rbp), %rdi
callq 0xac88
movq -0x9f0(%rbp), %rax
movq %rax, -0x358(%rbp)
movq -0x358(%rbp), %rdi
leaq 0x42240(%rip), %rsi     # 0x14c92e
callq 0xa5c0
movq %rax, -0x9f8(%rbp)
jmp 0x10a6fc
movq -0x9f8(%rbp), %rdi
movq 0x8e87e(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0x10a711
leaq -0x320(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0xffa90
jmp 0x10a726
leaq -0x350(%rbp), %rdi
callq 0x3dfa0
jmp 0x10a360
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a97f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a961
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a955
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a949
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a93d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a931
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a925
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a919
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a90d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a901
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a8f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a8e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a8dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a8d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a8c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10a8b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x378(%rbp), %rdi
callq 0xac88
leaq -0x398(%rbp), %rdi
callq 0xac88
leaq -0x538(%rbp), %rdi
callq 0xac88
leaq -0x3b8(%rbp), %rdi
callq 0xac88
leaq -0x3d8(%rbp), %rdi
callq 0xac88
leaq -0x518(%rbp), %rdi
callq 0xac88
leaq -0x3f8(%rbp), %rdi
callq 0xac88
leaq -0x418(%rbp), %rdi
callq 0xac88
leaq -0x438(%rbp), %rdi
callq 0xac88
leaq -0x458(%rbp), %rdi
callq 0xac88
leaq -0x478(%rbp), %rdi
callq 0xac88
leaq -0x498(%rbp), %rdi
callq 0xac88
leaq -0x4b8(%rbp), %rdi
callq 0xac88
leaq -0x4d8(%rbp), %rdi
callq 0xac88
leaq -0x4f8(%rbp), %rdi
callq 0xac88
testb $0x1, -0x539(%rbp)
jne 0x10a96c
jmp 0x10a97d
movq -0x9f0(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0xa5e0
jmp 0x10a97f
leaq -0x350(%rbp), %rdi
callq 0x3dfa0
jmp 0x10c23a
movslq 0x8f081(%rip), %rax     # 0x199a18
movq %rax, -0xa08(%rbp)
movq $0x0, -0x598(%rbp)
leaq -0x599(%rbp), %rdi
movq %rdi, -0xa00(%rbp)
callq 0x484d0
movq -0xa08(%rbp), %rsi
movq -0xa00(%rbp), %rcx
leaq -0x590(%rbp), %rdi
leaq -0x598(%rbp), %rdx
callq 0xffb00
jmp 0x10a9df
leaq -0x599(%rbp), %rdi
callq 0x4a130
leaq -0x5b9(%rbp), %rdi
movq %rdi, -0xa10(%rbp)
callq 0xffb80
movq -0xa10(%rbp), %rcx
leaq -0x5b8(%rbp), %rdi
movl $0x3, %esi
leaq -0x590(%rbp), %rdx
callq 0xffba0
jmp 0x10aa1f
leaq -0x5b9(%rbp), %rdi
callq 0xffc20
leaq -0x338(%rbp), %rdi
callq 0x409f0
movq %rax, -0xa20(%rbp)
leaq -0x5d9(%rbp), %rdi
movq %rdi, -0xa18(%rbp)
callq 0xffc40
movq -0xa20(%rbp), %rsi
movq -0xa18(%rbp), %rcx
leaq -0x5d8(%rbp), %rdi
leaq -0x5b8(%rbp), %rdx
callq 0xffc60
jmp 0x10aa74
leaq -0x5d9(%rbp), %rdi
callq 0xffce0
movl $0x0, -0x5e0(%rbp)
leaq -0x338(%rbp), %rdi
callq 0x409f0
movq %rax, -0xa30(%rbp)
movl $0x0, -0x5fc(%rbp)
leaq -0x5fd(%rbp), %rdi
movq %rdi, -0xa28(%rbp)
callq 0x46300
movq -0xa30(%rbp), %rsi
movq -0xa28(%rbp), %rcx
leaq -0x5f8(%rbp), %rdi
leaq -0x5fc(%rbp), %rdx
callq 0x83540
jmp 0x10aadd
leaq -0x5fd(%rbp), %rdi
callq 0x483e0
leaq -0x618(%rbp), %rdi
callq 0x48da0
leaq -0x630(%rbp), %rdi
callq 0x48da0
movl $0x3e8, -0x634(%rbp)    # imm = 0x3E8
leaq -0x658(%rbp), %rdi
callq 0xa820
leaq -0x678(%rbp), %rdi
callq 0xa820
movq -0x1d0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa0d0
movq %rax, -0xa38(%rbp)
jmp 0x10ab3c
movq -0xa38(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xa740
movb %al, -0xa39(%rbp)
jmp 0x10ab5a
movb -0xa39(%rbp), %al
testb $0x1, %al
jne 0x10ab69
jmp 0x10c0fc
leaq -0x30(%rbp), %rdi
movq %rdi, -0xa50(%rbp)
callq 0xa4f0
movq -0xa50(%rbp), %rdi
movq %rax, -0x6c0(%rbp)
callq 0xa330
movq %rax, -0x6c8(%rbp)
movb $0xd, -0x6c9(%rbp)
movq -0x6c0(%rbp), %rdi
movq -0x6c8(%rbp), %rsi
leaq -0x6c9(%rbp), %rdx
callq 0xc6570
movq %rax, -0xa48(%rbp)
jmp 0x10abbd
movq -0xa48(%rbp), %rax
movq %rax, -0x6b8(%rbp)
leaq -0x6b0(%rbp), %rdi
leaq -0x6b8(%rbp), %rsi
callq 0xc65c0
leaq -0x30(%rbp), %rdi
movq %rdi, -0xa60(%rbp)
callq 0xa330
movq %rax, -0x6e0(%rbp)
leaq -0x6d8(%rbp), %rdi
leaq -0x6e0(%rbp), %rsi
callq 0xc65c0
movq -0xa60(%rbp), %rdi
movq -0x6b0(%rbp), %rsi
movq -0x6d8(%rbp), %rdx
callq 0xa120
movq %rax, -0xa58(%rbp)
jmp 0x10ac2b
movq -0xa58(%rbp), %rax
movq %rax, -0x6e8(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0xac60
movq %rax, -0xa68(%rbp)
jmp 0x10ac4f
movq -0xa68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x10ad34
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0xac60
movq %rax, -0xa70(%rbp)
jmp 0x10ac79
movq -0xa70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x10ad34
jmp 0x10ab23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x599(%rbp), %rdi
callq 0x4a130
jmp 0x10c23a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x5b9(%rbp), %rdi
callq 0xffc20
jmp 0x10c22e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x5d9(%rbp), %rdi
callq 0xffce0
jmp 0x10c222
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x5fd(%rbp), %rdi
callq 0x483e0
jmp 0x10c216
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10c1da
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0xac60
movq %rax, -0xa78(%rbp)
jmp 0x10ad4a
movq -0xa78(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x10b17f
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0xac60
movq %rax, -0xa80(%rbp)
jmp 0x10ad74
movq -0xa80(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x43, %eax
jne 0x10b17f
leaq -0x700(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x9, %edx
callq 0x7bbe0
jmp 0x10ad9e
leaq -0x630(%rbp), %rdi
movq %rdi, -0xa90(%rbp)
leaq -0x700(%rbp), %rsi
movq %rsi, -0xa98(%rbp)
callq 0x50c30
movq -0xa98(%rbp), %rdi
callq 0x3dfa0
movq -0xa90(%rbp), %rdi
callq 0x44030
movq %rax, -0x728(%rbp)
leaq -0x728(%rbp), %rdi
movl $0x9, %esi
callq 0x44390
movq -0xa90(%rbp), %rdi
movq %rax, -0x720(%rbp)
callq 0x44060
movq %rax, -0x730(%rbp)
leaq -0x731(%rbp), %rdi
movq %rdi, -0xa88(%rbp)
callq 0x48e80
movq -0xa88(%rbp), %rcx
movq -0x720(%rbp), %rsi
movq -0x730(%rbp), %rdx
leaq -0x718(%rbp), %rdi
callq 0xc6600
jmp 0x10ae3f
leaq -0x731(%rbp), %rdi
callq 0x40090
movq $0x0, -0x740(%rbp)
movq -0x740(%rbp), %rax
movq %rax, -0xaa0(%rbp)
leaq -0x718(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0xaa0(%rbp), %rax
cmpq %rcx, %rax
je 0x10af32
movq -0x740(%rbp), %rsi
leaq -0x718(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
leaq -0x268(%rbp), %rdi
callq 0x584d0
movq %rax, -0xaa8(%rbp)
jmp 0x10aeae
leaq -0x2c8(%rbp), %rdi
leaq -0x740(%rbp), %rsi
callq 0x95260
movq %rax, -0xab0(%rbp)
jmp 0x10aeca
movq -0xaa8(%rbp), %rsi
movq -0xab0(%rbp), %rdi
callq 0xa060
jmp 0x10aedf
jmp 0x10aee1
movq -0x740(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x740(%rbp)
jmp 0x10ae56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x731(%rbp), %rdi
callq 0x40090
jmp 0x10c1da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10b16e
leaq -0x238(%rbp), %rdi
callq 0x6c3d0
movq %rax, -0x748(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x6c430
movq %rax, -0x750(%rbp)
leaq -0x748(%rbp), %rdi
leaq -0x750(%rbp), %rsi
callq 0x6c400
testb $0x1, %al
jne 0x10af74
jmp 0x10b151
leaq -0x748(%rbp), %rdi
callq 0x6c460
movq %rax, %rsi
leaq -0x770(%rbp), %rdi
callq 0xa250
jmp 0x10af91
leaq -0x748(%rbp), %rdi
callq 0x6c460
movq %rax, %rsi
addq $0x20, %rsi
leaq -0x788(%rbp), %rdi
callq 0x3fee0
jmp 0x10afb2
leaq -0x7a0(%rbp), %rdi
leaq -0x718(%rbp), %rsi
leaq -0x788(%rbp), %rdx
callq 0x81250
jmp 0x10afce
leaq -0x7a0(%rbp), %rdi
callq 0x95340
testb $0x1, %al
jne 0x10afe3
jmp 0x10b0d1
movq 0x8e006(%rip), %rdi     # 0x198ff0
leaq 0x318ea(%rip), %rsi     # 0x13c8db
callq 0xa5c0
movq %rax, -0xab8(%rbp)
jmp 0x10afff
movq -0xab8(%rbp), %rdi
leaq -0x770(%rbp), %rsi
callq 0xa520
movq %rax, -0xac0(%rbp)
jmp 0x10b01b
movq -0xac0(%rbp), %rdi
leaq 0x303e6(%rip), %rsi     # 0x13b40f
callq 0xa5c0
movq %rax, -0xac8(%rbp)
jmp 0x10b037
movq -0xac8(%rbp), %rdi
movq 0x8df43(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0x10b04c
leaq -0x7a0(%rbp), %rdi
callq 0x95340
xorb $-0x1, %al
testb $0x1, %al
jne 0x10b060
jmp 0x10b062
jmp 0x10b0cf
leaq 0x3189c(%rip), %rdi     # 0x13c905
leaq 0x41892(%rip), %rsi     # 0x14c902
movl $0xc6, %edx
leaq 0x41892(%rip), %rcx     # 0x14c90e
callq 0xa390
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10b143
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10b137
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x7a0(%rbp), %rdi
callq 0x50d40
jmp 0x10b137
jmp 0x10b0d1
leaq -0x298(%rbp), %rdi
leaq -0x770(%rbp), %rsi
callq 0x95380
movq %rax, -0xad0(%rbp)
jmp 0x10b0ed
movq -0xad0(%rbp), %rdi
leaq -0x7a0(%rbp), %rsi
callq 0x95460
jmp 0x10b102
leaq -0x7a0(%rbp), %rdi
callq 0x50d40
leaq -0x788(%rbp), %rdi
callq 0x3dfa0
leaq -0x770(%rbp), %rdi
callq 0xac88
leaq -0x748(%rbp), %rdi
callq 0x71fc0
jmp 0x10af45
leaq -0x788(%rbp), %rdi
callq 0x3dfa0
leaq -0x770(%rbp), %rdi
callq 0xac88
jmp 0x10b16e
callq 0xa3a0
movq %rax, -0x680(%rbp)
leaq -0x718(%rbp), %rdi
callq 0x3dfa0
jmp 0x10c0f5
leaq -0x718(%rbp), %rdi
callq 0x3dfa0
jmp 0x10c1da
movl -0x5e0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5e0(%rbp)
movl -0x5e0(%rbp), %eax
cltd
idivl -0x634(%rbp)
cmpl $0x0, %edx
jne 0x10b312
callq 0xa3a0
movq -0x680(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x2e268(%rip), %xmm1    # 0x139428
divsd %xmm1, %xmm0
movsd %xmm0, -0x698(%rbp)
movq 0x8de1d(%rip), %rdi     # 0x198ff0
leaq 0x3176c(%rip), %rsi     # 0x13c946
callq 0xa5c0
movq %rax, -0xad8(%rbp)
jmp 0x10b1e8
movq -0xad8(%rbp), %rdi
movl -0x5e0(%rbp), %esi
callq 0xab20
movq %rax, -0xae0(%rbp)
jmp 0x10b203
movq -0xae0(%rbp), %rdi
leaq 0x34971(%rip), %rsi     # 0x13fb82
callq 0xa5c0
movq %rax, -0xae8(%rbp)
jmp 0x10b21f
movq -0xae8(%rbp), %rdi
movsd -0x698(%rbp), %xmm0
callq 0xabd0
movq %rax, -0xaf0(%rbp)
jmp 0x10b23c
movq -0xaf0(%rbp), %rdi
leaq 0x3789e(%rip), %rsi     # 0x142ae8
callq 0xa5c0
movq %rax, -0xaf8(%rbp)
jmp 0x10b258
movq -0xaf8(%rbp), %rdi
movq 0x8dd22(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0x10b26d
movq 0x8dd7c(%rip), %rdi     # 0x198ff0
leaq 0x3ebc5(%rip), %rsi     # 0x149e40
callq 0xa5c0
movq %rax, -0xb00(%rbp)
jmp 0x10b289
movq -0xb00(%rbp), %rdi
movsd -0x6a0(%rbp), %xmm0
callq 0xabd0
movq %rax, -0xb08(%rbp)
jmp 0x10b2a6
movq -0xb08(%rbp), %rdi
leaq 0x3eb9b(%rip), %rsi     # 0x149e4f
callq 0xa5c0
movq %rax, -0xb10(%rbp)
jmp 0x10b2c2
movq -0xb10(%rbp), %rdi
movsd -0x6a8(%rbp), %xmm0
callq 0xabd0
movq %rax, -0xb18(%rbp)
jmp 0x10b2df
movq -0xb18(%rbp), %rdi
leaq 0x377fb(%rip), %rsi     # 0x142ae8
callq 0xa5c0
movq %rax, -0xb20(%rbp)
jmp 0x10b2fb
movq -0xb20(%rbp), %rdi
movq 0x8dc7f(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0x10b310
jmp 0x10b312
leaq -0x7b8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x9, %edx
callq 0x7bbe0
jmp 0x10b329
leaq -0x630(%rbp), %rdi
movq %rdi, -0xb28(%rbp)
leaq -0x7b8(%rbp), %rsi
movq %rsi, -0xb30(%rbp)
callq 0x50c30
movq -0xb30(%rbp), %rdi
callq 0x3dfa0
movq -0xb28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3d940
movq %rax, %rsi
leaq -0x658(%rbp), %rdi
callq 0xa060
jmp 0x10b377
leaq -0x630(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rsi
leaq -0x678(%rbp), %rdi
callq 0xa060
jmp 0x10b399
leaq -0x630(%rbp), %rdi
movq %rdi, -0xb40(%rbp)
callq 0x44030
movq %rax, -0x7e0(%rbp)
leaq -0x7e0(%rbp), %rdi
movl $0x9, %esi
callq 0x44390
movq -0xb40(%rbp), %rdi
movq %rax, -0x7d8(%rbp)
callq 0x44060
movq %rax, -0x7e8(%rbp)
leaq -0x7e9(%rbp), %rdi
movq %rdi, -0xb38(%rbp)
callq 0x48e80
movq -0xb38(%rbp), %rcx
movq -0x7d8(%rbp), %rsi
movq -0x7e8(%rbp), %rdx
leaq -0x7d0(%rbp), %rdi
callq 0xc6600
jmp 0x10b414
leaq -0x7e9(%rbp), %rdi
callq 0x40090
leaq -0x630(%rbp), %rdi
movl $0x3, %esi
callq 0x3d940
movq %rax, %rsi
leaq -0x810(%rbp), %rdi
callq 0xa250
jmp 0x10b442
leaq -0x630(%rbp), %rdi
movl $0x4, %esi
callq 0x3d940
movq %rax, %rsi
leaq -0x830(%rbp), %rdi
callq 0xa250
jmp 0x10b464
leaq -0x810(%rbp), %rdi
callq 0xa930
cmpq $0x1, %rax
ja 0x10b4b2
leaq -0x830(%rbp), %rdi
callq 0xa930
cmpq $0x1, %rax
ja 0x10b4b2
leaq 0x42d53(%rip), %rsi     # 0x14e1e2
leaq -0x830(%rbp), %rdi
callq 0x2d770
movb %al, -0xb41(%rbp)
jmp 0x10b4a3
movb -0xb41(%rbp), %al
testb $0x1, %al
jne 0x10b4b2
jmp 0x10b588
leaq -0x810(%rbp), %rdi
movq %rdi, -0xb60(%rbp)
callq 0xa7b0
movq -0xb60(%rbp), %rdi
callq 0xac30
leaq -0x830(%rbp), %rdi
movq %rdi, -0xb58(%rbp)
callq 0xa7b0
movq -0xb58(%rbp), %rdi
callq 0xac30
leaq -0x7d0(%rbp), %rdi
movq %rdi, -0xb50(%rbp)
callq 0x591f0
movq -0xb50(%rbp), %rdi
callq 0xc6680
jmp 0x10b511
movl $0x9, -0x834(%rbp)
jmp 0x10c089
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x7e9(%rbp), %rdi
callq 0x40090
jmp 0x10c1da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10c0e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10c0d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10c0cc
callq 0xa3a0
movq %rax, -0x688(%rbp)
movl $0x240, %edi            # imm = 0x240
callq 0xa5d0
movq %rax, -0xb68(%rbp)
jmp 0x10b5a7
leaq -0x7d0(%rbp), %rdi
callq 0x3ffd0
movq -0xb68(%rbp), %rdi
movl %eax, %edx
leaq -0x298(%rbp), %rsi
callq 0xc66a0
jmp 0x10b5ca
movq -0xb68(%rbp), %rax
movq %rax, -0x840(%rbp)
movq -0x840(%rbp), %rdi
leaq -0x7d0(%rbp), %rsi
leaq -0x2c8(%rbp), %rdx
callq 0x7b530
jmp 0x10b5f4
leaq -0x7d0(%rbp), %rdi
movq %rdi, -0xb70(%rbp)
callq 0x591f0
movq -0xb70(%rbp), %rdi
callq 0xc6680
jmp 0x10b615
callq 0xa3a0
movq -0x688(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x2ddf7(%rip), %xmm1    # 0x139428
divsd %xmm1, %xmm0
movsd %xmm0, -0x6a0(%rbp)
callq 0xa3a0
movq %rax, -0x690(%rbp)
leaq -0x678(%rbp), %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, %ecx
leaq -0x858(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0x658(%rbp), %rdx
callq 0x8f3e0
jmp 0x10b67b
movl $0x0, -0x87c(%rbp)
movslq -0x87c(%rbp), %rax
movq %rax, -0xb78(%rbp)
leaq -0x338(%rbp), %rdi
callq 0x409f0
movq %rax, %rcx
movq -0xb78(%rbp), %rax
cmpq %rcx, %rax
je 0x10c01d
movq -0x840(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0xb88(%rbp)
movslq -0x87c(%rbp), %rsi
leaq -0x338(%rbp), %rdi
callq 0x3ec10
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3d940
movq -0xb88(%rbp), %rdi
movq %rax, %rsi
callq 0x847c0
movq %rax, -0xb80(%rbp)
jmp 0x10b6fd
movq -0xb80(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x860(%rbp)
movsd -0x860(%rbp), %xmm0
movsd 0x27fa0(%rip), %xmm1    # 0x1336c0
ucomisd %xmm1, %xmm0
jne 0x10b76c
jp 0x10b76c
jmp 0x10bff8
movq -0xb68(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
movl $0x240, %esi            # imm = 0x240
callq 0xa5e0
jmp 0x10c0cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10c0c0
movq -0x840(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0xb98(%rbp)
movslq -0x87c(%rbp), %rsi
leaq -0x338(%rbp), %rdi
callq 0x3ec10
movq %rax, %rdi
movl $0x1, %esi
callq 0x3d940
movq -0xb98(%rbp), %rdi
movq %rax, %rsi
callq 0x847c0
movq %rax, -0xb90(%rbp)
jmp 0x10b7b8
movq -0xb90(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x868(%rbp)
movsd -0x868(%rbp), %xmm0
movsd 0x27ee5(%rip), %xmm1    # 0x1336c0
ucomisd %xmm1, %xmm0
jne 0x10b7e8
jp 0x10b7e8
jmp 0x10bff8
movq -0x840(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0xba8(%rbp)
movslq -0x87c(%rbp), %rsi
leaq -0x338(%rbp), %rdi
callq 0x3ec10
movq %rax, %rdi
movl $0x2, %esi
callq 0x3d940
movq -0xba8(%rbp), %rdi
movq %rax, %rsi
callq 0x847c0
movq %rax, -0xba0(%rbp)
jmp 0x10b834
movq -0xba0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x870(%rbp)
movsd -0x870(%rbp), %xmm0
movsd 0x27e69(%rip), %xmm1    # 0x1336c0
ucomisd %xmm1, %xmm0
jne 0x10b864
jp 0x10b864
jmp 0x10bff8
movq -0x840(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0xbb8(%rbp)
movslq -0x87c(%rbp), %rsi
leaq -0x338(%rbp), %rdi
callq 0x3ec10
movq %rax, %rdi
movl $0x3, %esi
callq 0x3d940
movq -0xbb8(%rbp), %rdi
movq %rax, %rsi
callq 0x847c0
movq %rax, -0xbb0(%rbp)
jmp 0x10b8b0
movq -0xbb0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x878(%rbp)
movsd -0x878(%rbp), %xmm0
movsd 0x27ded(%rip), %xmm1    # 0x1336c0
ucomisd %xmm1, %xmm0
jne 0x10b8e0
jp 0x10b8e0
jmp 0x10bff8
movsd -0x860(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x10b931
jp 0x10b931
movsd -0x868(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x10b931
jp 0x10b931
movsd -0x870(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x10b931
jp 0x10b931
movsd -0x878(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x10b931
jp 0x10b931
jmp 0x10bff8
movsd -0x860(%rbp), %xmm0
movsd 0x26977(%rip), %xmm1    # 0x1322b8
ucomisd %xmm1, %xmm0
jne 0x10b996
jp 0x10b996
movsd -0x868(%rbp), %xmm0
movsd 0x2695f(%rip), %xmm1    # 0x1322b8
ucomisd %xmm1, %xmm0
jne 0x10b996
jp 0x10b996
movsd -0x870(%rbp), %xmm0
movsd 0x26947(%rip), %xmm1    # 0x1322b8
ucomisd %xmm1, %xmm0
jne 0x10b996
jp 0x10b996
movsd -0x878(%rbp), %xmm0
movsd 0x2692f(%rip), %xmm1    # 0x1322b8
ucomisd %xmm1, %xmm0
jne 0x10b996
jp 0x10b996
jmp 0x10bff8
movslq -0x87c(%rbp), %rsi
leaq -0x5f8(%rbp), %rdi
callq 0x4d100
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movsd -0x860(%rbp), %xmm0
movsd %xmm0, -0xbe8(%rbp)
movsd -0x868(%rbp), %xmm0
movsd %xmm0, -0xbe0(%rbp)
movsd -0x870(%rbp), %xmm0
movsd %xmm0, -0xbd8(%rbp)
movsd -0x878(%rbp), %xmm0
movsd %xmm0, -0xbd0(%rbp)
movq -0x840(%rbp), %rax
addq $0x68, %rax
movq %rax, -0xbc8(%rbp)
movslq -0x87c(%rbp), %rsi
leaq -0x338(%rbp), %rdi
callq 0x3ec10
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3d940
movq -0xbc8(%rbp), %rdi
movq %rax, %rsi
callq 0x83190
movq %rax, -0xbc0(%rbp)
jmp 0x10ba38
movq -0xbc0(%rbp), %rax
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0xc00(%rbp)
movq -0x840(%rbp), %rax
addq $0x68, %rax
movq %rax, -0xbf8(%rbp)
movslq -0x87c(%rbp), %rsi
leaq -0x338(%rbp), %rdi
callq 0x3ec10
movq %rax, %rdi
movl $0x1, %esi
callq 0x3d940
movq -0xbf8(%rbp), %rdi
movq %rax, %rsi
callq 0x83190
movq %rax, -0xbf0(%rbp)
jmp 0x10ba95
movq -0xbf0(%rbp), %rax
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0xc18(%rbp)
movq -0x840(%rbp), %rax
addq $0x68, %rax
movq %rax, -0xc10(%rbp)
movslq -0x87c(%rbp), %rsi
leaq -0x338(%rbp), %rdi
callq 0x3ec10
movq %rax, %rdi
movl $0x2, %esi
callq 0x3d940
movq -0xc10(%rbp), %rdi
movq %rax, %rsi
callq 0x83190
movq %rax, -0xc08(%rbp)
jmp 0x10baf2
movq -0xc08(%rbp), %rax
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0xc30(%rbp)
movq -0x840(%rbp), %rax
addq $0x68, %rax
movq %rax, -0xc28(%rbp)
movslq -0x87c(%rbp), %rsi
leaq -0x338(%rbp), %rdi
callq 0x3ec10
movq %rax, %rdi
movl $0x3, %esi
callq 0x3d940
movq -0xc28(%rbp), %rdi
movq %rax, %rsi
callq 0x83190
movq %rax, -0xc20(%rbp)
jmp 0x10bb4f
movsd -0xc30(%rbp), %xmm6
movsd -0xc18(%rbp), %xmm5
movsd -0xc00(%rbp), %xmm4
movsd -0xbd0(%rbp), %xmm3
movsd -0xbd8(%rbp), %xmm2
movsd -0xbe0(%rbp), %xmm1
movsd -0xbe8(%rbp), %xmm0
movq -0xc20(%rbp), %rax
cvtsi2sdl (%rax), %xmm7
leaq -0x898(%rbp), %rdi
callq 0x10c700
jmp 0x10bba0
movslq -0x87c(%rbp), %rsi
leaq -0x5d8(%rbp), %rdi
callq 0x100340
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0xc40(%rbp)
callq 0x100360
movq -0xc40(%rbp), %rsi
movq %rax, -0xc38(%rbp)
leaq -0x898(%rbp), %rdi
callq 0x3ec30
movq -0xc38(%rbp), %rdi
movq %rax, %rsi
callq 0x100380
jmp 0x10bbf1
movslq -0x87c(%rbp), %rsi
leaq -0x5d8(%rbp), %rdi
callq 0x100340
movq %rax, %rdi
movl $0x1, %esi
movq %rsi, -0xc50(%rbp)
callq 0x100360
movq -0xc50(%rbp), %rsi
movq %rax, -0xc48(%rbp)
leaq -0x898(%rbp), %rdi
callq 0x3ec30
movq -0xc48(%rbp), %rdi
movq %rax, %rsi
callq 0x100380
jmp 0x10bc43
movslq -0x87c(%rbp), %rsi
leaq -0x5d8(%rbp), %rdi
callq 0x100340
movq %rax, %rdi
movl $0x2, %esi
callq 0x100360
movq %rax, -0xc58(%rbp)
leaq -0x8c0(%rbp), %rdi
leaq -0x678(%rbp), %rsi
callq 0xa250
jmp 0x10bc7f
leaq -0x8c0(%rbp), %rdi
callq 0x7bab0
movsd %xmm0, -0xc60(%rbp)
jmp 0x10bc95
movq -0xc58(%rbp), %rdi
movsd -0xc60(%rbp), %xmm0
movsd %xmm0, -0x8a0(%rbp)
leaq -0x8a0(%rbp), %rsi
callq 0x1003e0
jmp 0x10bcba
leaq -0x8c0(%rbp), %rdi
callq 0xac88
movslq -0x87c(%rbp), %rsi
leaq -0x5d8(%rbp), %rdi
callq 0x100340
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x100360
movq %rax, %rdi
callq 0x100410
movslq -0x87c(%rbp), %rsi
leaq -0x5d8(%rbp), %rdi
callq 0x100340
movq %rax, %rdi
movl $0x1, %esi
callq 0x100360
movq %rax, %rdi
callq 0x100410
movslq -0x87c(%rbp), %rsi
leaq -0x5d8(%rbp), %rdi
callq 0x100340
movq %rax, %rdi
movl $0x2, %esi
callq 0x100360
movq %rax, %rdi
callq 0x100410
movslq -0x87c(%rbp), %rsi
leaq -0x5f8(%rbp), %rdi
callq 0x4d100
movl (%rax), %eax
cmpl 0x8dcc0(%rip), %eax     # 0x199a18
jle 0x10bfec
movslq -0x87c(%rbp), %rsi
leaq -0x5f8(%rbp), %rdi
callq 0x4d100
movl (%rax), %eax
cltd
idivl 0x8dca2(%rip)           # 0x199a1c
cmpl $0x0, %edx
jne 0x10bfec
movslq -0x87c(%rbp), %rsi
leaq -0x320(%rbp), %rdi
callq 0xffd00
movq (%rax), %rdi
leaq -0x658(%rbp), %rsi
callq 0xa520
movq %rax, -0xc68(%rbp)
jmp 0x10bdae
movq -0xc68(%rbp), %rdi
leaq 0x2a122(%rip), %rsi     # 0x135ede
callq 0xa5c0
movq %rax, -0xc70(%rbp)
jmp 0x10bdca
movslq -0x87c(%rbp), %rsi
leaq -0x5d8(%rbp), %rdi
callq 0x100340
movq %rax, %rdi
movl $0x2, %esi
callq 0x100360
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x100480
movq -0xc70(%rbp), %rdi
movsd (%rax), %xmm0
callq 0xabd0
movq %rax, -0xc78(%rbp)
jmp 0x10be0f
movq -0xc78(%rbp), %rdi
leaq 0x2a0c1(%rip), %rsi     # 0x135ede
callq 0xa5c0
movq %rax, -0xc80(%rbp)
jmp 0x10be2b
movq -0xc80(%rbp), %rdi
leaq -0x678(%rbp), %rsi
callq 0xa520
movq %rax, -0xc88(%rbp)
jmp 0x10be47
movq -0xc88(%rbp), %rdi
leaq 0x2a089(%rip), %rsi     # 0x135ede
callq 0xa5c0
movq %rax, -0xc90(%rbp)
jmp 0x10be63
movslq -0x87c(%rbp), %rsi
leaq -0x5d8(%rbp), %rdi
callq 0x100340
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x100360
movq %rax, %rsi
leaq -0x910(%rbp), %rdi
callq 0x100570
jmp 0x10be93
leaq -0x910(%rbp), %rdi
callq 0x1004b0
movsd %xmm0, -0xc98(%rbp)
jmp 0x10bea9
movsd -0xc98(%rbp), %xmm0
movq -0xc90(%rbp), %rdi
callq 0xabd0
movq %rax, -0xca0(%rbp)
jmp 0x10bec6
movq -0xca0(%rbp), %rdi
leaq 0x2a00a(%rip), %rsi     # 0x135ede
callq 0xa5c0
movq %rax, -0xca8(%rbp)
jmp 0x10bee2
movslq -0x87c(%rbp), %rsi
leaq -0x5d8(%rbp), %rdi
callq 0x100340
movq %rax, %rdi
movl $0x1, %esi
callq 0x100360
movq %rax, %rsi
leaq -0x960(%rbp), %rdi
callq 0x100570
jmp 0x10bf13
leaq -0x960(%rbp), %rdi
callq 0x1004b0
movsd %xmm0, -0xcb0(%rbp)
jmp 0x10bf29
movsd -0xcb0(%rbp), %xmm0
movq -0xca8(%rbp), %rdi
callq 0xabd0
movq %rax, -0xcb8(%rbp)
jmp 0x10bf46
movq -0xcb8(%rbp), %rdi
movq 0x8d034(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0x10bf5b
leaq -0x960(%rbp), %rdi
callq 0x100690
leaq -0x910(%rbp), %rdi
callq 0x100690
jmp 0x10bfec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10c00c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x8c0(%rbp), %rdi
callq 0xac88
jmp 0x10c00c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
jmp 0x10bfde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0x960(%rbp), %rdi
callq 0x100690
leaq -0x910(%rbp), %rdi
callq 0x100690
jmp 0x10c00c
leaq -0x898(%rbp), %rdi
callq 0x3ecb0
movl -0x87c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x87c(%rbp)
jmp 0x10b685
leaq -0x898(%rbp), %rdi
callq 0x3ecb0
jmp 0x10c0c0
callq 0xa3a0
subq -0x690(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x2d3f2(%rip), %xmm1    # 0x139428
divsd %xmm1, %xmm0
movsd %xmm0, -0x6a8(%rbp)
movq -0x840(%rbp), %rax
movq %rax, -0xcc0(%rbp)
cmpq $0x0, %rax
je 0x10c073
movq -0xcc0(%rbp), %rdi
callq 0xc6bd0
movq -0xcc0(%rbp), %rdi
movl $0x240, %esi            # imm = 0x240
callq 0xa5e0
leaq -0x858(%rbp), %rdi
callq 0x3dfa0
movl $0x0, -0x834(%rbp)
leaq -0x830(%rbp), %rdi
callq 0xac88
leaq -0x810(%rbp), %rdi
callq 0xac88
leaq -0x7d0(%rbp), %rdi
callq 0x3dfa0
movl -0x834(%rbp), %eax
testl %eax, %eax
je 0x10c0be
jmp 0x10c0b9
jmp 0x10ab23
jmp 0x10c0f5
leaq -0x858(%rbp), %rdi
callq 0x3dfa0
leaq -0x830(%rbp), %rdi
callq 0xac88
leaq -0x810(%rbp), %rdi
callq 0xac88
leaq -0x7d0(%rbp), %rdi
callq 0x3dfa0
jmp 0x10c1da
jmp 0x10c0f7
jmp 0x10ab23
movl $0x1, -0x834(%rbp)
leaq -0x678(%rbp), %rdi
callq 0xac88
leaq -0x658(%rbp), %rdi
callq 0xac88
leaq -0x630(%rbp), %rdi
callq 0x3dfa0
leaq -0x618(%rbp), %rdi
callq 0x3dfa0
leaq -0x5f8(%rbp), %rdi
callq 0x48290
leaq -0x5d8(%rbp), %rdi
callq 0x100700
leaq -0x5b8(%rbp), %rdi
callq 0x100760
leaq -0x590(%rbp), %rdi
callq 0x100690
leaq -0x338(%rbp), %rdi
callq 0x3ec50
leaq -0x320(%rbp), %rdi
callq 0x1007c0
leaq -0x2f8(%rbp), %rdi
callq 0x3dfa0
leaq -0x2c8(%rbp), %rdi
callq 0x95b50
leaq -0x298(%rbp), %rdi
callq 0x95b70
leaq -0x268(%rbp), %rdi
callq 0x58620
leaq -0x238(%rbp), %rdi
callq 0x58f00
leaq -0xf0(%rbp), %rdi
callq 0x588b0
leaq -0x30(%rbp), %rdi
callq 0xac88
xorl %eax, %eax
addq $0xcc0, %rsp            # imm = 0xCC0
popq %rbp
retq
leaq -0x678(%rbp), %rdi
callq 0xac88
leaq -0x658(%rbp), %rdi
callq 0xac88
leaq -0x630(%rbp), %rdi
callq 0x3dfa0
leaq -0x618(%rbp), %rdi
callq 0x3dfa0
leaq -0x5f8(%rbp), %rdi
callq 0x48290
leaq -0x5d8(%rbp), %rdi
callq 0x100700
leaq -0x5b8(%rbp), %rdi
callq 0x100760
leaq -0x590(%rbp), %rdi
callq 0x100690
leaq -0x338(%rbp), %rdi
callq 0x3ec50
leaq -0x320(%rbp), %rdi
callq 0x1007c0
leaq -0x2f8(%rbp), %rdi
callq 0x3dfa0
leaq -0x2c8(%rbp), %rdi
callq 0x95b50
leaq -0x298(%rbp), %rdi
callq 0x95b70
leaq -0x268(%rbp), %rdi
callq 0x58620
leaq -0x238(%rbp), %rdi
callq 0x58f00
leaq -0xf0(%rbp), %rdi
callq 0x588b0
leaq -0x30(%rbp), %rdi
callq 0xac88
movq -0xf8(%rbp), %rdi
callq 0xab50
nop