// File: /workspace/github_cpp_makefile_star2_O3/millanek[P]evo/process_vcf_fill_aa.cpp
// Function: fillAaMain(int, char**)
int fillAaMain(int argc, char** argv) {
    parseFillAaOptions(argc, argv);
    string line; // for reading the input files
    
    std::istream* vcfFile = createReader(opt::vcfFile.c_str());
    std::ifstream* ancSeqFile = new std::ifstream(opt::ancSeqFile.c_str());
    
    string refFastaFileRoot;
    if (opt::out.empty()) {
        refFastaFileRoot = stripExtension(opt::vcfFile);
    } else {
        refFastaFileRoot = opt::out;
    }
    // the output file
    std::ostream* outFile;
    if (opt::out == "") {
        outFile = &std::cout;
    } else {
        string outFN = refFastaFileRoot + "_AAfilled.vcf.gz";
        outFile = createWriter(outFN.c_str());
    }
    
    // Read in the whole ancestral sequence
    std::map<string, string> ancSeqs;
    getline(*ancSeqFile, line);
    string currentScaffold = line.substr(1,string::npos);
    ancSeqs[currentScaffold] = ""; ancSeqs[currentScaffold].reserve(50000000);
    while (getline(*ancSeqFile, line)) {
        if (line[0] != '>') {
            ancSeqs[currentScaffold].append(line);
        } else {
            // std::cerr << currentScaffold << " length: " << ancSeqs[currentScaffold].length() << std::endl;
            currentScaffold = line.substr(1,string::npos);
            ancSeqs[currentScaffold] = ""; ancSeqs[currentScaffold].reserve(50000000);
        }
    }
    
    // Now go through the vcf and add the AA fields
    int totalVariantNumber = 0;
    int aaDashCount = 0; int aaRefCount = 0; int aaAltCount = 0; int aaDiffCount = 0; int aaNcount = 0; int aaHetCount = 0;
    while (getline(*vcfFile, line)) {
        if (line[0] == '#' && line[1] == '#')
            *outFile << line << std::endl;
        else if (line[0] == '#' && line[1] == 'C') {
            if (opt::IndividualName == "") {
                *outFile << "##INFO=<ID=AA,Number=1,Type=String,Description=\"Ancestral allele\">" << std::endl;
                *outFile << line << std::endl;
            } else {
                *outFile << line << "\t" << opt::IndividualName << std::endl;
            }
        } else {
            totalVariantNumber++; string genotypeToAdd;
            std::vector<std::string> fields = split(line, '\t');
            std::vector<std::string> info = split(fields[7], ';');
            if (info[0] != "INDEL") {
                assert(ancSeqs.find(fields[0]) != ancSeqs.end());
                char AA;
                if (ancSeqs[fields[0]].length() == 0) {
                    AA = 'N';
                } else {
                    AA = std::toupper(ancSeqs[fields[0]][atoi(fields[1].c_str())-1]);
                    if (AA == '-') { aaDashCount++; genotypeToAdd = "./."; }
                    else if (AA == 'N') { aaNcount++; genotypeToAdd = "./."; }
                    else if (isDNAonly(AA)) {
                         if (AA == fields[3][0]) { aaRefCount++; genotypeToAdd = "0/0"; }
                        else if (AA == fields[4][0]) { aaAltCount++; genotypeToAdd = "1/1"; }
                        else if (!((AA == fields[3][0]) || (AA == fields[4][0]))) {
                            aaDiffCount++; genotypeToAdd = "./.";
                        }
                    } else {
                        aaHetCount++; string AAhetBases = returnHetIUPAC(AA);
                        if ((AAhetBases[0] == fields[3][0]) && (AAhetBases[1] == fields[4][0])) {
                            genotypeToAdd = "1/0";
                        } else if ((AAhetBases[1] == fields[3][0]) && (AAhetBases[0] == fields[4][0])) {
                            genotypeToAdd = "1/0";
                        } else {
                            genotypeToAdd = "./.";
                        }
                    }
                    // std::cerr << fields[0] << "\t" << fields[1] << "\t" << fields[3] << "\t" << fields[4] << "\t" << AA << std::endl;
                    // assert((AA == fields[3][0]) || (AA == fields[4][0]));
                }
                if (opt::IndividualName == "") {
                    fields[7] += ";AA="; fields[7] += AA;
                    print_vector(fields, *outFile, '\t');
                } else {
                    fields.push_back(genotypeToAdd);
                    print_vector(fields, *outFile, '\t');
                }
            } else {
                if (opt::IndividualName == "") {
                    *outFile << line << std::endl;
                } else {
                    fields.push_back("./.");
                    print_vector(fields, *outFile, '\t');
                }
            }
            if (totalVariantNumber % 100000 == 0) {
                double totalAAfilled = aaRefCount + aaAltCount + aaDashCount + aaDiffCount + aaNcount;
                std::cerr << totalVariantNumber << " variants processed. AA=Ref:" << aaRefCount << "("<< 100*(aaRefCount/totalAAfilled) <<"%); AA=Alt:" << aaAltCount << "("<< 100*(aaAltCount/totalAAfilled) <<"%); AA='-':" << aaDashCount << "("<< 100*(aaDashCount/totalAAfilled) << "%); AA=?(Neither Ref nor Alt):" << aaDiffCount << "("<< 100*(aaDiffCount/totalAAfilled) <<"%); AA=N:" << aaNcount << "("<< 100*(aaNcount/totalAAfilled) << "%)" << std::endl;
            }
        }
    }
    // Final summary
    double totalAAfilled = aaRefCount + aaAltCount + aaDashCount + aaDiffCount;
    std::cerr << std::endl;
    std::cerr << "All " << totalVariantNumber << " variants processed. AA=Ref:" << aaRefCount << "("<< 100*(aaRefCount/totalAAfilled) <<"%); AA=Alt:" << aaAltCount << "("<< 100*(aaAltCount/totalAAfilled) <<"%); AA='-':" << aaDashCount << "("<< 100*(aaDashCount/totalAAfilled) << "%); AA=?(Neither Ref nor Alt):" << aaDiffCount << "("<< 100*(aaDiffCount/totalAAfilled) <<"%)" << std::endl;
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
callq 0x4c3ba
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0xb7e13(%rip), %rsi     # 0x103130
leaq 0x98(%rsp), %rdi
leaq 0x108(%rsp), %rdx
callq 0x287de
leaq 0x98(%rsp), %rdi
movl $0x8, %esi
callq 0x500af
movq %rax, %rbx
leaq 0xa8(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x4b369
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x8480
movl $0x208, %edi            # imm = 0x208
callq 0x8470
movq %rax, %r15
movq 0xb7dd3(%rip), %rsi     # 0x103150
movq %rax, %rdi
movl $0x8, %edx
callq 0x8860
leaq 0x118(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpq $0x0, 0xb7dcf(%rip)     # 0x103178
je 0x4b3c1
leaq 0xb7dbe(%rip), %rsi     # 0x103170
leaq 0x108(%rsp), %rdi
callq 0x8270
jmp 0x4b405
leaq 0xb7d68(%rip), %rsi     # 0x103130
leaq 0x98(%rsp), %rdi
callq 0x4d82f
leaq 0x108(%rsp), %rdi
leaq 0x98(%rsp), %r14
movq %r14, %rsi
callq 0x8540
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x4b405
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0xb7d64(%rip), %rdi     # 0x103170
leaq 0x825b8(%rip), %rsi     # 0xcd9cb
callq 0x8160
testl %eax, %eax
je 0x4b4c7
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
movq 0x108(%rsp), %rsi
movq 0x110(%rsp), %rdx
addq %rsi, %rdx
callq 0x2ba06
leaq 0x8473e(%rip), %rsi     # 0xcfb88
leaq 0x98(%rsp), %rdi
callq 0x88c0
movq 0x98(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x287de
leaq 0xe8(%rsp), %rdi
movl $0x10, %esi
callq 0x5013e
movq %rax, (%rsp)
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4b4a8
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0x4b4d2
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x4b4d2
movq 0xb6aea(%rip), %rax     # 0x101fb8
movq %rax, (%rsp)
leaq 0xa0(%rsp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
leaq 0x58(%rsp), %rsi
movq %r15, %rdi
callq 0x8870
leaq 0xe8(%rsp), %rdi
leaq 0x58(%rsp), %rsi
movl $0x1, %edx
movq $-0x1, %rcx
callq 0x84a0
leaq 0x98(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x3b46e
movq 0x8(%rax), %rdx
leaq 0x82477(%rip), %rcx     # 0xcd9cb
movq %rax, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x86c0
leaq 0x98(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x3b46e
movl $0x2faf080, %esi        # imm = 0x2FAF080
movq %rax, %rdi
callq 0x86f0
leaq 0x58(%rsp), %r12
leaq 0x30(%rsp), %r13
leaq 0xe8(%rsp), %rbp
leaq 0x98(%rsp), %r14
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4b67b
movq 0x58(%rsp), %rax
cmpb $0x3e, (%rax)
jne 0x4b659
movl $0x1, %edx
movq %r13, %rdi
movq %r12, %rsi
movq $-0x1, %rcx
callq 0x84a0
movq %rbp, %rdi
movq %r13, %rsi
callq 0x8540
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x4b619
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r14, %rdi
movq %rbp, %rsi
callq 0x3b46e
movq 0x8(%rax), %rdx
movq %rax, %rdi
xorl %esi, %esi
leaq 0x82397(%rip), %rcx     # 0xcd9cb
xorl %r8d, %r8d
callq 0x86c0
movq %r14, %rdi
movq %rbp, %rsi
callq 0x3b46e
movl $0x2faf080, %esi        # imm = 0x2FAF080
movq %rax, %rdi
callq 0x86f0
jmp 0x4b59d
movq %r14, %rdi
movq %rbp, %rsi
callq 0x3b46e
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq %rax, %rdi
callq 0x8180
jmp 0x4b59d
movq $0x0, 0x50(%rsp)
leaq 0x58(%rsp), %r13
leaq 0xb7b00(%rip), %r12     # 0x103190
leaq 0x82334(%rip), %rbp     # 0xcd9cb
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x0, 0x8(%rsp)
movq (%rsp), %r15
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x8450
movsbl %al, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x8870
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4bf2b
movq 0x58(%rsp), %rsi
cmpb $0x23, (%rsi)
jne 0x4b827
movzbl 0x1(%rsi), %eax
cmpl $0x43, %eax
je 0x4b744
cmpl $0x23, %eax
jne 0x4b827
movq 0x60(%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
jmp 0x4b80f
movq %r12, %rdi
movq %rbp, %rsi
callq 0x8160
testl %eax, %eax
je 0x4b7ab
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq %r15, %rdi
callq 0x84e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x82253(%rip), %rsi     # 0xcd9ca
callq 0x84e0
movq 0xb7a0d(%rip), %rsi     # 0x103190
movq 0xb7a0e(%rip), %rdx     # 0x103198
movq %r14, %rdi
callq 0x84e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x8450
jmp 0x4b80f
movl $0x42, %edx
movq %r15, %rdi
leaq 0x843df(%rip), %rsi     # 0xcfb99
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 0x58(%rsp), %rsi
movq 0x60(%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
jmp 0x4b6c7
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movb $0x0, 0x40(%rsp)
leaq 0x78(%rsp), %rdi
movq %r13, %rsi
movl $0x9, %edx
callq 0x4d650
movq 0x78(%rsp), %rsi
movl $0xe0, %eax
addq %rax, %rsi
leaq 0x128(%rsp), %rdi
movl $0x3b, %edx
callq 0x4d650
movq 0x128(%rsp), %rdi
leaq 0x80f5b(%rip), %rsi     # 0xcc7da
callq 0x8160
testl %eax, %eax
je 0x4b94d
movq 0x78(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0x4c720
leaq 0xa0(%rsp), %rcx
cmpq %rcx, %rax
je 0x4c1c2
movq 0x78(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0x3b46e
cmpq $0x0, 0x8(%rax)
je 0x4b9f4
movq 0x78(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0x3b46e
movq %rax, %r14
movq 0x78(%rsp), %r15
movq 0x20(%r15), %rdi
callq 0x86e0
movq (%r14), %rcx
cltq
movsbl -0x1(%rcx,%rax), %edi
callq 0x8880
movl %eax, %r14d
shll $0x18, %eax
cmpl $0x4e000000, %eax       # imm = 0x4E000000
je 0x4ba3d
cmpl $0x2d000000, %eax       # imm = 0x2D000000
jne 0x4ba70
movq 0x38(%rsp), %rdx
movl $0x3, %r8d
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
leaq 0x84307(%rip), %rcx     # 0xcfc3a
callq 0x86c0
movq (%rsp), %r15
movq 0x20(%rsp), %rax
incl %eax
movq %rax, 0x20(%rsp)
jmp 0x4bbdc
movq %r12, %rdi
movq %rbp, %rsi
callq 0x8160
testl %eax, %eax
je 0x4b9fc
leaq 0xd8(%rsp), %rax
movq %rax, 0xc8(%rsp)
leaq 0xc8(%rsp), %r14
movq %r14, %rdi
leaq 0x842b8(%rip), %rsi     # 0xcfc3a
leaq 0x842b4(%rip), %rdx     # 0xcfc3d
callq 0x28a52
leaq 0x78(%rsp), %rdi
movq %r14, %rsi
callq 0x3e784
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x4b9c0
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x140(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x2fc8e
leaq 0x140(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x36ba0
jmp 0x4bc89
movb $0x4e, %r14b
jmp 0x4bbdc
movq 0x58(%rsp), %rsi
movq 0x60(%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
jmp 0x4bc91
movq 0x38(%rsp), %rdx
movl $0x3, %r8d
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
leaq 0x841e4(%rip), %rcx     # 0xcfc3a
callq 0x86c0
movq (%rsp), %r15
movq 0x50(%rsp), %rax
incl %eax
movq %rax, 0x50(%rsp)
jmp 0x4bbdc
movsbl %r14b, %esi
movzbl %sil, %eax
addl $-0x41, %eax
cmpl $0x13, %eax
ja 0x4bb3f
movl $0x80045, %ecx          # imm = 0x80045
btl %eax, %ecx
jae 0x4bb3f
movq 0x60(%r15), %rax
movsbl (%rax), %eax
cmpl %eax, %esi
jne 0x4bad0
movq 0x38(%rsp), %rdx
movl $0x3, %r8d
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
leaq 0x84188(%rip), %rcx     # 0xcfc3e
callq 0x86c0
movq (%rsp), %r15
movq 0x28(%rsp), %rax
incl %eax
movq %rax, 0x28(%rsp)
jmp 0x4bbdc
movq 0x80(%r15), %rax
movsbl (%rax), %eax
movq 0x38(%rsp), %rdx
cmpl %eax, %esi
jne 0x4bb11
movl $0x3, %r8d
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
leaq 0x8414b(%rip), %rcx     # 0xcfc42
callq 0x86c0
movq (%rsp), %r15
movq 0x18(%rsp), %rax
incl %eax
movq %rax, 0x18(%rsp)
jmp 0x4bbdc
movl $0x3, %r8d
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
leaq 0x84115(%rip), %rcx     # 0xcfc3a
callq 0x86c0
movq (%rsp), %r15
movq 0x10(%rsp), %rax
incl %eax
movq %rax, 0x10(%rsp)
jmp 0x4bbdc
leaq 0xc8(%rsp), %rdi
callq 0x4c66a
movq 0xc8(%rsp), %rcx
movb (%rcx), %al
movb 0x1(%rcx), %sil
movq 0x78(%rsp), %rdx
movq 0x60(%rdx), %rcx
movb (%rcx), %dil
cmpb %dil, %al
movq (%rsp), %r15
jne 0x4bb82
movq 0x80(%rdx), %r8
leaq 0x840c9(%rip), %rcx     # 0xcfc46
cmpb (%r8), %sil
je 0x4bba0
cmpb %dil, %sil
jne 0x4bb99
movq 0x80(%rdx), %rdx
leaq 0x840b1(%rip), %rcx     # 0xcfc46
cmpb (%rdx), %al
je 0x4bba0
leaq 0x8409a(%rip), %rcx     # 0xcfc3a
movq 0x38(%rsp), %rdx
movl $0x3, %r8d
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
callq 0x86c0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x4bbdc
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x8480
movq %r12, %rdi
movq %rbp, %rsi
callq 0x8160
testl %eax, %eax
je 0x4bc2b
leaq 0x78(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3133c
leaq 0x158(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x2fc8e
leaq 0x158(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x36ba0
jmp 0x4bc89
movq 0x78(%rsp), %rdi
movl $0xe0, %eax
addq %rax, %rdi
leaq 0x8400b(%rip), %rsi     # 0xcfc4a
callq 0x88c0
movq 0x78(%rsp), %rdi
movl $0xe0, %eax
addq %rax, %rdi
movsbl %r14b, %esi
callq 0x83d0
leaq 0x170(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x2fc8e
leaq 0x170(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movl $0x9, %edx
movl $0x1, %ecx
callq 0x36ba0
movq %r14, %rdi
callq 0x2e784
movl 0x8(%rsp), %eax
incl %eax
movl %eax, 0x8(%rsp)
imull $0xbcbe61d, %eax, %eax  # imm = 0xBCBE61D
rorl $0x5, %eax
cmpl $0xa7c5, %eax           # imm = 0xA7C5
ja 0x4beef
movq 0xb6332(%rip), %rdi     # 0x101fe8
movl 0x8(%rsp), %esi
callq 0x8810
movq %rax, %r14
movl $0x1c, %edx
movq %rax, %rdi
leaq 0x83f7e(%rip), %rsi     # 0xcfc4f
callq 0x84e0
movq %r14, %rdi
movq 0x28(%rsp), %rsi
callq 0x8810
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8740f(%rip), %rsi     # 0xd3104
callq 0x84e0
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rsi
addl %esi, %eax
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
addl %edx, %ecx
addl %eax, %ecx
addl 0x50(%rsp), %ecx
cvtsi2sd %ecx, %xmm1
cvtsi2sd %esi, %xmm0
movsd %xmm1, 0x90(%rsp)
divsd %xmm1, %xmm0
mulsd 0x83e4b(%rip), %xmm0    # 0xcfb80
movq %r14, %rdi
callq 0x8730
movq %rax, %r14
movl $0xb, %edx
movq %rax, %rdi
leaq 0x83f1d(%rip), %rsi     # 0xcfc6c
callq 0x84e0
movq %r14, %rdi
movq 0x18(%rsp), %rsi
callq 0x8810
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x87391(%rip), %rsi     # 0xd3104
callq 0x84e0
xorps %xmm0, %xmm0
cvtsi2sdl 0x18(%rsp), %xmm0
divsd 0x90(%rsp), %xmm0
mulsd 0x83dee(%rip), %xmm0    # 0xcfb80
movq %r14, %rdi
callq 0x8730
movq %rax, %r14
movl $0xb, %edx
movq %rax, %rdi
leaq 0x83ecc(%rip), %rsi     # 0xcfc78
callq 0x84e0
movq %r14, %rdi
movq 0x20(%rsp), %rsi
callq 0x8810
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x87334(%rip), %rsi     # 0xd3104
callq 0x84e0
xorps %xmm0, %xmm0
cvtsi2sdl 0x20(%rsp), %xmm0
divsd 0x90(%rsp), %xmm0
mulsd 0x83d91(%rip), %xmm0    # 0xcfb80
movq %r14, %rdi
callq 0x8730
movq %rax, %r14
movl $0x1e, %edx
movq %rax, %rdi
leaq 0x83e7b(%rip), %rsi     # 0xcfc84
callq 0x84e0
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x8810
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x872d7(%rip), %rsi     # 0xd3104
callq 0x84e0
xorps %xmm0, %xmm0
cvtsi2sdl 0x10(%rsp), %xmm0
divsd 0x90(%rsp), %xmm0
mulsd 0x83d34(%rip), %xmm0    # 0xcfb80
movq %r14, %rdi
callq 0x8730
movq %rax, %r14
movl $0x9, %edx
movq %rax, %rdi
leaq 0x83e3d(%rip), %rsi     # 0xcfca3
callq 0x84e0
movq %r14, %rdi
movq 0x50(%rsp), %rsi
callq 0x8810
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8727a(%rip), %rsi     # 0xd3104
callq 0x84e0
xorps %xmm0, %xmm0
cvtsi2sdl 0x50(%rsp), %xmm0
divsd 0x90(%rsp), %xmm0
mulsd 0x83cd7(%rip), %xmm0    # 0xcfb80
movq %r14, %rdi
callq 0x8730
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x8c154(%rip), %rsi     # 0xd8017
callq 0x84e0
movq (%r14), %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 0x128(%rsp), %rdi
callq 0x2e784
leaq 0x78(%rsp), %rdi
callq 0x2e784
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x4b6c7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x4b6c7
movq 0xb60b6(%rip), %rdi     # 0x101fe8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x8450
movq 0x10(%rsp), %r14
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %r12
movsbl %al, %esi
movq 0xb608c(%rip), %rdi     # 0x101fe8
callq 0x8040
movq %rax, %rdi
callq 0x8300
movq 0xb6078(%rip), %rdi     # 0x101fe8
leaq 0x83d36(%rip), %rsi     # 0xcfcad
movl $0x4, %edx
callq 0x84e0
movq 0xb6060(%rip), %rdi     # 0x101fe8
movl 0x8(%rsp), %esi
callq 0x8810
movq %rax, %rbx
leaq 0x83cb4(%rip), %rsi     # 0xcfc4f
movl $0x1c, %edx
movq %rax, %rdi
callq 0x84e0
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
callq 0x8810
movq %rax, %rbx
leaq 0x87145(%rip), %rsi     # 0xd3104
movl $0x1, %edx
movq %rax, %rdi
callq 0x84e0
movq 0x28(%rsp), %rdx
leal (%r12,%r14), %ecx
addl %edx, %ecx
addl %r15d, %ecx
cvtsi2sd %ecx, %xmm1
cvtsi2sd %edx, %xmm0
movsd %xmm1, 0x8(%rsp)
divsd %xmm1, %xmm0
mulsd 0x83b8c(%rip), %xmm0    # 0xcfb80
movq %rbx, %rdi
callq 0x8730
movq %rax, %rbx
leaq 0x83c66(%rip), %rsi     # 0xcfc6c
movl $0xb, %edx
movq %rax, %rdi
callq 0x84e0
movq %rbx, %rdi
movl %r12d, %esi
callq 0x8810
movq %rax, %rbx
leaq 0x870dc(%rip), %rsi     # 0xd3104
movl $0x1, %edx
movq %rax, %rdi
callq 0x84e0
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
divsd 0x8(%rsp), %xmm0
mulsd 0x83b35(%rip), %xmm0    # 0xcfb80
movq %rbx, %rdi
callq 0x8730
movq %rax, %rbx
leaq 0x83c1b(%rip), %rsi     # 0xcfc78
movl $0xb, %edx
movq %rax, %rdi
callq 0x84e0
movq %rbx, %rdi
movl %r15d, %esi
callq 0x8810
movq %rax, %rbx
leaq 0x87085(%rip), %rsi     # 0xd3104
movl $0x1, %edx
movq %rax, %rdi
callq 0x84e0
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
divsd 0x8(%rsp), %xmm0
mulsd 0x83ade(%rip), %xmm0    # 0xcfb80
movq %rbx, %rdi
callq 0x8730
movq %rax, %rbx
leaq 0x83bd0(%rip), %rsi     # 0xcfc84
movl $0x1e, %edx
movq %rax, %rdi
callq 0x84e0
movq %rbx, %rdi
movl %r14d, %esi
callq 0x8810
movq %rax, %rbx
leaq 0x8702e(%rip), %rsi     # 0xd3104
movl $0x1, %edx
movq %rax, %rdi
callq 0x84e0
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
divsd 0x8(%rsp), %xmm0
mulsd 0x83a87(%rip), %xmm0    # 0xcfb80
movq %rbx, %rdi
callq 0x8730
movq %rax, %rbx
leaq 0x8bf0c(%rip), %rsi     # 0xd8017
movl $0x2, %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
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4c160
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x98(%rsp), %rdi
callq 0x3c6d4
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x4c192
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x4c1ae
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x8480
xorl %eax, %eax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x83a13(%rip), %rdi     # 0xcfbdc
leaq 0x83a35(%rip), %rsi     # 0xcfc05
leaq 0x83a46(%rip), %rcx     # 0xcfc1d
movl $0x67, %edx
callq 0x82c0
jmp 0x4c302
jmp 0x4c1fa
jmp 0x4c302
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
jmp 0x4c245
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x4c305
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x4c305
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
jmp 0x4c245
jmp 0x4c2a2
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x2e784
jmp 0x4c305
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4c27a
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x4c27a
jmp 0x4c277
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0x4c371
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x4c371
jmp 0x4c2a2
movq %rax, %rbx
jmp 0x4c371
jmp 0x4c302
jmp 0x4c2f9
movq %rax, %rbx
movl $0x208, %esi            # imm = 0x208
movq %r15, %rdi
jmp 0x4c391
jmp 0x4c2e5
movq %rax, %rbx
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4c396
movq 0xa8(%rsp), %rsi
jmp 0x4c38e
movq %rax, %rbx
jmp 0x4c396
jmp 0x4c302
movq %rax, %rbx
jmp 0x4c312
movq %rax, %rbx
jmp 0x4c31c
movq %rax, %rbx
jmp 0x4c364
jmp 0x4c340
jmp 0x4c302
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x2e784
leaq 0x78(%rsp), %rdi
callq 0x2e784
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x4c343
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8480
jmp 0x4c343
jmp 0x4c340
jmp 0x4c340
jmp 0x4c340
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4c364
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x8480
leaq 0x98(%rsp), %rdi
callq 0x3c6d4
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x4c396
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x8480
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x4c3b2
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x8480
movq %rbx, %rdi
callq 0x8840