// File: millanek[P]evo/evo_DNA_to_Protein.cpp
// Function: DNAtoProtein(int, char**)
int DNAtoProtein(int argc, char** argv) {
    parseDNAtoProteinOptions(argc, argv);
    std::vector<string> allAligmentFiles; string AAFileName;
    std::vector<string> allNewLabels;
    
    std::cerr << "Translate multiple aligments from DNA to protein" << std::endl;
    
    if (opt::alignmentFile != "") {
        allAligmentFiles.push_back(opt::alignmentFile);
        // look at suffix
        size_t suffixPos = opt::alignmentFile.find_last_of('.');
        if (suffixPos !=  std::string::npos) {
            if (opt::alignmentFile.substr(suffixPos) == ".fa" || opt::alignmentFile.substr(suffixPos) == ".fasta")
                std::cerr << "for the gene: " << stripExtension(opt::alignmentFile) << std::endl;
            else
                std::cerr << "for the gene: " << opt::alignmentFile << std::endl;
        } else {
            std::cerr << "for the gene: " << opt::alignmentFile << std::endl;
        }
    } else {
        std::ifstream* alignmentList = new std::ifstream(opt::alignmentListFile.c_str());
        std::cerr << "for the genes in: " << opt::alignmentListFile << std::endl;
        std::string line;
        while (getline(*alignmentList, line)) {
            allAligmentFiles.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 mutiple alignment files:
    for (std::vector<std::string>::size_type i = 0; i != allAligmentFiles.size(); i++) {
        std::ifstream* alignment = new std::ifstream(allAligmentFiles[i].c_str());
        std::vector<string> allSeqs; std::vector<string> allSeqsAA;
        // Load the DNA alignment
        std::string line; int lineNum = 1;
        while (getline(*alignment, line)) {
            if (lineNum % 2 == 1) assert(line[0] == '>');
            lineNum++;
            if (line[0] == '>' && opt::newLabelFile != "") continue;
            if (line[0] == '>' && opt::newLabelFile == "") { allNewLabels.push_back(line); continue; }
            allSeqs.push_back(line);
        } alignment->close();
        
       // std::cerr << "loaded seqs for: " << allAligmentFiles[i] << std::endl;
        //std::cerr << "allSeqs.size(): " << allSeqs.size() << std::endl;
        // Translate to Amino Acid sequences:
        std::string::size_type geneLengthNt = allSeqs[0].length();
        int numSamples = (int)allSeqs.size();
        std::vector<string> altCodons; altCodons.resize(numSamples);
        allSeqsAA.resize(numSamples);
        if (numSamples > 0) {
            assert(geneLengthNt % 3 == 0); // The gene length must be divisible by three
            for (std::vector<std::string>::size_type j = 0; j != numSamples; j++) {
                allSeqsAA[j].reserve(geneLengthNt/3);
            }
            for (string::size_type k = 0; k != geneLengthNt; k++) {
                for (std::vector<std::string>::size_type j = 0; j != numSamples; j++) {
                    altCodons[j] += allSeqs[j][k];
                }
                // Find the types of mutation we are dealing with
                if ((k+1)%3 == 0) {
                    for (std::vector<std::string>::size_type j = 0; j != numSamples; j++) {
                        assert(allSeqs[j].substr(k-2,3) == altCodons[j]);
                        allSeqsAA[j] += getAminoAcidOneLetterCode(altCodons[j]);
                    }
                    for (std::vector<std::string>::size_type j = 0; j != numSamples; j++) {
                        altCodons[j] = "";
                    }
                }
            }
        } else{
            std::cerr << allAligmentFiles[i] << "has no alignment.." << std::endl;
        }
        //std::cerr << "processed seqs for: " << allAligmentFiles[i] << std::endl;
        //std::cerr << "going to output: " << allAligmentFiles[i] << std::endl;
        size_t suffixPos = allAligmentFiles[i].find_last_of('.');
        if (suffixPos != std::string::npos) {
            if (allAligmentFiles[i].substr(suffixPos) == ".fa" || allAligmentFiles[i].substr(suffixPos) == ".fasta")
                AAFileName = opt::outFolder + stripExtension(allAligmentFiles[i]) + "_AA.fasta";
            else
                AAFileName = opt::outFolder + allAligmentFiles[i] + "_AA.fasta";
        } else {
            AAFileName = opt::outFolder + allAligmentFiles[i] + "_AA.fasta";
        }
        //std::cerr << "into: " << AAFileName << std::endl;
        std::ofstream* AAalignment = new std::ofstream(AAFileName.c_str());
        for (std::vector<std::string>::size_type j = 0; j != numSamples; j++) {
            *AAalignment << allNewLabels[j] << std::endl;
            *AAalignment << allSeqsAA[j] << std::endl;
        } AAalignment->close();
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x480, %rsp            # imm = 0x480
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x61260
leaq -0x28(%rbp), %rdi
callq 0x48da0
leaq -0x48(%rbp), %rdi
callq 0xa820
leaq -0x60(%rbp), %rdi
callq 0x48da0
movq 0x138f10(%rip), %rdi    # 0x198ff0
leaq 0xd6bc9(%rip), %rsi     # 0x136cb0
callq 0xa5c0
movq %rax, -0x350(%rbp)
jmp 0x600f5
movq -0x350(%rbp), %rdi
movq 0x138e85(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x6010a
leaq 0x13a1a7(%rip), %rdi    # 0x19a2b8
leaq 0xd5dc7(%rip), %rsi     # 0x135edf
callq 0x50eb0
movb %al, -0x351(%rbp)
jmp 0x60125
movb -0x351(%rbp), %al
testb $0x1, %al
jne 0x60134
jmp 0x603dc
leaq 0x13a17d(%rip), %rsi    # 0x19a2b8
leaq -0x28(%rbp), %rdi
callq 0x48dc0
jmp 0x60146
leaq 0x13a16b(%rip), %rdi    # 0x19a2b8
movl $0x2e, %esi
movq $-0x1, %rdx
callq 0xabf0
movq %rax, -0x78(%rbp)
cmpq $-0x1, -0x78(%rbp)
je 0x60388
movq -0x78(%rbp), %rdx
movb $0x0, -0xb9(%rbp)
leaq 0x13a139(%rip), %rsi    # 0x19a2b8
leaq -0x98(%rbp), %rdi
movq $-0x1, %rcx
callq 0xa5f0
jmp 0x60194
leaq 0xe562f(%rip), %rsi     # 0x1457ca
leaq -0x98(%rbp), %rdi
callq 0x2d770
movb %al, -0x352(%rbp)
jmp 0x601af
movb -0x352(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x353(%rbp)
jne 0x60214
jmp 0x601c4
movq -0x78(%rbp), %rdx
leaq 0x13a0e9(%rip), %rsi    # 0x19a2b8
leaq -0xb8(%rbp), %rdi
movq $-0x1, %rcx
callq 0xa5f0
jmp 0x601e4
movb $0x1, -0xb9(%rbp)
leaq 0xd6b67(%rip), %rsi     # 0x136d59
leaq -0xb8(%rbp), %rdi
callq 0x2d770
movb %al, -0x354(%rbp)
jmp 0x60206
movb -0x354(%rbp), %al
movb %al, -0x353(%rbp)
jmp 0x60214
movb -0x353(%rbp), %al
movb %al, -0x355(%rbp)
testb $0x1, -0xb9(%rbp)
jne 0x6022b
jmp 0x60237
leaq -0xb8(%rbp), %rdi
callq 0xac88
leaq -0x98(%rbp), %rdi
callq 0xac88
movb -0x355(%rbp), %al
testb $0x1, %al
jne 0x60252
jmp 0x60337
movq 0x138d97(%rip), %rdi    # 0x198ff0
leaq 0xd5bfd(%rip), %rsi     # 0x135e5d
callq 0xa5c0
movq %rax, -0x360(%rbp)
jmp 0x6026e
leaq 0x13a043(%rip), %rsi    # 0x19a2b8
leaq -0xe0(%rbp), %rdi
callq 0x7be70
jmp 0x60283
movq -0x360(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0xa520
movq %rax, -0x368(%rbp)
jmp 0x6029f
movq -0x368(%rbp), %rdi
movq 0x138cdb(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x602b4
leaq -0xe0(%rbp), %rdi
callq 0xac88
jmp 0x60386
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6122e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x60309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
testb $0x1, -0xb9(%rbp)
jne 0x602fb
jmp 0x60307
leaq -0xb8(%rbp), %rdi
callq 0xac88
jmp 0x60309
leaq -0x98(%rbp), %rdi
callq 0xac88
jmp 0x6122e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0xac88
jmp 0x6122e
movq 0x138cb2(%rip), %rdi    # 0x198ff0
leaq 0xd5b18(%rip), %rsi     # 0x135e5d
callq 0xa5c0
movq %rax, -0x370(%rbp)
jmp 0x60353
movq -0x370(%rbp), %rdi
leaq 0x139f57(%rip), %rsi    # 0x19a2b8
callq 0xa520
movq %rax, -0x378(%rbp)
jmp 0x6036f
movq -0x378(%rbp), %rdi
movq 0x138c0b(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x60384
jmp 0x60386
jmp 0x603d7
movq 0x138c61(%rip), %rdi    # 0x198ff0
leaq 0xd5ac7(%rip), %rsi     # 0x135e5d
callq 0xa5c0
movq %rax, -0x380(%rbp)
jmp 0x603a4
movq -0x380(%rbp), %rdi
leaq 0x139f06(%rip), %rsi    # 0x19a2b8
callq 0xa520
movq %rax, -0x388(%rbp)
jmp 0x603c0
movq -0x388(%rbp), %rdi
movq 0x138bba(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x603d5
jmp 0x603d7
jmp 0x6051d
movl $0x208, %edi            # imm = 0x208
callq 0xa5d0
movq %rax, -0x390(%rbp)
jmp 0x603ef
leaq 0x139ee2(%rip), %rdi    # 0x19a2d8
callq 0xa220
movq -0x390(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0xab90
jmp 0x60411
movq -0x390(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq 0x138bca(%rip), %rdi    # 0x198ff0
leaq 0xd232b(%rip), %rsi     # 0x132758
callq 0xa5c0
movq %rax, -0x398(%rbp)
jmp 0x6043b
movq -0x398(%rbp), %rdi
leaq 0x139e8f(%rip), %rsi    # 0x19a2d8
callq 0xa520
movq %rax, -0x3a0(%rbp)
jmp 0x60457
movq -0x3a0(%rbp), %rdi
movq 0x138b23(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x6046c
leaq -0x108(%rbp), %rdi
callq 0xa820
movq -0xe8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0xa0d0
movq %rax, -0x3a8(%rbp)
jmp 0x60494
movq -0x3a8(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xa740
movb %al, -0x3a9(%rbp)
jmp 0x604b2
movb -0x3a9(%rbp), %al
testb $0x1, %al
jne 0x604be
jmp 0x60511
leaq -0x28(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x48dc0
jmp 0x604d0
jmp 0x60478
movq -0x390(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
movl $0x208, %esi            # imm = 0x208
callq 0xa5e0
jmp 0x6122e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0xac88
jmp 0x6122e
leaq -0x108(%rbp), %rdi
callq 0xac88
leaq 0x139dd4(%rip), %rdi    # 0x19a2f8
leaq 0xd59b4(%rip), %rsi     # 0x135edf
callq 0x50eb0
movb %al, -0x3aa(%rbp)
jmp 0x60538
movb -0x3aa(%rbp), %al
testb $0x1, %al
jne 0x60547
jmp 0x60688
movq 0x138aa2(%rip), %rdi    # 0x198ff0
leaq 0xd49d9(%rip), %rsi     # 0x134f2e
callq 0xa5c0
movq %rax, -0x3b8(%rbp)
jmp 0x60563
movq -0x3b8(%rbp), %rdi
leaq 0x139d87(%rip), %rsi    # 0x19a2f8
callq 0xa520
movq %rax, -0x3c0(%rbp)
jmp 0x6057f
movq -0x3c0(%rbp), %rdi
movq 0x1389fb(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x60594
movl $0x208, %edi            # imm = 0x208
callq 0xa5d0
movq %rax, -0x3c8(%rbp)
jmp 0x605a7
leaq 0x139d4a(%rip), %rdi    # 0x19a2f8
callq 0xa220
movq -0x3c8(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0xab90
jmp 0x605c9
movq -0x3c8(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq -0x130(%rbp), %rdi
callq 0xa820
movq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xa0d0
movq %rax, -0x3d0(%rbp)
jmp 0x605ff
movq -0x3d0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xa740
movb %al, -0x3d1(%rbp)
jmp 0x6061d
movb -0x3d1(%rbp), %al
testb $0x1, %al
jne 0x60629
jmp 0x6067c
leaq -0x60(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x48dc0
jmp 0x6063b
jmp 0x605e3
movq -0x3c8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
movl $0x208, %esi            # imm = 0x208
callq 0xa5e0
jmp 0x6122e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0xac88
jmp 0x6122e
leaq -0x130(%rbp), %rdi
callq 0xac88
movq $0x0, -0x138(%rbp)
movq -0x138(%rbp), %rax
movq %rax, -0x3e0(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0x3e0(%rbp), %rax
cmpq %rcx, %rax
je 0x61208
movl $0x208, %edi            # imm = 0x208
callq 0xa5d0
movq %rax, -0x3e8(%rbp)
jmp 0x606d0
movq -0x138(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
callq 0xa220
movq -0x3e8(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0xab90
jmp 0x606fe
movq -0x3e8(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x48da0
leaq -0x170(%rbp), %rdi
callq 0x48da0
leaq -0x190(%rbp), %rdi
callq 0xa820
movl $0x1, -0x194(%rbp)
movq -0x140(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0xa0d0
movq %rax, -0x3f0(%rbp)
jmp 0x60756
movq -0x3f0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xa740
movb %al, -0x3f1(%rbp)
jmp 0x60774
movb -0x3f1(%rbp), %al
testb $0x1, %al
jne 0x60783
jmp 0x608f6
movl -0x194(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x1, %edx
jne 0x60814
xorl %eax, %eax
movl %eax, %esi
leaq -0x190(%rbp), %rdi
callq 0xac60
movq %rax, -0x400(%rbp)
jmp 0x607af
movq -0x400(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0x607c0
jmp 0x60812
leaq 0xd1fa4(%rip), %rdi     # 0x13276b
leaq 0xd6513(%rip), %rsi     # 0x136ce1
movl $0x5d, %edx
leaq 0xd651e(%rip), %rcx     # 0x136cf8
callq 0xa390
movq -0x3e8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
movl $0x208, %esi            # imm = 0x208
callq 0xa5e0
jmp 0x6122e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x611e2
jmp 0x60814
movl -0x194(%rbp), %eax
incl %eax
movl %eax, -0x194(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x190(%rbp), %rdi
callq 0xac60
movq %rax, -0x408(%rbp)
jmp 0x6083b
movq -0x408(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0x60876
leaq 0x139aa7(%rip), %rdi    # 0x19a2f8
leaq 0xd5687(%rip), %rsi     # 0x135edf
callq 0x50eb0
movb %al, -0x409(%rbp)
jmp 0x60865
movb -0x409(%rbp), %al
testb $0x1, %al
jne 0x60871
jmp 0x60876
jmp 0x6073a
xorl %eax, %eax
movl %eax, %esi
leaq -0x190(%rbp), %rdi
callq 0xac60
movq %rax, -0x418(%rbp)
jmp 0x6088f
movq -0x418(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0x608dc
leaq 0x139a53(%rip), %rdi    # 0x19a2f8
leaq 0xd5633(%rip), %rsi     # 0x135edf
callq 0x2d770
movb %al, -0x419(%rbp)
jmp 0x608b9
movb -0x419(%rbp), %al
testb $0x1, %al
jne 0x608c5
jmp 0x608dc
leaq -0x60(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x48dc0
jmp 0x608d7
jmp 0x6073a
leaq -0x158(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x48dc0
jmp 0x608f1
jmp 0x6073a
movq -0x140(%rbp), %rdi
callq 0xa110
jmp 0x60904
xorl %eax, %eax
movl %eax, %esi
leaq -0x158(%rbp), %rdi
movq %rdi, -0x430(%rbp)
callq 0x3d940
movq %rax, %rdi
callq 0xa930
movq -0x430(%rbp), %rdi
movq %rax, -0x1a0(%rbp)
callq 0x3ffd0
movl %eax, -0x1a4(%rbp)
leaq -0x1c0(%rbp), %rdi
movq %rdi, -0x428(%rbp)
callq 0x48da0
movq -0x428(%rbp), %rdi
movslq -0x1a4(%rbp), %rsi
callq 0x5f8f0
jmp 0x60964
movslq -0x1a4(%rbp), %rsi
leaq -0x170(%rbp), %rdi
callq 0x5f8f0
jmp 0x60979
cmpl $0x0, -0x1a4(%rbp)
jle 0x60c8f
movq -0x1a0(%rbp), %rax
movl $0x3, %ecx
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0x6099f
jmp 0x609cf
leaq 0xd6371(%rip), %rdi     # 0x136d17
leaq 0xd6334(%rip), %rsi     # 0x136ce1
movl $0x6c, %edx
leaq 0xd633f(%rip), %rcx     # 0x136cf8
callq 0xa390
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x611d6
movq $0x0, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
movslq -0x1a4(%rbp), %rcx
cmpq %rcx, %rax
je 0x60a3a
movq -0x1c8(%rbp), %rsi
leaq -0x170(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movq -0x1a0(%rbp), %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
movq %rdx, %rsi
shrq %rsi
callq 0xa980
jmp 0x60a24
jmp 0x60a26
movq -0x1c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1c8(%rbp)
jmp 0x609da
movq $0x0, -0x1d0(%rbp)
movq -0x1d0(%rbp), %rax
cmpq -0x1a0(%rbp), %rax
je 0x60c8d
movq $0x0, -0x1d8(%rbp)
movq -0x1d8(%rbp), %rax
movslq -0x1a4(%rbp), %rcx
cmpq %rcx, %rax
je 0x60aee
movq -0x1d8(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movq -0x1d0(%rbp), %rsi
callq 0xac60
movq %rax, -0x438(%rbp)
jmp 0x60aa2
movq -0x438(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x43c(%rbp)
movq -0x1d8(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x3d940
movl -0x43c(%rbp), %esi
movq %rax, %rdi
callq 0xa380
jmp 0x60ad5
jmp 0x60ad7
movq -0x1d8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1d8(%rbp)
jmp 0x60a64
movq -0x1d0(%rbp), %rax
addq $0x1, %rax
movl $0x3, %ecx
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0x60c74
movq $0x0, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
movslq -0x1a4(%rbp), %rcx
cmpq %rcx, %rax
je 0x60c1a
movq -0x1e0(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
movq -0x1d0(%rbp), %rdx
addq $-0x2, %rdx
leaq -0x200(%rbp), %rdi
movl $0x3, %ecx
callq 0xa5f0
jmp 0x60b63
movq -0x1e0(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
leaq -0x200(%rbp), %rdi
callq 0x39210
testb $0x1, %al
jne 0x60b8b
jmp 0x60b8d
jmp 0x60bac
leaq 0xd6199(%rip), %rdi     # 0x136d2d
leaq 0xd6146(%rip), %rsi     # 0x136ce1
movl $0x77, %edx
leaq 0xd6151(%rip), %rcx     # 0x136cf8
callq 0xa390
leaq -0x200(%rbp), %rdi
callq 0xac88
movq -0x1e0(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
callq 0x615d0
movb %al, -0x43d(%rbp)
jmp 0x60bdb
movq -0x1e0(%rbp), %rsi
leaq -0x170(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movb -0x43d(%rbp), %al
movsbl %al, %esi
callq 0xa380
jmp 0x60c01
jmp 0x60c03
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x60b18
movq $0x0, -0x208(%rbp)
movq -0x208(%rbp), %rax
movslq -0x1a4(%rbp), %rcx
cmpq %rcx, %rax
je 0x60c72
movq -0x208(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
leaq 0xd528a(%rip), %rsi     # 0x135edf
callq 0xa810
jmp 0x60c5c
jmp 0x60c5e
movq -0x208(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x208(%rbp)
jmp 0x60c25
jmp 0x60c74
jmp 0x60c76
movq -0x1d0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1d0(%rbp)
jmp 0x60a45
jmp 0x60cea
movq -0x138(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
movq 0x138347(%rip), %rdi    # 0x198ff0
callq 0xa520
movq %rax, -0x448(%rbp)
jmp 0x60cb7
movq -0x448(%rbp), %rdi
leaq 0xd51e4(%rip), %rsi     # 0x135ea9
callq 0xa5c0
movq %rax, -0x450(%rbp)
jmp 0x60cd3
movq -0x450(%rbp), %rdi
movq 0x1382a7(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x60ce8
jmp 0x60cea
movq -0x138(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2e, %esi
movq $-0x1, %rdx
callq 0xabf0
movq %rax, -0x210(%rbp)
cmpq $-0x1, -0x210(%rbp)
je 0x60fc3
movq -0x138(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
movq -0x210(%rbp), %rdx
movb $0x0, -0x251(%rbp)
leaq -0x230(%rbp), %rdi
movq $-0x1, %rcx
callq 0xa5f0
jmp 0x60d59
leaq 0xe4a6a(%rip), %rsi     # 0x1457ca
leaq -0x230(%rbp), %rdi
callq 0x2d770
movb %al, -0x451(%rbp)
jmp 0x60d74
movb -0x451(%rbp), %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x452(%rbp)
jne 0x60de8
jmp 0x60d89
movq -0x138(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
movq -0x210(%rbp), %rdx
leaq -0x250(%rbp), %rdi
movq $-0x1, %rcx
callq 0xa5f0
jmp 0x60db8
movb $0x1, -0x251(%rbp)
leaq 0xd5f93(%rip), %rsi     # 0x136d59
leaq -0x250(%rbp), %rdi
callq 0x2d770
movb %al, -0x453(%rbp)
jmp 0x60dda
movb -0x453(%rbp), %al
movb %al, -0x452(%rbp)
jmp 0x60de8
movb -0x452(%rbp), %al
movb %al, -0x454(%rbp)
testb $0x1, -0x251(%rbp)
jne 0x60dff
jmp 0x60e0b
leaq -0x250(%rbp), %rdi
callq 0xac88
leaq -0x230(%rbp), %rdi
callq 0xac88
movb -0x454(%rbp), %al
testb $0x1, %al
jne 0x60e26
jmp 0x60f33
movq -0x138(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3d940
movq %rax, %rsi
leaq -0x2b8(%rbp), %rdi
callq 0x7be70
jmp 0x60e47
leaq 0x1394ca(%rip), %rsi    # 0x19a318
leaq -0x298(%rbp), %rdi
leaq -0x2b8(%rbp), %rdx
callq 0x3e140
jmp 0x60e63
leaq 0xd5eec(%rip), %rdx     # 0x136d56
leaq -0x278(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x3e020
jmp 0x60e7f
leaq -0x48(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0xa710
leaq -0x278(%rbp), %rdi
callq 0xac88
leaq -0x298(%rbp), %rdi
callq 0xac88
leaq -0x2b8(%rbp), %rdi
callq 0xac88
jmp 0x60fbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x60eeb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
testb $0x1, -0x251(%rbp)
jne 0x60edd
jmp 0x60ee9
leaq -0x250(%rbp), %rdi
callq 0xac88
jmp 0x60eeb
leaq -0x230(%rbp), %rdi
callq 0xac88
jmp 0x611d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x60f22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x298(%rbp), %rdi
callq 0xac88
leaq -0x2b8(%rbp), %rdi
callq 0xac88
jmp 0x611d6
movq -0x138(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3d940
movq %rax, %rdx
leaq 0x1393cb(%rip), %rsi    # 0x19a318
leaq -0x2f8(%rbp), %rdi
callq 0x3e290
jmp 0x60f5b
leaq 0xd5df4(%rip), %rdx     # 0x136d56
leaq -0x2d8(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x3e020
jmp 0x60f77
leaq -0x48(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0xa710
leaq -0x2d8(%rbp), %rdi
callq 0xac88
leaq -0x2f8(%rbp), %rdi
callq 0xac88
jmp 0x60fbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0xac88
jmp 0x611d6
jmp 0x6104e
movq -0x138(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3d940
movq %rax, %rdx
leaq 0x13933b(%rip), %rsi    # 0x19a318
leaq -0x338(%rbp), %rdi
callq 0x3e290
jmp 0x60feb
leaq 0xd5d64(%rip), %rdx     # 0x136d56
leaq -0x318(%rbp), %rdi
leaq -0x338(%rbp), %rsi
callq 0x3e020
jmp 0x61007
leaq -0x48(%rbp), %rdi
leaq -0x318(%rbp), %rsi
callq 0xa710
leaq -0x318(%rbp), %rdi
callq 0xac88
leaq -0x338(%rbp), %rdi
callq 0xac88
jmp 0x6104e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x338(%rbp), %rdi
callq 0xac88
jmp 0x611d6
movl $0x200, %edi            # imm = 0x200
callq 0xa5d0
movq %rax, -0x460(%rbp)
jmp 0x61061
leaq -0x48(%rbp), %rdi
callq 0xa220
movq -0x460(%rbp), %rdi
movq %rax, %rsi
movl $0x10, %edx
callq 0xa650
jmp 0x61080
movq -0x460(%rbp), %rax
movq %rax, -0x340(%rbp)
movq $0x0, -0x348(%rbp)
movq -0x348(%rbp), %rax
movslq -0x1a4(%rbp), %rcx
cmpq %rcx, %rax
je 0x61181
movq -0x340(%rbp), %rax
movq %rax, -0x470(%rbp)
movq -0x348(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3d940
movq -0x470(%rbp), %rdi
movq %rax, %rsi
callq 0xa520
movq %rax, -0x468(%rbp)
jmp 0x610e6
movq -0x468(%rbp), %rdi
movq 0x137e94(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x610fb
movq -0x340(%rbp), %rax
movq %rax, -0x480(%rbp)
movq -0x348(%rbp), %rsi
leaq -0x170(%rbp), %rdi
callq 0x3d940
movq -0x480(%rbp), %rdi
movq %rax, %rsi
callq 0xa520
movq %rax, -0x478(%rbp)
jmp 0x61134
movq -0x478(%rbp), %rdi
movq 0x137e46(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x61149
jmp 0x6114b
movq -0x348(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x348(%rbp)
jmp 0x61099
movq -0x460(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
movl $0x200, %esi            # imm = 0x200
callq 0xa5e0
jmp 0x611d6
movq -0x340(%rbp), %rdi
callq 0xa840
jmp 0x6118f
leaq -0x1c0(%rbp), %rdi
callq 0x3dfa0
leaq -0x190(%rbp), %rdi
callq 0xac88
leaq -0x170(%rbp), %rdi
callq 0x3dfa0
leaq -0x158(%rbp), %rdi
callq 0x3dfa0
movq -0x138(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x138(%rbp)
jmp 0x60693
leaq -0x1c0(%rbp), %rdi
callq 0x3dfa0
leaq -0x190(%rbp), %rdi
callq 0xac88
leaq -0x170(%rbp), %rdi
callq 0x3dfa0
leaq -0x158(%rbp), %rdi
callq 0x3dfa0
jmp 0x6122e
leaq -0x60(%rbp), %rdi
callq 0x3dfa0
leaq -0x48(%rbp), %rdi
callq 0xac88
leaq -0x28(%rbp), %rdi
callq 0x3dfa0
xorl %eax, %eax
addq $0x480, %rsp            # imm = 0x480
popq %rbp
retq
leaq -0x60(%rbp), %rdi
callq 0x3dfa0
leaq -0x48(%rbp), %rdi
callq 0xac88
leaq -0x28(%rbp), %rdi
callq 0x3dfa0
movq -0x68(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)