// File: /workspace/github_cpp_makefile_star2_O1/millanek[P]evo/evo_codingSeqs_fromGenomes.cpp
// Function: SeqFromGenomes(int, char**)
int SeqFromGenomes(int argc, char** argv) {
    parseSeqFromGenomesOptions(argc, argv);
    // Load up the annotation file
    std::ifstream* geneFile = new std::ifstream(opt::geneFile.c_str());
    Annotation wgAnnotation(geneFile, false);
    std::vector<std::vector<string> > annotation;
    
    std::cerr << "Getting subsequences defined in " << opt::geneFile << std::endl;
    
    std::vector<string> allGenomeFiles; string AAFileName;
    std::vector<string> allNewLabels;
    if (opt::genomeFile != "") {
        allGenomeFiles.push_back(opt::genomeFile);
        std::cerr << "from the genome in: " << stripExtension(opt::genomeFile) << std::endl;
    } else {
        std::ifstream* alignmentList = new std::ifstream(opt::genomeListFile.c_str());
        std::cerr << "from the genomes listed in: " << opt::genomeListFile << std::endl;
        std::string line;
        while (getline(*alignmentList, line)) {
            allGenomeFiles.push_back(line);
        }
    }
    if (opt::newLabelFile != "") {
        std::cerr << "using labels from: " << opt::newLabelFile << std::endl;
        std::ifstream* newLabels = new std::ifstream(opt::newLabelFile.c_str());
        std::string line;
        while (getline(*newLabels, line)) {
            allNewLabels.push_back(line);
        }
    }
    
    // Loop over the genome files and load all into memory (so can handle only a few genomes):
    std::vector<std::map<std::string,string>> allGenomes;
    for (std::vector<std::string>::size_type i = 0; i != allGenomeFiles.size(); i++) {
        std::ifstream* genome = new std::ifstream(allGenomeFiles[i].c_str());
        std::map<std::string,string> allSeqs;
        // Load the whole genome
        std::string scaffoldSeq; scaffoldSeq.reserve(20000000); scaffoldSeq = "";
        std::string line; std::string thisScaffold;
        while (getline(*genome, line)) {
            if (line[0] == '>') {
                if (scaffoldSeq != "") { allSeqs[thisScaffold] = scaffoldSeq;}
                thisScaffold = line.substr(1); scaffoldSeq = "";
                continue;
            }
            scaffoldSeq.append(line);
        } genome->close();
        allSeqs[thisScaffold] = scaffoldSeq; // The final scaffold
        std::cerr << "Loaded sequences from: " << allGenomeFiles[i] << std::endl;
        allGenomes.push_back(allSeqs);
    }
    
    for(std::map<std::string,string>::iterator itGenome = allGenomes[0].begin(); itGenome != allGenomes[0].end(); ++itGenome) {
        //std::cerr << itGenome->first << std::endl;
        
        annotation = wgAnnotation.annotationMap[itGenome->first]; // Get annotation for this scaffold
        if (annotation.size() == 0) continue; // if we don't have any, just move to the next scaffold
        
        // check that this scaffold is present in all genomes:
        bool scaffoldInAllGenomes = true;
        for (std::vector<std::map<std::string,string>>::size_type i = 1; i != allGenomes.size(); i++) {
            if (allGenomes[i].count(itGenome->first) == 0)
                scaffoldInAllGenomes = false;
        }
        if (!scaffoldInAllGenomes) continue; // if not, just move on to the next scaffold
        
        //std::cerr << "Going through the annotation..." << std::endl;
        for (std::vector<std::vector<string> >::size_type k = 0; k != annotation.size(); k++) {
            std::vector<string> annotLineVec = split(annotation[k][0], '\t');
            string thisGeneName = annotLineVec[4];
            // std::cerr << "Gene:" << thisGeneName << std::endl;
            string geneSequence = getReferenceForThisRegion(annotation[k], annotLineVec[3], itGenome->second);
            int geneLengthDivisibleByThree = geneSequence.length() % 3;
            
            std::ofstream* geneOutFiles;
            if (geneLengthDivisibleByThree == 0)
                geneOutFiles = new std::ofstream(thisGeneName.c_str());
            else
                geneOutFiles = new std::ofstream((opt::nonDivPrefix+'_'+thisGeneName).c_str());
            
            *geneOutFiles << ">" << stripExtension(allGenomeFiles[0]) << std::endl;
            *geneOutFiles << geneSequence << std::endl;
            for (std::vector<std::map<std::string,string>>::size_type i = 1; i != allGenomes.size(); i++) {
                *geneOutFiles << ">" << stripExtension(allGenomeFiles[i]) << std::endl;
                string geneSequence = getReferenceForThisRegion(annotation[k], annotLineVec[3], allGenomes[i][itGenome->first]);
                *geneOutFiles << geneSequence << std::endl;
            } geneOutFiles->close();
            //std::cerr << "Got all sequences for: " << thisGeneName << std::endl;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
callq 0x3df1f
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %r14
movq 0xcebc6(%rip), %rsi     # 0x10bb40
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
leaq 0x180(%rsp), %rsi
movq %r14, (%rsi)
leaq 0x188(%rsp), %rdi
xorl %edx, %edx
callq 0x3e250
xorps %xmm0, %xmm0
movaps %xmm0, 0xe0(%rsp)
movq $0x0, 0xf0(%rsp)
movq 0xce029(%rip), %rdi     # 0x10afe8
leaq 0x93cb5(%rip), %rsi     # 0xd0c7b
movl $0x20, %edx
callq 0x84e0
movq 0xceb69(%rip), %rsi     # 0x10bb40
movq 0xceb6a(%rip), %rdx     # 0x10bb48
movq 0xce003(%rip), %rdi     # 0x10afe8
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
xorps %xmm0, %xmm0
movaps %xmm0, 0xc0(%rsp)
xorl %eax, %eax
movq %rax, 0xd0(%rsp)
leaq 0x150(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
movq %rax, 0x170(%rsp)
movaps %xmm0, 0x160(%rsp)
leaq 0xcea6d(%rip), %rdi     # 0x10bac0
leaq 0x94c25(%rip), %rsi     # 0xd1c7f
callq 0x8160
testl %eax, %eax
je 0x3db8a
leaq 0xcea52(%rip), %rsi     # 0x10bac0
leaq 0xc0(%rsp), %rdi
callq 0x33db0
movq 0xcdf66(%rip), %rdi     # 0x10afe8
leaq 0x93c13(%rip), %rsi     # 0xd0c9c
movl $0x14, %edx
callq 0x84e0
leaq 0xcea26(%rip), %rsi     # 0x10bac0
leaq 0x30(%rsp), %rdi
callq 0x50803
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0xcdf33(%rip), %rdi     # 0x10afe8
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
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3d0ff
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xce9fa(%rip), %rdi     # 0x10bb00
leaq 0x94b72(%rip), %rsi     # 0xd1c7f
callq 0x8160
testl %eax, %eax
je 0x3d210
movq 0xcdec7(%rip), %rdi     # 0x10afe8
leaq 0x93ba6(%rip), %rsi     # 0xd0cce
movl $0x13, %edx
callq 0x84e0
movq 0xce9c7(%rip), %rsi     # 0x10bb00
movq 0xce9c8(%rip), %rdx     # 0x10bb08
movq 0xcdea1(%rip), %rdi     # 0x10afe8
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
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %r14
movq 0xce976(%rip), %rsi     # 0x10bb00
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x30(%rsp), %rbx
leaq 0x160(%rsp), %r15
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3d1f9
movq %r15, %rdi
movq %rbx, %rsi
callq 0x33db0
jmp 0x3d1bc
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x3d210
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8480
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
movq 0xc0(%rsp), %r12
cmpq %r12, 0xc8(%rsp)
je 0x3d524
leaq 0x80(%rsp), %rbx
leaq 0x94a33(%rip), %r14     # 0xd1c7f
leaq 0x8(%rsp), %r15
movq $0x0, 0x28(%rsp)
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %rbp
movq 0x28(%rsp), %r13
shlq $0x5, %r13
movq (%r12,%r13), %rsi
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
movl $0x0, 0x38(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x40(%rsp)
leaq 0x38(%rsp), %rax
movq %rax, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq %rcx, 0x58(%rsp)
leaq 0x90(%rsp), %r12
movq %r12, 0x80(%rsp)
movq %rcx, 0x88(%rsp)
movb $0x0, 0x90(%rsp)
movl $0x1312d00, %esi        # imm = 0x1312D00
movq %rbx, %rdi
callq 0x86f0
movq 0x88(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x86c0
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x10(%rsp)
movb %cl, 0x18(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq %rcx, 0x68(%rsp)
movb %cl, 0x70(%rsp)
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3d3fd
movq 0x8(%rsp), %rsi
cmpb $0x3e, (%rsi)
jne 0x3d3eb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8160
testl %eax, %eax
je 0x3d37d
leaq 0x30(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x3e394
movq %rax, %rdi
movq %rbx, %rsi
callq 0x8270
movl $0x1, %edx
leaq 0x110(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x84a0
leaq 0x60(%rsp), %rdi
movq %r12, %rsi
callq 0x8540
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x3d3ce
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x88(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x86c0
jmp 0x3d311
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x8180
jmp 0x3d311
movq %rbp, %rdi
callq 0x80f0
leaq 0x30(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x3e394
movq %rax, %rdi
movq %rbx, %rsi
callq 0x8270
movl $0x17, %edx
movq 0xcdbbd(%rip), %rdi     # 0x10afe8
leaq 0x938b0(%rip), %rsi     # 0xd0ce2
callq 0x84e0
movq 0xc0(%rsp), %rax
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq 0xcdb99(%rip), %rdi     # 0x10afe8
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 0xa0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3e410
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x3d4ac
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3d4c8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x3d4ed
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x30(%rsp), %rdi
callq 0x3f5f4
movq 0x28(%rsp), %rdx
incq %rdx
movq 0xc0(%rsp), %r12
movq 0xc8(%rsp), %rax
subq %r12, %rax
sarq $0x5, %rax
movq %rdx, 0x28(%rsp)
cmpq %rax, %rdx
jne 0x3d25a
movq 0xa0(%rsp), %rcx
movq 0x18(%rcx), %rax
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x3dae9
movq %rax, 0x100(%rsp)
leaq 0x20(%rax), %rsi
leaq 0x188(%rsp), %rdi
movq %rsi, 0x108(%rsp)
callq 0x323c8
leaq 0xe0(%rsp), %rdi
movq %rax, %rsi
callq 0x32444
movq 0xe8(%rsp), %rax
cmpq 0xe0(%rsp), %rax
leaq 0x110(%rsp), %rbx
je 0x3dacf
movq 0xa0(%rsp), %r14
movq 0xa8(%rsp), %rax
subq %r14, %rax
cmpq $0x30, %rax
je 0x3d61c
movb $0x1, %bl
movl $0x1, %r15d
movl $0x30, %r12d
leaq (%r14,%r12), %rdi
movq 0x108(%rsp), %rsi
callq 0x3feb6
leaq (%r14,%r12), %rcx
addq $0x8, %rcx
cmpq %rax, %rcx
movzbl %bl, %ebx
movl $0x0, %eax
cmovel %eax, %ebx
incq %r15
movq 0xa0(%rsp), %r14
movq 0xa8(%rsp), %rax
subq %r14, %rax
sarq $0x4, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq $0x30, %r12
cmpq %rax, %r15
jne 0x3d5b3
testb $0x1, %bl
leaq 0x110(%rsp), %rbx
je 0x3dacf
movq 0xe0(%rsp), %rax
cmpq %rax, 0xe8(%rsp)
je 0x3dacf
movq 0x100(%rsp), %rcx
addq $0x40, %rcx
movq %rcx, 0x130(%rsp)
xorl %esi, %esi
movq %rsi, 0x138(%rsp)
leaq (%rsi,%rsi,2), %rcx
movq %rcx, 0x28(%rsp)
movq (%rax,%rcx,8), %rsi
movq %rbx, %rdi
movl $0x9, %edx
callq 0x50624
movq 0x110(%rsp), %rax
leaq 0x40(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movq 0x80(%rax), %rsi
movq 0x88(%rax), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x2e45c
movq 0x28(%rsp), %rax
leaq (,%rax,8), %rsi
addq 0xe0(%rsp), %rsi
movq 0x110(%rsp), %rdx
addq $0x60, %rdx
leaq 0x80(%rsp), %rdi
movq 0x130(%rsp), %rcx
callq 0x57e0c
movq 0x88(%rsp), %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
cmpq %rcx, %rax
jbe 0x3d77f
movl $0x200, %edi            # imm = 0x200
callq 0x8470
leaq 0x18(%rsp), %r14
movq %rax, %r13
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0xce447(%rip), %rsi     # 0x10bb60
movq 0xce448(%rip), %rdx     # 0x10bb68
addq %rsi, %rdx
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x2e45c
movq 0x68(%rsp), %rsi
movl $0x1, %ecx
movq %rbx, %rdi
xorl %edx, %edx
movl $0x5f, %r8d
callq 0x88a0
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %rbx, %rdi
callq 0x8180
movq %r14, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3d7a5
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x3d7ac
movl $0x200, %edi            # imm = 0x200
callq 0x8470
leaq 0x18(%rsp), %r14
movq %rax, %r13
movq 0x30(%rsp), %rsi
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
jmp 0x3d809
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq %r13, %rdi
movl $0x10, %edx
callq 0x84c0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3d7ed
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x3d809
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x1, %edx
movq %r13, %rdi
leaq 0x9915a(%rip), %rsi     # 0xd6972
callq 0x84e0
movq 0xc0(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x50803
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r13, %rdi
callq 0x84e0
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 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3d882
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq %r13, %rdi
callq 0x84e0
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 0xa8(%rsp), %rax
subq 0xa0(%rsp), %rax
cmpq $0x30, %rax
je 0x3da3d
movl $0x1, %ebx
movl $0x20, %r15d
movl $0x30, %ebp
movl $0x1, %edx
movq %r13, %rdi
leaq 0x99075(%rip), %rsi     # 0xd6972
callq 0x84e0
movq 0xc0(%rsp), %rsi
addq %r15, %rsi
leaq 0x8(%rsp), %rdi
callq 0x50803
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r13, %rdi
callq 0x84e0
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 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3d96a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0xe0(%rsp), %r14
movq 0x110(%rsp), %r12
movq 0xa0(%rsp), %rdi
addq %rbp, %rdi
movq 0x108(%rsp), %rsi
callq 0x3e394
addq $0x60, %r12
movq 0x28(%rsp), %rcx
leaq (%r14,%rcx,8), %rsi
leaq 0x8(%rsp), %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0x57e0c
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r13, %rdi
callq 0x84e0
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 0x8(%rsp), %rdi
leaq 0x18(%rsp), %r14
cmpq %r14, %rdi
je 0x3da07
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8480
incq %rbx
movq 0xa8(%rsp), %rax
subq 0xa0(%rsp), %rax
sarq $0x4, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq $0x20, %r15
addq $0x30, %rbp
cmpq %rax, %rbx
jne 0x3d8ee
movq %r13, %rdi
callq 0x8600
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x3da6a
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3da86
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
callq 0x3123c
movq 0x138(%rsp), %rsi
incq %rsi
movq 0xe0(%rsp), %rax
movq 0xe8(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
cmpq %rcx, %rsi
jne 0x3d648
movq 0x100(%rsp), %rdi
callq 0x8310
movq 0xa0(%rsp), %rcx
jmp 0x3d530
leaq 0xa0(%rsp), %rdi
callq 0x3e43c
leaq 0x160(%rsp), %rdi
callq 0x3123c
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x3db28
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xc0(%rsp), %rdi
callq 0x3123c
leaq 0xe0(%rsp), %rdi
callq 0x31aa2
leaq 0x218(%rsp), %rdi
callq 0x3f49e
leaq 0x1e8(%rsp), %rdi
callq 0x3f522
leaq 0x1b8(%rsp), %rdi
callq 0x3f5a6
leaq 0x188(%rsp), %rdi
callq 0x33302
xorl %eax, %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %r14
movq 0xcdf42(%rip), %rsi     # 0x10bae0
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
movq 0xcd436(%rip), %rdi     # 0x10afe8
leaq 0x930f8(%rip), %rsi     # 0xd0cb1
movl $0x1c, %edx
callq 0x84e0
movq 0xcdf16(%rip), %rsi     # 0x10bae0
movq 0xcdf17(%rip), %rdx     # 0x10bae8
movq 0xcd410(%rip), %rdi     # 0x10afe8
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
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x30(%rsp), %rbx
leaq 0xc0(%rsp), %r15
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3dc69
movq %r15, %rdi
movq %rbx, %rsi
callq 0x33db0
jmp 0x3dc2c
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
jne 0x3d0f2
jmp 0x3d0ff
jmp 0x3dc7e
movq %rax, %r15
movl $0x208, %esi            # imm = 0x208
movq %r14, %rdi
jmp 0x3dd11
jmp 0x3dcbf
jmp 0x3dcbf
movq %rax, %r15
movl $0x208, %esi            # imm = 0x208
movq %r14, %rdi
callq 0x8480
jmp 0x3df17
jmp 0x3dcbf
movq %rax, %r15
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3dd09
jmp 0x3de97
movq %rax, %r15
jmp 0x3de97
movq %rax, %r15
jmp 0x3ded6
jmp 0x3dd85
movq %rax, %r15
movl $0x208, %esi            # imm = 0x208
movq %rbp, %rdi
callq 0x8480
jmp 0x3de8a
jmp 0x3dcf8
jmp 0x3dd85
movq %rax, %r15
jmp 0x3ddd1
movq %rax, %r15
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x3de97
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x3de97
jmp 0x3dd1d
movq %rax, %r15
jmp 0x3dd5f
jmp 0x3dd24
movq %rax, %r15
jmp 0x3dd43
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3dd43
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x3dd5f
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x200, %esi            # imm = 0x200
movq %r13, %rdi
jmp 0x3de37
movq %rax, %r15
jmp 0x3de7d
movq %rax, %r15
jmp 0x3de61
jmp 0x3dd85
jmp 0x3de09
jmp 0x3dd96
movq %rax, %r15
jmp 0x3de8a
jmp 0x3dd96
jmp 0x3de22
jmp 0x3de09
movq %rax, %r15
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x3ddb5
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3ddd1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x3ddf6
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x30(%rsp), %rdi
callq 0x3f5f4
jmp 0x3de8a
jmp 0x3de09
jmp 0x3de09
movq %rax, %r15
jmp 0x3de3c
movq %rax, %r15
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x3de2f
jmp 0x3de3c
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3de3c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x3de61
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3de7d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x110(%rsp), %rdi
callq 0x3123c
leaq 0xa0(%rsp), %rdi
callq 0x3e43c
leaq 0x160(%rsp), %rdi
callq 0x3123c
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x3dec9
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xc0(%rsp), %rdi
callq 0x3123c
leaq 0xe0(%rsp), %rdi
callq 0x31aa2
leaq 0x218(%rsp), %rdi
callq 0x3f49e
leaq 0x1e8(%rsp), %rdi
callq 0x3f522
leaq 0x1b8(%rsp), %rdi
callq 0x3f5a6
leaq 0x188(%rsp), %rdi
callq 0x33302
movq %r15, %rdi
callq 0x8840