// File: /workspace/github_cpp_makefile_star2_O2/mshabbirhasan[P]ups-indel/src/ups_indel.cpp
// Function: genenateUPSCoordinate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int genenateUPSCoordinate(string referenceFileName, string inputFileName,
    string outputFileName) {

    ifstream fin(inputFileName);
    FILE * fout = fopen((outputFileName + ".uvcf").c_str(), "w");

    string type;

    bool isFirstTime = true;
    string chromosomeNumber;
    seqan::FaiIndex faiIndex;
    unsigned idx = 0;
    seqan::Dna5String sequenceInfix;
    stringstream seqStr;
    string reference;

    int ups_rs_id = 1;

    if (fout != NULL && fin.is_open()) {
        string line;
        while (getline(fin, line)) {
            if (line.at(0) == '#') {
                if (line.at(1) == '#') {
                    fprintf(fout, "%s\n", line.c_str()); // only the header of the VCF file
                } else {
                    fprintf(
                        fout, "%s\n",
                        "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tUPS-COORDINATE\tINFO");
                }
            } else if (line.at(0) != '#' && line.at(0) != '\n') {
                vector < string > tokens = split(line, '\t');
                std::size_t found;
                string pattern;
                string chrom = tokens.at(0); // CHROM

                if (isFirstTime) {
                    chromosomeNumber = chrom;

                    // Try to load index and create on the fly if necessary.
                    if (seqan::read(faiIndex, referenceFileName.c_str()) != 0) {
                        if (build(faiIndex, referenceFileName.c_str()) != 0) {
                            std::cerr << "ERROR: Index could not be loaded or built.\n";
                            return 1;
                        }

                        // Name is stored from when reading.
                        if (write(faiIndex) != 0) {
                            std::cerr << "ERROR: Index could not be written do disk.\n";
                            return 1;
                        }
                    }

                    // Translate sequence name to index.
                    if (!getIdByName(faiIndex, chromosomeNumber, idx)) {
                        std::cerr << "ERROR: Index does not know about sequence " << referenceFileName << ".\n";
                        return 1;
                    }

                    // Finally, get infix of sequence.
                    if (readSequence(sequenceInfix, faiIndex, idx) != 0) {
                        std::cerr << "ERROR: Could not load infix.\n";
                        return 1;
                    }

                    seqStr << sequenceInfix;
                    reference = seqStr.str();

                    isFirstTime = false;
                } else if (chrom != chromosomeNumber) {
                    string chromosomeNumber = chrom;

                    // Translate sequence name to index.
                    unsigned idx = 0;
                    if (!getIdByName(faiIndex, chromosomeNumber, idx)) {
                        std::cerr << "ERROR: Index does not know about sequence " << referenceFileName << ".\n";
                        return 1;
                    }

                    // Finally, get infix of sequence.
                    if (readSequence(sequenceInfix, faiIndex, idx) != 0) {
                        std::cerr << "ERROR: Could not load infix.\n";
                        return 1;
                    }

                    stringstream newSeqStr;
                    newSeqStr << sequenceInfix;

                    reference = newSeqStr.str();
                }

                string pos = tokens.at(1); // POS
                string id = tokens.at(2); // ID

                // in some cases, there is no id in the ID column of vcf, in that case
                // assign an id
                if (id == ".") {
                    id = std::to_string(ups_rs_id);
                    ups_rs_id++;
                }
                string refer = tokens.at(3); // REF
                string alt = " "; // ALT will be filled later
                string qual = tokens.at(5); // QUAL
                string filter = tokens.at(6); // FILTER
                string info = tokens.at(7); // INFO

                found = tokens.at(4).find(','); // some rows have more than one indel in the alt column
                if (found != string::npos) {
                    vector < string > alternative_indel_token =
                        split(tokens.at(4).c_str(), ',');
                    for (int i = 0; i < alternative_indel_token.size(); i++) {
                        if ((alternative_indel_token.at(i)).at(0) != '<') {
                            alt = alternative_indel_token.at(i);
                            if (refer.length() < alt.length()) {
                                type = "I"; // insertion
                                if(isHorizontalDecompositionEnabled){
                                    pattern = diff(alt,refer); // pattern means difference between ref sequence and alt sequence in the VCF file
                                }
                                else{
                                    if(isComplexVariant(refer, alt)){
                                        type = "N/A";
                                        pattern = "[]";
                                    }
                                    else{
                                        pattern = diff(alt, refer);
                                    }
                                }
                            } else if (refer.length() > alt.length()) {
                                type = "D"; // deletion
                                if(isHorizontalDecompositionEnabled){
                                    pattern = diff(refer,alt); // pattern means difference between ref sequence and alt sequence in the VCF file
                                }
                                else{
                                    if(isComplexVariant(refer, alt)){
                                        type = "N/A";
                                        pattern = "[]";
                                    }
                                    else{
                                        pattern = diff(refer, alt);
                                    }
                                }
                            } else if (refer.length() == alt.length()) {
                                type = "N/A"; // when REF and ALT have same length, such as SNPs and MNPs
                                pattern = "[]";
                            }

                            generateEir(chrom, pos, id, refer, alt, qual, filter, info, & reference, strtoul(pos.c_str(), NULL, 0),
                                pattern, type, fout);
                        }
                    }
                } else {
                    alt = tokens.at(4); // ALT

                    // indel without any comma
                    if (refer.length() < alt.length()) {
                        type = "I";
                        if(isHorizontalDecompositionEnabled){
                            pattern = diff(alt, refer);
                        }
                        else{
                            if(isComplexVariant(refer, alt)){
                                type = "N/A";
                                pattern = "[]";
                            }
                            else{
                                pattern = diff(alt, refer);
                            }
                        }
                    } else if (refer.length() > alt.length()) {
                        type = "D";
                        if(isHorizontalDecompositionEnabled){
                            pattern = diff(refer, alt);
                        }
                        else{
                            if(isComplexVariant(refer, alt)){
                                type = "N/A";
                                pattern = "[]";
                            }
                            else{
                                pattern = diff(refer, alt);
                            }
                        }
                    }

                    // when REF and ALT have same length, such as SNPs and MNPs
                    else if (refer.length() == alt.length()) {
                        type = "N/A";
                        pattern = "[]";
                    }

                    generateEir(chrom, pos, id, refer, alt, qual, filter, info, & reference, strtoul(pos.c_str(), NULL, 0),
                        pattern, type, fout);
                }
            }
        }
        fin.close();
        fclose(fout);
    } else {
        std::cerr << "ERROR: File operation error.\n";
        return 1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xdd8, %rsp            # imm = 0xDD8
movq %rdx, %rbx
movq %rdi, %r15
leaq -0xdf8(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3500
leaq 0x87ae(%rip), %rdx      # 0xd1db
leaq -0xbf0(%rbp), %rdi
movq %rbx, %rsi
callq 0x6863
leaq -0xbf0(%rbp), %rbx
movq (%rbx), %rdi
leaq 0x8615(%rip), %rsi      # 0xd062
callq 0x33a0
movq %rax, -0x38(%rbp)
movq %rbx, %rdi
callq 0x3668
leaq -0xd8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x1f0(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0x8e0(%rbp), %rdi
callq 0x689c
andl $0x0, -0x60(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x695a
leaq -0xbf0(%rbp), %rdi
callq 0x3240
leaq -0x1b0(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpq $0x0, -0x38(%rbp)
je 0x5921
leaq -0xd80(%rbp), %rdi
callq 0x30d0
testb %al, %al
je 0x5921
movq %r15, -0x88(%rbp)
leaq -0x138(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
pushq $0x1
popq %rcx
movl %ecx, -0x5c(%rbp)
movb $0x0, (%rax)
movb $0x1, %bl
pushq $0x9
popq %r15
leaq -0x700(%rbp), %r13
leaq -0xdf8(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x30b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %r12d
testb $0x5, %r12b
jne 0x5939
leaq -0x148(%rbp), %rdi
xorl %esi, %esi
callq 0x3620
cmpb $0x23, (%rax)
jne 0x4b76
leaq -0x148(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x3620
cmpb $0x23, (%rax)
jne 0x4cfe
movq -0x148(%rbp), %rdx
movq -0x38(%rbp), %rdi
leaq 0x84e7(%rip), %rsi      # 0xd058
jmp 0x4d10
leaq -0x148(%rbp), %rdi
xorl %esi, %esi
callq 0x3620
cmpb $0x23, (%rax)
je 0x4b0b
leaq -0x148(%rbp), %rdi
xorl %esi, %esi
callq 0x3620
cmpb $0xa, (%rax)
je 0x4b0b
movl %r15d, %edx
leaq -0xc0(%rbp), %r15
movq %r15, %rdi
leaq -0x148(%rbp), %rsi
callq 0x39b7
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
andq $0x0, -0xa0(%rbp)
movb $0x0, -0x98(%rbp)
movq %r15, %rdi
xorl %esi, %esi
callq 0x69ae
leaq -0x1a0(%rbp), %rdi
movq %rax, %rsi
callq 0x3440
testb $0x1, %bl
je 0x4d1c
leaq -0x200(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x31d0
movq -0x88(%rbp), %rax
movq (%rax), %rsi
leaq -0x8e0(%rbp), %rdi
callq 0x69cf
testl %eax, %eax
je 0x4c73
movq -0x88(%rbp), %rax
movq (%rax), %rsi
leaq -0x8e0(%rbp), %rdi
callq 0x6a21
movq 0xf3ae(%rip), %rdi      # 0x13ff0
leaq 0x8451(%rip), %rsi      # 0xd09a
testl %eax, %eax
jne 0x5518
leaq -0x8e0(%rbp), %rdi
callq 0xbf37
movq 0xf38c(%rip), %rdi      # 0x13ff0
leaq 0x845b(%rip), %rsi      # 0xd0c6
testl %eax, %eax
jne 0x5518
leaq -0x8e0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x6a99
testb %al, %al
je 0x54ec
movl -0x60(%rbp), %edx
leaq -0x178(%rbp), %rdi
leaq -0x8e0(%rbp), %rsi
callq 0x6ab1
movq 0xf341(%rip), %rdi      # 0x13ff0
leaq 0x8467(%rip), %rsi      # 0xd11d
testl %eax, %eax
jne 0x5518
leaq -0xbf0(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0xcd62
leaq -0xa68(%rbp), %rbx
movq %rbx, %rdi
leaq -0xbd8(%rbp), %rsi
callq 0x34d0
leaq -0x1c0(%rbp), %rdi
movq %rbx, %rsi
callq 0x33e0
movq %rbx, %rdi
jmp 0x4df5
movq -0x38(%rbp), %rdi
leaq 0x834f(%rip), %rsi      # 0xd058
leaq 0x8354(%rip), %rdx      # 0xd064
xorl %eax, %eax
callq 0x3470
jmp 0x4b0b
leaq -0x1a0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x680e
testb %al, %al
je 0x4dfa
leaq -0x128(%rbp), %rbx
movq %rbx, %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x3440
andl $0x0, -0x58(%rbp)
leaq -0x8e0(%rbp), %rdi
movq %rbx, %rsi
leaq -0x58(%rbp), %rdx
callq 0x6a99
testb %al, %al
je 0x54ab
movl -0x58(%rbp), %edx
leaq -0x178(%rbp), %rdi
leaq -0x8e0(%rbp), %rsi
callq 0x6ab1
movl %eax, %ecx
movq 0xf265(%rip), %rax      # 0x13ff0
leaq 0x838b(%rip), %rsi      # 0xd11d
testl %ecx, %ecx
jne 0x54d4
leaq -0xa68(%rbp), %rbx
movq %rbx, %rdi
callq 0x3240
movq %rbx, %rdi
leaq -0x178(%rbp), %rsi
callq 0xcd62
leaq -0x80(%rbp), %rbx
movq %rbx, %rdi
leaq -0xa50(%rbp), %rsi
callq 0x34d0
leaq -0x1c0(%rbp), %rdi
movq %rbx, %rsi
callq 0x33e0
movq %rbx, %rdi
callq 0x3668
leaq -0xa68(%rbp), %rdi
callq 0x3260
leaq -0x128(%rbp), %rdi
callq 0x3668
leaq -0xc0(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x69ae
leaq -0xa68(%rbp), %rdi
movq %rax, %rsi
callq 0x3440
leaq -0xc0(%rbp), %rdi
pushq $0x2
popq %rsi
callq 0x69ae
leaq -0x128(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3440
movq %rbx, %rdi
leaq 0x82f8(%rip), %rsi      # 0xd13b
callq 0x681b
testb %al, %al
je 0x4e79
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movl -0x5c(%rbp), %ebx
movl %ebx, %esi
callq 0x6b0e
leaq -0x128(%rbp), %rdi
movq %r15, %rsi
callq 0x33e0
movq %r15, %rdi
callq 0x3668
incl %ebx
movl %ebx, -0x5c(%rbp)
leaq -0xc0(%rbp), %rdi
pushq $0x3
popq %rsi
callq 0x69ae
leaq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x3440
leaq -0x58(%rbp), %rdi
leaq 0x840b(%rip), %rsi      # 0xd2aa
leaq -0x1e0(%rbp), %rdx
callq 0x3150
leaq -0xc0(%rbp), %rdi
pushq $0x5
popq %rsi
callq 0x69ae
leaq -0x1e0(%rbp), %rdi
movq %rax, %rsi
callq 0x3440
leaq -0xc0(%rbp), %rdi
pushq $0x6
popq %rsi
callq 0x69ae
leaq -0x240(%rbp), %rdi
movq %rax, %rsi
callq 0x3440
leaq -0xc0(%rbp), %rdi
pushq $0x7
popq %rsi
callq 0x69ae
leaq -0x220(%rbp), %rdi
movq %rax, %rsi
callq 0x3440
leaq -0xc0(%rbp), %rdi
pushq $0x4
popq %rsi
callq 0x69ae
movq %rax, %rdi
pushq $0x2c
popq %rsi
xorl %edx, %edx
callq 0x3420
cmpq $-0x1, %rax
je 0x53fc
leaq -0xc0(%rbp), %rdi
pushq $0x4
popq %rsi
callq 0x69ae
movq (%rax), %rsi
leaq -0x108(%rbp), %rbx
movq %rbx, %rdi
leaq -0x29(%rbp), %rdx
callq 0x3150
leaq -0x160(%rbp), %rdi
movq %rbx, %rsi
pushq $0x2c
popq %rdx
callq 0x39b7
movq %rbx, %rdi
callq 0x3668
xorl %esi, %esi
movq -0x158(%rbp), %rax
subq -0x160(%rbp), %rax
sarq $0x5, %rax
cmpq %rsi, %rax
jbe 0x53eb
leaq -0x160(%rbp), %rdi
movq %rsi, -0xc8(%rbp)
callq 0x69ae
movq %rax, %rdi
xorl %esi, %esi
callq 0x3620
cmpb $0x3c, (%rax)
je 0x53dc
leaq -0x160(%rbp), %rdi
movq -0xc8(%rbp), %rsi
callq 0x69ae
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x31d0
movq -0x50(%rbp), %rax
cmpq %rax, -0x78(%rbp)
jae 0x5060
leaq -0xe8(%rbp), %rdi
leaq 0x801e(%rip), %rsi      # 0xd006
callq 0x3610
cmpb $0x1, 0xf34c(%rip)      # 0x14340
jne 0x50ca
leaq -0x620(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x7c0(%rbp), %rbx
movq %rbx, %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x108(%rbp), %r15
movq %r15, %rdi
leaq -0x620(%rbp), %r14
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3a04
leaq -0xa8(%rbp), %rdi
movq %r15, %rsi
callq 0x33e0
movq %r15, %rdi
callq 0x3668
movq %rbx, %rdi
callq 0x3668
movq %r14, %rdi
jmp 0x5235
jbe 0x51ac
leaq -0xe8(%rbp), %rdi
leaq 0x7fc6(%rip), %rsi      # 0xd03a
callq 0x3610
cmpb $0x1, 0xf2c0(%rip)      # 0x14340
jne 0x515f
leaq -0x5c0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x760(%rbp), %r14
movq %r14, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x108(%rbp), %r15
movq %r15, %rdi
leaq -0x5c0(%rbp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3a04
jmp 0x5213
leaq -0x600(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x7a0(%rbp), %rbx
movq %rbx, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x600(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3c5a
movl %eax, %r15d
movq %rbx, %rdi
callq 0x3668
movq %r14, %rdi
callq 0x3668
testb %r15b, %r15b
jne 0x51ac
leaq -0x5e0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x780(%rbp), %r14
movq %r14, %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x108(%rbp), %r15
movq %r15, %rdi
leaq -0x5e0(%rbp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3a04
jmp 0x5213
leaq -0x5a0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x740(%rbp), %r14
movq %r14, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x5a0(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3c5a
movl %eax, %r15d
movq %r14, %rdi
callq 0x3668
movq %rbx, %rdi
callq 0x3668
testb %r15b, %r15b
je 0x51d4
leaq -0xe8(%rbp), %rdi
leaq 0x7e82(%rip), %rsi      # 0xd03c
callq 0x3610
leaq -0xa8(%rbp), %rdi
leaq 0x7e92(%rip), %rsi      # 0xd05f
callq 0x3610
jmp 0x523a
leaq -0x580(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x720(%rbp), %r14
movq %r14, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x108(%rbp), %r15
movq %r15, %rdi
leaq -0x580(%rbp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3a04
leaq -0xa8(%rbp), %rdi
movq %r15, %rsi
callq 0x33e0
movq %r15, %rdi
callq 0x3668
movq %r14, %rdi
callq 0x3668
movq %rbx, %rdi
callq 0x3668
leaq -0x3e0(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x3440
leaq -0x3c0(%rbp), %rdi
leaq -0xa68(%rbp), %rsi
callq 0x3440
leaq -0x3a0(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x3440
leaq -0x380(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x360(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
movq %r13, %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x3440
leaq -0x560(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x3440
leaq -0x540(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x3440
movq -0xa68(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3120
movq %rax, %rbx
leaq -0x520(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3440
movq %rbx, -0x180(%rbp)
movq %r13, %r15
leaq -0x340(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x3440
subq $0x8, %rsp
leaq -0x3e0(%rbp), %rdi
leaq -0x3c0(%rbp), %rsi
leaq -0x3a0(%rbp), %rdx
leaq -0x380(%rbp), %rcx
leaq -0x360(%rbp), %r8
movq %r15, %r13
movq %r15, %r9
pushq -0x38(%rbp)
leaq -0x340(%rbp), %rax
pushq %rax
leaq -0x520(%rbp), %rbx
pushq %rbx
pushq -0x180(%rbp)
leaq -0x1c0(%rbp), %rax
pushq %rax
leaq -0x540(%rbp), %r14
pushq %r14
leaq -0x560(%rbp), %r15
pushq %r15
callq 0x3db4
addq $0x40, %rsp
leaq -0x340(%rbp), %rdi
callq 0x3668
movq %rbx, %rdi
callq 0x3668
movq %r14, %rdi
callq 0x3668
movq %r15, %rdi
callq 0x3668
movq %r13, %rdi
callq 0x3668
leaq -0x360(%rbp), %rdi
callq 0x3668
leaq -0x380(%rbp), %rdi
callq 0x3668
leaq -0x3a0(%rbp), %rdi
callq 0x3668
leaq -0x3c0(%rbp), %rdi
callq 0x3668
leaq -0x3e0(%rbp), %rdi
callq 0x3668
movq -0xc8(%rbp), %rsi
incq %rsi
jmp 0x4f6c
leaq -0x160(%rbp), %rdi
callq 0x67c0
jmp 0x589b
leaq -0xc0(%rbp), %rdi
pushq $0x4
popq %rsi
callq 0x69ae
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x31d0
movq -0x50(%rbp), %rax
cmpq %rax, -0x78(%rbp)
jae 0x5527
leaq -0xe8(%rbp), %rdi
leaq 0x7bd3(%rip), %rsi      # 0xd006
callq 0x3610
cmpb $0x1, 0xef01(%rip)      # 0x14340
jne 0x5591
leaq -0x500(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x6e0(%rbp), %r14
movq %r14, %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x108(%rbp), %r15
movq %r15, %rdi
leaq -0x500(%rbp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3a04
leaq -0xa8(%rbp), %rdi
movq %r15, %rsi
callq 0x33e0
movq %r15, %rdi
callq 0x3668
movq %r14, %rdi
callq 0x3668
movq %rbx, %rdi
jmp 0x56f8
movq 0xeb3e(%rip), %rdi      # 0x13ff0
leaq 0x7c39(%rip), %rsi      # 0xd0f2
callq 0x3310
movq %rax, %rdi
movq -0x88(%rbp), %rsi
callq 0x32c0
leaq 0x7d56(%rip), %rsi      # 0xd22a
movq %rax, %rdi
callq 0x3310
leaq -0x128(%rbp), %rdi
callq 0x3668
xorl %ebx, %ebx
jmp 0x551f
movq 0xeafd(%rip), %rdi      # 0x13ff0
leaq 0x7bf8(%rip), %rsi      # 0xd0f2
callq 0x3310
movq %rax, %rdi
movq -0x88(%rbp), %rsi
callq 0x32c0
movq %rax, %rdi
leaq 0x7d12(%rip), %rsi      # 0xd22a
callq 0x3310
movb $0x1, %bl
xorl %r15d, %r15d
jmp 0x58ee
jbe 0x566f
leaq -0xe8(%rbp), %rdi
leaq 0x7aff(%rip), %rsi      # 0xd03a
callq 0x3610
cmpb $0x1, 0xedf9(%rip)      # 0x14340
jne 0x5624
leaq -0x4a0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x680(%rbp), %r14
movq %r14, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x108(%rbp), %rbx
movq %rbx, %rdi
leaq -0x4a0(%rbp), %r15
movq %r15, %rsi
movq %r14, %rdx
callq 0x3a04
jmp 0x56d6
leaq -0x4e0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x6c0(%rbp), %r14
movq %r14, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x4e0(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3c5a
movl %eax, %ebx
movq %r14, %rdi
callq 0x3668
movq %r15, %rdi
callq 0x3668
testb %bl, %bl
jne 0x566f
leaq -0x4c0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x6a0(%rbp), %r14
movq %r14, %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x108(%rbp), %rbx
movq %rbx, %rdi
leaq -0x4c0(%rbp), %r15
movq %r15, %rsi
movq %r14, %rdx
callq 0x3a04
jmp 0x56d6
leaq -0x480(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x660(%rbp), %r14
movq %r14, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x480(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3c5a
movl %eax, %ebx
movq %r14, %rdi
callq 0x3668
movq %r15, %rdi
callq 0x3668
testb %bl, %bl
je 0x5697
leaq -0xe8(%rbp), %rdi
leaq 0x79bf(%rip), %rsi      # 0xd03c
callq 0x3610
leaq -0xa8(%rbp), %rdi
leaq 0x79cf(%rip), %rsi      # 0xd05f
callq 0x3610
jmp 0x56fd
leaq -0x460(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x640(%rbp), %r14
movq %r14, %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x108(%rbp), %rbx
movq %rbx, %rdi
leaq -0x460(%rbp), %r15
movq %r15, %rsi
movq %r14, %rdx
callq 0x3a04
leaq -0xa8(%rbp), %rdi
movq %rbx, %rsi
callq 0x33e0
movq %rbx, %rdi
callq 0x3668
movq %r14, %rdi
callq 0x3668
movq %r15, %rdi
callq 0x3668
leaq -0x320(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x3440
leaq -0x300(%rbp), %rdi
leaq -0xa68(%rbp), %rsi
callq 0x3440
leaq -0x2e0(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x3440
leaq -0x2c0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3440
leaq -0x2a0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3440
leaq -0x280(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x3440
leaq -0x440(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x3440
leaq -0x420(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x3440
movq -0xa68(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3120
movq %rax, %rbx
leaq -0x400(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3440
leaq -0x260(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x3440
subq $0x8, %rsp
leaq -0x320(%rbp), %rdi
leaq -0x300(%rbp), %rsi
leaq -0x2e0(%rbp), %rdx
leaq -0x2c0(%rbp), %rcx
leaq -0x2a0(%rbp), %r8
leaq -0x280(%rbp), %r9
pushq -0x38(%rbp)
leaq -0x260(%rbp), %rax
pushq %rax
leaq -0x400(%rbp), %rax
movq %rax, %r14
pushq %rax
pushq %rbx
leaq -0x1c0(%rbp), %rax
pushq %rax
leaq -0x420(%rbp), %r15
pushq %r15
leaq -0x440(%rbp), %rbx
pushq %rbx
callq 0x3db4
addq $0x40, %rsp
leaq -0x260(%rbp), %rdi
callq 0x3668
movq %r14, %rdi
callq 0x3668
movq %r15, %rdi
callq 0x3668
movq %rbx, %rdi
callq 0x3668
leaq -0x280(%rbp), %rdi
callq 0x3668
leaq -0x2a0(%rbp), %rdi
callq 0x3668
leaq -0x2c0(%rbp), %rdi
callq 0x3668
leaq -0x2e0(%rbp), %rdi
callq 0x3668
leaq -0x300(%rbp), %rdi
callq 0x3668
leaq -0x320(%rbp), %rdi
callq 0x3668
leaq -0x220(%rbp), %rdi
callq 0x3668
leaq -0x240(%rbp), %rdi
callq 0x3668
leaq -0x1e0(%rbp), %rdi
callq 0x3668
leaq -0x58(%rbp), %rdi
callq 0x3668
leaq -0x80(%rbp), %rdi
callq 0x3668
leaq -0x128(%rbp), %rdi
callq 0x3668
leaq -0xa68(%rbp), %rdi
callq 0x3668
movb $0x1, %r15b
xorl %ebx, %ebx
leaq -0x1a0(%rbp), %rdi
callq 0x3668
leaq -0xa8(%rbp), %rdi
callq 0x3668
leaq -0xc0(%rbp), %rdi
callq 0x67c0
testb %r15b, %r15b
pushq $0x9
popq %r15
jne 0x4b0b
jmp 0x594e
movq 0xe6c8(%rip), %rdi      # 0x13ff0
leaq 0x780e(%rip), %rsi      # 0xd13d
callq 0x3310
pushq $0x1
popq %rbx
jmp 0x5963
leaq -0xdf8(%rbp), %rdi
callq 0x30c0
movq -0x38(%rbp), %rdi
callq 0x3320
xorl %ebx, %ebx
testb $0x5, %r12b
sete %bl
leaq -0x148(%rbp), %rdi
callq 0x3668
leaq -0x1c0(%rbp), %rdi
callq 0x3668
leaq -0xbf0(%rbp), %rdi
callq 0x3260
movq -0x178(%rbp), %rdi
callq 0x32e0
leaq -0x8e0(%rbp), %rdi
callq 0x6b6e
leaq -0x200(%rbp), %rdi
callq 0x3668
leaq -0xe8(%rbp), %rdi
callq 0x3668
leaq -0xdf8(%rbp), %rdi
callq 0x30e0
movl %ebx, %eax
addq $0xdd8, %rsp            # imm = 0xDD8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x640(%rbp), %rdi
callq 0x3668
jmp 0x59df
movq %rax, %rbx
leaq -0x460(%rbp), %rdi
jmp 0x5b49
jmp 0x5ca1
movq %rax, %rbx
leaq -0x6a0(%rbp), %rdi
callq 0x3668
jmp 0x5a04
movq %rax, %rbx
leaq -0x4c0(%rbp), %rdi
jmp 0x5b49
jmp 0x5ca1
movq %rax, %rbx
leaq -0x680(%rbp), %rdi
callq 0x3668
jmp 0x5a29
movq %rax, %rbx
leaq -0x4a0(%rbp), %rdi
jmp 0x5b49
jmp 0x5ca1
movq %rax, %rbx
leaq -0x660(%rbp), %rdi
callq 0x3668
jmp 0x5a4e
movq %rax, %rbx
leaq -0x480(%rbp), %rdi
jmp 0x5b49
movq %rax, %rbx
leaq -0x6e0(%rbp), %rdi
callq 0x3668
jmp 0x5a6e
movq %rax, %rbx
leaq -0x500(%rbp), %rdi
jmp 0x5b49
jmp 0x5ca1
movq %rax, %rbx
leaq -0x6c0(%rbp), %rdi
callq 0x3668
jmp 0x5a93
movq %rax, %rbx
leaq -0x4e0(%rbp), %rdi
jmp 0x5b49
jmp 0x5cb6
jmp 0x5aa6
movq %rax, %rbx
leaq -0xa68(%rbp), %rdi
callq 0x3260
jmp 0x5c95
jmp 0x5c92
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x3668
jmp 0x5ad3
movq %rax, %rbx
leaq -0x400(%rbp), %rdi
callq 0x3668
jmp 0x5ae4
movq %rax, %rbx
leaq -0x420(%rbp), %rdi
callq 0x3668
jmp 0x5af5
movq %rax, %rbx
leaq -0x440(%rbp), %rdi
callq 0x3668
jmp 0x5b06
movq %rax, %rbx
leaq -0x280(%rbp), %rdi
callq 0x3668
leaq -0x2a0(%rbp), %rdi
callq 0x3668
leaq -0x2c0(%rbp), %rdi
callq 0x3668
leaq -0x2e0(%rbp), %rdi
callq 0x3668
leaq -0x300(%rbp), %rdi
callq 0x3668
leaq -0x320(%rbp), %rdi
callq 0x3668
jmp 0x5da4
movq %rax, %rbx
jmp 0x5b12
movq %rax, %rbx
jmp 0x5b1e
movq %rax, %rbx
jmp 0x5b2a
movq %rax, %rbx
jmp 0x5b36
movq %rax, %rbx
jmp 0x5b42
jmp 0x5c3b
movq %rax, %rbx
leaq -0x720(%rbp), %rdi
callq 0x3668
jmp 0x5b85
movq %rax, %rbx
leaq -0x580(%rbp), %rdi
jmp 0x5d61
jmp 0x5d95
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
jmp 0x5b49
jmp 0x5ca1
jmp 0x5ca1
jmp 0x5cb6
movq %rax, %rbx
jmp 0x5dd1
movq %rax, %rbx
jmp 0x5c08
jmp 0x5d95
movq %rax, %rbx
leaq -0x740(%rbp), %rdi
callq 0x3668
jmp 0x5bed
jmp 0x5d95
movq %rax, %rbx
leaq -0x780(%rbp), %rdi
callq 0x3668
jmp 0x5c17
movq %rax, %rbx
leaq -0x5a0(%rbp), %rdi
jmp 0x5d61
movq %rax, %rbx
leaq -0x760(%rbp), %rdi
callq 0x3668
leaq -0x5c0(%rbp), %rdi
jmp 0x5d61
movq %rax, %rbx
leaq -0x5e0(%rbp), %rdi
jmp 0x5d61
movq %rax, %rbx
jmp 0x5dc8
movq %rax, %rbx
jmp 0x5dbc
movq %rax, %rbx
jmp 0x5db0
movq %rax, %rbx
jmp 0x5dda
jmp 0x5cb6
movq %rax, %rbx
jmp 0x5de6
jmp 0x5d95
movq %rax, %rbx
leaq -0x7a0(%rbp), %rdi
callq 0x3668
jmp 0x5c77
movq %rax, %rbx
leaq -0x7c0(%rbp), %rdi
callq 0x3668
jmp 0x5c86
movq %rax, %rbx
leaq -0x600(%rbp), %rdi
jmp 0x5d61
movq %rax, %rbx
leaq -0x620(%rbp), %rdi
jmp 0x5d61
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
jmp 0x5ded
movq %rax, %rbx
jmp 0x5da4
jmp 0x5e18
movq %rax, %rbx
jmp 0x5dfe
movq %rax, %rbx
jmp 0x5df2
movq %rax, %rbx
jmp 0x5d12
movq %rax, %rbx
jmp 0x5d1e
movq %rax, %rbx
jmp 0x5d2a
movq %rax, %rbx
jmp 0x5d36
movq %rax, %rbx
jmp 0x5d42
movq %rax, %rbx
leaq -0x340(%rbp), %rdi
callq 0x3668
jmp 0x5cf0
movq %rax, %rbx
jmp 0x5d4e
movq %rax, %rbx
leaq -0x520(%rbp), %rdi
callq 0x3668
jmp 0x5d06
movq %rax, %rbx
jmp 0x5d5a
movq %rax, %rbx
leaq -0x540(%rbp), %rdi
callq 0x3668
leaq -0x560(%rbp), %rdi
callq 0x3668
leaq -0x700(%rbp), %rdi
callq 0x3668
leaq -0x360(%rbp), %rdi
callq 0x3668
leaq -0x380(%rbp), %rdi
callq 0x3668
leaq -0x3a0(%rbp), %rdi
callq 0x3668
leaq -0x3c0(%rbp), %rdi
callq 0x3668
leaq -0x3e0(%rbp), %rdi
callq 0x3668
jmp 0x5d98
jmp 0x5e18
movq %rax, %rbx
jmp 0x5e27
movq %rax, %rbx
jmp 0x5e3f
movq %rax, %rbx
jmp 0x5e4b
movq %rax, %rbx
jmp 0x5e57
movq %rax, %rbx
jmp 0x5e6f
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x67c0
leaq -0x220(%rbp), %rdi
callq 0x3668
leaq -0x240(%rbp), %rdi
callq 0x3668
leaq -0x1e0(%rbp), %rdi
callq 0x3668
leaq -0x58(%rbp), %rdi
callq 0x3668
leaq -0x80(%rbp), %rdi
callq 0x3668
leaq -0x128(%rbp), %rdi
callq 0x3668
leaq -0xa68(%rbp), %rdi
callq 0x3668
leaq -0x1a0(%rbp), %rdi
callq 0x3668
leaq -0xa8(%rbp), %rdi
callq 0x3668
leaq -0xc0(%rbp), %rdi
callq 0x67c0
jmp 0x5e1b
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
callq 0x3668
leaq -0x1c0(%rbp), %rdi
callq 0x3668
leaq -0xbf0(%rbp), %rdi
callq 0x3260
movq -0x178(%rbp), %rdi
callq 0x32e0
leaq -0x8e0(%rbp), %rdi
callq 0x6b6e
leaq -0x200(%rbp), %rdi
callq 0x3668
leaq -0xe8(%rbp), %rdi
callq 0x3668
leaq -0xdf8(%rbp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x3590