// File: /workspace/github_cpp_makefile_star2_O3/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 $0x238, %rsp            # imm = 0x238
callq 0x3b00a
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %rbx
movq 0xc8aae(%rip), %rsi     # 0x102b48
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
leaq 0x170(%rsp), %rsi
movq %rbx, (%rsi)
leaq 0x178(%rsp), %rdi
xorl %edx, %edx
callq 0x3b332
xorps %xmm0, %xmm0
movaps %xmm0, 0xc0(%rsp)
movq $0x0, 0xd0(%rsp)
movq 0xc7f09(%rip), %rdi     # 0x101fe8
leaq 0x9339d(%rip), %rsi     # 0xcd483
movl $0x20, %edx
callq 0x84e0
movq 0xc8a51(%rip), %rsi     # 0x102b48
movq 0xc8a52(%rip), %rdx     # 0x102b50
movq 0xc7ee3(%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
xorps %xmm0, %xmm0
movaps %xmm0, 0xe0(%rsp)
xorl %eax, %eax
movq %rax, 0xf0(%rsp)
leaq 0x140(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
movq %rax, 0x160(%rsp)
movaps %xmm0, 0x150(%rsp)
leaq 0xc8955(%rip), %rdi     # 0x102ac8
leaq 0x93851(%rip), %rsi     # 0xcd9cb
callq 0x8160
testl %eax, %eax
je 0x3ac8c
leaq 0xc893a(%rip), %rsi     # 0x102ac8
leaq 0xe0(%rsp), %rdi
callq 0x3133c
movq 0xc7e46(%rip), %rdi     # 0x101fe8
leaq 0x932fb(%rip), %rsi     # 0xcd4a4
movl $0x14, %edx
callq 0x84e0
leaq 0xc890e(%rip), %rsi     # 0x102ac8
leaq 0x28(%rsp), %rdi
callq 0x4d82f
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0xc7e13(%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
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3a21f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xc88e2(%rip), %rdi     # 0x102b08
leaq 0x9379e(%rip), %rsi     # 0xcd9cb
callq 0x8160
testl %eax, %eax
je 0x3a330
movq 0xc7da7(%rip), %rdi     # 0x101fe8
leaq 0x9328e(%rip), %rsi     # 0xcd4d6
movl $0x13, %edx
callq 0x84e0
movq 0xc88af(%rip), %rsi     # 0x102b08
movq 0xc88b0(%rip), %rdx     # 0x102b10
movq 0xc7d81(%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
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %rbx
movq 0xc885e(%rip), %rsi     # 0x102b08
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x28(%rsp), %r14
leaq 0x150(%rsp), %r15
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3a319
movq %r15, %rdi
movq %r14, %rsi
callq 0x3133c
jmp 0x3a2dc
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3a330
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
xorps %xmm0, %xmm0
leaq 0xa0(%rsp), %rax
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq 0xe0(%rsp), %r14
leaq 0x80(%rsp), %rbp
movq %rsp, %r12
movq $0x0, 0x20(%rsp)
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %rbx
movq 0x20(%rsp), %r13
shlq $0x5, %r13
movq (%r14,%r13), %rsi
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
movl $0x0, 0x30(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x38(%rsp)
leaq 0x30(%rsp), %rax
movq %rax, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movq %rcx, 0x50(%rsp)
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
movq %rcx, 0x88(%rsp)
movb $0x0, 0x90(%rsp)
movl $0x1312d00, %esi        # imm = 0x1312D00
movq %rbp, %rdi
callq 0x86f0
leaq 0x110(%rsp), %r14
movq 0x88(%rsp), %rdx
movq %rbp, %rdi
xorl %esi, %esi
leaq 0x935d6(%rip), %rcx     # 0xcd9cb
xorl %r8d, %r8d
callq 0x86c0
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
xorl %ecx, %ecx
movq %rcx, 0x8(%rsp)
movb %cl, 0x10(%rsp)
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq %rcx, 0x60(%rsp)
movb %cl, 0x68(%rsp)
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3a50e
movq (%rsp), %rsi
cmpb $0x3e, (%rsi)
jne 0x3a4fc
movq %rbp, %rdi
leaq 0x9355c(%rip), %rsi     # 0xcd9cb
callq 0x8160
testl %eax, %eax
je 0x3a492
leaq 0x28(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x3b46e
movq %rax, %rdi
movq %rbp, %rsi
callq 0x8270
movl $0x1, %edx
leaq 0x100(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
movq $-0x1, %rcx
callq 0x84a0
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0x8540
movq 0x100(%rsp), %rdi
cmpq %r14, %rdi
je 0x3a4db
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x88(%rsp), %rdx
movq %rbp, %rdi
xorl %esi, %esi
leaq 0x934dc(%rip), %rcx     # 0xcd9cb
xorl %r8d, %r8d
callq 0x86c0
jmp 0x3a424
movq 0x8(%rsp), %rdx
movq %rbp, %rdi
callq 0x8180
jmp 0x3a424
movq %rbx, %rdi
callq 0x80f0
movq 0xc7acb(%rip), %rbx     # 0x101fe8
leaq 0x28(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x3b46e
movq %rax, %rdi
movq %rbp, %rsi
callq 0x8270
movl $0x17, %edx
movq %rbx, %rdi
leaq 0x92fa4(%rip), %rsi     # 0xcd4ea
callq 0x84e0
movq 0xe0(%rsp), %rax
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq %rbx, %rdi
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 0xa0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x3b4ea
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x3a5bc
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x8480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3a5d7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x3a5fc
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x28(%rsp), %rdi
callq 0x3c6d4
movq 0x20(%rsp), %rdx
incq %rdx
movq 0xe0(%rsp), %r14
movq 0xe8(%rsp), %rax
subq %r14, %rax
sarq $0x5, %rax
movq %rdx, 0x20(%rsp)
cmpq %rax, %rdx
jne 0x3a362
movq 0xa0(%rsp), %rcx
movq 0x18(%rcx), %rax
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x3abeb
movq %rax, 0x78(%rsp)
leaq 0x20(%rax), %rsi
leaq 0x178(%rsp), %rdi
movq %rsi, 0xf8(%rsp)
callq 0x2f908
leaq 0xc0(%rsp), %rdi
movq %rax, %rsi
callq 0x2f984
movq 0xc0(%rsp), %rax
movq 0xc8(%rsp), %rcx
movq 0xa0(%rsp), %rbx
cmpq %rax, %rcx
je 0x3abd4
movq 0xa8(%rsp), %rdx
subq %rbx, %rdx
cmpq $0x30, %rdx
je 0x3a727
movb $0x1, %bpl
movl $0x1, %r14d
movl $0x30, %r15d
leaq (%rbx,%r15), %rdi
movq 0xf8(%rsp), %rsi
callq 0x3cf88
leaq (%rbx,%r15), %rcx
addq $0x8, %rcx
cmpq %rax, %rcx
setne %al
andb %al, %bpl
incq %r14
movq 0xa0(%rsp), %rbx
movq 0xa8(%rsp), %rax
subq %rbx, %rax
sarq $0x4, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq $0x30, %r15
cmpq %rax, %r14
jne 0x3a6bb
testb %bpl, %bpl
je 0x3abd4
movq 0xc0(%rsp), %rax
movq 0xc8(%rsp), %rcx
movq 0x78(%rsp), %rdi
cmpq %rax, %rcx
je 0x3abd9
leaq 0x40(%rdi), %rcx
movq %rcx, 0x120(%rsp)
xorl %esi, %esi
leaq 0x100(%rsp), %rbx
movq %rsi, 0x128(%rsp)
leaq (%rsi,%rsi,2), %rcx
movq %rcx, 0x20(%rsp)
movq (%rax,%rcx,8), %rsi
movq %rbx, %rdi
movl $0x9, %edx
callq 0x4d650
movq 0x100(%rsp), %rax
leaq 0x38(%rsp), %rcx
movq %rcx, 0x28(%rsp)
movq 0x80(%rax), %rsi
movq 0x88(%rax), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x2ba06
movq 0x20(%rsp), %rax
leaq (,%rax,8), %rsi
addq 0xc0(%rsp), %rsi
movq 0x100(%rsp), %rdx
addq $0x60, %rdx
leaq 0x80(%rsp), %rdi
movq 0x120(%rsp), %rcx
callq 0x57f78
movq 0x88(%rsp), %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
cmpq %rcx, %rax
jbe 0x3a880
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, %r13
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xc8351(%rip), %rsi     # 0x102b68
movq 0xc8352(%rip), %rdx     # 0x102b70
addq %rsi, %rdx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x2ba06
movq 0x60(%rsp), %rsi
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
movl $0x5f, %r8d
callq 0x88a0
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r14, %rdi
callq 0x8180
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3a8a1
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x3a8a7
movl $0x200, %edi            # imm = 0x200
callq 0x8470
movq %rax, %r13
movq 0x28(%rsp), %rsi
movq %rax, %rdi
movl $0x10, %edx
callq 0x84c0
jmp 0x3a907
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq %r13, %rdi
movl $0x10, %edx
callq 0x84c0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3a8eb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x3a907
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x1, %edx
movq %r13, %rdi
leaq 0x952c4(%rip), %rsi     # 0xcfbda
callq 0x84e0
movq 0xe0(%rsp), %rsi
movq %rsp, %rdi
callq 0x4d82f
movq (%rsp), %rsi
movq 0x8(%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 (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3a981
movq 0x10(%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 0x3ab42
movl $0x1, %r14d
movl $0x20, %r15d
movl $0x30, %ebp
movl $0x1, %edx
movq %r13, %rdi
leaq 0x951dd(%rip), %rsi     # 0xcfbda
callq 0x84e0
movq 0xe0(%rsp), %rsi
addq %r15, %rsi
movq %rsp, %rdi
callq 0x4d82f
movq (%rsp), %rsi
movq 0x8(%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 (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3aa6b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0xc0(%rsp), %rbx
movq 0x100(%rsp), %r12
movq 0xa0(%rsp), %rdi
addq %rbp, %rdi
movq 0xf8(%rsp), %rsi
callq 0x3b46e
addq $0x60, %r12
movq 0x20(%rsp), %rcx
leaq (%rbx,%rcx,8), %rsi
movq %rsp, %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0x57f78
movq (%rsp), %rsi
movq 0x8(%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 (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3ab04
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
incq %r14
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, %r14
leaq 0x100(%rsp), %rbx
jne 0x3a9ee
movq %r13, %rdi
callq 0x8600
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x3ab6f
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3ab8b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
movq %rbx, %rdi
callq 0x2e784
movq 0x128(%rsp), %rsi
incq %rsi
movq 0xc0(%rsp), %rax
movq 0xc8(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
cmpq %rcx, %rsi
jne 0x3a74b
movq 0xa0(%rsp), %rbx
movq 0x78(%rsp), %rdi
callq 0x8310
addq $0x8, %rbx
cmpq %rbx, %rax
jne 0x3a64c
leaq 0xa0(%rsp), %rdi
callq 0x3b516
leaq 0x150(%rsp), %rdi
callq 0x2e784
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x3ac2a
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xe0(%rsp), %rdi
callq 0x2e784
leaq 0xc0(%rsp), %rdi
callq 0x2efec
leaq 0x208(%rsp), %rdi
callq 0x3c57e
leaq 0x1d8(%rsp), %rdi
callq 0x3c602
leaq 0x1a8(%rsp), %rdi
callq 0x3c686
leaq 0x178(%rsp), %rdi
callq 0x30870
xorl %eax, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %rbx
movq 0xc7e48(%rip), %rsi     # 0x102ae8
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
movq 0xc7334(%rip), %rdi     # 0x101fe8
leaq 0x927fe(%rip), %rsi     # 0xcd4b9
movl $0x1c, %edx
callq 0x84e0
movq 0xc7e1c(%rip), %rsi     # 0x102ae8
movq 0xc7e1d(%rip), %rdx     # 0x102af0
movq 0xc730e(%rip), %rdi     # 0x101fe8
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 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x28(%rsp), %r14
leaq 0xe0(%rsp), %r15
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3ad6b
movq %r15, %rdi
movq %r14, %rsi
callq 0x3133c
jmp 0x3ad2e
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
jne 0x3a212
jmp 0x3a21f
jmp 0x3ad80
movq %rax, %r15
movl $0x208, %esi            # imm = 0x208
movq %rbx, %rdi
jmp 0x3ae08
jmp 0x3adbe
jmp 0x3adbe
movq %rax, %r15
movl $0x208, %esi            # imm = 0x208
movq %rbx, %rdi
callq 0x8480
jmp 0x3b002
jmp 0x3adbe
movq %rax, %r15
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3ae00
jmp 0x3af82
movq %rax, %r15
jmp 0x3af82
movq %rax, %r15
jmp 0x3afc1
jmp 0x3ae83
movq %rax, %r15
movl $0x208, %esi            # imm = 0x208
movq %rbx, %rdi
callq 0x8480
jmp 0x3af75
jmp 0x3adef
jmp 0x3ae83
movq %rax, %r15
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3af82
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x3af82
movq %rax, %r15
jmp 0x3aed1
jmp 0x3ae1c
movq %rax, %r15
jmp 0x3ae62
jmp 0x3ae23
movq %rax, %r15
jmp 0x3ae46
movq %rax, %r15
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3ae46
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x3ae62
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x200, %esi            # imm = 0x200
movq %r13, %rdi
jmp 0x3af22
movq %rax, %r15
jmp 0x3af68
jmp 0x3ae83
movq %rax, %r15
jmp 0x3af4c
jmp 0x3af02
movq %rax, %r15
jmp 0x3af75
jmp 0x3ae97
jmp 0x3ae97
jmp 0x3af09
jmp 0x3af02
jmp 0x3af02
jmp 0x3af02
movq %rax, %r15
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x3aeb6
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x8480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3aed1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x3aef6
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x28(%rsp), %rdi
callq 0x3c6d4
jmp 0x3af75
movq %rax, %r15
jmp 0x3af27
jmp 0x3af09
movq %rax, %r15
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3af27
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x3af4c
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3af68
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x100(%rsp), %rdi
callq 0x2e784
leaq 0xa0(%rsp), %rdi
callq 0x3b516
leaq 0x150(%rsp), %rdi
callq 0x2e784
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x3afb4
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xe0(%rsp), %rdi
callq 0x2e784
leaq 0xc0(%rsp), %rdi
callq 0x2efec
leaq 0x208(%rsp), %rdi
callq 0x3c57e
leaq 0x1d8(%rsp), %rdi
callq 0x3c602
leaq 0x1a8(%rsp), %rdi
callq 0x3c686
leaq 0x178(%rsp), %rdi
callq 0x30870
movq %r15, %rdi
callq 0x8840