// File: /workspace/github_cpp_makefile_star2_O3/millanek[P]evo/process_vcf_testing.cpp
// Function: testMain(int, char**)
int testMain(int argc, char** argv) {
    parseTestOptions(argc, argv);
    std::ios_base::openmode mode = std::ios_base::in;
    string fileName = opt::vcfFile;
    string fileRoot = stripExtension(fileName);
    std::vector<int> depthsHetFailed;
    std::vector<int> depthsHetPassed;
    std::vector<int> numVariantsPerHetCount;
    std::vector<std::vector<int> > num_indiv_het_vs_depth;
    
    
    std::cerr << "Filtering variants from: " << fileName << std::endl;
    std::cerr << "Maximum read depth (overall) set to: " << opt::max_overall_depth << std::endl;
    std::cerr << "Minimum copies for a variant (e.g. 1 for allowing singletons): " << opt::min_copies << std::endl;
    std::cerr << "Minimum read depth at the variant position: " << opt::min_depth_in_any_individual << std::endl;
    std::cerr << "Filter out sites where more than " << opt::max_het_indiv << " individuals are heterozygous"  << std::endl;
    
    // Open connection to read from the vcf file
    std::ifstream* inFile = new std::ifstream(fileName.c_str(), mode);
    
    
    bool gotChromosomeNumber = false;
    int numChromosomes;
    string line;
    int totalVariantNumber = 0;
    while (getline(*inFile, line)) {
        if (line[0] == '#') 
            std::cout << line << std::endl;  
        else {
            totalVariantNumber++;
            FilterResult result;
            std::vector<std::string> fields = split(line, '\t');
            if (!gotChromosomeNumber) {
                const std::vector<std::string>::size_type numSamples = fields.size() - NUM_NON_GENOTYPE_COLUMNS;
                numVariantsPerHetCount.assign(numSamples + 1, 0);
                numChromosomes = (int)numSamples * 2;
                std::cerr << "Number of chromosomes: " << numChromosomes << std::endl;
                gotChromosomeNumber = true;
            }
            result.overallQuality = atoi(fields[5].c_str());
            
            
            if (result.overallQuality >= MIN_OVERALL_VARIANT_PHRED_QUAL) {
                result.overallDepthPassed = testOverallReadDepth(opt::max_overall_depth,opt::min_overall_depth,fields[7]);
                result.biallelicPassed = testBiallelic(fields[4]);
            }
                
            if (result.biallelicPassed) 
                result.counts = getThisVariantCounts(fields);
            
            
            if (result.biallelicPassed && result.counts.overall <= (numChromosomes - opt::min_copies) && result.counts.overall >= opt::min_copies) {
                if (result.counts.minimumDepthInAnIndividual >= opt::min_depth_in_any_individual) {
                    // filter out sites where more than MAX_NUM_HET individuals are heterozygous
                    bool mnhPassed = testMaxNumHet(result, depthsHetFailed, depthsHetPassed, numVariantsPerHetCount, opt::max_het_indiv,num_indiv_het_vs_depth);
                    if (result.overallDepthPassed && mnhPassed) {
                        std::cout << line << std::endl;
                    }
                }
            }  
        }
    }
    
    std::cerr << "Finished filtering; tabulating depths\n" << std::endl;
    // Does the same as R function table
    std::map<int, int> tableHetFailed = tabulateVector(depthsHetFailed);
    std::map<int, int> tableHetPassed = tabulateVector(depthsHetPassed);
    
    std::ios_base::openmode mode_out = std::ios_base::out;
    string hetFailedFileName = fileRoot + ".het_filter.failed_max" + numToString<int>(opt::max_het_indiv);
    std::ofstream* pHetFailOutFile = new std::ofstream(hetFailedFileName.c_str(), mode_out);
    *pHetFailOutFile << "# Failed HetFilter:" << fileName << std::endl;
    *pHetFailOutFile << "Depth\tNum_variants" << std::endl;
    for (std::map<int, int>::const_iterator iter = tableHetFailed.begin(); iter != tableHetFailed.end(); ++iter) {
        *pHetFailOutFile << iter->first << "\t" << iter->second << std::endl;
    }


    string hetPassedFileName = fileRoot + ".het_filter.passed_max" + numToString<int>(opt::max_het_indiv);
    std::ofstream* pHetPassOutFile = new std::ofstream(hetPassedFileName.c_str(), mode_out);
    *pHetPassOutFile << "# Passed HetFilter:" << fileName << std::endl;
    *pHetPassOutFile << "Depth\tNum_variants" << std::endl;
    for (std::map<int, int>::const_iterator iter = tableHetPassed.begin(); iter != tableHetPassed.end(); ++iter) {
        *pHetPassOutFile << iter->first << "\t" << iter->second << std::endl;
    }
    
    string hetVarCountName = fileRoot + ".het_filter.variants_per_het_count_max" + numToString<int>(opt::max_het_indiv);;
    std::ofstream* pHetVarCountFile = new std::ofstream(hetVarCountName.c_str(), mode_out);
    *pHetVarCountFile << "# Number of variants per each het count: " << fileName << std::endl;
    *pHetVarCountFile << "Num_hets\tNum_variants" << std::endl;
    for (std::vector<int>::size_type i = 0; i != numVariantsPerHetCount.size(); i++) {
        *pHetVarCountFile << i << "\t" << numVariantsPerHetCount[i] << std::endl;
    }
    
    string hetDepthScatterplotName = fileRoot + ".het_filter.depth_scatterplot" + numToString<int>(opt::max_het_indiv);;
    std::ofstream* pHetDepthScatterplotFile = new std::ofstream(hetDepthScatterplotName.c_str(), mode_out);
    *pHetDepthScatterplotFile << "# Number of hets and depth for individual variants for a scatterplot: " << fileName << std::endl;
    *pHetDepthScatterplotFile << "Num_hets\tDepth" << std::endl;
    print_matrix<std::vector<std::vector<int> >&>(num_indiv_het_vs_depth, *pHetDepthScatterplotFile);
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3b8, %rsp            # imm = 0x3B8
callq 0x652fe
leaq 0xb0(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x9f6cf(%rip), %rsi     # 0x103360
movq 0x9f6d0(%rip), %rdx     # 0x103368
addq %rsi, %rdx
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0x2ba06
leaq 0xe0(%rsp), %rdi
movq %rbx, %rsi
callq 0x4d82f
xorps %xmm0, %xmm0
movaps %xmm0, 0x140(%rsp)
xorl %eax, %eax
movq %rax, 0x150(%rsp)
movq %rax, 0x130(%rsp)
movaps %xmm0, 0x120(%rsp)
movq %rax, 0xd0(%rsp)
movaps %xmm0, 0xc0(%rsp)
movq %rax, 0x190(%rsp)
movaps %xmm0, 0x180(%rsp)
movq 0x9e2e1(%rip), %rdi     # 0x101fe8
leaq 0x6f15a(%rip), %rsi     # 0xd2e68
movl $0x19, %edx
callq 0x84e0
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq 0x9e2b9(%rip), %rdi     # 0x101fe8
callq 0x84e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x9e283(%rip), %rdi     # 0x101fe8
leaq 0x6f147(%rip), %rsi     # 0xd2eb3
movl $0x25, %edx
callq 0x84e0
movl 0x9e7cc(%rip), %esi     # 0x102548
movq 0x9e265(%rip), %rdi     # 0x101fe8
callq 0x8810
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x9e22f(%rip), %rdi     # 0x101fe8
leaq 0x6f13f(%rip), %rsi     # 0xd2eff
movl $0x3f, %edx
callq 0x84e0
movl 0x9e77c(%rip), %esi     # 0x10254c
movq 0x9e211(%rip), %rdi     # 0x101fe8
callq 0x8810
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x9e1db(%rip), %rdi     # 0x101fe8
leaq 0x6f12b(%rip), %rsi     # 0xd2f3f
movl $0x2c, %edx
callq 0x84e0
movl 0x9e72c(%rip), %esi     # 0x102550
movq 0x9e1bd(%rip), %rdi     # 0x101fe8
callq 0x8810
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x9e187(%rip), %rdi     # 0x101fe8
leaq 0x6f169(%rip), %rsi     # 0xd2fd1
movl $0x21, %edx
callq 0x84e0
movl 0x9e6dc(%rip), %esi     # 0x102554
movq 0x9e169(%rip), %rdi     # 0x101fe8
callq 0x8810
movq %rax, %rbx
leaq 0x6f165(%rip), %rsi     # 0xd2ff3
movl $0x1d, %edx
movq %rax, %rdi
callq 0x84e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %r15
movq 0xa0(%rsp), %rsi
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
leaq 0x110(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x1a8(%rsp), %rbx
leaq 0x100(%rsp), %r14
movq 0x9e0a6(%rip), %r12     # 0x101fb8
xorl %r13d, %r13d
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x644da
movq 0x100(%rsp), %rsi
cmpb $0x23, (%rsi)
jne 0x63f92
movq 0x108(%rsp), %rdx
movq %r12, %rdi
callq 0x84e0
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbp, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
jmp 0x63f15
movaps 0x6ddb7(%rip), %xmm0    # 0xd1d50
movaps %xmm0, 0x1a0(%rsp)
xorl %ecx, %ecx
movl %ecx, 0x1b0(%rsp)
leaq 0x1c8(%rsp), %rax
movq %rax, 0x1b8(%rsp)
movq %rcx, 0x1c0(%rsp)
movb %cl, 0x1c8(%rsp)
leaq 0x1e8(%rsp), %rax
movq %rax, 0x1d8(%rsp)
movq %rcx, 0x1e0(%rsp)
movb %cl, 0x1e8(%rsp)
movsd 0x67d30(%rip), %xmm0    # 0xcbd20
movups %xmm0, 0x1f8(%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x208(%rsp)
movb %cl, 0x210(%rsp)
movq %rcx, 0x288(%rsp)
movl %ecx, 0x290(%rsp)
movq %rcx, 0x298(%rsp)
movw $0x0, 0x2a0(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0xcc(%rbx)
movups %xmm0, 0xc0(%rbx)
movups %xmm0, 0xb0(%rbx)
movups %xmm0, 0xa0(%rbx)
movups %xmm0, 0x90(%rbx)
movups %xmm0, 0x80(%rbx)
movups %xmm0, 0x70(%rbx)
movw $0x101, 0x2a8(%rsp)     # imm = 0x101
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
movl $0x9, %edx
callq 0x4d650
testb $0x1, %r13b
jne 0x64121
movq 0x88(%rsp), %r13
subq 0x80(%rsp), %r13
sarq $0x5, %r13
leaq -0x8(%r13), %rsi
movl $0x0, 0x2b8(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0x2b8(%rsp), %rdx
callq 0x56106
movl $0x17, %edx
movq 0x9df18(%rip), %rdi     # 0x101fe8
leaq 0x6de0c(%rip), %rsi     # 0xd1ee3
callq 0x84e0
leal -0x12(,%r13,2), %esi
movq 0x9defd(%rip), %rdi     # 0x101fe8
movl %esi, 0xdc(%rsp)
callq 0x8810
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbp, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0x80(%rsp), %rbp
movq 0xa0(%rbp), %rdi
callq 0x86e0
movl %eax, 0x1a0(%rsp)
cmpl $0x1d, %eax
jle 0x64179
movl 0x9e401(%rip), %edi     # 0x102548
addq $0xe0, %rbp
xorl %esi, %esi
movq %rbp, %rdx
callq 0x4f8ca
movb %al, 0x1a5(%rsp)
movq 0x80(%rsp), %rdi
subq $-0x80, %rdi
callq 0x4f891
movb %al, 0x2a8(%rsp)
jmp 0x64180
movb 0x2a8(%rsp), %al
testb $0x1, %al
je 0x643fb
leaq 0x2b8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x4e40d
movl 0x2c0(%rsp), %eax
movl %eax, 0x8(%rbx)
movq 0x2b8(%rsp), %rax
movq %rax, (%rbx)
leaq 0x1b8(%rsp), %rdi
leaq 0x2c8(%rsp), %r13
movq %r13, %rsi
callq 0x8540
leaq 0x1d8(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
callq 0x8540
movups 0x40(%r13), %xmm0
movups 0x49(%r13), %xmm1
movups %xmm0, 0x50(%rbx)
movups %xmm1, 0x59(%rbx)
movq 0x218(%rsp), %rdi
movq 0x228(%rsp), %rsi
movups 0x328(%rsp), %xmm0
movups %xmm0, 0x218(%rsp)
movq 0x338(%rsp), %rax
movq %rax, 0x228(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%r13)
movq $0x0, 0x70(%r13)
testq %rdi, %rdi
je 0x6423e
subq %rdi, %rsi
callq 0x8480
movq 0x230(%rsp), %rdi
movq 0x240(%rsp), %rsi
movups 0x340(%rsp), %xmm0
movaps %xmm0, 0x230(%rsp)
movq 0x350(%rsp), %rax
movq %rax, 0x240(%rsp)
leaq 0x2c8(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x78(%rax)
movq $0x0, 0x88(%rax)
testq %rdi, %rdi
je 0x64295
subq %rdi, %rsi
callq 0x8480
movq 0x248(%rsp), %rdi
movq 0x258(%rsp), %rsi
movups 0x358(%rsp), %xmm0
movups %xmm0, 0x248(%rsp)
movq 0x368(%rsp), %rax
movq %rax, 0x258(%rsp)
leaq 0x2c8(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x90(%rax)
movq $0x0, 0xa0(%rax)
testq %rdi, %rdi
je 0x642ef
subq %rdi, %rsi
callq 0x8480
movq 0x260(%rsp), %rdi
movq 0x270(%rsp), %rsi
movups 0x370(%rsp), %xmm0
movaps %xmm0, 0x260(%rsp)
movq 0x380(%rsp), %rax
movq %rax, 0x270(%rsp)
leaq 0x2c8(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0xa8(%rax)
movq $0x0, 0xb8(%rax)
testq %rdi, %rdi
je 0x64349
subq %rdi, %rsi
callq 0x8480
movq 0x278(%rsp), %rdi
testq %rdi, %rdi
je 0x6437d
movq 0x298(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq $0x0, 0x278(%rsp)
movl $0x0, 0x280(%rsp)
leaq 0x2c8(%rsp), %rcx
movq 0xe0(%rcx), %rax
movq %rax, 0xf0(%rbx)
movups 0xc0(%rcx), %xmm0
movups 0xd0(%rcx), %xmm1
movups %xmm1, 0xe0(%rbx)
movups %xmm0, 0xd0(%rbx)
xorl %eax, %eax
movq %rax, 0x388(%rsp)
movl %eax, 0x390(%rsp)
movq %rax, 0x398(%rsp)
movl %eax, 0x3a0(%rsp)
movq %rax, 0x3a8(%rsp)
movzwl 0x3b0(%rsp), %eax
movw %ax, 0x2a0(%rsp)
leaq 0x2b8(%rsp), %rdi
callq 0x2e6d0
movb 0x2a8(%rsp), %al
testb $0x1, %al
je 0x644bd
movl 0x1a8(%rsp), %eax
movl 0x9e13c(%rip), %ecx     # 0x10254c
cmpl %ecx, %eax
jl 0x644bd
movl 0xdc(%rsp), %edx
subl %ecx, %edx
cmpl %edx, %eax
jg 0x644bd
movl 0x1ac(%rsp), %eax
cmpl 0x9e11a(%rip), %eax     # 0x102550
jl 0x644bd
movl 0x9e111(%rip), %r8d     # 0x102554
leaq 0x1a0(%rsp), %rdi
leaq 0x140(%rsp), %rsi
leaq 0x120(%rsp), %rdx
leaq 0xc0(%rsp), %rcx
leaq 0x180(%rsp), %r9
callq 0x4f95b
andb 0x1a5(%rsp), %al
cmpb $0x1, %al
jne 0x644bd
movq 0x100(%rsp), %rsi
movq 0x108(%rsp), %rdx
movq %r12, %rdi
callq 0x84e0
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbp, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
leaq 0x80(%rsp), %rdi
callq 0x2e784
movq %rbx, %rdi
callq 0x2e6d0
movb $0x1, %r13b
jmp 0x63f15
movq 0x9db07(%rip), %r14     # 0x101fe8
leaq 0x6fbd8(%rip), %rsi     # 0xd40c0
movl $0x26, %edx
movq %r14, %rdi
callq 0x84e0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq 0x9dad5(%rip), %rdi     # 0x101fe8
callq 0x8040
movq %rax, %rdi
callq 0x8300
leaq 0x1a0(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x4fad5
leaq 0x2b8(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x4fad5
leaq 0x50(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0xe0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x2ba06
leaq 0x6fb70(%rip), %rsi     # 0xd40e7
leaq 0x40(%rsp), %rdi
callq 0x88c0
movl 0x9dfcd(%rip), %esi     # 0x102554
movq %rsp, %rdi
callq 0x2e7e2
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %r8
movq 0x8(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %rbp, %rcx
je 0x645b1
movq 0x50(%rsp), %rdi
movq (%rsp), %rsi
cmpq %rdi, %rax
jbe 0x645d3
leaq 0x10(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x645ce
movq 0x10(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x645df
leaq 0x40(%rsp), %rdi
callq 0x8180
jmp 0x645eb
movq %rsp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x84d0
leaq 0x90(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x64618
movq %rsi, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
jmp 0x6461e
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x88(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64659
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x64670
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, %r15
movq 0x80(%rsp), %rsi
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
leaq 0x6fa65(%rip), %rsi     # 0xd40fe
movl $0x13, %edx
movq %r15, %rdi
callq 0x84e0
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq %r15, %rdi
callq 0x84e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
leaq 0x6fa23(%rip), %rsi     # 0xd4112
movl $0x12, %edx
movq %r15, %rdi
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 0x1b8(%rsp), %r14
cmpq %rbx, %r14
je 0x6479c
leaq 0x69293(%rip), %r12     # 0xcd9ca
movl 0x20(%r14), %esi
movq %r15, %rdi
callq 0x8810
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x84e0
movl 0x24(%r14), %esi
movq %r13, %rdi
callq 0x8810
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 %r14, %rdi
callq 0x84f0
movq %rax, %r14
cmpq %rbx, %rax
jne 0x64737
movq %rsp, %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, (%rdi)
movq 0xe0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
addq %rsi, %rdx
callq 0x2ba06
leaq 0x6f95f(%rip), %rsi     # 0xd4125
movq %rsp, %rdi
callq 0x88c0
movl 0x9dd80(%rip), %esi     # 0x102554
leaq 0x20(%rsp), %rdi
callq 0x2e7e2
movq (%rsp), %rcx
movq 0x8(%rsp), %r8
movq 0x28(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %rbx, %rcx
je 0x647ff
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x64822
leaq 0x30(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x6481d
movq 0x30(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x6482c
movq %rsp, %rdi
callq 0x8180
jmp 0x6483a
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x84d0
movq %rbp, 0x40(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x6485a
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x64861
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x30(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x64899
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x8480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x648b4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, %rbx
movq 0x40(%rsp), %rsi
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
leaq 0x6f862(%rip), %rsi     # 0xd413c
movl $0x13, %edx
movq %rbx, %rdi
callq 0x84e0
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq %rbx, %rdi
callq 0x84e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
leaq 0x6f7e2(%rip), %rsi     # 0xd4112
movl $0x12, %edx
movq %rbx, %rdi
callq 0x84e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
leaq 0x2c0(%rsp), %rbp
movq 0x10(%rbp), %r14
cmpq %rbp, %r14
je 0x649e1
leaq 0x6904e(%rip), %r15     # 0xcd9ca
movl 0x20(%r14), %esi
movq %rbx, %rdi
callq 0x8810
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x84e0
movl 0x24(%r14), %esi
movq %r12, %rdi
callq 0x8810
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r12, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq %r14, %rdi
callq 0x84f0
movq %rax, %r14
cmpq %rbp, %rax
jne 0x6497c
leaq 0x20(%rsp), %rdi
movq %r13, (%rdi)
movq 0xe0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
addq %rsi, %rdx
callq 0x2ba06
leaq 0x6f748(%rip), %rsi     # 0xd4150
leaq 0x20(%rsp), %rdi
callq 0x88c0
movl 0x9db3c(%rip), %esi     # 0x102554
leaq 0x60(%rsp), %rdi
callq 0x2e7e2
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x68(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r13, %rcx
je 0x64a44
movq 0x30(%rsp), %rdi
movq 0x60(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x64a67
leaq 0x70(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x64a62
movq 0x70(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x64a73
leaq 0x20(%rsp), %rdi
callq 0x8180
jmp 0x64a81
leaq 0x60(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x84d0
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x64aa4
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x64aaa
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x70(%rsp), %rbp
movq -0x10(%rbp), %rdi
cmpq %rbp, %rdi
je 0x64ae2
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x64af9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, %rbx
movq (%rsp), %rsi
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
leaq 0x6f659(%rip), %rsi     # 0xd4177
movl $0x29, %edx
movq %rbx, %rdi
callq 0x84e0
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq %rbx, %rdi
callq 0x84e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
leaq 0x6f62d(%rip), %rsi     # 0xd41a1
movl $0x15, %edx
movq %rbx, %rdi
callq 0x84e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0xc8(%rsp), %rax
cmpq 0xc0(%rsp), %rax
je 0x64c40
xorl %r14d, %r14d
leaq 0x68e02(%rip), %r15     # 0xcd9ca
movq %rbx, %rdi
movq %r14, %rsi
callq 0x82f0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x84e0
movq 0xc0(%rsp), %rax
movl (%rax,%r14,4), %esi
movq %r12, %rdi
callq 0x8810
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r12, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
incq %r14
movq 0xc8(%rsp), %rax
subq 0xc0(%rsp), %rax
sarq $0x2, %rax
cmpq %rax, %r14
jne 0x64bc8
leaq 0x60(%rsp), %rdi
movq %rbp, (%rdi)
movq 0xe0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
addq %rsi, %rdx
callq 0x2ba06
leaq 0x6f550(%rip), %rsi     # 0xd41b7
leaq 0x60(%rsp), %rdi
callq 0x88c0
movl 0x9d8dd(%rip), %esi     # 0x102554
leaq 0x160(%rsp), %rdi
callq 0x2e7e2
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0x168(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %rbp, %rcx
je 0x64ca9
movq 0x70(%rsp), %rdi
movq 0x160(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x64cd5
leaq 0x170(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x64cd0
movq 0x170(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x64ce1
leaq 0x60(%rsp), %rdi
callq 0x8180
jmp 0x64cf2
leaq 0x160(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x84d0
movq %r13, 0x20(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x64d12
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x64d1a
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x170(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64d58
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x60(%rsp), %rdi
cmpq %rbp, %rdi
je 0x64d6f
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x200, %edi            # imm = 0x200
leaq 0x50(%rsp), %r15
callq 0x8470
movq %rax, %rbx
movq 0x20(%rsp), %rsi
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
leaq 0x6f43b(%rip), %rsi     # 0xd41d5
movl $0x46, %edx
movq %rbx, %rdi
callq 0x84e0
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq %rbx, %rdi
callq 0x84e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %r14, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
leaq 0x6f42c(%rip), %rsi     # 0xd421c
movl $0xe, %edx
movq %rbx, %rdi
callq 0x84e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x8300
leaq 0x180(%rsp), %rdi
movq %rbx, %rsi
callq 0x5ae92
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x64e4b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x8480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x64e66
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x64e7d
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64e9e
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x2b8(%rsp), %rdi
callq 0x553d4
leaq 0x1a0(%rsp), %rdi
callq 0x553d4
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x64edd
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x180(%rsp), %rdi
callq 0x480b0
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x64f07
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x64f24
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x64f41
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0xf0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64f62
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x64f87
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x8480
xorl %eax, %eax
addq $0x3b8, %rsp            # imm = 0x3B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6514f
jmp 0x6514f
jmp 0x6514f
movq %rax, %r14
jmp 0x6515f
jmp 0x6514f
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
callq 0x8480
jmp 0x6517d
movq %rax, %r14
leaq 0x170(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64ff7
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x64ff7
jmp 0x64ff4
movq %rax, %r14
movq 0x60(%rsp), %rdi
cmpq %rbp, %rdi
je 0x651a1
movq 0x70(%rsp), %rsi
jmp 0x6518c
jmp 0x6519e
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
jmp 0x6518f
movq %rax, %r14
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x65049
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x65049
jmp 0x65046
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x651c6
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x651c6
jmp 0x651c3
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
jmp 0x651bc
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x650a1
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x650a1
movq %rax, %r14
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
jne 0x650c4
jmp 0x651e7
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x651e7
movq 0x10(%rsp), %rsi
jmp 0x651da
jmp 0x651e4
movq %rax, %r14
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
jmp 0x651dd
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x65108
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x65108
jmp 0x65105
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x65208
movq 0x50(%rsp), %rsi
jmp 0x65200
movq %rax, %r14
jmp 0x65208
movq %rax, %r14
jmp 0x65215
jmp 0x65224
movq %rax, %r14
movl $0x208, %esi            # imm = 0x208
movq %r15, %rdi
jmp 0x65247
jmp 0x65196
movq %rax, %r14
jmp 0x652d1
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0x2e784
movq %rbx, %rdi
callq 0x2e6d0
jmp 0x65227
jmp 0x65224
jmp 0x6519e
movq %rax, %r14
jmp 0x651cb
jmp 0x651e4
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x651a1
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x651a1
movq %rax, %r14
jmp 0x6524c
movq %rax, %r14
leaq 0x50(%rsp), %rbp
leaq 0x10(%rsp), %rax
movq (%rsp), %rdi
cmpq %rax, %rdi
je 0x651cb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x651cb
movq %rax, %r14
leaq 0x50(%rsp), %rbp
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x651e7
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x651e7
movq %rax, %r14
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x65208
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x2b8(%rsp), %rdi
callq 0x553d4
leaq 0x1a0(%rsp), %rdi
callq 0x553d4
jmp 0x65227
movq %rax, %r14
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x6524c
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x180(%rsp), %rdi
callq 0x480b0
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x65276
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x65293
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x652b0
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x8480
leaq 0xf0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x652d1
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xb0(%rsp), %rax
movq 0xa0(%rsp), %rdi
cmpq %rax, %rdi
je 0x652f6
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r14, %rdi
callq 0x8840