// File: /workspace/github_cpp_makefile_star2_O1/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 0x7f6db
leaq 0x1d0(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x8f21c(%rip), %rsi     # 0x10c700
leaq 0x2b0(%rsp), %rdi
leaq 0x378(%rsp), %rdx
callq 0x286de
leaq 0x2b0(%rsp), %rdi
movl $0x8, %esi
callq 0x53224
movq %rax, %rbx
leaq 0x2c0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7d52f
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %r14
movq 0x8f1dd(%rip), %rsi     # 0x10c720
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
leaq 0x8f1c9(%rip), %rsi     # 0x10c720
leaq 0x2f8(%rsp), %rdi
callq 0x50803
movq 0x8da7d(%rip), %rdi     # 0x10afe8
leaq 0x60ce8(%rip), %rsi     # 0xde25a
movl $0x2d, %edx
callq 0x84e0
movq 0x8f17d(%rip), %rsi     # 0x10c700
movq 0x8f17e(%rip), %rdx     # 0x10c708
movq 0x8da57(%rip), %rdi     # 0x10afe8
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 0x8da21(%rip), %rdi     # 0x10afe8
leaq 0x60cba(%rip), %rsi     # 0xde288
movl $0x1b, %edx
callq 0x84e0
movq 0x8f141(%rip), %rsi     # 0x10c720
movq 0x8f142(%rip), %rdx     # 0x10c728
movq 0x8d9fb(%rip), %rdi     # 0x10afe8
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 0x2b8(%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 0x1c0(%rsp), %r15
leaq 0x128(%rsp), %r12
leaq 0x2b0(%rsp), %r13
leaq 0x378(%rsp), %rbp
movq %rbx, 0x1a8(%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 0x7d741
movq %r12, %rdi
movq %r15, %rsi
movl $0x9, %edx
callq 0x50624
movq 0x128(%rsp), %rsi
addq $0x20, %rsi
movq %r13, %rdi
callq 0x49f44
movq 0x128(%rsp), %rsi
movq %rax, %rdi
callq 0x33db0
movq 0x128(%rsp), %rbx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x3e394
addq $0x20, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x8270
movq %r12, %rdi
callq 0x3123c
jmp 0x7d6ae
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x2c8(%rsp), %r14
leaq 0x2b8(%rsp), %rax
cmpq %rax, %r14
je 0x7d7c1
leaq 0x597fa(%rip), %r15     # 0xd6f6a
leaq 0x5aad9(%rip), %r12     # 0xd8250
leaq 0x40(%rsp), %r13
leaq 0x20(%r14), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x8160
testl %eax, %eax
je 0x7d7a9
movq %rbp, %rdi
movq %r12, %rsi
callq 0x8160
testl %eax, %eax
je 0x7d7a9
movq %r13, %rdi
movq %rbp, %rsi
callq 0x33db0
movq %r14, %rdi
callq 0x8310
movq %rax, %r14
leaq 0x2b8(%rsp), %rax
cmpq %rax, %r14
jne 0x7d77c
movq 0x8d820(%rip), %rdi     # 0x10afe8
leaq 0x6c722(%rip), %rsi     # 0xe9ef1
movl $0xa, %edx
callq 0x84e0
movq 0x48(%rsp), %rsi
subq 0x40(%rsp), %rsi
sarq $0x5, %rsi
movq 0x8d7fa(%rip), %rdi     # 0x10afe8
callq 0x82f0
movq %rax, %r14
leaq 0x60aa7(%rip), %rsi     # 0xde2a4
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 0x8ef10(%rip), %rax     # 0x10c748
subq 0x8ef01(%rip), %rax     # 0x10c740
cmpq $0x40, %rax
jne 0x7dae4
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, 0x1b0(%rsp)
leaq 0xe0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x8eeea(%rip), %rsi     # 0x10c758
movq 0x8eeeb(%rip), %rdx     # 0x10c760
addq %rsi, %rdx
leaq 0xd0(%rsp), %rdi
callq 0x2e45c
leaq 0x60a37(%rip), %rsi     # 0xde2c3
leaq 0xd0(%rsp), %rdi
callq 0x88c0
movq 0x8eea0(%rip), %rax     # 0x10c740
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0xd0(%rsp), %rdi
callq 0x8180
leaq 0xc0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d8e4
movq %rdx, 0xb0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc0(%rsp)
jmp 0x7d8ed
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0xb0(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x5dc29(%rip), %rsi     # 0xdb53c
callq 0x88c0
leaq 0x190(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d948
movq %rdx, 0x180(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x190(%rsp)
jmp 0x7d951
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x180(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8edc9(%rip), %rax     # 0x10c740
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
callq 0x8180
leaq 0x168(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d9b4
movq %rdx, 0x158(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x168(%rsp)
jmp 0x7d9be
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x158(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x67171(%rip), %rsi     # 0xe4b55
callq 0x88c0
leaq 0x138(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7da19
movq %rdx, 0x128(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x138(%rsp)
jmp 0x7da22
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
movq 0x8(%rax), %rdx
leaq 0x128(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1b0(%rsp), %rdi
movl $0x10, %edx
callq 0x88d0
movq 0x128(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7da70
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x158(%rsp), %rdi
cmpq %r13, %rdi
je 0x7da8d
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x180(%rsp), %rdi
cmpq %r15, %rdi
je 0x7daaa
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0x7dac7
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0xd0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7dae4
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x168(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x8ec61(%rip), %rsi     # 0x10c758
movq 0x8ec62(%rip), %rdx     # 0x10c760
addq %rsi, %rdx
leaq 0x158(%rsp), %rdi
callq 0x2e45c
leaq 0x607c7(%rip), %rsi     # 0xde2dc
leaq 0x158(%rsp), %rdi
callq 0x88c0
leaq 0x607d0(%rip), %rsi     # 0xde2f9
leaq 0xd0(%rsp), %rdi
leaq 0x2f8(%rsp), %rdx
callq 0x77abc
leaq 0x5d9f7(%rip), %rsi     # 0xdb53c
leaq 0xd0(%rsp), %rdi
callq 0x88c0
leaq 0xc0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7db82
movq %rdx, 0xb0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc0(%rsp)
jmp 0x7db8b
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
movq 0x8(%rax), %rdx
leaq 0xb0(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8eba7(%rip), %rsi     # 0x10c758
movq 0x8eba8(%rip), %rdx     # 0x10c760
callq 0x8180
leaq 0x138(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7dbed
movq %rdx, 0x128(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x138(%rsp)
jmp 0x7dbf5
movupd (%rcx), %xmm0
movupd %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x128(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x66f3a(%rip), %rsi     # 0xe4b55
callq 0x88c0
leaq 0x190(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7dc50
movq %rdx, 0x180(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x190(%rsp)
jmp 0x7dc58
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x188(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x128(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7dc90
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0xb0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7dcad
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xe0(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x7dcce
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xb0(%rsp), %rdi
movq %rbp, (%rdi)
movq 0x8ea78(%rip), %rsi     # 0x10c758
movq 0x8ea79(%rip), %rdx     # 0x10c760
addq %rsi, %rdx
callq 0x2e45c
leaq 0x6061b(%rip), %rsi     # 0xde311
leaq 0xb0(%rsp), %rdi
callq 0x88c0
leaq 0x605ef(%rip), %rsi     # 0xde2f9
leaq 0x90(%rsp), %rdi
leaq 0x2f8(%rsp), %rdx
callq 0x77abc
leaq 0x5d816(%rip), %rsi     # 0xdb53c
leaq 0x90(%rsp), %rdi
callq 0x88c0
leaq 0x20(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7dd5a
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x7dd62
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0x10(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8e9d3(%rip), %rsi     # 0x10c758
movq 0x8e9d4(%rip), %rdx     # 0x10c760
callq 0x8180
movq %rbx, 0x128(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7ddbd
movq %rdx, 0x128(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x138(%rsp)
jmp 0x7ddc5
movupd (%rcx), %xmm0
movupd %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x128(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x6053e(%rip), %rsi     # 0xde329
callq 0x88c0
movq %r14, 0xd0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7de1c
movq %rdx, 0xd0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xe0(%rsp)
jmp 0x7de25
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0xd8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x128(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7de5d
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
movq 0x1a8(%rsp), %rbx
je 0x7de81
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7dea2
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq 0x158(%rsp), %rsi
movq %rax, 0x250(%rsp)
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq 0x180(%rsp), %rsi
movq %rax, 0x240(%rsp)
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq 0xb0(%rsp), %rsi
movq %rax, 0x248(%rsp)
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, %r12
movq 0xd0(%rsp), %rsi
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
xorpd %xmm0, %xmm0
leaq 0x220(%rsp), %rax
movapd %xmm0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
leaq 0x290(%rsp), %rax
movq %rcx, 0x10(%rax)
movapd %xmm0, (%rax)
leaq 0x200(%rsp), %rax
movq %rcx, 0x10(%rax)
movapd %xmm0, (%rax)
leaq 0x270(%rsp), %rax
movq %rcx, 0x10(%rax)
movapd %xmm0, (%rax)
leaq 0x1e0(%rsp), %rax
movq %rcx, 0x10(%rax)
movapd %xmm0, (%rax)
movq %rcx, 0x100(%rsp)
movapd %xmm0, 0xf0(%rsp)
leaq 0x130(%rsp), %rax
movl $0x0, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movl $0x0, 0x3c(%rsp)
movl %ecx, %eax
movq %rax, 0x60(%rsp)
decl %ecx
movq %rcx, 0x120(%rsp)
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %rbx, %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7ed89
movq 0x1c0(%rsp), %rdi
movq 0x1c8(%rsp), %rsi
addq %rdi, %rsi
movb $0xd, 0x10(%rsp)
leaq 0x10(%rsp), %rdx
callq 0x80103
movq %rax, %rcx
subq 0x1c0(%rsp), %rcx
movq %rcx, 0x1c8(%rsp)
movb $0x0, (%rax)
movq 0x1c0(%rsp), %rax
movb (%rax), %cl
cmpb $0x23, %cl
jne 0x7e070
cmpb $0x23, 0x1(%rax)
je 0x7dfd7
cmpb $0x23, %cl
jne 0x7e070
cmpb $0x43, 0x1(%rax)
je 0x7ea4e
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 0x7e13e
callq 0x82e0
subq 0x2e0(%rsp), %rax
cvtsi2sd %rax, %xmm0
divsd 0x5713b(%rip), %xmm0    # 0xd51e8
movsd %xmm0, 0x68(%rsp)
movl $0xa, %edx
movq 0x8cf29(%rip), %rdi     # 0x10afe8
leaq 0x5a360(%rip), %rsi     # 0xd8426
callq 0x84e0
movq 0x8cf16(%rip), %rdi     # 0x10afe8
movl 0x3c(%rsp), %esi
callq 0x8810
movq %rax, %r15
movl $0xd, %edx
movq %rax, %rdi
leaq 0x5d241(%rip), %rsi     # 0xdb32e
callq 0x84e0
movq %r15, %rdi
movsd 0x68(%rsp), %xmm0
callq 0x8730
movq %rax, %r15
movl $0x4, %edx
movq %rax, %rdi
leaq 0x6025c(%rip), %rsi     # 0xde36e
callq 0x84e0
movq (%r15), %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 0x90(%rsp), %r15
movq %r15, %rdi
leaq 0x1c0(%rsp), %rsi
movl $0x9, %edx
callq 0x50624
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movapd 0xf0(%rsp), %xmm0
movq 0x100(%rsp), %rax
movups 0x90(%rsp), %xmm1
movaps %xmm1, 0xf0(%rsp)
movq 0xa0(%rsp), %rcx
movq %rcx, 0x100(%rsp)
movapd 0x10(%rsp), %xmm1
movapd %xmm0, 0x10(%rsp)
movq %rax, 0x20(%rsp)
movupd %xmm1, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x3123c
movq %r15, %rdi
callq 0x3123c
movq 0xf0(%rsp), %rsi
movl $0x120, %eax            # imm = 0x120
addq %rax, %rsi
movq 0xf8(%rsp), %rdx
leaq 0x108(%rsp), %rdi
movq %rbx, %rcx
callq 0x7fa48
movq 0xf0(%rsp), %rax
leaq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq 0x60(%rax), %rsi
movq 0x68(%rax), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x2e45c
movq 0xf0(%rsp), %rax
leaq 0xa0(%rsp), %rcx
movq %rcx, 0x90(%rsp)
movq 0x80(%rax), %rsi
movq 0x88(%rax), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0x2e45c
cmpq $0x2, 0x18(%rsp)
setb %al
cmpq $0x2, 0x98(%rsp)
setb %cl
andb %al, %cl
movb %cl, 0xf(%rsp)
je 0x7e94a
movl $0x240, %edi            # imm = 0x240
callq 0x8470
leaq 0x108(%rsp), %r13
movq %rax, %rbp
movq 0x110(%rsp), %rdx
subq 0x108(%rsp), %rdx
shrq $0x5, %rdx
movq %rax, %rdi
leaq 0x3d8(%rsp), %rsi
callq 0x7fa8a
movq %rbp, %rdi
movq %r13, %rsi
leaq 0x3a8(%rsp), %rdx
callq 0x4fc66
movq 0x108(%rsp), %rbx
movq 0x110(%rsp), %r14
cmpq %rbx, %r14
je 0x7e309
leaq 0x10(%rbx), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x7e2f1
movq (%r15), %rsi
incq %rsi
callq 0x8480
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x7e2dd
movq %rbx, 0x110(%rsp)
movq 0x118(%rsp), %rax
cmpq 0x110(%rsp), %rax
je 0x7e323
movq %r13, %rdi
callq 0x8024a
cmpl $0x0, 0x60(%rsp)
jle 0x7e381
movq 0x1c0(%rbp), %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 0x7e35b
cmpl $-0x1, %r8d
jne 0x7e373
movq %rcx, %r9
movq (%r9,%rsi,2), %r8
movsd (%r8,%rdi,8), %xmm0
addsd 0x510d3(%rip), %xmm0    # 0xcf440
movsd %xmm0, (%r8,%rdi,8)
incq %rdi
addq $0xc, %rsi
cmpq %rdi, 0x60(%rsp)
jne 0x7e345
movq %rbp, 0x1a0(%rsp)
cmpl $0x2, 0x60(%rsp)
jl 0x7e473
movq 0x1a0(%rsp), %rax
movq 0x1c0(%rax), %rax
movq 0x290(%rsp), %rcx
addq $0x18, %rcx
movl $0x1, %edx
movl $0x6, %esi
movq 0x60(%rsp), %rdi
movq %rax, %r8
xorl %r9d, %r9d
movl (%rax,%r9,4), %ebx
cmpl $0x1, %ebx
je 0x7e3ff
movq 0x60(%rsp), %r10
movq %rcx, %r11
cmpl $-0x1, %ebx
jne 0x7e450
movq (%r11), %rbx
movsd (%rbx,%r9,8), %xmm0
addsd 0x51055(%rip), %xmm0    # 0xcf440
movsd %xmm0, (%rbx,%r9,8)
addq $0x18, %r11
decq %r10
cmpq %r10, %rdx
jne 0x7e3da
jmp 0x7e450
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 0x7e42c
cmpl $-0x1, %ebp
jne 0x7e444
movq %r10, %r15
movq (%r15,%r14,4), %r15
movsd (%r15,%r9,8), %xmm0
addsd 0x51002(%rip), %xmm0    # 0xcf440
movsd %xmm0, (%r15,%r9,8)
addq $0x6, %r14
incq %r11
cmpq %r11, %rdi
jne 0x7e418
incq %r9
incq %rdx
addq $0x18, %rcx
addq $0x6, %rsi
addq $0x4, %r8
decq %rdi
cmpq 0x120(%rsp), %r9
jne 0x7e3c4
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rax
subq %rsi, %rax
shrq $0x5, %rax
testl %eax, %eax
leaq 0x200(%rsp), %rbp
jle 0x7e577
movq 0x1a0(%rsp), %r13
addq $0xe0, %r13
xorl %ebx, %ebx
xorl %r14d, %r14d
xorl %r15d, %r15d
addq %rbx, %rsi
movq %r13, %rdi
callq 0x551e8
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0x7e4ee
movsd (%rax), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x78(%rsp)
jmp 0x7e4fb
leaq 0x70(%rsp), %rdi
movq %rax, %rdx
callq 0x79f34
movq 0x70(%rsp), %rax
movsd (%rax,%r15,8), %xmm0
ucomisd 0x4fb1a(%rip), %xmm0    # 0xce028
jbe 0x7e521
movsd 0x50f28(%rip), %xmm1    # 0xcf440
ucomisd %xmm0, %xmm1
movq %rbp, %rax
ja 0x7e535
ucomisd 0x50f1f(%rip), %xmm0    # 0xcf448
leaq 0x270(%rsp), %rax
jne 0x7e550
jp 0x7e550
movq (%rax), %rax
movq (%rax,%r14), %rax
movsd (%rax,%r15,8), %xmm0
addsd 0x50ef6(%rip), %xmm0    # 0xcf440
movsd %xmm0, (%rax,%r15,8)
incq %r15
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rax
subq %rsi, %rax
shrq $0x5, %rax
cltq
addq $0x18, %r14
addq $0x20, %rbx
cmpq %rax, %r15
jl 0x7e4c1
movq %r12, 0x2e8(%rsp)
movq 0x48(%rsp), %rax
subq 0x40(%rsp), %rax
shrq $0x5, %rax
cmpl $0x2, %eax
jl 0x7e8ee
movl $0x1, %ecx
movq %rcx, 0x68(%rsp)
movl $0x18, %ecx
movq %rcx, 0x268(%rsp)
movl $0x3, %ecx
movq %rcx, 0x260(%rsp)
movl $0x28, %ecx
movq %rcx, 0x258(%rsp)
xorl %ebx, %ebx
movq 0x70(%rsp), %rcx
movsd (%rcx,%rbx,8), %xmm0
ucomisd 0x4fa4d(%rip), %xmm0    # 0xce028
jbe 0x7e852
movsd 0x50e57(%rip), %xmm1    # 0xcf440
ucomisd %xmm0, %xmm1
jbe 0x7e852
leaq 0x1(%rbx), %rax
movq 0x40(%rsp), %r15
movq 0x48(%rsp), %rcx
subq %r15, %rcx
shrq $0x5, %rcx
movl %ecx, %ecx
cmpq %rcx, %rax
je 0x7e89c
movq 0x258(%rsp), %r12
movq 0x260(%rsp), %r14
movq 0x68(%rsp), %rbp
movq 0x70(%rsp), %rax
movsd (%rax,%rbp,8), %xmm0
ucomisd 0x4f9ee(%rip), %xmm0    # 0xce028
jbe 0x7e7ff
movsd 0x50df8(%rip), %xmm1    # 0xcf440
ucomisd %xmm0, %xmm1
jbe 0x7e7ff
movq 0x200(%rsp), %rax
movq (%rax,%r14,8), %rax
movsd (%rax,%rbx,8), %xmm0
addsd 0x50dd5(%rip), %xmm0    # 0xcf440
movsd %xmm0, (%rax,%rbx,8)
movq 0x8e0d1(%rip), %rax     # 0x10c748
movq 0x8e0c2(%rip), %r13     # 0x10c740
subq %r13, %rax
cmpq $0x40, %rax
jne 0x7e829
movq %rbx, %rax
shlq $0x5, %rax
leaq (%r15,%rax), %rdi
movq 0x8(%r15,%rax), %rcx
movq 0x8(%r13), %rax
movq %rax, 0x2f0(%rsp)
cmpq %rax, %rcx
jne 0x7e735
testq %rcx, %rcx
je 0x7e6f0
movq (%r13), %rsi
movq %rdi, 0x178(%rsp)
movq 0x178(%rsp), %rax
movq (%rax), %rdi
movq %rcx, %rdx
movq %rcx, 0x1b8(%rsp)
callq 0x8490
movq 0x178(%rsp), %rdi
movq 0x1b8(%rsp), %rcx
testl %eax, %eax
jne 0x7e735
movq (%r15,%r12), %rdx
cmpq 0x28(%r13), %rdx
jne 0x7e735
testq %rdx, %rdx
je 0x7e788
movq 0x20(%r13), %rsi
movq %rdi, 0x178(%rsp)
movq -0x8(%r15,%r12), %rdi
movq %rcx, 0x1b8(%rsp)
callq 0x8490
movq 0x178(%rsp), %rdi
movq 0x1b8(%rsp), %rcx
testl %eax, %eax
je 0x7e788
cmpq 0x28(%r13), %rcx
jne 0x7e829
testq %rcx, %rcx
je 0x7e75b
movq 0x20(%r13), %rsi
movq (%rdi), %rdi
movq %rcx, %rdx
callq 0x8490
testl %eax, %eax
jne 0x7e829
movq (%r15,%r12), %rdx
cmpq 0x2f0(%rsp), %rdx
jne 0x7e829
testq %rdx, %rdx
je 0x7e788
movq (%r13), %rsi
movq -0x8(%r15,%r12), %rdi
callq 0x8490
testl %eax, %eax
jne 0x7e829
movq 0xf0(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x1b0(%rsp), %rdi
callq 0x84e0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x534c8(%rip), %rsi     # 0xd1c7e
callq 0x84e0
movq 0xf0(%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
jmp 0x7e829
ucomisd 0x50c41(%rip), %xmm0    # 0xcf448
jne 0x7e829
jp 0x7e829
movq 0x270(%rsp), %rax
movq (%rax,%r14,8), %rax
movsd (%rax,%rbx,8), %xmm0
addsd 0x50c1c(%rip), %xmm0    # 0xcf440
movsd %xmm0, (%rax,%rbx,8)
incq %rbp
movq 0x40(%rsp), %r15
movq 0x48(%rsp), %rax
subq %r15, %rax
shrq $0x5, %rax
movl %eax, %eax
addq $0x3, %r14
addq $0x20, %r12
cmpq %rax, %rbp
jne 0x7e628
jmp 0x7e89c
ucomisd 0x50bee(%rip), %xmm0    # 0xcf448
jne 0x7e89c
jp 0x7e89c
leaq 0x1(%rbx), %rcx
movl %eax, %eax
cmpq %rax, %rcx
je 0x7e89c
movq 0x270(%rsp), %rcx
addq 0x268(%rsp), %rcx
movq (%rcx), %rdx
movsd (%rdx,%rbx,8), %xmm0
addsd 0x50bb7(%rip), %xmm0    # 0xcf440
movsd %xmm0, (%rdx,%rbx,8)
addq $0x18, %rcx
decq %rax
cmpq %rax, 0x68(%rsp)
jne 0x7e879
incq %rbx
movq 0x48(%rsp), %rcx
subq 0x40(%rsp), %rcx
movq %rcx, %rax
shrq $0x5, %rax
shlq $0x1b, %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
addq %rdx, %rcx
sarq $0x20, %rcx
incq 0x68(%rsp)
addq $0x18, 0x268(%rsp)
addq $0x3, 0x260(%rsp)
addq $0x20, 0x258(%rsp)
cmpq %rcx, %rbx
jl 0x7e5c9
movq 0x1a0(%rsp), %rbx
movq %rbx, %rdi
callq 0x7fed0
movl $0x240, %esi            # imm = 0x240
movq %rbx, %rdi
callq 0x8480
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x7e925
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0xc0(%rsp), %rbp
movq 0x1a8(%rsp), %rbx
leaq 0xe0(%rsp), %r14
movq 0x2e8(%rsp), %r12
jmp 0x7e9f6
movq $0x0, 0x18(%rsp)
movq 0x10(%rsp), %rax
movb $0x0, (%rax)
movq %rbx, %rdi
callq 0x8290
movq $0x0, 0x98(%rsp)
movq 0x90(%rsp), %rax
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x8290
movq 0x108(%rsp), %rbx
movq 0x110(%rsp), %r14
cmpq %rbx, %r14
je 0x7e9c7
leaq 0x10(%rbx), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x7e9af
movq (%r15), %rsi
incq %rsi
callq 0x8480
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x7e99b
movq %rbx, 0x110(%rsp)
movq 0x118(%rsp), %rax
cmpq 0x110(%rsp), %rax
movq 0x1a8(%rsp), %rbx
leaq 0xe0(%rsp), %r14
je 0x7e9f6
leaq 0x108(%rsp), %rdi
callq 0x8024a
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x7ea1b
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x7ea37
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x108(%rsp), %rdi
callq 0x3123c
cmpb $0x0, 0xf(%rsp)
jmp 0x7dfd7
leaq 0x90(%rsp), %r13
movq %r13, %rdi
leaq 0x1c0(%rsp), %rsi
movl $0x9, %edx
callq 0x50624
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movapd 0xf0(%rsp), %xmm0
movq 0x100(%rsp), %rax
movups 0x90(%rsp), %xmm1
movaps %xmm1, 0xf0(%rsp)
movq 0xa0(%rsp), %rcx
movq %rcx, 0x100(%rsp)
movapd 0x10(%rsp), %xmm1
movapd %xmm0, 0x10(%rsp)
movq %rax, 0x20(%rsp)
movupd %xmm1, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x3123c
movq %r13, %rdi
callq 0x3123c
movq 0xf0(%rsp), %rsi
movl $0x120, %eax            # imm = 0x120
addq %rax, %rsi
movq 0xf8(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rcx
callq 0x7fa48
leaq 0x1e0(%rsp), %rdi
movq %r13, %rsi
callq 0x32ffe
movq 0x1e0(%rsp), %rax
movq 0x1e8(%rsp), %rcx
movq $0x0, 0x10(%rsp)
subq %rax, %rcx
je 0x7eb93
xorl %esi, %esi
shlq $0x5, %rsi
addq %rax, %rsi
leaq 0x378(%rsp), %rdi
callq 0x3e394
movq %rax, %r15
leaq 0x3a8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5d80c
movq %rax, %rdi
movq %r15, %rsi
callq 0x8270
movq 0x10(%rsp), %rsi
incq %rsi
movq %rsi, 0x10(%rsp)
movq 0x1e0(%rsp), %rax
movq 0x1e8(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rcx, %rsi
jne 0x7eb34
jmp 0x7eb97
sarq $0x5, %rcx
movq %rcx, 0x120(%rsp)
movq 0x2c8(%rsp), %r13
leaq 0x2b8(%rsp), %rax
cmpq %rax, %r13
je 0x7ecfa
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x2e45c
leaq 0x40(%r13), %rsi
leaq 0x108(%rsp), %r15
movq %r15, %rdi
callq 0x3273a
leaq 0x70(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
movq %r15, %rdx
callq 0x53501
movq 0x70(%rsp), %rax
cmpq 0x78(%rsp), %rax
jne 0x7ec88
movl $0x29, %edx
movq 0x8c3d0(%rip), %rdi     # 0x10afe8
leaq 0x5979c(%rip), %rsi     # 0xd83bb
callq 0x84e0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x8c3b3(%rip), %rdi     # 0x10afe8
callq 0x84e0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x584d3(%rip), %rsi     # 0xd711f
callq 0x84e0
movq (%r15), %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 0x70(%rsp), %rax
cmpq 0x78(%rsp), %rax
je 0x7f13d
leaq 0x3d8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5d872
movq %rax, %rdi
leaq 0x70(%rsp), %rsi
callq 0x5d8ee
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x7ecc1
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x108(%rsp), %rdi
callq 0x3123c
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x7ecea
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r13, %rdi
callq 0x8310
movq %rax, %r13
jmp 0x7eba7
leaq 0x220(%rsp), %rdi
movq 0x120(%rsp), %rsi
xorl %edx, %edx
callq 0x50664
leaq 0x290(%rsp), %rdi
movq 0x120(%rsp), %rsi
xorl %edx, %edx
callq 0x50664
movq 0x48(%rsp), %rsi
subq 0x40(%rsp), %rsi
shrq $0x5, %rsi
leaq 0x200(%rsp), %rdi
xorl %edx, %edx
callq 0x50664
movq 0x48(%rsp), %rsi
subq 0x40(%rsp), %rsi
shrq $0x5, %rsi
leaq 0x270(%rsp), %rdi
xorl %edx, %edx
callq 0x50664
callq 0x82e0
movq %rax, 0x2e0(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x3123c
movq 0x120(%rsp), %rcx
jmp 0x7dfc6
leaq 0x360(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x3273a
leaq 0x360(%rsp), %rdi
movq 0x250(%rsp), %rbx
movq %rbx, %rsi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x39979
leaq 0x360(%rsp), %rdi
callq 0x3123c
leaq 0x220(%rsp), %rdi
movq %rbx, %rsi
callq 0x5aeca
cvtsi2sdl 0x3c(%rsp), %xmm0
movsd %xmm0, 0x68(%rsp)
cmpl $0x0, 0x60(%rsp)
jle 0x7ee60
movq 0x290(%rsp), %rax
movq 0x220(%rsp), %rcx
movq 0x60(%rsp), %rdx
leaq (,%rdx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
movsd 0x50625(%rip), %xmm3    # 0xcf440
movsd 0x68(%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 0x7ee23
incq %rsi
cmpq 0x60(%rsp), %rsi
jne 0x7ee21
leaq 0x348(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x3273a
leaq 0x348(%rsp), %rdi
movq 0x248(%rsp), %rbx
movq %rbx, %rsi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x39979
leaq 0x348(%rsp), %rdi
callq 0x3123c
leaq 0x220(%rsp), %rdi
movq %rbx, %rsi
callq 0x5aeca
leaq 0x330(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x3273a
leaq 0x330(%rsp), %rdi
movq 0x240(%rsp), %rbx
movq %rbx, %rsi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x39979
leaq 0x330(%rsp), %rdi
callq 0x3123c
leaq 0x200(%rsp), %rdi
movq %rbx, %rsi
callq 0x5aeca
movq 0x48(%rsp), %rax
subq 0x40(%rsp), %rax
shrq $0x5, %rax
testl %eax, %eax
jle 0x7ef7d
movq 0x270(%rsp), %rcx
movq 0x200(%rsp), %rdx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %esi, %esi
movsd 0x5050a(%rip), %xmm3    # 0xcf440
movsd 0x68(%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 0x7ef42
incq %rsi
cmpq %rax, %rsi
jne 0x7ef3c
leaq 0x318(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x3273a
leaq 0x318(%rsp), %rdi
movq %r12, %rsi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x39979
leaq 0x318(%rsp), %rdi
callq 0x3123c
leaq 0x200(%rsp), %rdi
movq %r12, %rsi
callq 0x5aeca
leaq 0x128(%rsp), %rdi
callq 0x800b6
leaq 0xf0(%rsp), %rdi
callq 0x3123c
leaq 0x1e0(%rsp), %rdi
callq 0x3123c
leaq 0x270(%rsp), %rdi
callq 0x45f06
leaq 0x200(%rsp), %rdi
callq 0x45f06
leaq 0x290(%rsp), %rdi
callq 0x45f06
leaq 0x220(%rsp), %rdi
callq 0x45f06
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x7f03e
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0xb0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7f05b
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x7f080
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x7f0a5
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x40(%rsp), %rdi
callq 0x3123c
leaq 0x3a8(%rsp), %rdi
callq 0x5ddda
leaq 0x3d8(%rsp), %rdi
callq 0x5de52
leaq 0x378(%rsp), %rdi
callq 0x3f5f4
leaq 0x2b0(%rsp), %rdi
callq 0x3f522
leaq 0x308(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7f104
movq 0x308(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x1c0(%rsp), %rdi
leaq 0x1d0(%rsp), %rax
cmpq %rax, %rdi
je 0x7f129
movq 0x1d0(%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 0x592a1(%rip), %rdi     # 0xd83e5
leaq 0x5f1ea(%rip), %rsi     # 0xde335
leaq 0x5f1fc(%rip), %rcx     # 0xde34e
movl $0x77, %edx
callq 0x82c0
jmp 0x7f55b
jmp 0x7f55b
jmp 0x7f246
movq %rax, %r12
jmp 0x7f464
movq %rax, %r12
jmp 0x7f471
jmp 0x7f246
movq %rax, %r12
movq 0x128(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7f1a5
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7f1a5
movq %rax, %r12
movq 0x158(%rsp), %rdi
cmpq %r13, %rdi
je 0x7f1c7
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7f1c7
movq %rax, %r12
movq 0x180(%rsp), %rdi
cmpq %r15, %rdi
je 0x7f1e9
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7f1e9
movq %rax, %r12
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0x7f20d
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7f20d
jmp 0x7f20a
movq %rax, %r12
movq 0xd0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7f22f
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7f22f
movq %rax, %r12
movl $0x200, %esi            # imm = 0x200
movq 0x1b0(%rsp), %rdi
jmp 0x7f638
jmp 0x7f4bd
movq %rax, %r12
jmp 0x7f48d
jmp 0x7f250
movq %rax, %rdi
callq 0x287e1
movq %rax, %r12
movl $0x240, %esi            # imm = 0x240
movq %rbp, %rdi
jmp 0x7f4f6
movq %rax, %r12
leaq 0x318(%rsp), %rdi
jmp 0x7f29a
movq %rax, %r12
leaq 0x330(%rsp), %rdi
jmp 0x7f29a
movq %rax, %r12
leaq 0x348(%rsp), %rdi
jmp 0x7f29a
movq %rax, %r12
leaq 0x360(%rsp), %rdi
callq 0x3123c
jmp 0x7f55e
movq %r12, %rdi
movq %rax, %r12
movl $0x200, %esi            # imm = 0x200
jmp 0x7f2eb
jmp 0x7f2f5
movq %rax, %r12
movl $0x200, %esi            # imm = 0x200
movq 0x248(%rsp), %rdi
jmp 0x7f2eb
jmp 0x7f2f5
movq %rax, %r12
movl $0x200, %esi            # imm = 0x200
movq 0x240(%rsp), %rdi
jmp 0x7f2eb
jmp 0x7f2f5
movq %rax, %r12
movl $0x200, %esi            # imm = 0x200
movq 0x250(%rsp), %rdi
callq 0x8480
jmp 0x7f5b9
movq %rax, %r12
jmp 0x7f5b9
movq %rax, %r12
movq 0x128(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7f322
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7f322
movq %rax, %r12
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x7f343
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7f343
movq %rax, %r12
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7f369
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7f369
movq %rax, %r12
leaq 0xc0(%rsp), %rbp
jmp 0x7f5d6
movq %rax, %r12
jmp 0x7f5d6
movq %rax, %r12
jmp 0x7f5f3
movq %rax, %r12
movq 0x128(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7f3ab
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7f3ab
movq %rax, %r12
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x7f3d5
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x7f3d5
movq %rax, %r12
leaq 0xe0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7f618
movq 0xe0(%rsp), %rsi
jmp 0x7f610
jmp 0x7f3f9
movq %rax, %r12
jmp 0x7f618
jmp 0x7f4bd
jmp 0x7f43f
movq %rax, %r12
movl $0x208, %esi            # imm = 0x208
movq %r14, %rdi
jmp 0x7f6a9
jmp 0x7f43f
movq %rax, %r12
leaq 0x2c0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7f6ae
movq 0x2c0(%rsp), %rsi
jmp 0x7f6a6
movq %rax, %r12
jmp 0x7f6ae
movq %rax, %r12
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x7f464
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0x108(%rsp), %rdi
callq 0x3123c
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x7f48d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x90(%rsp), %rdi
jmp 0x7f544
movq %rax, %r12
jmp 0x7f4fb
movq %rax, %r12
jmp 0x7f520
movq %rax, %r12
jmp 0x7f53c
jmp 0x7f55b
jmp 0x7f55b
jmp 0x7f55b
jmp 0x7f4bd
movq %rax, %r12
jmp 0x7f63d
jmp 0x7f55b
movq %rax, %r12
jmp 0x7f68d
jmp 0x7f4de
jmp 0x7f55b
jmp 0x7f644
movq %rax, %r12
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x7f4fb
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x7f520
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x7f53c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x108(%rsp), %rdi
callq 0x3123c
leaq 0xc0(%rsp), %rbp
leaq 0xe0(%rsp), %r14
jmp 0x7f55e
movq %rax, %r12
leaq 0x128(%rsp), %rdi
callq 0x800b6
leaq 0xf0(%rsp), %rdi
callq 0x3123c
leaq 0x1e0(%rsp), %rdi
callq 0x3123c
leaq 0x270(%rsp), %rdi
callq 0x45f06
leaq 0x200(%rsp), %rdi
callq 0x45f06
leaq 0x290(%rsp), %rdi
callq 0x45f06
leaq 0x220(%rsp), %rdi
callq 0x45f06
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x7f5d6
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0xb0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7f5f3
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x7f618
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x7f63d
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x40(%rsp), %rdi
jmp 0x7f654
movq %rax, %r12
jmp 0x7f659
movq %rax, %r12
leaq 0x128(%rsp), %rdi
callq 0x3123c
leaq 0x3a8(%rsp), %rdi
callq 0x5ddda
leaq 0x3d8(%rsp), %rdi
callq 0x5de52
leaq 0x378(%rsp), %rdi
callq 0x3f5f4
leaq 0x2b0(%rsp), %rdi
callq 0x3f522
leaq 0x308(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7f6ae
movq 0x308(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x1c0(%rsp), %rdi
leaq 0x1d0(%rsp), %rax
cmpq %rax, %rdi
je 0x7f6d3
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r12, %rdi
callq 0x8840