// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/index/BamStandardIndex_p.cpp
// Function: BamTools::Internal::BamStandardIndex::Create()
bool BamStandardIndex::Create(void) {

    // skip if BamReader is invalid or not open
    if ( m_reader == 0 || !m_reader->IsOpen() ) {
        SetErrorString("BamStandardIndex::Create", "could not create index: reader is not open");
        return false;
    }

    // rewind BamReader
    if ( !m_reader->Rewind() ) {
        const string readerError = m_reader->GetErrorString();
        const string message = "could not create index: \n\t" + readerError;
        SetErrorString("BamStandardIndex::Create", message);
        return false;
    }

    try {

        // open new index file (read & write)
        string indexFilename = m_reader->Filename() + Extension();
        OpenFile(indexFilename, IBamIODevice::ReadWrite);

        // initialize BaiFileSummary with number of references
        const int& numReferences = m_reader->GetReferenceCount();
        ReserveForSummary(numReferences);

        // initialize output file
        WriteHeader();

        // set up bin, ID, offset, & coordinate markers
        const uint32_t defaultValue = 0xffffffffu;
        uint32_t currentBin    = defaultValue;
        uint32_t lastBin       = defaultValue;
        int32_t  currentRefID  = defaultValue;
        int32_t  lastRefID     = defaultValue;
        uint64_t currentOffset = (uint64_t)m_reader->Tell();
        uint64_t lastOffset    = currentOffset;
        int32_t  lastPosition  = defaultValue;

        // iterate through alignments in BAM file
        BamAlignment al;
        BaiReferenceEntry refEntry;
        while ( m_reader->LoadNextAlignment(al) ) {

            // changed to new reference
            if ( lastRefID != al.RefID ) {

                // if not first reference, save previous reference data
                if ( lastRefID != (int32_t)defaultValue ) {

                    SaveAlignmentChunkToBin(refEntry.Bins, currentBin, currentOffset, lastOffset);
                    WriteReferenceEntry(refEntry);
                    ClearReferenceEntry(refEntry);

                    // write any empty references between (but *NOT* including) lastRefID & al.RefID
                    for ( int i = lastRefID+1; i < al.RefID; ++i ) {
                        BaiReferenceEntry emptyEntry(i);
                        WriteReferenceEntry(emptyEntry);
                    }

                    // update bin markers
                    currentOffset = lastOffset;
                    currentBin    = al.Bin;
                    lastBin       = al.Bin;
                    currentRefID  = al.RefID;
                }

                // otherwise, this is first pass
                // be sure to write any empty references up to (but *NOT* including) current RefID
                else {
                    for ( int i = 0; i < al.RefID; ++i ) {
                        BaiReferenceEntry emptyEntry(i);
                        WriteReferenceEntry(emptyEntry);
                    }
                }

                // update reference markers
                refEntry.ID = al.RefID;
                lastRefID   = al.RefID;
                lastBin     = defaultValue;
            }

            // if lastPosition greater than current alignment position - file not sorted properly
            else if ( lastPosition > al.Position ) {
                stringstream s("");
                s << "BAM file is not properly sorted by coordinate" << endl
                  << "Current alignment position: " << al.Position
                  << " < previous alignment position: " << lastPosition
                  << " on reference ID: " << al.RefID << endl;
                SetErrorString("BamStandardIndex::Create", s.str());
                return false;
            }

            // if alignment's ref ID is valid & its bin is not a 'leaf'
            if ( (al.RefID >= 0) && (al.Bin < 4681) )
                SaveLinearOffsetEntry(refEntry.LinearOffsets, al.Position, al.GetEndPosition(), lastOffset);

            // changed to new BAI bin
            if ( al.Bin != lastBin ) {

                // if not first bin on reference, save previous bin data
                if ( currentBin != defaultValue )
                    SaveAlignmentChunkToBin(refEntry.Bins, currentBin, currentOffset, lastOffset);

                // update markers
                currentOffset = lastOffset;
                currentBin    = al.Bin;
                lastBin       = al.Bin;
                currentRefID  = al.RefID;

                // if invalid RefID, break out
                if ( currentRefID < 0 )
                    break;
            }

            // make sure that current file pointer is beyond lastOffset
            if ( m_reader->Tell() <= (int64_t)lastOffset ) {
                SetErrorString("BamStandardIndex::Create", "calculating offsets failed");
                return false;
            }

            // update lastOffset & lastPosition
            lastOffset   = m_reader->Tell();
            lastPosition = al.Position;
        }

        // after finishing alignments, if any data was read, check:
        if ( lastOffset != currentOffset ) {

            // store last alignment chunk to its bin, then write last reference entry with data
            SaveAlignmentChunkToBin(refEntry.Bins, currentBin, currentOffset, lastOffset);
            WriteReferenceEntry(refEntry);
        }

        // then write any empty references remaining at end of file
        for ( int i = currentRefID+1; i < numReferences; ++i ) {
            BaiReferenceEntry emptyEntry(i);
            WriteReferenceEntry(emptyEntry);
        }

    } catch ( BamException& e) {
        m_errorString = e.what();
        return false;
    }

    // rewind BamReader
    if ( !m_reader->Rewind() ) {
        const string readerError = m_reader->GetErrorString();
        const string message = "could not create index: \n\t" + readerError;
        SetErrorString("BamStandardIndex::Create", message);
        return false;
    }

    // return success
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3c8, %rsp            # imm = 0x3C8
movq %rdi, %r15
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3edeb
callq 0x27b00
testb %al, %al
je 0x3edeb
movq 0x8(%r15), %rdi
callq 0x28a60
testb %al, %al
je 0x3ee79
movq 0x8(%r15), %rsi
leaq 0xa0(%rsp), %rdi
movq %r15, (%rsp)
callq 0x27db0
leaq 0x280(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x2c611(%rip), %rax     # 0x6afa0
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x270(%rsp), %rdi
callq 0x267c0
leaq 0x250(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x270(%rsp), %rdx
callq 0x29120
movq 0x270(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3e9d5
callq 0x27560
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3e9eb
callq 0x27560
leaq 0x250(%rsp), %rsi
movq %r15, %rdi
movl $0x3, %edx
callq 0x28800
movq 0x8(%r15), %rdi
callq 0x27930
movl %eax, 0xc(%rsp)
leaq 0x38(%r15), %rdi
movq 0x38(%r15), %rax
cmpq %rax, 0x40(%r15)
je 0x3ea1f
movq %rax, 0x40(%r15)
movslq 0xc(%rsp), %rsi
xorps %xmm0, %xmm0
leaq 0xa0(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
callq 0x28630
movq %r15, %rdi
callq 0x26d00
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
movq 0x8(%r15), %rdi
callq 0x26a70
movq %rax, %r15
movq %rax, 0x20(%rsp)
movq %rax, 0x18(%rsp)
leaq 0x270(%rsp), %rdi
callq 0x265e0
leaq 0x60(%rsp), %rax
movl $0xffffffff, -0x10(%rax) # imm = 0xFFFFFFFF
movl $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
leaq 0xd0(%rsp), %r14
movl $0xffffffff, 0x10(%rsp) # imm = 0xFFFFFFFF
leaq 0xa0(%rsp), %rbp
movq %r15, 0x28(%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
movq (%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x270(%rsp), %rsi
callq 0x26ea0
testb %al, %al
je 0x3ef29
movl 0x318(%rsp), %eax
cmpl %eax, %r13d
jne 0x3eb14
movl 0x14(%rsp), %eax
cmpl 0x31c(%rsp), %eax
jle 0x3ecfe
jmp 0x3efcd
cmpl $-0x1, %r13d
je 0x3ec44
leaq 0x58(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x18(%rsp), %r8
callq 0x28d40
movq (%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x27390
movq (%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x28710
leaq 0x50(%rsp), %rsi
callq 0x26c60
incl %r13d
movl 0x318(%rsp), %eax
cmpl %eax, %r13d
leaq 0xa8(%rsp), %r12
jge 0x3ec22
movl %r13d, 0xa0(%rsp)
movl $0x0, 0xb0(%rsp)
movq $0x0, 0xb8(%rsp)
leaq 0xb0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq %rax, 0xc8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
movq (%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x27390
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0xd8(%rsp), %rdx
callq 0x28710
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x3ebff
callq 0x27560
movq 0xb8(%rsp), %rsi
movq %r12, %rdi
callq 0x26fd0
incl %r13d
movl 0x318(%rsp), %eax
cmpl %eax, %r13d
jl 0x3eb85
movq %r15, 0x20(%rsp)
movzwl 0x320(%rsp), %ecx
movl %ecx, 0x10(%rsp)
movl %ecx, 0x8(%rsp)
movq %r15, 0x28(%rsp)
movl %eax, %r12d
jmp 0x3ecf2
testl %eax, %eax
jle 0x3ecf2
xorl %ebx, %ebx
movl %ebx, 0xa0(%rsp)
movl $0x0, 0xb0(%rsp)
movq $0x0, 0xb8(%rsp)
leaq 0xb0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq %rax, 0xc8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
movq (%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
leaq 0xa8(%rsp), %rdx
callq 0x27390
movq %r13, %rdi
movq %rbp, %rsi
leaq 0xd8(%rsp), %rdx
callq 0x28710
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x3eccc
callq 0x27560
movq 0xb8(%rsp), %rsi
leaq 0xa8(%rsp), %rdi
callq 0x26fd0
incl %ebx
movl 0x318(%rsp), %eax
cmpl %eax, %ebx
jl 0x3ec4e
movl %eax, 0x50(%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %eax, %r13d
testl %r13d, %r13d
setns %cl
movzwl 0x320(%rsp), %eax
movzwl %ax, %edx
cmpl $0x1249, %edx           # imm = 0x1249
setb %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x3ed5c
leaq 0x270(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x274a0
movl %eax, 0xa0(%rsp)
leaq 0x88(%rsp), %rsi
leaq 0x31c(%rsp), %rdx
movq %rbp, %rcx
leaq 0x18(%rsp), %r8
callq 0x28b20
movzwl 0x320(%rsp), %eax
movzwl %ax, %eax
cmpl %eax, %ebx
je 0x3edb0
cmpl $-0x1, 0x10(%rsp)
je 0x3ed8b
leaq 0x58(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x18(%rsp), %r8
callq 0x28d40
movzwl 0x320(%rsp), %eax
movq %r15, 0x20(%rsp)
movl %eax, 0x8(%rsp)
movl 0x318(%rsp), %r12d
movq %r15, 0x28(%rsp)
movl %eax, 0x10(%rsp)
movl %eax, %ebx
testl %r12d, %r12d
js 0x3f185
movq (%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x26a70
cmpq %r15, %rax
jle 0x3ef33
movq (%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x26a70
movq %rax, %r15
movq %rax, 0x18(%rsp)
movl 0x31c(%rsp), %eax
movl %eax, 0x14(%rsp)
jmp 0x3ead5
leaq 0xb0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x1714e(%rip), %rsi     # 0x55f4c
leaq 0x1715f(%rip), %rdx     # 0x55f64
leaq 0xa0(%rsp), %rdi
callq 0x26750
leaq 0x280(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x17140(%rip), %rsi     # 0x55f65
leaq 0x17163(%rip), %rdx     # 0x55f8f
leaq 0x270(%rsp), %rdi
callq 0x26750
leaq 0xa0(%rsp), %rsi
leaq 0x270(%rsp), %rdx
movq %r15, %rdi
callq 0x26370
movq 0x270(%rsp), %rdi
cmpq %r14, %rdi
je 0x3ee63
callq 0x27560
movq 0xa0(%rsp), %rdi
cmpq %rbx, %rdi
jne 0x3ef10
jmp 0x3ef15
movq 0x8(%r15), %rsi
leaq 0xa0(%rsp), %r14
movq %r14, %rdi
callq 0x28df0
leaq 0x16aa0(%rip), %rsi     # 0x55934
leaq 0x270(%rsp), %rdi
movq %r14, %rdx
callq 0x273f0
leaq 0x60(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x17098(%rip), %rsi     # 0x55f4c
leaq 0x170a9(%rip), %rdx     # 0x55f64
leaq 0x50(%rsp), %rdi
callq 0x26750
leaq 0x50(%rsp), %rsi
leaq 0x270(%rsp), %rdx
movq %r15, %rdi
callq 0x26370
movq 0x50(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3eee9
callq 0x27560
leaq 0x280(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3eeff
callq 0x27560
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3ef15
callq 0x27560
xorl %eax, %eax
addq $0x3c8, %rsp            # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rsp), %rax
jmp 0x3f188
leaq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
movq %rax, (%rdi)
leaq 0x16fff(%rip), %rsi     # 0x55f4c
leaq 0x17010(%rip), %rdx     # 0x55f64
callq 0x26750
leaq 0x40(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x170a6(%rip), %rsi     # 0x5600f
leaq 0x170b9(%rip), %rdx     # 0x56029
leaq 0x30(%rsp), %rdi
movq (%rsp), %r13
callq 0x26750
leaq 0x280(%rsp), %r14
leaq 0xa0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %r13, %rdi
callq 0x26370
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3efaa
callq 0x27560
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x3f17e
callq 0x27560
jmp 0x3f17e
leaq 0x40(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x16eb2(%rip), %rdx     # 0x55e8f
leaq 0x30(%rsp), %rdi
movq %rdx, %rsi
callq 0x26750
leaq 0xa0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movl $0x18, %edx
movq (%rsp), %r13
callq 0x28740
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x3f014
callq 0x27560
leaq 0x16f75(%rip), %rsi     # 0x55f90
movl $0x2d, %edx
leaq 0xb0(%rsp), %rdi
callq 0x27a70
movq 0xb0(%rsp), %rax
movq -0x18(%rax), %rdi
leaq 0xb0(%rsp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x275a0
movsbl %al, %esi
leaq 0xb0(%rsp), %rdi
callq 0x260a0
movq %rax, %rdi
callq 0x26fc0
movq %rax, %r15
leaq 0x16f4e(%rip), %rsi     # 0x55fbe
movl $0x1c, %edx
movq %rax, %rdi
callq 0x27a70
movl 0x31c(%rsp), %esi
movq %r15, %rdi
callq 0x28a90
movq %rax, %r15
leaq 0x16f45(%rip), %rsi     # 0x55fdb
movl $0x20, %edx
movq %rax, %rdi
callq 0x27a70
movq %r15, %rdi
movl 0x14(%rsp), %esi
callq 0x28a90
movq %rax, %r15
leaq 0x16f43(%rip), %rsi     # 0x55ffc
movl $0x12, %edx
movq %rax, %rdi
callq 0x27a70
movl 0x318(%rsp), %esi
movq %r15, %rdi
callq 0x28a90
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x275a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x260a0
movq %rax, %rdi
callq 0x26fc0
leaq 0x30(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x16e3e(%rip), %rsi     # 0x55f4c
leaq 0x16e4f(%rip), %rdx     # 0x55f64
callq 0x26750
leaq 0xb8(%rsp), %rsi
leaq 0x230(%rsp), %rdi
callq 0x28730
leaq 0x30(%rsp), %rsi
leaq 0x230(%rsp), %rdx
movq %r13, %rdi
callq 0x26370
leaq 0x240(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3f15a
callq 0x27560
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x3f169
callq 0x27560
leaq 0xa0(%rsp), %rdi
callq 0x270d0
leaq 0x280(%rsp), %r14
xorl %ebx, %ebx
jmp 0x3f2a4
movq %r15, %rax
cmpq %rax, %r15
movq (%rsp), %r13
je 0x3f1d1
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x58(%rsp), %rsi
callq 0x28d40
leaq 0x50(%rsp), %rsi
movq %r13, %rdi
leaq 0x58(%rsp), %rdx
callq 0x27390
leaq 0x50(%rsp), %rsi
movq %r13, %rdi
leaq 0x88(%rsp), %rdx
callq 0x28710
incl %r12d
movb $0x1, %bl
cmpl 0xc(%rsp), %r12d
jge 0x3f29c
leaq 0xa8(%rsp), %r15
leaq 0xd8(%rsp), %rbp
leaq 0xa0(%rsp), %r13
movq (%rsp), %rbx
movl %r12d, 0xa0(%rsp)
movl $0x0, 0xb0(%rsp)
movq $0x0, 0xb8(%rsp)
leaq 0xb0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq %rax, 0xc8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x27390
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x28710
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x3f26e
callq 0x27560
movq 0xb8(%rsp), %rsi
movq %r15, %rdi
callq 0x26fd0
incl %r12d
cmpl %r12d, 0xc(%rsp)
jne 0x3f1fd
movq (%rsp), %r13
leaq 0x280(%rsp), %r14
movb $0x1, %bl
jmp 0x3f2a4
leaq 0x280(%rsp), %r14
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x3f2b6
callq 0x27560
movq 0x68(%rsp), %rsi
leaq 0x58(%rsp), %rdi
callq 0x26fd0
leaq 0x270(%rsp), %rdi
callq 0x285f0
leaq 0x260(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3f2e8
callq 0x27560
testb %bl, %bl
je 0x3ef15
movq 0x8(%r13), %rdi
callq 0x28a60
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0x3ef17
movq 0x8(%r13), %rsi
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
callq 0x28df0
leaq 0x16614(%rip), %rsi     # 0x55934
leaq 0x270(%rsp), %rdi
movq %r15, %rdx
callq 0x273f0
leaq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rbx
movq %rbx, (%rdi)
leaq 0x16c08(%rip), %rsi     # 0x55f4c
leaq 0x16c19(%rip), %rdx     # 0x55f64
callq 0x26750
leaq 0x50(%rsp), %rsi
leaq 0x270(%rsp), %rdx
movq %r13, %rdi
callq 0x26370
movq 0x50(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3f374
callq 0x27560
movq 0x270(%rsp), %rdi
cmpq %r14, %rdi
je 0x3f386
callq 0x27560
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
jmp 0x3ef0b
jmp 0x3f5a3
movq %rdx, %r12
movq %rax, %r15
leaq 0x240(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3f3c4
callq 0x27560
jmp 0x3f3c4
movq %rdx, %r12
movq %rax, %r15
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x3f53b
callq 0x27560
jmp 0x3f53b
jmp 0x3f535
movq %rdx, %r12
movq %rax, %r15
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
jne 0x3f480
jmp 0x3f5d3
jmp 0x3f5a3
movq %rax, %r15
movq 0x50(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3f416
callq 0x27560
jmp 0x3f416
movq %rax, %r15
movq 0x270(%rsp), %rdi
leaq 0x280(%rsp), %rax
cmpq %rax, %rdi
je 0x3f435
callq 0x27560
jmp 0x3f435
movq %rax, %r15
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
jmp 0x3f516
movq %rdx, %r12
movq %rax, %r15
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3f467
callq 0x27560
jmp 0x3f467
movq %rdx, %r12
movq %rax, %r15
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x3f5d3
callq 0x27560
jmp 0x3f5d3
jmp 0x3f5a3
jmp 0x3f5a3
movq %rdx, %r12
movq %rax, %r15
jmp 0x3f5dd
jmp 0x3f52a
jmp 0x3f52a
jmp 0x3f52a
movq %rax, %r15
movq 0x50(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3f4dc
callq 0x27560
jmp 0x3f4dc
movq %rdx, %r12
movq %rax, %r15
movq 0x270(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3f4fa
callq 0x27560
jmp 0x3f4fa
movq %rax, %r15
leaq 0x280(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3f50a
callq 0x27560
jmp 0x3f50a
movq %rdx, %r12
movq %rax, %r15
leaq 0xb0(%rsp), %rax
jmp 0x3f5f2
movq %rax, %r15
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3f574
jmp 0x3f57e
movq %rdx, %r12
movq %rax, %r15
jmp 0x3f600
jmp 0x3f52a
movq %rdx, %r12
movq %rax, %r15
jmp 0x3f5ea
movq %rdx, %r12
movq %rax, %r15
leaq 0xa0(%rsp), %rdi
callq 0x270d0
jmp 0x3f5d3
movq %rax, %r15
movq 0x270(%rsp), %rdi
cmpq %r14, %rdi
je 0x3f567
callq 0x27560
jmp 0x3f567
movq %rax, %r15
movq 0xa0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3f57e
callq 0x27560
jmp 0x3f57e
movq %rax, %r15
movq %r15, %rdi
callq 0x28c10
jmp 0x3f5a3
jmp 0x3f5a3
movq %rdx, %r12
movq %rax, %r15
leaq 0xa0(%rsp), %rdi
callq 0x26cb0
jmp 0x3f5d3
jmp 0x3f5a3
jmp 0x3f5a3
movq %rdx, %r12
movq %rax, %r15
jmp 0x3f5d3
movq %rdx, %r12
movq %rax, %r15
leaq 0xa0(%rsp), %rdi
callq 0x26cb0
jmp 0x3f5d3
movq %rdx, %r12
movq %rax, %r15
leaq 0xa0(%rsp), %rdi
callq 0x26cb0
leaq 0x50(%rsp), %rdi
callq 0x26cb0
leaq 0x270(%rsp), %rdi
callq 0x285f0
leaq 0x260(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3f600
callq 0x27560
cmpl $0x1, %r12d
jne 0x3f57e
movq %r15, %rdi
callq 0x267d0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq (%rsp), %rdi
addq $0x10, %rdi
movq %rax, %rsi
callq 0x27ff0
callq 0x287d0
jmp 0x3ef15
movq %rax, %r15
callq 0x287d0
jmp 0x3f57e
movq %rax, %rdi
callq 0x2f047