// File: /workspace/github_cpp_makefile_star2_O3/millanek[P]evo/evo_shared_variation.cpp
// Function: sharedVarMain(int, char**)
int sharedVarMain(int argc, char** argv) {
    parseSharedVarOptions(argc, argv);
    string line; // for reading the input files
    
    std::istream* vcfFile = createReader(opt::vcfFile.c_str());
    std::ifstream* setsFile = new std::ifstream(opt::setsFile.c_str());
    string fileRoot = stripExtension(opt::setsFile);
    std::cerr << "Looking shared variation between samples in: " << opt::vcfFile << std::endl;
    std::cerr << "The groups are defined in: " << opt::setsFile << std::endl;
    
    std::map<string, std::vector<string>> speciesToIDsMap;
    std::map<string, string> IDsToSpeciesMap;
    std::map<string, std::vector<size_t>> speciesToPosMap;
    std::map<size_t, string> posToSpeciesMap;
    
    // Get the sample sets
    while (getline(*setsFile, line)) {
        std::vector<string> ID_Species = split(line, '\t');
        speciesToIDsMap[ID_Species[1]].push_back(ID_Species[0]);
        IDsToSpeciesMap[ID_Species[0]] = ID_Species[1];
    }
    
    // Get a vector of set names (usually species)
    std::vector<string> species;
    for(std::map<string,std::vector<string>>::iterator it = speciesToIDsMap.begin(); it != speciesToIDsMap.end(); ++it) {
        if ((it->first) != "Outgroup" && it->first != "xxx") {
            species.push_back(it->first);
            // std::cerr << it->first << std::endl;
        }
    } std::cerr << "There are " << species.size() << " sets (excluding the Outgroup)" << std::endl;
    
    std::ofstream* sharedLocsFile;
    if (opt::getLocsFor.size() == 2) {
        sharedLocsFile = new std::ofstream(opt::runName+"sharedVariationLocation_" + opt::getLocsFor[0] + "_" + opt::getLocsFor[1] + ".txt");
    }

    string sharedPerIndividualN = opt::runName + "sharedHets_perIndividual.txt";
    string sharedBetweenGroupsN = "sharedVariationBetween_" + fileRoot + "_" + opt::runName + ".txt";
    string sharedPerIndividualNscaled = opt::runName + "sharedHets_perIndividual_scaled.txt";
    string sharedBetweenGroupsNscaled = "sharedVariationBetween_" + fileRoot + "_" + opt::runName + "_scaled.txt";
    std::ofstream* sharedPerIndividual = new std::ofstream(sharedPerIndividualN.c_str());
    std::ofstream* sharedBetweenGroups = new std::ofstream(sharedBetweenGroupsN.c_str());
    std::ofstream* sharedPerIndividualScaled = new std::ofstream(sharedPerIndividualNscaled.c_str());
    std::ofstream* sharedBetweenGroupsScaled = new std::ofstream(sharedBetweenGroupsNscaled.c_str());
    std::vector<std::vector<double> > hetMatrix; std::vector<std::vector<double> > hetMatrixMissing;
    std::vector<std::vector<double> > sharedBetweenGroupsMatrix; std::vector<std::vector<double> > sharedBetweenGroupsMatrixMissing;
    
    int totalVariantNumber = 0; int reportProgressEvery = 10000;
    std::vector<string> sampleNames; int numSamples = 0;
    std::vector<string> fields;
    std::map<std::string, double> loc_pval;
    std::clock_t start; double durationOverall;
    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> sN(fields.begin()+NUM_NON_GENOTYPE_COLUMNS,fields.end());
            sampleNames = sN;
            for (std::vector<std::string>::size_type i = 0; i != sampleNames.size(); i++) {
                posToSpeciesMap[i] = IDsToSpeciesMap[sampleNames[i]];
            }
            numSamples = (int)sampleNames.size();
            
            // 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 = speciesToIDsMap.begin(); it != speciesToIDsMap.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());
                }
                speciesToPosMap[sp] = spPos;
            }
            
            initialize_matrix_double(hetMatrix, numSamples); initialize_matrix_double(hetMatrixMissing, numSamples);
            initialize_matrix_double(sharedBetweenGroupsMatrix, (int)species.size());
            initialize_matrix_double(sharedBetweenGroupsMatrixMissing, (int)species.size());
            start = std::clock();
        } else {
            totalVariantNumber++;
            if (totalVariantNumber % reportProgressEvery == 0) {
                durationOverall = ( std::clock() - start ) / (double) CLOCKS_PER_SEC;
                std::cerr << "Processed " << totalVariantNumber << " variants in " << durationOverall << "secs" << std::endl;
            }
            fields = split(line, '\t');
            std::vector<std::string> genotypes(fields.begin()+NUM_NON_GENOTYPE_COLUMNS,fields.end());

            // Only consider biallelic SNPs
            string refAllele = fields[3]; string altAllele = fields[4];
            if (refAllele.length() > 1 || altAllele.length() > 1) {
                refAllele.clear(); refAllele.shrink_to_fit(); altAllele.clear(); altAllele.shrink_to_fit();
                genotypes.clear(); genotypes.shrink_to_fit(); continue;
            }
            
            GeneralSetCounts* c = new GeneralSetCounts(speciesToPosMap, (int)genotypes.size());
            c->getSetVariantCounts(genotypes, posToSpeciesMap);
            genotypes.clear(); genotypes.shrink_to_fit();
            
            // Put the number of hets in each sample on the diagonal
            for (int i = 0; i < numSamples; i++) {
                if (c->individualsWithVariant[i] == 1)
                    hetMatrix[i][i]++;
                else if (c->individualsWithVariant[i] == -1) // Missing data for this individual
                    hetMatrixMissing[i][i]++;
            }
            // Now look if the het is shared between individuals
            for (int i = 0; i < (numSamples-1); i++) {
                int iAllele = c->individualsWithVariant[i];
                if (iAllele == 1) {
                    for (int j = i+1; j != numSamples; j++) {
                        if (c->individualsWithVariant[j] == 1)
                            hetMatrix[j][i]++;
                        else if (c->individualsWithVariant[j] == -1)
                            hetMatrixMissing[j][i]++;
                    }
                } else if (iAllele == -1) {
                    for (int j = i+1; j != numSamples; j++) {
                        hetMatrixMissing[j][i]++;
                    }
                }
            }
            
            // Now look at the numbers a polymorphic sites in groups and shared between groups:
            std::vector<double> allPs;
            for (int i = 0; i < (int)species.size(); i++) {
                allPs.push_back(c->setAAFs.at(species[i]));
                double p_Si = allPs[i];
                if (p_Si > 0 && p_Si < 1)
                    sharedBetweenGroupsMatrix[i][i]++;
                else if (p_Si == -1)
                    sharedBetweenGroupsMatrixMissing[i][i]++;
            }
            for (int i = 0; i < ((int)species.size()-1); i++) {
                double p_Si = allPs[i];
                if (p_Si > 0 && p_Si < 1) {
                    for (int j = i+1; j != (int)species.size(); j++) {
                        double p_Sj = allPs[j];
                        if (p_Sj > 0 && p_Sj < 1) {
                            sharedBetweenGroupsMatrix[j][i]++;
                            if (opt::getLocsFor.size() == 2) {
                                if ((species[i] == opt::getLocsFor[0] && species[j] == opt::getLocsFor[1]) || (species[i] == opt::getLocsFor[1] && species[j] == opt::getLocsFor[0]))
                                    *sharedLocsFile << fields[0] << "\t" << fields[1] << std::endl;
                            }
                        }
                        else if (p_Sj == -1)
                            sharedBetweenGroupsMatrixMissing[j][i]++;
                    }
                } else if (p_Si == -1) { // Entirely missing data for this species/population
                    for (int j = i+1; j != (int)species.size(); j++) {
                        sharedBetweenGroupsMatrixMissing[j][i]++;
                    }
                }
            }
            delete c;
        }
    }
    
    // print het sharing per individual
    print_vector(sampleNames, *sharedPerIndividual);
    print_matrix<const std::vector<std::vector<double> >&>(hetMatrix, *sharedPerIndividual);
    for (int i = 0; i < numSamples; i++) {
        for (int j = 0; j < numSamples; j++) {
            double proportionUsed = 1 - (hetMatrixMissing[j][i]/totalVariantNumber);
            hetMatrix[j][i] = hetMatrix[j][i]/proportionUsed;
        }
    }
    print_vector(sampleNames, *sharedPerIndividualScaled);
    print_matrix<const std::vector<std::vector<double> >&>(hetMatrix, *sharedPerIndividualScaled);
    
    // Print variant sharing between groups
    print_vector(species, *sharedBetweenGroups);
    print_matrix<const std::vector<std::vector<double> >&>(sharedBetweenGroupsMatrix, *sharedBetweenGroups);
    for (int i = 0; i < (int)species.size(); i++) {
        for (int j = 0; j < (int)species.size(); j++) {
            double proportionUsed = 1 - (sharedBetweenGroupsMatrixMissing[j][i]/totalVariantNumber);
            sharedBetweenGroupsMatrix[j][i] = sharedBetweenGroupsMatrix[j][i]/proportionUsed;
        }
    }
    print_vector(species, *sharedBetweenGroupsScaled);
    print_matrix<const std::vector<std::vector<double> >&>(sharedBetweenGroupsMatrix, *sharedBetweenGroupsScaled);
    
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
callq 0x7f31a
leaq 0x1f0(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x86660(%rip), %rsi     # 0x103708
leaq 0x2a8(%rsp), %rdi
leaq 0x378(%rsp), %rdx
callq 0x287de
leaq 0x2a8(%rsp), %rdi
movl $0x8, %esi
callq 0x500af
movq %rax, %rbx
leaq 0x2b8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7d0f3
movq 0x2b8(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %r14
movq 0x86621(%rip), %rsi     # 0x103728
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
leaq 0x8660d(%rip), %rsi     # 0x103728
leaq 0x2f8(%rsp), %rdi
callq 0x4d82f
movq 0x84eb9(%rip), %rdi     # 0x101fe8
leaq 0x5a1b4(%rip), %rsi     # 0xd72ea
movl $0x2d, %edx
callq 0x84e0
movq 0x865c1(%rip), %rsi     # 0x103708
movq 0x865c2(%rip), %rdx     # 0x103710
movq 0x84e93(%rip), %rdi     # 0x101fe8
callq 0x84e0
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 0x84e5d(%rip), %rdi     # 0x101fe8
leaq 0x5a186(%rip), %rsi     # 0xd7318
movl $0x1b, %edx
callq 0x84e0
movq 0x86585(%rip), %rsi     # 0x103728
movq 0x86586(%rip), %rdx     # 0x103730
movq 0x84e37(%rip), %rdi     # 0x101fe8
callq 0x84e0
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
leaq 0x2b0(%rsp), %rcx
xorl %eax, %eax
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x380(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x3e0(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x3b0(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x1e0(%rsp), %r15
leaq 0x168(%rsp), %r12
leaq 0x2a8(%rsp), %r13
leaq 0x378(%rsp), %rbp
movq %rbx, 0x118(%rsp)
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7d305
movq %r12, %rdi
movq %r15, %rsi
movl $0x9, %edx
callq 0x4d650
movq 0x168(%rsp), %rsi
addq $0x20, %rsi
movq %r13, %rdi
callq 0x46fb4
movq 0x168(%rsp), %rsi
movq %rax, %rdi
callq 0x3133c
movq 0x168(%rsp), %rbx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x3b46e
addq $0x20, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x8270
movq %r12, %rdi
callq 0x2e784
jmp 0x7d272
xorpd %xmm0, %xmm0
movapd %xmm0, 0xc0(%rsp)
movq $0x0, 0xd0(%rsp)
movq 0x2c0(%rsp), %r14
leaq 0x2b0(%rsp), %rax
cmpq %rax, %r14
je 0x7d38e
leaq 0x5315c(%rip), %r15     # 0xd0496
leaq 0x54a4f(%rip), %r12     # 0xd1d90
leaq 0xc0(%rsp), %r13
leaq 0x20(%r14), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x8160
testl %eax, %eax
je 0x7d376
movq %rbp, %rdi
movq %r12, %rsi
callq 0x8160
testl %eax, %eax
je 0x7d376
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3133c
movq %r14, %rdi
callq 0x8310
movq %rax, %r14
leaq 0x2b0(%rsp), %rax
cmpq %rax, %r14
jne 0x7d349
movq 0x84c53(%rip), %rdi     # 0x101fe8
leaq 0x63bcd(%rip), %rsi     # 0xe0f69
movl $0xa, %edx
callq 0x84e0
movq 0xc8(%rsp), %rsi
subq 0xc0(%rsp), %rsi
sarq $0x5, %rsi
movq 0x84c27(%rip), %rdi     # 0x101fe8
callq 0x82f0
movq %rax, %r14
leaq 0x59f64(%rip), %rsi     # 0xd7334
movl $0x1e, %edx
movq %rax, %rdi
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 0x8634d(%rip), %rax     # 0x103758
subq 0x8633e(%rip), %rax     # 0x103750
cmpq $0x40, %rax
jne 0x7d695
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, 0x1c0(%rsp)
leaq 0xf0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x86327(%rip), %rsi     # 0x103768
movq 0x86328(%rip), %rdx     # 0x103770
addq %rsi, %rdx
leaq 0xe0(%rsp), %rdi
callq 0x2ba06
leaq 0x59ef4(%rip), %rsi     # 0xd7353
leaq 0xe0(%rsp), %rdi
callq 0x88c0
movq 0x862dd(%rip), %rax     # 0x103750
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0xe0(%rsp), %rdi
callq 0x8180
leaq 0x70(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d4ae
movq %rdx, 0x60(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x70(%rsp)
jmp 0x7d4b7
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x60(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x57ba2(%rip), %rsi     # 0xd507c
callq 0x88c0
leaq 0x158(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d510
movq %rdx, 0x148(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x158(%rsp)
jmp 0x7d51a
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x148(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x86210(%rip), %rax     # 0x103750
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
callq 0x8180
leaq 0x50(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d574
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x7d57e
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x40(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x5fba4(%rip), %rsi     # 0xdd145
callq 0x88c0
leaq 0x178(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d5d6
movq %rdx, 0x168(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x178(%rsp)
jmp 0x7d5df
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
movq 0x8(%rax), %rdx
leaq 0x168(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1c0(%rsp), %rdi
movl $0x10, %edx
callq 0x88d0
movq 0x168(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7d62d
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x7d644
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x148(%rsp), %rdi
cmpq %r12, %rdi
je 0x7d661
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x7d678
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0xe0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7d695
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x860c2(%rip), %rsi     # 0x103768
movq 0x860c3(%rip), %rdx     # 0x103770
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x2ba06
leaq 0x59cab(%rip), %rsi     # 0xd736c
leaq 0x40(%rsp), %rdi
callq 0x88c0
leaq 0x59cb7(%rip), %rsi     # 0xd7389
leaq 0xe0(%rsp), %rdi
leaq 0x2f8(%rsp), %rdx
callq 0x77736
leaq 0x5798e(%rip), %rsi     # 0xd507c
leaq 0xe0(%rsp), %rdi
callq 0x88c0
leaq 0x70(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d722
movq %rdx, 0x60(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x70(%rsp)
jmp 0x7d72a
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0x60(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8601b(%rip), %rsi     # 0x103768
movq 0x8601c(%rip), %rdx     # 0x103770
callq 0x8180
leaq 0x178(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d789
movq %rdx, 0x168(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x178(%rsp)
jmp 0x7d791
movupd (%rcx), %xmm0
movupd %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x168(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x5f98e(%rip), %rsi     # 0xdd145
callq 0x88c0
leaq 0x158(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d7ec
movq %rdx, 0x148(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x158(%rsp)
jmp 0x7d7f4
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x150(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x168(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7d82c
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x7d848
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xf0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7d869
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
movq %rax, (%rdi)
movq 0x85eeb(%rip), %rsi     # 0x103768
movq 0x85eec(%rip), %rdx     # 0x103770
addq %rsi, %rdx
callq 0x2ba06
leaq 0x59b0e(%rip), %rsi     # 0xd73a1
leaq 0x60(%rsp), %rdi
callq 0x88c0
leaq 0x59ae5(%rip), %rsi     # 0xd7389
leaq 0xa0(%rsp), %rdi
leaq 0x2f8(%rsp), %rdx
callq 0x77736
leaq 0x577bc(%rip), %rsi     # 0xd507c
leaq 0xa0(%rsp), %rdi
callq 0x88c0
leaq 0x20(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d8f4
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x7d8fe
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x10(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x85e47(%rip), %rsi     # 0x103768
movq 0x85e48(%rip), %rdx     # 0x103770
callq 0x8180
movq %rbx, 0x168(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d959
movq %rdx, 0x168(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x178(%rsp)
jmp 0x7d961
movupd (%rcx), %xmm0
movupd %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x168(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x59a32(%rip), %rsi     # 0xd73b9
callq 0x88c0
leaq 0xf0(%rsp), %rsi
movq %rsi, 0xe0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d9c0
movq %rdx, 0xe0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xf0(%rsp)
jmp 0x7d9c8
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0xe8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x168(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7da00
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
movq 0x118(%rsp), %rbx
je 0x7da1f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7da40
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq 0x40(%rsp), %rsi
movq %rax, 0x258(%rsp)
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq 0x148(%rsp), %rsi
movq %rax, 0x248(%rsp)
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq 0x60(%rsp), %rsi
movq %rax, 0x250(%rsp)
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq 0xe0(%rsp), %rsi
movq %rax, 0x240(%rsp)
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
xorpd %xmm0, %xmm0
leaq 0x220(%rsp), %rax
movapd %xmm0, (%rax)
xorl %r12d, %r12d
movq %r12, 0x10(%rax)
leaq 0x290(%rsp), %rax
movq %r12, 0x10(%rax)
movapd %xmm0, (%rax)
leaq 0x200(%rsp), %rax
movq %r12, 0x10(%rax)
movapd %xmm0, (%rax)
leaq 0x270(%rsp), %rax
movq %r12, 0x10(%rax)
movapd %xmm0, (%rax)
leaq 0x1a0(%rsp), %r15
movq %r12, 0x10(%r15)
movapd %xmm0, (%r15)
movq %r12, 0x110(%rsp)
movapd %xmm0, 0x100(%rsp)
leaq 0x170(%rsp), %rax
movl $0x0, (%rax)
movq %r12, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %r12, 0x20(%rax)
leaq 0x10(%rsp), %rbp
movl $0x0, 0x3c(%rsp)
movl %r12d, %eax
movq %rax, 0x1c8(%rsp)
decl %r12d
movq %r12, 0x2e8(%rsp)
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %rbx, %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7e9bb
movq 0x1e0(%rsp), %rdi
movq 0x1e8(%rsp), %rsi
addq %rdi, %rsi
movb $0xd, 0x10(%rsp)
movq %rbp, %rdx
callq 0x7fd35
movq %rax, %rcx
subq 0x1e0(%rsp), %rcx
movq %rcx, 0x1e8(%rsp)
movb $0x0, (%rax)
movq 0x1e0(%rsp), %rax
cmpb $0x23, (%rax)
jne 0x7dc12
movzbl 0x1(%rax), %eax
cmpl $0x23, %eax
je 0x7db80
cmpl $0x43, %eax
je 0x7e692
movl 0x3c(%rsp), %ecx
imull $0x3afb7e91, %ecx, %eax # imm = 0x3AFB7E91
incl %ecx
movl %ecx, 0x3c(%rsp)
addl $0x3b2fec51, %eax       # imm = 0x3B2FEC51
rorl $0x4, %eax
cmpl $0x68db8, %eax          # imm = 0x68DB8
ja 0x7dce0
callq 0x82e0
subq 0x2d8(%rsp), %rax
cvtsi2sd %rax, %xmm0
divsd 0x512c1(%rip), %xmm0    # 0xcef10
movsd %xmm0, 0x8(%rsp)
movl $0xa, %edx
movq 0x84387(%rip), %rdi     # 0x101fe8
leaq 0x542fe(%rip), %rsi     # 0xd1f66
callq 0x84e0
movq 0x84374(%rip), %rdi     # 0x101fe8
movl 0x3c(%rsp), %esi
callq 0x8810
movq %rax, %r14
movl $0xd, %edx
movq %rax, %rdi
leaq 0x571df(%rip), %rsi     # 0xd4e6e
callq 0x84e0
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x8730
movq %rax, %r14
movl $0x4, %edx
movq %rax, %rdi
leaq 0x5974a(%rip), %rsi     # 0xd73fe
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
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
leaq 0x1e0(%rsp), %rsi
movl $0x9, %edx
callq 0x4d650
movq 0x110(%rsp), %rax
movapd 0xa0(%rsp), %xmm0
movq 0xb0(%rsp), %rcx
movq %rcx, 0x110(%rsp)
movapd 0x100(%rsp), %xmm1
movapd %xmm0, 0x100(%rsp)
movapd %xmm1, 0x10(%rsp)
movq %rax, 0x20(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
movq %rbp, %rdi
callq 0x2e784
movq %rbx, %rdi
callq 0x2e784
movq 0x100(%rsp), %rsi
movl $0x120, %eax            # imm = 0x120
addq %rax, %rsi
movq 0x108(%rsp), %rdx
leaq 0x130(%rsp), %rdi
movq %rbp, %rcx
callq 0x7f67a
movq 0x100(%rsp), %rax
movq %r13, 0x10(%rsp)
movq 0x60(%rax), %rsi
movq 0x68(%rax), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x2ba06
movq 0x100(%rsp), %rax
leaq 0xb0(%rsp), %rcx
movq %rcx, 0xa0(%rsp)
movq 0x80(%rax), %rsi
movq 0x88(%rax), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x2ba06
cmpq $0x2, 0x18(%rsp)
setb %al
cmpq $0x2, 0xa8(%rsp)
setb %cl
andb %al, %cl
movb %cl, 0x7(%rsp)
je 0x7e59b
movl $0x240, %edi            # imm = 0x240
callq 0x8470
leaq 0x130(%rsp), %r12
movq 0x1c8(%rsp), %rbp
movq %rax, %rbx
movq 0x138(%rsp), %rdx
subq 0x130(%rsp), %rdx
shrq $0x5, %rdx
movq %rax, %rdi
leaq 0x3d8(%rsp), %rsi
callq 0x7f6bc
movq %rbx, %rdi
movq %r12, %rsi
leaq 0x3a8(%rsp), %rdx
callq 0x4cc6a
movq %rbx, 0x198(%rsp)
movq 0x130(%rsp), %rbx
movq 0x138(%rsp), %r14
cmpq %rbx, %r14
je 0x7de9f
leaq 0x10(%rbx), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x7de87
movq (%r15), %rsi
incq %rsi
callq 0x8480
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x7de73
movq %rbx, 0x138(%rsp)
cmpq %rbx, 0x140(%rsp)
je 0x7deb1
movq %r12, %rdi
callq 0x7fe80
testl %ebp, %ebp
jle 0x7e002
movq 0x198(%rsp), %rax
movq 0x1c0(%rax), %rax
movq 0x290(%rsp), %rcx
movq 0x220(%rsp), %rdx
xorl %esi, %esi
xorl %edi, %edi
movl (%rax,%rdi,4), %r8d
movq %rdx, %r9
cmpl $0x1, %r8d
je 0x7def2
cmpl $-0x1, %r8d
jne 0x7df0a
movq %rcx, %r9
movq (%r9,%rsi,2), %r8
movsd (%r8,%rdi,8), %xmm0
addsd 0x4e80c(%rip), %xmm0    # 0xcc710
movsd %xmm0, (%r8,%rdi,8)
incq %rdi
addq $0xc, %rsi
cmpq %rdi, %rbp
jne 0x7dedc
cmpl $0x2, %ebp
jl 0x7e002
movq 0x198(%rsp), %rax
movq 0x1c0(%rax), %rax
movq 0x290(%rsp), %rcx
addq $0x18, %rcx
movl $0x1, %edx
movl $0x6, %esi
movq %rbp, %rdi
movq %rax, %r8
xorl %r9d, %r9d
movl (%rax,%r9,4), %ebx
cmpl $0x1, %ebx
je 0x7df86
movq %rbp, %r10
movq %rcx, %r11
cmpl $-0x1, %ebx
jne 0x7dfd7
movq (%r11), %rbx
movsd (%rbx,%r9,8), %xmm0
addsd 0x4e79e(%rip), %xmm0    # 0xcc710
movsd %xmm0, (%rbx,%r9,8)
addq $0x18, %r11
decq %r10
cmpq %r10, %rdx
jne 0x7df61
jmp 0x7dfd7
movq 0x290(%rsp), %r10
movl $0x1, %r11d
movq 0x220(%rsp), %rbx
movq %rsi, %r14
movl (%r8,%r11,4), %ebp
movq %rbx, %r15
cmpl $0x1, %ebp
je 0x7dfb3
cmpl $-0x1, %ebp
jne 0x7dfcb
movq %r10, %r15
movq (%r15,%r14,4), %r15
movsd (%r15,%r9,8), %xmm0
addsd 0x4e74b(%rip), %xmm0    # 0xcc710
movsd %xmm0, (%r15,%r9,8)
addq $0x6, %r14
incq %r11
cmpq %r11, %rdi
jne 0x7df9f
incq %r9
incq %rdx
addq $0x18, %rcx
addq $0x6, %rsi
addq $0x4, %r8
decq %rdi
cmpq 0x2e8(%rsp), %r9
movq 0x1c8(%rsp), %rbp
jne 0x7df4d
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movq 0xc0(%rsp), %r8
movq 0xc8(%rsp), %rax
subq %r8, %rax
shrq $0x5, %rax
testl %eax, %eax
movq 0x118(%rsp), %rbx
leaq 0x1a0(%rsp), %r15
leaq 0x10(%rsp), %rbp
jle 0x7e558
movq 0x198(%rsp), %r14
addq $0xe0, %r14
xorl %ebx, %ebx
xorl %r15d, %r15d
xorl %r12d, %r12d
addq %rbx, %r8
movq %r14, %rdi
movq %r8, %rsi
callq 0x52202
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0x7e09c
movsd (%rax), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x88(%rsp)
jmp 0x7e0ac
leaq 0x80(%rsp), %rdi
movq %rax, %rdx
callq 0x79b8e
movq 0x80(%rsp), %rax
movsd (%rax,%r12,8), %xmm0
ucomisd 0x4dc6e(%rip), %xmm0    # 0xcbd30
jbe 0x7e0da
movsd 0x4e644(%rip), %xmm1    # 0xcc710
ucomisd %xmm0, %xmm1
leaq 0x200(%rsp), %rax
ja 0x7e0ee
ucomisd 0x4e636(%rip), %xmm0    # 0xcc718
leaq 0x270(%rsp), %rax
jne 0x7e109
jp 0x7e109
movq (%rax), %rax
movq (%rax,%r15), %rax
movsd (%rax,%r12,8), %xmm0
addsd 0x4e60d(%rip), %xmm0    # 0xcc710
movsd %xmm0, (%rax,%r12,8)
incq %r12
movq 0xc0(%rsp), %r8
movq 0xc8(%rsp), %rdi
movq %rdi, %rax
subq %r8, %rax
shrq $0x5, %rax
movslq %eax, %rcx
addq $0x18, %r15
addq $0x20, %rbx
cmpq %rcx, %r12
jl 0x7e066
cmpl $0x2, %eax
movq 0x118(%rsp), %rbx
leaq 0x1a0(%rsp), %r15
jl 0x7e558
movl $0x1, %r14d
movl $0x18, %edx
movl $0x3, %ecx
movq %rcx, 0x268(%rsp)
movl $0x28, %ecx
movq %rcx, 0x260(%rsp)
xorl %r12d, %r12d
movq 0x80(%rsp), %rcx
movsd (%rcx,%r12,8), %xmm0
ucomisd 0x4db9f(%rip), %xmm0    # 0xcbd30
movq %rdx, 0x2f0(%rsp)
jbe 0x7e4bf
movsd 0x4e569(%rip), %xmm1    # 0xcc710
ucomisd %xmm0, %xmm1
jbe 0x7e4bf
leaq 0x1(%r12), %rsi
movq %rdi, %rax
subq %r8, %rax
shrq $0x5, %rax
movl %eax, %eax
cmpq %rax, %rsi
je 0x7e509
movq 0x260(%rsp), %r15
movq 0x268(%rsp), %rbx
movq %r14, 0x2e0(%rsp)
movq %rsi, 0x120(%rsp)
movq 0x80(%rsp), %rax
movsd (%rax,%r14,8), %xmm0
ucomisd 0x4db2f(%rip), %xmm0    # 0xcbd30
jbe 0x7e44f
movsd 0x4e501(%rip), %xmm1    # 0xcc710
ucomisd %xmm0, %xmm1
jbe 0x7e44f
movq 0x200(%rsp), %rax
movq (%rax,%rbx,8), %rax
movsd (%rax,%r12,8), %xmm0
addsd 0x4e4dd(%rip), %xmm0    # 0xcc710
movsd %xmm0, (%rax,%r12,8)
movq 0x85518(%rip), %rax     # 0x103758
movq 0x85509(%rip), %rbp     # 0x103750
subq %rbp, %rax
cmpq $0x40, %rax
jne 0x7e47b
movq %r12, %rax
shlq $0x5, %rax
leaq (%r8,%rax), %rcx
movq 0x8(%r8,%rax), %r13
movq 0x8(%rbp), %rax
cmpq %rax, %r13
jne 0x7e336
testq %r13, %r13
je 0x7e2cb
movq (%rbp), %rsi
movq %rdi, 0x8(%rsp)
movq (%rcx), %rdi
movq %r13, %rdx
movq %r8, 0x1d8(%rsp)
movq %rax, 0x128(%rsp)
movq %rcx, 0x1d0(%rsp)
callq 0x8490
movq 0x1d0(%rsp), %rcx
movq 0x8(%rsp), %rdi
movq 0x120(%rsp), %rsi
movq 0x1d8(%rsp), %r8
testl %eax, %eax
movq 0x128(%rsp), %rax
jne 0x7e336
movq (%r8,%r15), %rdx
cmpq 0x28(%rbp), %rdx
jne 0x7e336
testq %rdx, %rdx
je 0x7e3c0
movq 0x20(%rbp), %rsi
movq %rdi, 0x8(%rsp)
movq -0x8(%r8,%r15), %rdi
movq %r8, 0x1d8(%rsp)
movq %rax, 0x128(%rsp)
movq %rcx, 0x1d0(%rsp)
callq 0x8490
movq 0x1d0(%rsp), %rcx
movq 0x8(%rsp), %rdi
movq 0x120(%rsp), %rsi
movq 0x1d8(%rsp), %r8
testl %eax, %eax
movq 0x128(%rsp), %rax
je 0x7e3c0
cmpq 0x28(%rbp), %r13
jne 0x7e47b
testq %r13, %r13
je 0x7e384
movq 0x20(%rbp), %rsi
movq %rdi, 0x8(%rsp)
movq (%rcx), %rdi
movq %r13, %rdx
movq %r8, %r13
movq %rax, 0x128(%rsp)
callq 0x8490
movq 0x8(%rsp), %rdi
movq 0x120(%rsp), %rsi
movq %r13, %r8
testl %eax, %eax
movq 0x128(%rsp), %rax
jne 0x7e47b
cmpq %rax, (%r8,%r15)
jne 0x7e47b
testq %rax, %rax
je 0x7e3c0
movq (%rbp), %rsi
movq %rdi, %rbp
movq -0x8(%r8,%r15), %rdi
movq %rax, %rdx
movq %r8, %r13
callq 0x8490
movq %rbp, %rdi
movq 0x120(%rsp), %rsi
movq %r13, %r8
testl %eax, %eax
jne 0x7e47b
movq 0x100(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x1c0(%rsp), %rdi
callq 0x84e0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4f5dc(%rip), %rsi     # 0xcd9ca
callq 0x84e0
movq 0x100(%rsp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
movq %r13, %rdi
callq 0x84e0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r13, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0xc0(%rsp), %r8
movq 0xc8(%rsp), %rdi
movq 0x120(%rsp), %rsi
jmp 0x7e47b
ucomisd 0x4e2c1(%rip), %xmm0    # 0xcc718
jne 0x7e47b
jp 0x7e47b
movq 0x270(%rsp), %rax
movq (%rax,%rbx,8), %rax
movsd (%rax,%r12,8), %xmm0
addsd 0x4e29b(%rip), %xmm0    # 0xcc710
movsd %xmm0, (%rax,%r12,8)
incq %r14
movq %rdi, %rax
subq %r8, %rax
shrq $0x5, %rax
movl %eax, %eax
addq $0x3, %rbx
addq $0x20, %r15
cmpq %rax, %r14
leaq 0x20(%rsp), %r13
leaq 0x10(%rsp), %rbp
jne 0x7e1eb
movq 0x118(%rsp), %rbx
leaq 0x1a0(%rsp), %r15
movq 0x2e0(%rsp), %r14
jmp 0x7e509
leaq 0x1(%r12), %rsi
ucomisd 0x4e24c(%rip), %xmm0    # 0xcc718
jne 0x7e509
jp 0x7e509
movl %eax, %eax
cmpq %rax, %rsi
je 0x7e509
movq 0x270(%rsp), %rcx
addq %rdx, %rcx
movsd 0x4e226(%rip), %xmm1    # 0xcc710
movq (%rcx), %rdx
movsd (%rdx,%r12,8), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rdx,%r12,8)
addq $0x18, %rcx
decq %rax
cmpq %rax, %r14
jne 0x7e4ea
movq %rdi, %rcx
subq %r8, %rcx
movq %rcx, %rax
shrq $0x5, %rax
shlq $0x1b, %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
addq %rdx, %rcx
sarq $0x20, %rcx
incq %r14
movq 0x2f0(%rsp), %rdx
addq $0x18, %rdx
addq $0x3, 0x268(%rsp)
addq $0x20, 0x260(%rsp)
movq %rsi, %r12
cmpq %rcx, %rsi
jl 0x7e17b
movq 0x198(%rsp), %r14
movq %r14, %rdi
callq 0x7fb02
movl $0x240, %esi            # imm = 0x240
movq %r14, %rdi
callq 0x8480
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x7e63f
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
jmp 0x7e63f
movq $0x0, 0x18(%rsp)
movq 0x10(%rsp), %rax
movb $0x0, (%rax)
movq %rbp, %rdi
callq 0x8290
movq $0x0, 0xa8(%rsp)
movq 0xa0(%rsp), %rax
movb $0x0, (%rax)
movq %rbx, %rdi
callq 0x8290
movq 0x130(%rsp), %rbx
movq 0x138(%rsp), %r14
cmpq %rbx, %r14
je 0x7e620
leaq 0x10(%rbx), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x7e600
movq (%r15), %rsi
incq %rsi
callq 0x8480
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x7e5ec
movq %rbx, 0x138(%rsp)
leaq 0x1a0(%rsp), %r15
cmpq %rbx, 0x140(%rsp)
movq 0x118(%rsp), %rbx
je 0x7e63f
leaq 0x130(%rsp), %rdi
callq 0x7fe80
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x7e664
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x7e67b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x130(%rsp), %rdi
callq 0x2e784
cmpb $0x0, 0x7(%rsp)
jmp 0x7db80
leaq 0xa0(%rsp), %r14
movq %r14, %rdi
leaq 0x1e0(%rsp), %rsi
movl $0x9, %edx
callq 0x4d650
movq 0x110(%rsp), %rax
movapd 0xa0(%rsp), %xmm0
movq 0xb0(%rsp), %rcx
movq %rcx, 0x110(%rsp)
movapd 0x100(%rsp), %xmm1
movapd %xmm0, 0x100(%rsp)
movapd %xmm1, 0x10(%rsp)
movq %rax, 0x20(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
movq %rbp, %rdi
callq 0x2e784
movq %r14, %rdi
callq 0x2e784
movq 0x100(%rsp), %rsi
movl $0x120, %eax            # imm = 0x120
addq %rax, %rsi
movq 0x108(%rsp), %rdx
movq %r14, %rdi
movq %rbp, %rcx
callq 0x7f67a
movq %r15, %rdi
movq %r14, %rsi
callq 0x30550
movq 0x1a0(%rsp), %rax
movq 0x1a8(%rsp), %rsi
movq $0x0, 0x10(%rsp)
subq %rax, %rsi
je 0x7e7c1
xorl %esi, %esi
shlq $0x5, %rsi
addq %rax, %rsi
leaq 0x378(%rsp), %rdi
callq 0x3b46e
movq %rax, %r14
leaq 0x3a8(%rsp), %rdi
movq %rbp, %rsi
callq 0x5d958
movq %rax, %rdi
movq %r14, %rsi
callq 0x8270
movq 0x10(%rsp), %rsi
incq %rsi
movq %rsi, 0x10(%rsp)
movq 0x1a0(%rsp), %rax
movq 0x1a8(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rcx, %rsi
jne 0x7e764
jmp 0x7e7c5
sarq $0x5, %rsi
movq %rsi, %r12
movq 0x2c0(%rsp), %rbp
leaq 0x2b0(%rsp), %rax
cmpq %rax, %rbp
je 0x7e92d
movq %r13, 0x10(%rsp)
movq 0x20(%rbp), %rsi
movq 0x28(%rbp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x2ba06
leaq 0x40(%rbp), %rsi
leaq 0x130(%rsp), %r14
movq %r14, %rdi
callq 0x2fc8e
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5038c
movq 0x80(%rsp), %rax
cmpq 0x88(%rsp), %rax
jne 0x7e8ba
movl $0x29, %edx
movq 0x837a4(%rip), %rdi     # 0x101fe8
leaq 0x536b0(%rip), %rsi     # 0xd1efb
callq 0x84e0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x83787(%rip), %rdi     # 0x101fe8
callq 0x84e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x51dd3(%rip), %rsi     # 0xd064b
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 0x80(%rsp), %rax
cmpq 0x88(%rsp), %rax
je 0x7ed83
leaq 0x3d8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5d9be
movq %rax, %rdi
leaq 0x80(%rsp), %rsi
callq 0x5da3a
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x7e8f9
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x130(%rsp), %rdi
callq 0x2e784
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x7e91d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
movq %rbp, %rdi
callq 0x8310
movq %rax, %rbp
jmp 0x7e7d0
leaq 0x220(%rsp), %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x4d690
leaq 0x10(%rsp), %rbp
leaq 0x290(%rsp), %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x4d690
movq 0xc8(%rsp), %rsi
subq 0xc0(%rsp), %rsi
shrq $0x5, %rsi
leaq 0x200(%rsp), %rdi
xorl %edx, %edx
callq 0x4d690
movq 0xc8(%rsp), %rsi
subq 0xc0(%rsp), %rsi
shrq $0x5, %rsi
leaq 0x270(%rsp), %rdi
xorl %edx, %edx
callq 0x4d690
callq 0x82e0
movq %rax, 0x2d8(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x2e784
jmp 0x7db6a
leaq 0x360(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
leaq 0x50(%rsp), %r12
callq 0x2fc8e
movq 0x1c8(%rsp), %r14
leaq 0x360(%rsp), %rdi
movq 0x258(%rsp), %rbx
movq %rbx, %rsi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x36ba0
leaq 0x360(%rsp), %rdi
callq 0x2e784
leaq 0x220(%rsp), %rdi
movq %rbx, %rsi
callq 0x5b035
cvtsi2sdl 0x3c(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
testl %r14d, %r14d
jle 0x7ea96
movq 0x290(%rsp), %rax
movq 0x220(%rsp), %rcx
leaq (,%r14,8), %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
movsd 0x4dcbd(%rip), %xmm3    # 0xcc710
movsd 0x8(%rsp), %xmm4
xorl %edi, %edi
movq (%rax,%rdi), %r8
movsd (%r8,%rsi,8), %xmm0
divsd %xmm4, %xmm0
movapd %xmm3, %xmm1
movq (%rcx,%rdi), %r8
movsd (%r8,%rsi,8), %xmm2
subsd %xmm0, %xmm1
divsd %xmm1, %xmm2
movsd %xmm2, (%r8,%rsi,8)
addq $0x18, %rdi
cmpq %rdi, %rdx
jne 0x7ea5b
incq %rsi
cmpq %r14, %rsi
jne 0x7ea59
leaq 0x348(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x2fc8e
leaq 0x348(%rsp), %rdi
movq 0x250(%rsp), %rbx
movq %rbx, %rsi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x36ba0
leaq 0x348(%rsp), %rdi
callq 0x2e784
leaq 0x220(%rsp), %rdi
movq %rbx, %rsi
callq 0x5b035
leaq 0x330(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x2fc8e
leaq 0x330(%rsp), %rdi
movq 0x248(%rsp), %rbx
movq %rbx, %rsi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x36ba0
leaq 0x330(%rsp), %rdi
callq 0x2e784
leaq 0x200(%rsp), %rdi
movq %rbx, %rsi
callq 0x5b035
movq 0xc8(%rsp), %rax
subq 0xc0(%rsp), %rax
shrq $0x5, %rax
testl %eax, %eax
jle 0x7ebbc
movq 0x270(%rsp), %rcx
movq 0x200(%rsp), %rdx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %esi, %esi
movsd 0x4db9b(%rip), %xmm3    # 0xcc710
movsd 0x8(%rsp), %xmm4
movq %rax, %rdi
xorl %r8d, %r8d
movq (%rcx,%r8), %r9
movsd (%r9,%rsi,8), %xmm0
divsd %xmm4, %xmm0
movapd %xmm3, %xmm1
movq (%rdx,%r8), %r9
movsd (%r9,%rsi,8), %xmm2
subsd %xmm0, %xmm1
divsd %xmm1, %xmm2
movsd %xmm2, (%r9,%rsi,8)
addq $0x18, %r8
decq %rdi
jne 0x7eb81
incq %rsi
cmpq %rax, %rsi
jne 0x7eb7b
leaq 0x318(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x2fc8e
leaq 0x318(%rsp), %rdi
movq 0x240(%rsp), %rbx
movq %rbx, %rsi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x36ba0
leaq 0x318(%rsp), %rdi
callq 0x2e784
leaq 0x200(%rsp), %rdi
movq %rbx, %rsi
callq 0x5b035
leaq 0x168(%rsp), %rdi
callq 0x7fce8
leaq 0x100(%rsp), %rdi
callq 0x2e784
leaq 0x1a0(%rsp), %rdi
callq 0x2e784
leaq 0x270(%rsp), %rdi
callq 0x42ffa
leaq 0x200(%rsp), %rdi
callq 0x42ffa
leaq 0x290(%rsp), %rdi
callq 0x42ffa
leaq 0x220(%rsp), %rdi
callq 0x42ffa
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x7ec90
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x7ecac
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x7ecd1
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x7ece8
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xc0(%rsp), %rdi
callq 0x2e784
leaq 0x3a8(%rsp), %rdi
callq 0x5df54
leaq 0x3d8(%rsp), %rdi
callq 0x5dfcc
leaq 0x378(%rsp), %rdi
callq 0x3c6d4
leaq 0x2a8(%rsp), %rdi
callq 0x3c602
leaq 0x308(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7ed4a
movq 0x308(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0x7ed6f
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x8480
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5319b(%rip), %rdi     # 0xd1f25
leaq 0x58634(%rip), %rsi     # 0xd73c5
leaq 0x58646(%rip), %rcx     # 0xd73de
movl $0x77, %edx
callq 0x82c0
movq %rax, %r15
movq 0x168(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7edc7
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7edc7
movq %rax, %r15
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x7ede3
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7ede3
movq %rax, %r15
movq 0x148(%rsp), %rdi
cmpq %r12, %rdi
je 0x7ee05
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7ee05
movq %rax, %r15
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x7ee23
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7ee23
jmp 0x7ee20
movq %rax, %r15
movq 0xe0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7ee45
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7ee45
movq %rax, %r15
movl $0x200, %esi            # imm = 0x200
movq 0x1c0(%rsp), %rdi
jmp 0x7f279
jmp 0x7f085
jmp 0x7f139
jmp 0x7f139
movq %rax, %r15
movl $0x240, %esi            # imm = 0x240
movq %rbx, %rdi
jmp 0x7f0d6
jmp 0x7ee78
movq %rax, %rdi
callq 0x288e1
movq %rax, %r15
leaq 0x318(%rsp), %rdi
jmp 0x7f1a1
movq %rax, %r15
leaq 0x330(%rsp), %rdi
jmp 0x7f1a1
movq %rax, %r15
leaq 0x348(%rsp), %rdi
jmp 0x7f1a1
movq %rax, %r15
leaq 0x360(%rsp), %rdi
jmp 0x7f1a1
movq %rax, %r15
movl $0x200, %esi            # imm = 0x200
movq 0x240(%rsp), %rdi
callq 0x8480
leaq 0x50(%rsp), %r12
jmp 0x7f201
jmp 0x7ef23
movq %rax, %r15
movl $0x200, %esi            # imm = 0x200
movq 0x250(%rsp), %rdi
jmp 0x7ef19
jmp 0x7ef23
movq %rax, %r15
movl $0x200, %esi            # imm = 0x200
movq 0x248(%rsp), %rdi
jmp 0x7ef19
jmp 0x7ef23
movq %rax, %r15
movl $0x200, %esi            # imm = 0x200
movq 0x258(%rsp), %rdi
callq 0x8480
jmp 0x7f201
movq %rax, %r15
jmp 0x7f201
movq %rax, %r15
movq 0x168(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7ef50
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7ef50
movq %rax, %r15
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x7ef71
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7ef71
movq %rax, %r15
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7f226
movq 0xb0(%rsp), %rsi
jmp 0x7f21e
jmp 0x7ef95
movq %rax, %r15
jmp 0x7f226
movq %rax, %r15
jmp 0x7f242
movq %rax, %r15
movq 0x168(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7efca
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7efca
movq %rax, %r15
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x7efeb
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7efeb
movq %rax, %r15
leaq 0xf0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7f267
movq 0xf0(%rsp), %rsi
jmp 0x7f25f
jmp 0x7f00f
movq %rax, %r15
jmp 0x7f267
jmp 0x7f085
jmp 0x7f052
movq %rax, %r15
movl $0x208, %esi            # imm = 0x208
movq %r14, %rdi
jmp 0x7f2e8
jmp 0x7f052
movq %rax, %r15
leaq 0x2b8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7f2ed
movq 0x2b8(%rsp), %rsi
jmp 0x7f2e5
movq %rax, %r15
jmp 0x7f2ed
movq %rax, %r15
jmp 0x7f0db
movq %rax, %r15
jmp 0x7f11c
jmp 0x7f139
movq %rax, %r15
jmp 0x7f100
jmp 0x7f139
jmp 0x7f12f
jmp 0x7f139
jmp 0x7f085
movq %rax, %r15
jmp 0x7f27e
movq %rax, %r15
jmp 0x7f1a6
movq %rax, %r15
jmp 0x7f2cc
leaq 0x50(%rsp), %r12
movq %rax, %r15
jmp 0x7f170
leaq 0x50(%rsp), %r12
movq %rax, %r15
jmp 0x7f182
jmp 0x7f12f
jmp 0x7f0bb
movq %rax, %r15
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x7f0db
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x7f100
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x7f11c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x130(%rsp), %rdi
callq 0x2e784
jmp 0x7f13c
jmp 0x7f139
jmp 0x7f143
movq %rax, %r15
leaq 0x50(%rsp), %r12
jmp 0x7f199
movq %rax, %r15
leaq 0x50(%rsp), %r12
jmp 0x7f1a6
movq %rax, %r15
jmp 0x7f298
leaq 0x50(%rsp), %r12
movq %rax, %r15
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x7f170
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x130(%rsp), %rdi
callq 0x2e784
leaq 0x20(%rsp), %r13
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x7f199
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xa0(%rsp), %rdi
callq 0x2e784
leaq 0x168(%rsp), %rdi
callq 0x7fce8
leaq 0x100(%rsp), %rdi
callq 0x2e784
leaq 0x1a0(%rsp), %rdi
callq 0x2e784
leaq 0x270(%rsp), %rdi
callq 0x42ffa
leaq 0x200(%rsp), %rdi
callq 0x42ffa
leaq 0x290(%rsp), %rdi
callq 0x42ffa
leaq 0x220(%rsp), %rdi
callq 0x42ffa
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x7f226
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x7f242
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x158(%rsp), %rax
movq 0x148(%rsp), %rdi
cmpq %rax, %rdi
je 0x7f267
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x7f27e
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xc0(%rsp), %rdi
jmp 0x7f293
movq %rax, %r15
leaq 0x168(%rsp), %rdi
callq 0x2e784
leaq 0x3a8(%rsp), %rdi
callq 0x5df54
leaq 0x3d8(%rsp), %rdi
callq 0x5dfcc
leaq 0x378(%rsp), %rdi
callq 0x3c6d4
leaq 0x2a8(%rsp), %rdi
callq 0x3c602
leaq 0x308(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7f2ed
movq 0x308(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0x7f312
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r15, %rdi
callq 0x8840