// File: zeeev[P]DASVC/bamtools/src/api/BamAlignment.cpp
// Function: BamTools::BamAlignment::BuildCharData()
bool BamAlignment::BuildCharData(void) {

    // skip if char data already parsed
    if ( !SupportData.HasCoreOnly )
        return true;

    // check system endianness
    bool IsBigEndian = BamTools::SystemIsBigEndian();

    // calculate character lengths/offsets
    const unsigned int dataLength     = SupportData.BlockLength - Constants::BAM_CORE_SIZE;
    const unsigned int seqDataOffset  = SupportData.QueryNameLength + (SupportData.NumCigarOperations*4);
    const unsigned int qualDataOffset = seqDataOffset + (SupportData.QuerySequenceLength+1)/2;
    const unsigned int tagDataOffset  = qualDataOffset + SupportData.QuerySequenceLength;
    const unsigned int tagDataLength  = dataLength - tagDataOffset;

    // check offsets to see what char data exists
    const bool hasSeqData  = ( seqDataOffset  < qualDataOffset );
    const bool hasQualData = ( qualDataOffset < tagDataOffset );
    const bool hasTagData  = ( tagDataOffset  < dataLength );

    // store alignment name (relies on null char in name as terminator)
    Name.assign(SupportData.AllCharData.data());

    // save query sequence
    QueryBases.clear();
    if ( hasSeqData ) {
        const char* seqData = SupportData.AllCharData.data() + seqDataOffset;
        QueryBases.reserve(SupportData.QuerySequenceLength);
        for ( size_t i = 0; i < SupportData.QuerySequenceLength; ++i ) {
            const char singleBase = Constants::BAM_DNA_LOOKUP[ ( (seqData[(i/2)] >> (4*(1-(i%2)))) & 0xf ) ];
            QueryBases.append(1, singleBase);
        }
    }

    // save qualities

    Qualities.clear();
    if ( hasQualData ) {
        const char* qualData = SupportData.AllCharData.data() + qualDataOffset;

        // if marked as unstored (sequence of 0xFF) - don't do conversion, just fill with 0xFFs
        if ( qualData[0] == (char)0xFF )
            Qualities.resize(SupportData.QuerySequenceLength, (char)0xFF);

        // otherwise convert from numeric QV to 'FASTQ-style' ASCII character
        else {
            Qualities.reserve(SupportData.QuerySequenceLength);
            for ( size_t i = 0; i < SupportData.QuerySequenceLength; ++i )
                Qualities.append(1, qualData[i]+33);
        }
    }

    // clear previous AlignedBases
    AlignedBases.clear();

    // if QueryBases has data, build AlignedBases using CIGAR data
    // otherwise, AlignedBases will remain empty (this case IS allowed)
    if ( !QueryBases.empty() && QueryBases != "*" ) {

        // resize AlignedBases
        AlignedBases.reserve(SupportData.QuerySequenceLength);

        // iterate over CigarOps
        int k = 0;
        vector<CigarOp>::const_iterator cigarIter = CigarData.begin();
        vector<CigarOp>::const_iterator cigarEnd  = CigarData.end();
        for ( ; cigarIter != cigarEnd; ++cigarIter ) {
            const CigarOp& op = (*cigarIter);

            switch ( op.Type ) {

                // for 'M', 'I', '=', 'X' - write bases
                case (Constants::BAM_CIGAR_MATCH_CHAR)    :
                case (Constants::BAM_CIGAR_INS_CHAR)      :
                case (Constants::BAM_CIGAR_SEQMATCH_CHAR) :
                case (Constants::BAM_CIGAR_MISMATCH_CHAR) :
                    AlignedBases.append(QueryBases.substr(k, op.Length));
                    // fall through

                // for 'S' - soft clip, do not write bases
                // but increment placeholder 'k'
                case (Constants::BAM_CIGAR_SOFTCLIP_CHAR) :
                    k += op.Length;
                    break;

                // for 'D' - write gap character
                case (Constants::BAM_CIGAR_DEL_CHAR) :
                    AlignedBases.append(op.Length, Constants::BAM_DNA_DEL);
                    break;

                // for 'P' - write padding character
                case (Constants::BAM_CIGAR_PAD_CHAR) :
                    AlignedBases.append( op.Length, Constants::BAM_DNA_PAD );
                    break;

                // for 'N' - write N's, skip bases in original query sequence
                case (Constants::BAM_CIGAR_REFSKIP_CHAR) :
                    AlignedBases.append( op.Length, Constants::BAM_DNA_N );
                    break;

                // for 'H' - hard clip, do nothing to AlignedBases, move to next op
                case (Constants::BAM_CIGAR_HARDCLIP_CHAR) :
                    break;

                // invalid CIGAR op-code
                default:
                    const string message = string("invalid CIGAR operation type: ") + op.Type;
                    SetErrorString("BamAlignment::BuildCharData", message);
                    return false;
            }
        }
    }

    // save tag data
    TagData.clear();
    if ( hasTagData ) {

        char* tagData = (((char*)SupportData.AllCharData.data()) + tagDataOffset);

        if ( IsBigEndian ) {
            size_t i = 0;
            while ( i < tagDataLength ) {

                i += Constants::BAM_TAG_TAGSIZE;  // skip tag chars (e.g. "RG", "NM", etc.)
                const char type = tagData[i];     // get tag type at position i
                ++i;                              // move i past tag type

                switch (type) {

                    case(Constants::BAM_TAG_TYPE_ASCII) :
                    case(Constants::BAM_TAG_TYPE_INT8)  :
                    case(Constants::BAM_TAG_TYPE_UINT8) :
                        // no endian swapping necessary for single-byte data
                        ++i;
                        break;

                    case(Constants::BAM_TAG_TYPE_INT16)  :
                    case(Constants::BAM_TAG_TYPE_UINT16) :
                        BamTools::SwapEndian_16p(&tagData[i]);
                        i += sizeof(uint16_t);
                        break;

                    case(Constants::BAM_TAG_TYPE_FLOAT)  :
                    case(Constants::BAM_TAG_TYPE_INT32)  :
                    case(Constants::BAM_TAG_TYPE_UINT32) :
                        BamTools::SwapEndian_32p(&tagData[i]);
                        i += sizeof(uint32_t);
                        break;

                    case(Constants::BAM_TAG_TYPE_HEX) :
                    case(Constants::BAM_TAG_TYPE_STRING) :
                        // no endian swapping necessary for hex-string/string data
                        while ( tagData[i] )
                            ++i;
                        // increment one more for null terminator
                        ++i;
                        break;

                    case(Constants::BAM_TAG_TYPE_ARRAY) :

                    {
                        // read array type
                        const char arrayType = tagData[i];
                        ++i;

                        // swap endian-ness of number of elements in place, then retrieve for loop
                        BamTools::SwapEndian_32p(&tagData[i]);
                        uint32_t numElements;
                        memcpy(&numElements, &tagData[i], sizeof(uint32_t));
                        i += sizeof(uint32_t);

                        // swap endian-ness of array elements
                        for ( size_t j = 0; j < numElements; ++j ) {
                            switch (arrayType) {
                                case (Constants::BAM_TAG_TYPE_INT8)  :
                                case (Constants::BAM_TAG_TYPE_UINT8) :
                                    // no endian-swapping necessary
                                    ++i;
                                    break;
                                case (Constants::BAM_TAG_TYPE_INT16)  :
                                case (Constants::BAM_TAG_TYPE_UINT16) :
                                    BamTools::SwapEndian_16p(&tagData[i]);
                                    i += sizeof(uint16_t);
                                    break;
                                case (Constants::BAM_TAG_TYPE_FLOAT)  :
                                case (Constants::BAM_TAG_TYPE_INT32)  :
                                case (Constants::BAM_TAG_TYPE_UINT32) :
                                    BamTools::SwapEndian_32p(&tagData[i]);
                                    i += sizeof(uint32_t);
                                    break;
                                default:
                                    const string message = string("invalid binary array type: ") + arrayType;
                                    SetErrorString("BamAlignment::BuildCharData", message);
                                    return false;
                            }
                        }

                        break;
                    }

                    // invalid tag type-code
                    default :
                        const string message = string("invalid tag type: ") + type;
                        SetErrorString("BamAlignment::BuildCharData", message);
                        return false;
                }
            }
        }

        // store tagData in alignment
        TagData.resize(tagDataLength);
        memcpy((char*)(TagData.data()), tagData, tagDataLength);
    }

    // clear core-only flag & return success
    SupportData.HasCoreOnly = false;
    return true;
}

// Assembly:
subq $0x288, %rsp            # imm = 0x288
movq %rdi, 0x278(%rsp)
movq 0x278(%rsp), %rax
movq %rax, 0x58(%rsp)
testb $0x1, 0x130(%rax)
jne 0x86752
movb $0x1, 0x287(%rsp)
jmp 0x87493
callq 0x744b0
movq 0x58(%rsp), %rdi
andb $0x1, %al
movb %al, 0x277(%rsp)
movl 0x120(%rdi), %eax
subl $0x20, %eax
movl %eax, 0x270(%rsp)
movl 0x128(%rdi), %eax
movl 0x124(%rdi), %ecx
shll $0x2, %ecx
addl %ecx, %eax
movl %eax, 0x26c(%rsp)
movl 0x26c(%rsp), %eax
movl 0x12c(%rdi), %ecx
addl $0x1, %ecx
shrl %ecx
addl %ecx, %eax
movl %eax, 0x268(%rsp)
movl 0x268(%rsp), %eax
addl 0x12c(%rdi), %eax
movl %eax, 0x264(%rsp)
movl 0x270(%rsp), %eax
subl 0x264(%rsp), %eax
movl %eax, 0x260(%rsp)
movl 0x26c(%rsp), %eax
cmpl 0x268(%rsp), %eax
setb %al
andb $0x1, %al
movb %al, 0x25f(%rsp)
movl 0x268(%rsp), %eax
cmpl 0x264(%rsp), %eax
setb %al
andb $0x1, %al
movb %al, 0x25e(%rsp)
movl 0x264(%rsp), %eax
cmpl 0x270(%rsp), %eax
setb %al
andb $0x1, %al
movb %al, 0x25d(%rsp)
addq $0x100, %rdi            # imm = 0x100
callq 0x785e0
movq 0x58(%rsp), %rdi
movq %rax, %rsi
callq 0x7c590
movq 0x58(%rsp), %rdi
addq $0x28, %rdi
callq 0x78800
testb $0x1, 0x25f(%rsp)
je 0x86935
movq 0x58(%rsp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x785e0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movl 0x26c(%rsp), %edx
addq %rdx, %rcx
movq %rcx, 0x250(%rsp)
movq %rax, %rdi
addq $0x28, %rdi
movl 0x12c(%rax), %eax
movl %eax, %esi
callq 0x7a230
movq $0x0, 0x248(%rsp)
movq 0x58(%rsp), %rcx
movq 0x248(%rsp), %rax
movl 0x12c(%rcx), %ecx
cmpq %rcx, %rax
jae 0x86933
movq 0x58(%rsp), %rdi
movq 0x250(%rsp), %rax
movq 0x248(%rsp), %rcx
shrq %rcx
movsbl (%rax,%rcx), %eax
movq 0x248(%rsp), %rdx
andq $0x1, %rdx
movl $0x1, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
sarl %cl, %eax
andl $0xf, %eax
movslq %eax, %rcx
leaq 0x6390e(%rip), %rax     # 0xea208
movb (%rax,%rcx), %al
movb %al, 0x247(%rsp)
addq $0x28, %rdi
movl $0x1, %esi
movsbl 0x247(%rsp), %edx
callq 0x76f60
movq 0x248(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x248(%rsp)
jmp 0x8689f
jmp 0x86935
movq 0x58(%rsp), %rdi
addq $0x68, %rdi
callq 0x78800
testb $0x1, 0x25e(%rsp)
je 0x86a25
movq 0x58(%rsp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x785e0
movl 0x268(%rsp), %ecx
addq %rcx, %rax
movq %rax, 0x238(%rsp)
movq 0x238(%rsp), %rax
movsbl (%rax), %eax
cmpl $-0x1, %eax
jne 0x869a4
movq 0x58(%rsp), %rax
movq %rax, %rdi
addq $0x68, %rdi
movl 0x12c(%rax), %eax
movl %eax, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x72740
jmp 0x86a23
movq 0x58(%rsp), %rax
movq %rax, %rdi
addq $0x68, %rdi
movl 0x12c(%rax), %eax
movl %eax, %esi
callq 0x7a230
movq $0x0, 0x230(%rsp)
movq 0x58(%rsp), %rcx
movq 0x230(%rsp), %rax
movl 0x12c(%rcx), %ecx
cmpq %rcx, %rax
jae 0x86a21
movq 0x58(%rsp), %rdi
addq $0x68, %rdi
movq 0x238(%rsp), %rax
movq 0x230(%rsp), %rcx
movsbl (%rax,%rcx), %edx
addl $0x21, %edx
movl $0x1, %esi
callq 0x7b170
movq 0x230(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x230(%rsp)
jmp 0x869c9
jmp 0x86a23
jmp 0x86a25
movq 0x58(%rsp), %rdi
addq $0x48, %rdi
callq 0x78800
movq 0x58(%rsp), %rdi
addq $0x28, %rdi
callq 0x7aba0
testb $0x1, %al
jne 0x86e0a
movq 0x58(%rsp), %rdi
addq $0x28, %rdi
leaq 0x637c0(%rip), %rsi     # 0xea219
callq 0x75600
testb $0x1, %al
jne 0x86a67
jmp 0x86e0a
movq 0x58(%rsp), %rax
movq %rax, %rdi
addq $0x48, %rdi
movl 0x12c(%rax), %eax
movl %eax, %esi
callq 0x7a230
movq 0x58(%rsp), %rdi
movl $0x0, 0x22c(%rsp)
addq $0xb8, %rdi
callq 0x76910
movq %rax, 0x218(%rsp)
leaq 0x220(%rsp), %rdi
leaq 0x218(%rsp), %rsi
callq 0x75970
movq 0x58(%rsp), %rdi
addq $0xb8, %rdi
callq 0x7a710
movq %rax, 0x208(%rsp)
leaq 0x210(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x75970
leaq 0x220(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x75bf0
testb $0x1, %al
jne 0x86b05
jmp 0x86e08
leaq 0x220(%rsp), %rdi
callq 0x765d0
movq %rax, 0x200(%rsp)
movq 0x200(%rsp), %rax
movsbl (%rax), %eax
addl $-0x3d, %eax
movl %eax, %ecx
movq %rcx, 0x50(%rsp)
subl $0x1b, %eax
ja 0x86c61
movq 0x50(%rsp), %rax
leaq 0x634bc(%rip), %rcx     # 0xea000
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x58(%rsp), %rsi
movq %rsi, %rax
addq $0x48, %rax
movq %rax, 0x40(%rsp)
addq $0x28, %rsi
movslq 0x22c(%rsp), %rdx
movq 0x200(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %ecx
leaq 0x1e0(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x76c50
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x7c8b0
jmp 0x86b9a
leaq 0x1e0(%rsp), %rdi
callq 0x7cce8
movq 0x200(%rsp), %rax
movl 0x4(%rax), %eax
addl 0x22c(%rsp), %eax
movl %eax, 0x22c(%rsp)
jmp 0x86df4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0x7cce8
jmp 0x86be8
jmp 0x874a4
movq 0x58(%rsp), %rdi
addq $0x48, %rdi
movq 0x200(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %esi
movl $0x2d, %edx
callq 0x76f60
jmp 0x86df4
movq 0x58(%rsp), %rdi
addq $0x48, %rdi
movq 0x200(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %esi
movl $0x2a, %edx
callq 0x76f60
jmp 0x86df4
movq 0x58(%rsp), %rdi
addq $0x48, %rdi
movq 0x200(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %esi
movl $0x4e, %edx
callq 0x76f60
jmp 0x86df4
jmp 0x86df4
leaq 0x18f(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x7b5f0
movq 0x38(%rsp), %rdx
leaq 0x6359c(%rip), %rsi     # 0xea21b
leaq 0x190(%rsp), %rdi
callq 0x78e70
jmp 0x86c8e
movq 0x200(%rsp), %rax
movsbl (%rax), %edx
leaq 0x1b0(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x74830
jmp 0x86cb0
leaq 0x190(%rsp), %rdi
callq 0x7cce8
jmp 0x86cbf
leaq 0x18f(%rsp), %rdi
callq 0x76f80
leaq 0x167(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x7b5f0
movq 0x30(%rsp), %rdx
leaq 0x63550(%rip), %rsi     # 0xea23a
leaq 0x168(%rsp), %rdi
callq 0x78e70
jmp 0x86cf9
movq 0x58(%rsp), %rdi
leaq 0x168(%rsp), %rsi
leaq 0x1b0(%rsp), %rdx
callq 0x71210
jmp 0x86d15
leaq 0x168(%rsp), %rdi
callq 0x7cce8
jmp 0x86d24
leaq 0x167(%rsp), %rdi
callq 0x76f80
movb $0x0, 0x287(%rsp)
leaq 0x1b0(%rsp), %rdi
callq 0x7cce8
jmp 0x87493
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x86d86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x7cce8
jmp 0x86d84
jmp 0x86d86
leaq 0x18f(%rsp), %rdi
callq 0x76f80
jmp 0x874a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x86dd3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x7cce8
jmp 0x86dd1
jmp 0x86dd3
leaq 0x167(%rsp), %rdi
callq 0x76f80
leaq 0x1b0(%rsp), %rdi
callq 0x7cce8
jmp 0x86def
jmp 0x874a4
jmp 0x86df6
leaq 0x220(%rsp), %rdi
callq 0x72bc0
jmp 0x86ae7
jmp 0x86e0a
movq 0x58(%rsp), %rdi
addq $0x88, %rdi
callq 0x78800
testb $0x1, 0x25d(%rsp)
je 0x8747f
movq 0x58(%rsp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x785e0
movl 0x264(%rsp), %ecx
addq %rcx, %rax
movq %rax, 0x158(%rsp)
testb $0x1, 0x277(%rsp)
je 0x8743b
movq $0x0, 0x150(%rsp)
movq 0x150(%rsp), %rax
movl 0x260(%rsp), %ecx
cmpq %rcx, %rax
jae 0x87439
movq 0x150(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x150(%rsp)
movq 0x158(%rsp), %rax
movq 0x150(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x14f(%rsp)
movq 0x150(%rsp), %rax
incq %rax
movq %rax, 0x150(%rsp)
movsbl 0x14f(%rsp), %eax
addl $-0x41, %eax
movl %eax, %ecx
movq %rcx, 0x28(%rsp)
subl $0x32, %eax
ja 0x872be
movq 0x28(%rsp), %rax
leaq 0x6318a(%rip), %rcx     # 0xea070
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x150(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x150(%rsp)
jmp 0x87434
movq 0x158(%rsp), %rdi
addq 0x150(%rsp), %rdi
callq 0x726d0
movq 0x150(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x150(%rsp)
jmp 0x87434
movq 0x158(%rsp), %rdi
addq 0x150(%rsp), %rdi
callq 0x7a7d0
movq 0x150(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x150(%rsp)
jmp 0x87434
jmp 0x86f66
movq 0x158(%rsp), %rax
movq 0x150(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x86f92
movq 0x150(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x150(%rsp)
jmp 0x86f66
movq 0x150(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x150(%rsp)
jmp 0x87434
movq 0x158(%rsp), %rax
movq 0x150(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x14e(%rsp)
movq 0x150(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x150(%rsp)
movq 0x158(%rsp), %rdi
addq 0x150(%rsp), %rdi
callq 0x7a7d0
movq 0x158(%rsp), %rax
movq 0x150(%rsp), %rcx
movl (%rax,%rcx), %eax
movl %eax, 0x148(%rsp)
movq 0x150(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x150(%rsp)
movq $0x0, 0x140(%rsp)
movq 0x140(%rsp), %rax
movl 0x148(%rsp), %ecx
cmpq %rcx, %rax
jae 0x872b9
movsbl 0x14e(%rsp), %eax
movl %eax, 0x24(%rsp)
subl $0x43, %eax
je 0x87099
jmp 0x87053
movl 0x24(%rsp), %eax
subl $0x49, %eax
je 0x870e0
jmp 0x87062
movl 0x24(%rsp), %eax
subl $0x53, %eax
je 0x870b2
jmp 0x8706d
movl 0x24(%rsp), %eax
subl $0x63, %eax
je 0x87099
jmp 0x87078
movl 0x24(%rsp), %eax
subl $0x66, %eax
je 0x870e0
jmp 0x87083
movl 0x24(%rsp), %eax
subl $0x69, %eax
je 0x870e0
jmp 0x8708e
movl 0x24(%rsp), %eax
subl $0x73, %eax
je 0x870b2
jmp 0x8710e
movq 0x150(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x150(%rsp)
jmp 0x8729e
movq 0x158(%rsp), %rdi
addq 0x150(%rsp), %rdi
callq 0x726d0
movq 0x150(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x150(%rsp)
jmp 0x8729e
movq 0x158(%rsp), %rdi
addq 0x150(%rsp), %rdi
callq 0x7a7d0
movq 0x150(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x150(%rsp)
jmp 0x8729e
leaq 0xff(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x7b5f0
movq 0x18(%rsp), %rdx
leaq 0x6312a(%rip), %rsi     # 0xea256
leaq 0x100(%rsp), %rdi
callq 0x78e70
jmp 0x8713b
movsbl 0x14e(%rsp), %edx
leaq 0x120(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x74830
jmp 0x8715a
leaq 0x100(%rsp), %rdi
callq 0x7cce8
jmp 0x87169
leaq 0xff(%rsp), %rdi
callq 0x76f80
leaq 0xd7(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x7b5f0
movq 0x10(%rsp), %rdx
leaq 0x630a6(%rip), %rsi     # 0xea23a
leaq 0xd8(%rsp), %rdi
callq 0x78e70
jmp 0x871a3
movq 0x58(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x120(%rsp), %rdx
callq 0x71210
jmp 0x871bf
leaq 0xd8(%rsp), %rdi
callq 0x7cce8
jmp 0x871ce
leaq 0xd7(%rsp), %rdi
callq 0x76f80
movb $0x0, 0x287(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x7cce8
jmp 0x87493
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x87230
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x100(%rsp), %rdi
callq 0x7cce8
jmp 0x8722e
jmp 0x87230
leaq 0xff(%rsp), %rdi
callq 0x76f80
jmp 0x874a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x8727d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x7cce8
jmp 0x8727b
jmp 0x8727d
leaq 0xd7(%rsp), %rdi
callq 0x76f80
leaq 0x120(%rsp), %rdi
callq 0x7cce8
jmp 0x87299
jmp 0x874a4
jmp 0x872a0
movq 0x140(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x140(%rsp)
jmp 0x87028
jmp 0x87434
leaq 0x8f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x7b5f0
movq 0x8(%rsp), %rdx
leaq 0x62f96(%rip), %rsi     # 0xea272
leaq 0x90(%rsp), %rdi
callq 0x78e70
jmp 0x872eb
movsbl 0x14f(%rsp), %edx
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x74830
jmp 0x8730a
leaq 0x90(%rsp), %rdi
callq 0x7cce8
jmp 0x87319
leaq 0x8f(%rsp), %rdi
callq 0x76f80
leaq 0x67(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x7b5f0
movq (%rsp), %rdx
leaq 0x62efb(%rip), %rsi     # 0xea23a
leaq 0x68(%rsp), %rdi
callq 0x78e70
jmp 0x8734b
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0x71210
jmp 0x87364
leaq 0x68(%rsp), %rdi
callq 0x7cce8
jmp 0x87370
leaq 0x67(%rsp), %rdi
callq 0x76f80
movb $0x0, 0x287(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x7cce8
jmp 0x87493
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x873cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x7cce8
jmp 0x873cd
jmp 0x873cf
leaq 0x8f(%rsp), %rdi
callq 0x76f80
jmp 0x874a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x87419
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x7cce8
jmp 0x87417
jmp 0x87419
leaq 0x67(%rsp), %rdi
callq 0x76f80
leaq 0xb0(%rsp), %rdi
callq 0x7cce8
jmp 0x87432
jmp 0x874a4
jmp 0x86e66
jmp 0x8743b
movq 0x58(%rsp), %rdi
addq $0x88, %rdi
movl 0x260(%rsp), %eax
movl %eax, %esi
callq 0x79090
movq 0x58(%rsp), %rdi
addq $0x88, %rdi
callq 0x785e0
movq %rax, %rdi
movq 0x158(%rsp), %rsi
movl 0x260(%rsp), %eax
movl %eax, %edx
callq 0x757c0
movq 0x58(%rsp), %rax
movb $0x0, 0x130(%rax)
movb $0x1, 0x287(%rsp)
movb 0x287(%rsp), %al
andb $0x1, %al
addq $0x288, %rsp            # imm = 0x288
retq
movq 0x1d8(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopl (%rax)