// File: millanek[P]evo/process_vcf_sequenom.cpp
// Function: sequenomMain(int, char**)
int sequenomMain(int argc, char** argv) {
    parseSequenomOptions(argc, argv);
    std::ios_base::openmode mode = std::ios_base::in;
    string vcfFileName = opt::vcfFile;
    string vcfFileRoot = stripExtension(vcfFileName);
    string genomeFileName = opt::genomeFile;
    string geneFileName = opt::geneFile;
    
    
    std::cerr << "Generating a txt file for sequenom assay from: " << vcfFileName << std::endl;
    std::cerr << "and the reference genome: " << genomeFileName << std::endl;
    std::cerr << "with SNP flanking regions defined in: " << geneFileName << std::endl;
    
    // Open connections to read from the vcf and reference genome files
    std::ifstream* vcfFile = new std::ifstream(vcfFileName.c_str(), mode);
    std::ifstream* genomeFile = new std::ifstream(genomeFileName.c_str(), mode);
    std::ifstream* geneFile = new std::ifstream(geneFileName.c_str(), mode);
    std::ofstream* sequenomDesignFile = new std::ofstream("sequenom.txt");
    
    string line;
    int currentScaffoldNum = -1;
    string currentScaffoldReference;
    string::size_type inStrPos;
    std::vector<string> sampleNames;
    string thisScaffoldName;
    std::string sequenomString = "";
    
    // Load up the annotation file with SNP flanking regions
    std::vector<std::vector<string> > annotation;
    Annotation wgAnnotation(geneFile, false);
    
    while (getline(*vcfFile, line)) {
        if (line[0] == '#' && line[1] == '#')
            continue;
        else if (line[0] == '#' && line[1] == 'C') {
            
            std::vector<std::string> fields = split(line, '\t');
            // Initialize vectors
            sequenomString.reserve(100000000);
            sequenomString = "";
            
            for (std::vector<std::string>::size_type i = NUM_NON_GENOTYPE_COLUMNS; i != fields.size(); i++) {
                if (opt::sampleNameFile.empty())
                    sampleNames.push_back(fields[i]);
                else
                    sampleNames = readSampleNamesFromTextFile(opt::sampleNameFile);
            }
        } else {
            std::vector<std::string> fields = split(line, '\t');
            // Also get overall depth for this variant
            std::vector<std::string> info = split(fields[7], ';');
            std::vector<std::string> sc = split(fields[0], '_');
            if (atoi(sc[1].c_str()) > currentScaffoldNum) {
                if (currentScaffoldNum >= 0) {
                    // Fill in the rest of the scaffold sequence (after the last variant)
                    sequenomString.append(currentScaffoldReference.substr(inStrPos, string::npos));
                    
#ifdef DEBUG
                    if (sequenomString.length() != currentScaffoldReference.length()) {
                        std::cerr << "Error!!! Reference scaffold length: " << currentScaffoldReference.length() << " vcf scaffold length: " << sequenomString.length() << std::endl;
                    }
#endif
                    
                    string sc = "scaffold_" + numToString(currentScaffoldNum);
                    std::cerr << "Scaffold: " << sc << std::endl;
                    annotation = wgAnnotation.annotationMap[sc]; // Get the SNP surrounding regions on this scaffold
                    for (std::vector<std::vector<string> >::size_type k = 0; k != annotation.size(); k++) {
                        std::vector<string> annotLineVec = split(annotation[k][0], '\t');
                        // std::cerr << "Gene:" << annotLineVec[4] << std::endl;
                        
                        string regionSeq = getIndividualSequenceForThisRegion(annotation[k], annotLineVec[3], sequenomString);
                        string refSeq = getReferenceForThisRegion(annotation[k], annotLineVec[3], currentScaffoldReference);
                        int coordinate = atoi(annotLineVec[2].c_str()) - 100;
                        string location = sc + "_" + numToString(coordinate);
                        
                        writeSequenomOutput(regionSeq, refSeq, location, sequenomDesignFile);
                    }
                    
                    sequenomString = "";
                } else {
                    getline(*genomeFile, thisScaffoldName);
                }
                
                std::cerr << "Starting to read " << thisScaffoldName << std::endl;
                currentScaffoldReference = readScaffold(genomeFile, thisScaffoldName);
#ifdef DEBUG2
                std::cerr << "Finished reading. Next scaffold will be: " << thisScaffoldName << std::endl;
#endif
                inStrPos = 0;
                currentScaffoldNum = atoi(sc[1].c_str());
            }
            if (info[0] != "INDEL") {
                sequenomString.append(currentScaffoldReference.substr(inStrPos, (atoi(fields[1].c_str()) - 1)-inStrPos));
                Counts thisVariantCounts = getThisVariantCounts(fields);
                if (thisVariantCounts.overall != ((fields.size()-NUM_NON_GENOTYPE_COLUMNS)*2)) {
                    string ambiguityBase = getAmbiguityCode(fields[3], fields[4]);
                    sequenomString.append(ambiguityBase);
                } else {
                    sequenomString.append(fields[4]);
                }
                inStrPos = atoi(fields[1].c_str());
                
#ifdef DEBUG
                if (currentScaffoldReference[inStrPos-1] != fields[3][0]) {
                    std::cerr << "Error!!! Sequence: " << currentScaffoldReference[inStrPos-1] << " vcf-ref: " << fields[3][0] << std::endl;
                }
#endif
            }
        }
    }
    
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x700, %rsp            # imm = 0x700
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0xc1ac0
movl $0x8, -0x14(%rbp)
leaq 0xda214(%rip), %rsi     # 0x19ab20
leaq -0x38(%rbp), %rdi
movq %rdi, -0x5a0(%rbp)
callq 0xa250
movq -0x5a0(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x7be70
jmp 0xc092e
leaq 0xda20b(%rip), %rsi     # 0x19ab40
leaq -0x88(%rbp), %rdi
callq 0xa250
jmp 0xc0943
leaq 0xda216(%rip), %rsi     # 0x19ab60
leaq -0xa8(%rbp), %rdi
callq 0xa250
jmp 0xc0958
movq 0xd8691(%rip), %rdi     # 0x198ff0
leaq 0x81c16(%rip), %rsi     # 0x14257c
callq 0xa5c0
movq %rax, -0x5a8(%rbp)
jmp 0xc0974
movq -0x5a8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xa520
movq %rax, -0x5b0(%rbp)
jmp 0xc098d
movq -0x5b0(%rbp), %rdi
movq 0xd85ed(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xc09a2
movq 0xd8647(%rip), %rdi     # 0x198ff0
leaq 0x7f05f(%rip), %rsi     # 0x13fa0f
callq 0xa5c0
movq %rax, -0x5b8(%rbp)
jmp 0xc09be
movq -0x5b8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xa520
movq %rax, -0x5c0(%rbp)
jmp 0xc09da
movq -0x5c0(%rbp), %rdi
movq 0xd85a0(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xc09ef
movq 0xd85fa(%rip), %rdi     # 0x198ff0
leaq 0x81baf(%rip), %rsi     # 0x1425ac
callq 0xa5c0
movq %rax, -0x5c8(%rbp)
jmp 0xc0a0b
movq -0x5c8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xa520
movq %rax, -0x5d0(%rbp)
jmp 0xc0a27
movq -0x5d0(%rbp), %rdi
movq 0xd8553(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xc0a3c
movl $0x208, %edi            # imm = 0x208
callq 0xa5d0
movq %rax, -0x5d8(%rbp)
jmp 0xc0a4f
leaq -0x38(%rbp), %rdi
callq 0xa220
movq -0x5d8(%rbp), %rdi
movq %rax, %rsi
movl -0x14(%rbp), %edx
callq 0xab90
jmp 0xc0a6c
movq -0x5d8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl $0x208, %edi            # imm = 0x208
callq 0xa5d0
movq %rax, -0x5e0(%rbp)
jmp 0xc0a8d
leaq -0x88(%rbp), %rdi
callq 0xa220
movq -0x5e0(%rbp), %rdi
movq %rax, %rsi
movl -0x14(%rbp), %edx
callq 0xab90
jmp 0xc0aad
movq -0x5e0(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl $0x208, %edi            # imm = 0x208
callq 0xa5d0
movq %rax, -0x5e8(%rbp)
jmp 0xc0ace
leaq -0xa8(%rbp), %rdi
callq 0xa220
movq -0x5e8(%rbp), %rdi
movq %rax, %rsi
movl -0x14(%rbp), %edx
callq 0xab90
jmp 0xc0aee
movq -0x5e8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movl $0x200, %edi            # imm = 0x200
callq 0xa5d0
movq %rax, -0x5f0(%rbp)
jmp 0xc0b0f
movq -0x5f0(%rbp), %rdi
leaq 0x81ab6(%rip), %rsi     # 0x1425d3
movl $0x10, %edx
callq 0xa650
jmp 0xc0b29
movq -0x5f0(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xa820
movl $0xffffffff, -0xec(%rbp) # imm = 0xFFFFFFFF
leaq -0x110(%rbp), %rdi
callq 0xa820
leaq -0x130(%rbp), %rdi
callq 0x48da0
leaq -0x150(%rbp), %rdi
callq 0xa820
leaq -0x171(%rbp), %rdi
movq %rdi, -0x5f8(%rbp)
callq 0xab60
movq -0x5f8(%rbp), %rdx
leaq 0x7534d(%rip), %rsi     # 0x135edf
leaq -0x170(%rbp), %rdi
callq 0x2d6c0
jmp 0xc0ba0
leaq -0x171(%rbp), %rdi
callq 0xa640
leaq -0x190(%rbp), %rdi
callq 0x3f5f0
leaq -0x250(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
xorl %edx, %edx
callq 0x58390
jmp 0xc0bcf
jmp 0xc0bd1
movq -0xb0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0xa0d0
movq %rax, -0x600(%rbp)
jmp 0xc0bed
movq -0x600(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xa740
movb %al, -0x601(%rbp)
jmp 0xc0c0b
movb -0x601(%rbp), %al
testb $0x1, %al
jne 0xc0c1a
jmp 0xc19a5
xorl %eax, %eax
movl %eax, %esi
leaq -0xe8(%rbp), %rdi
callq 0xac60
movq %rax, -0x610(%rbp)
jmp 0xc0c33
movq -0x610(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0xc0d83
leaq -0xe8(%rbp), %rdi
movl $0x1, %esi
callq 0xac60
movq %rax, -0x618(%rbp)
jmp 0xc0c60
movq -0x618(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0xc0d83
jmp 0xc0bd1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc1aa3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc1a9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc1a8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc1a82
movq -0x5d8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl $0x208, %esi            # imm = 0x208
callq 0xa5e0
jmp 0xc1a82
movq -0x5e0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl $0x208, %esi            # imm = 0x208
callq 0xa5e0
jmp 0xc1a82
movq -0x5e8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl $0x208, %esi            # imm = 0x208
callq 0xa5e0
jmp 0xc1a82
movq -0x5f0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl $0x200, %esi            # imm = 0x200
callq 0xa5e0
jmp 0xc1a82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x171(%rbp), %rdi
callq 0xa640
jmp 0xc1a52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc1a3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc1a2e
xorl %eax, %eax
movl %eax, %esi
leaq -0xe8(%rbp), %rdi
callq 0xac60
movq %rax, -0x620(%rbp)
jmp 0xc0d9c
movq -0x620(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0xc0f09
leaq -0xe8(%rbp), %rdi
movl $0x1, %esi
callq 0xac60
movq %rax, -0x628(%rbp)
jmp 0xc0dc9
movq -0x628(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x43, %eax
jne 0xc0f09
leaq -0x268(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
movl $0x9, %edx
callq 0x7bbe0
jmp 0xc0df6
leaq -0x170(%rbp), %rdi
movl $0x5f5e100, %esi        # imm = 0x5F5E100
callq 0xa980
jmp 0xc0e09
leaq 0x750cf(%rip), %rsi     # 0x135edf
leaq -0x170(%rbp), %rdi
callq 0xa810
jmp 0xc0e1e
movq $0x9, -0x270(%rbp)
movq -0x270(%rbp), %rax
movq %rax, -0x630(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0x630(%rbp), %rax
cmpq %rcx, %rax
je 0xc0ef8
leaq 0xd9d23(%rip), %rdi     # 0x19ab80
callq 0xaa70
testb $0x1, %al
jne 0xc0e68
jmp 0xc0eab
movq -0x270(%rbp), %rsi
leaq -0x268(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
leaq -0x130(%rbp), %rdi
callq 0x48dc0
jmp 0xc0e8c
jmp 0xc0edf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x3dfa0
jmp 0xc1a2e
leaq 0xd9cce(%rip), %rsi     # 0x19ab80
leaq -0x288(%rbp), %rdi
callq 0x80aa0
jmp 0xc0ec0
leaq -0x130(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x50c30
leaq -0x288(%rbp), %rdi
callq 0x3dfa0
jmp 0xc0ee1
movq -0x270(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x270(%rbp)
jmp 0xc0e29
leaq -0x268(%rbp), %rdi
callq 0x3dfa0
jmp 0xc199e
leaq -0x2a0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
movl $0x9, %edx
callq 0x7bbe0
jmp 0xc0f23
leaq -0x2a0(%rbp), %rdi
movl $0x7, %esi
callq 0x3d940
movq %rax, %rsi
leaq -0x2b8(%rbp), %rdi
movl $0x3b, %edx
callq 0x7bbe0
jmp 0xc0f4a
xorl %eax, %eax
movl %eax, %esi
leaq -0x2a0(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
leaq -0x2d0(%rbp), %rdi
movl $0x5f, %edx
callq 0x7bbe0
jmp 0xc0f70
leaq -0x2d0(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
cmpl -0xec(%rbp), %eax
jle 0xc158c
cmpl $0x0, -0xec(%rbp)
jl 0xc14bb
movq -0x118(%rbp), %rdx
leaq -0x2f0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
movq $-0x1, %rcx
callq 0xa5f0
jmp 0xc0fcd
leaq -0x170(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0xac20
jmp 0xc0fe2
leaq -0x2f0(%rbp), %rdi
callq 0xac88
leaq -0x170(%rbp), %rdi
callq 0xa930
movq %rax, -0x638(%rbp)
leaq -0x110(%rbp), %rdi
callq 0xa930
movq %rax, %rcx
movq -0x638(%rbp), %rax
cmpq %rcx, %rax
je 0xc1107
movq 0xd7fc9(%rip), %rdi     # 0x198ff0
leaq 0x7fc04(%rip), %rsi     # 0x140c32
callq 0xa5c0
movq %rax, -0x640(%rbp)
jmp 0xc103c
leaq -0x110(%rbp), %rdi
callq 0xa930
movq -0x640(%rbp), %rdi
movq %rax, %rsi
callq 0xa140
movq %rax, -0x648(%rbp)
jmp 0xc1060
movq -0x648(%rbp), %rdi
leaq 0x7ea3a(%rip), %rsi     # 0x13faa8
callq 0xa5c0
movq %rax, -0x650(%rbp)
jmp 0xc107c
leaq -0x170(%rbp), %rdi
callq 0xa930
movq -0x650(%rbp), %rdi
movq %rax, %rsi
callq 0xa140
movq %rax, -0x658(%rbp)
jmp 0xc10a0
movq -0x658(%rbp), %rdi
movq 0xd7eda(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xc10b5
jmp 0xc1107
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc198d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc1981
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc1975
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0xac88
jmp 0xc1975
movl -0xec(%rbp), %esi
leaq -0x330(%rbp), %rdi
callq 0x3e190
jmp 0xc111b
leaq 0x81728(%rip), %rsi     # 0x14284a
leaq -0x310(%rbp), %rdi
leaq -0x330(%rbp), %rdx
callq 0xc2290
jmp 0xc1137
leaq -0x330(%rbp), %rdi
callq 0xac88
movq 0xd7ea6(%rip), %rdi     # 0x198ff0
leaq 0x8148f(%rip), %rsi     # 0x1425e0
callq 0xa5c0
movq %rax, -0x660(%rbp)
jmp 0xc115f
movq -0x660(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0xa520
movq %rax, -0x668(%rbp)
jmp 0xc117b
movq -0x668(%rbp), %rdi
movq 0xd7dff(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xc1190
leaq -0x250(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x3f760
movq %rax, -0x670(%rbp)
jmp 0xc11ac
movq -0x670(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x3f840
jmp 0xc11c1
movq $0x0, -0x338(%rbp)
movq -0x338(%rbp), %rax
movq %rax, -0x678(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x409f0
movq %rax, %rcx
movq -0x678(%rbp), %rax
cmpq %rcx, %rax
je 0xc1487
movq -0x338(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x3ec10
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3d940
movq %rax, %rsi
leaq -0x350(%rbp), %rdi
movl $0x9, %edx
callq 0x7bbe0
jmp 0xc122e
movq -0x338(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x3ec10
movq %rax, -0x680(%rbp)
leaq -0x350(%rbp), %rdi
movl $0x3, %esi
callq 0x3d940
movq -0x680(%rbp), %rsi
movq %rax, %rdx
leaq -0x370(%rbp), %rdi
leaq -0x170(%rbp), %rcx
callq 0x8ee60
jmp 0xc1278
movq -0x338(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x3ec10
movq %rax, -0x688(%rbp)
leaq -0x350(%rbp), %rdi
movl $0x3, %esi
callq 0x3d940
movq -0x688(%rbp), %rsi
movq %rax, %rdx
leaq -0x390(%rbp), %rdi
leaq -0x110(%rbp), %rcx
callq 0x8f120
jmp 0xc12c2
leaq -0x350(%rbp), %rdi
movl $0x2, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
addl $-0x64, %eax
movl %eax, -0x394(%rbp)
leaq 0x7ea9d(%rip), %rdx     # 0x13fd90
leaq -0x3d8(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x3da80
jmp 0xc1308
movl -0x394(%rbp), %esi
leaq -0x3f8(%rbp), %rdi
callq 0x3e190
jmp 0xc131c
leaq -0x3b8(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
leaq -0x3f8(%rbp), %rdx
callq 0x3e070
jmp 0xc1338
leaq -0x3f8(%rbp), %rdi
callq 0xac88
leaq -0x3d8(%rbp), %rdi
callq 0xac88
leaq -0x370(%rbp), %rdi
leaq -0x390(%rbp), %rsi
leaq -0x3b8(%rbp), %rdx
leaq -0xc8(%rbp), %rcx
callq 0xc1db0
jmp 0xc1373
leaq -0x3b8(%rbp), %rdi
callq 0xac88
leaq -0x390(%rbp), %rdi
callq 0xac88
leaq -0x370(%rbp), %rdi
callq 0xac88
leaq -0x350(%rbp), %rdi
callq 0x3dfa0
movq -0x338(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x338(%rbp)
jmp 0xc11cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x330(%rbp), %rdi
callq 0xac88
jmp 0xc1975
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc14aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc1479
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc146d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc1461
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc143b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x3f8(%rbp), %rdi
callq 0xac88
leaq -0x3d8(%rbp), %rdi
callq 0xac88
jmp 0xc1461
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0xac88
leaq -0x390(%rbp), %rdi
callq 0xac88
leaq -0x370(%rbp), %rdi
callq 0xac88
leaq -0x350(%rbp), %rdi
callq 0x3dfa0
jmp 0xc14aa
leaq 0x74a51(%rip), %rsi     # 0x135edf
leaq -0x170(%rbp), %rdi
callq 0xa810
jmp 0xc149c
leaq -0x310(%rbp), %rdi
callq 0xac88
jmp 0xc14d2
leaq -0x310(%rbp), %rdi
callq 0xac88
jmp 0xc1975
movq -0xb8(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0xa0d0
jmp 0xc14d0
jmp 0xc14d2
movq 0xd7b17(%rip), %rdi     # 0x198ff0
leaq 0x7e68e(%rip), %rsi     # 0x13fb6e
callq 0xa5c0
movq %rax, -0x690(%rbp)
jmp 0xc14ee
movq -0x690(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0xa520
movq %rax, -0x698(%rbp)
jmp 0xc150a
movq -0x698(%rbp), %rdi
movq 0xd7a70(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xc151f
leaq -0x418(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0x150(%rbp), %rdx
callq 0x6a7e0
jmp 0xc153b
leaq -0x110(%rbp), %rdi
leaq -0x418(%rbp), %rsi
callq 0xa710
leaq -0x418(%rbp), %rdi
callq 0xac88
movq $0x0, -0x118(%rbp)
leaq -0x2d0(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movl %eax, -0xec(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x2b8(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
leaq 0x721dc(%rip), %rsi     # 0x133782
callq 0x50eb0
movb %al, -0x699(%rbp)
jmp 0xc15b3
movb -0x699(%rbp), %al
testb $0x1, %al
jne 0xc15c2
jmp 0xc194f
movq -0x118(%rbp), %rax
movq %rax, -0x6a8(%rbp)
leaq -0x2a0(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
movq -0x6a8(%rbp), %rdx
decl %eax
movslq %eax, %rcx
movq -0x118(%rbp), %rax
subq %rax, %rcx
leaq -0x438(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0xa5f0
jmp 0xc161c
leaq -0x170(%rbp), %rdi
leaq -0x438(%rbp), %rsi
callq 0xac20
jmp 0xc1631
leaq -0x438(%rbp), %rdi
callq 0xac88
leaq -0x538(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x7d310
jmp 0xc1652
movslq -0x538(%rbp), %rax
movq %rax, -0x6b0(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0x6b0(%rbp), %rax
subq $0x9, %rcx
shlq %rcx
cmpq %rcx, %rax
je 0xc17a6
leaq -0x2a0(%rbp), %rdi
movl $0x3, %esi
callq 0x3d940
movq %rax, %rsi
leaq -0x578(%rbp), %rdi
callq 0xa250
jmp 0xc16a8
leaq -0x2a0(%rbp), %rdi
movl $0x4, %esi
callq 0x3d940
movq %rax, %rsi
leaq -0x598(%rbp), %rdi
callq 0xa250
jmp 0xc16ca
leaq -0x558(%rbp), %rdi
leaq -0x578(%rbp), %rsi
leaq -0x598(%rbp), %rdx
callq 0x8e990
jmp 0xc16e6
leaq -0x598(%rbp), %rdi
callq 0xac88
leaq -0x578(%rbp), %rdi
callq 0xac88
leaq -0x170(%rbp), %rdi
leaq -0x558(%rbp), %rsi
callq 0xac20
jmp 0xc1713
leaq -0x558(%rbp), %rdi
callq 0xac88
jmp 0xc17ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x438(%rbp), %rdi
callq 0xac88
jmp 0xc1975
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc1941
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xc1778
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x598(%rbp), %rdi
callq 0xac88
leaq -0x578(%rbp), %rdi
callq 0xac88
jmp 0xc1941
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x558(%rbp), %rdi
callq 0xac88
jmp 0xc1941
leaq -0x2a0(%rbp), %rdi
movl $0x4, %esi
callq 0x3d940
movq %rax, %rsi
leaq -0x170(%rbp), %rdi
callq 0xac20
jmp 0xc17c8
jmp 0xc17ca
leaq -0x2a0(%rbp), %rdi
movl $0x1, %esi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq %rax, %rdi
callq 0xa970
cltq
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rsi
decq %rsi
leaq -0x110(%rbp), %rdi
callq 0xac60
movq %rax, -0x6b8(%rbp)
jmp 0xc1813
movq -0x6b8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x6c4(%rbp)
leaq -0x2a0(%rbp), %rdi
movl $0x3, %esi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x6c0(%rbp)
jmp 0xc1849
movl -0x6c4(%rbp), %eax
movq -0x6c0(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0xc1933
movq 0xd7788(%rip), %rdi     # 0x198ff0
leaq 0x7f4c9(%rip), %rsi     # 0x140d38
callq 0xa5c0
movq %rax, -0x6d0(%rbp)
jmp 0xc187d
movq -0x118(%rbp), %rsi
decq %rsi
leaq -0x110(%rbp), %rdi
callq 0xac60
movq %rax, -0x6d8(%rbp)
jmp 0xc189c
movq -0x6d0(%rbp), %rdi
movq -0x6d8(%rbp), %rax
movsbl (%rax), %esi
callq 0xa6d0
movq %rax, -0x6e0(%rbp)
jmp 0xc18bb
movq -0x6e0(%rbp), %rdi
leaq 0x7f483(%rip), %rsi     # 0x140d4c
callq 0xa5c0
movq %rax, -0x6e8(%rbp)
jmp 0xc18d7
leaq -0x2a0(%rbp), %rdi
movl $0x3, %esi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x6f0(%rbp)
jmp 0xc18fd
movq -0x6e8(%rbp), %rdi
movq -0x6f0(%rbp), %rax
movsbl (%rax), %esi
callq 0xa6d0
movq %rax, -0x6f8(%rbp)
jmp 0xc191c
movq -0x6f8(%rbp), %rdi
movq 0xd765e(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xc1931
jmp 0xc1933
leaq -0x538(%rbp), %rdi
callq 0x3df20
jmp 0xc194f
leaq -0x538(%rbp), %rdi
callq 0x3df20
jmp 0xc1975
leaq -0x2d0(%rbp), %rdi
callq 0x3dfa0
leaq -0x2b8(%rbp), %rdi
callq 0x3dfa0
leaq -0x2a0(%rbp), %rdi
callq 0x3dfa0
jmp 0xc199e
leaq -0x2d0(%rbp), %rdi
callq 0x3dfa0
leaq -0x2b8(%rbp), %rdi
callq 0x3dfa0
leaq -0x2a0(%rbp), %rdi
callq 0x3dfa0
jmp 0xc1a2e
jmp 0xc19a0
jmp 0xc0bd1
leaq -0x250(%rbp), %rdi
callq 0x588b0
leaq -0x190(%rbp), %rdi
callq 0x3ec50
leaq -0x170(%rbp), %rdi
callq 0xac88
leaq -0x150(%rbp), %rdi
callq 0xac88
leaq -0x130(%rbp), %rdi
callq 0x3dfa0
leaq -0x110(%rbp), %rdi
callq 0xac88
leaq -0xe8(%rbp), %rdi
callq 0xac88
leaq -0xa8(%rbp), %rdi
callq 0xac88
leaq -0x88(%rbp), %rdi
callq 0xac88
leaq -0x58(%rbp), %rdi
callq 0xac88
leaq -0x38(%rbp), %rdi
callq 0xac88
xorl %eax, %eax
addq $0x700, %rsp            # imm = 0x700
popq %rbp
retq
leaq -0x250(%rbp), %rdi
callq 0x588b0
leaq -0x190(%rbp), %rdi
callq 0x3ec50
leaq -0x170(%rbp), %rdi
callq 0xac88
leaq -0x150(%rbp), %rdi
callq 0xac88
leaq -0x130(%rbp), %rdi
callq 0x3dfa0
leaq -0x110(%rbp), %rdi
callq 0xac88
leaq -0xe8(%rbp), %rdi
callq 0xac88
leaq -0xa8(%rbp), %rdi
callq 0xac88
leaq -0x88(%rbp), %rdi
callq 0xac88
leaq -0x58(%rbp), %rdi
callq 0xac88
leaq -0x38(%rbp), %rdi
callq 0xac88
movq -0x60(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)