// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::CheckVersion()
void BamToolsIndex::CheckVersion(void) {

    // read version from file
    const int64_t numBytesRead = m_resources.Device->Read((char*)&m_inputVersion, sizeof(m_inputVersion));
    if ( numBytesRead != sizeof(m_inputVersion) )
        throw BamException("BamToolsIndex::CheckVersion", "could not read format version");
    if ( m_isBigEndian ) SwapEndian_32(m_inputVersion);

    // if version is negative, or zero
    if ( m_inputVersion <= 0 )
        throw BamException("BamToolsIndex::CheckVersion", "invalid format version");

    // if version is newer than can be supported by this version of bamtools
    else if ( m_inputVersion > m_outputVersion ) {
        const string message = "unsupported format: this index was created by a newer version of BamTools. "
                               "Update your local version of BamTools to use the index file.";
        throw BamException("BamToolsIndex::CheckVersion", message);
    }

    // ------------------------------------------------------------------
    // check for deprecated, unsupported versions
    // (the format had to be modified to accomodate a particular bug fix)

    // Version 2.0: introduced support for half-open intervals, instead of the old closed intervals
    //   respondBy: throwing exception - we're not going to try to handle the old BTI files.
    else if ( (Version)m_inputVersion < BamToolsIndex::BTI_2_0 ) {
        const string message = "unsupported format: this version of the index may not properly handle "
                               "coordinate intervals. Please run 'bamtools index -bti -in yourData.bam' "
                               "to generate an up-to-date, fixed BTI file.";
        throw BamException("BamToolsIndex::CheckVersion", message);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
leaq 0x54(%rbx), %r14
movq (%rdi), %rax
pushq $0x4
popq %rdx
movq %r14, %rsi
callq *0x28(%rax)
cmpq $0x4, %rax
jne 0x4b211
cmpb $0x1, 0x30(%rbx)
jne 0x4b1eb
movq %r14, %rdi
callq 0x32c90
movl (%r14), %eax
testl %eax, %eax
jle 0x4b27a
cmpl 0x58(%rbx), %eax
jg 0x4b2e3
cmpl $0x3, %eax
jbe 0x4b349
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %r14
leaq 0x112bc(%rip), %rsi     # 0x5c4df
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
leaq 0x112c2(%rip), %rsi     # 0x5c4fb
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x29cd2(%rip), %rsi     # 0x74f38
movq 0x29d0b(%rip), %rdx     # 0x74f78
movq %r14, %rdi
callq 0x34c90
jmp 0x4b3ad
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %r14
leaq 0x11253(%rip), %rsi     # 0x5c4df
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
leaq 0x11277(%rip), %rsi     # 0x5c519
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x29c69(%rip), %rsi     # 0x74f38
movq 0x29ca2(%rip), %rdx     # 0x74f78
movq %r14, %rdi
callq 0x34c90
jmp 0x4b3ad
leaq 0x11246(%rip), %rsi     # 0x5c530
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x31b30
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %r14
leaq 0x111d4(%rip), %rsi     # 0x5c4df
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %r14, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x29c00(%rip), %rsi     # 0x74f38
movq 0x29c39(%rip), %rdx     # 0x74f78
movq %r14, %rdi
callq 0x34c90
jmp 0x4b3ad
leaq 0x11268(%rip), %rsi     # 0x5c5b8
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x31b30
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %r14
leaq 0x1116e(%rip), %rsi     # 0x5c4df
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %r14, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x29b9a(%rip), %rsi     # 0x74f38
movq 0x29bd3(%rip), %rdx     # 0x74f78
movq %r14, %rdi
callq 0x34c90
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x4b3c4
jmp 0x4b3cc
movq %rax, %rbx
movq %r14, %rdi
callq 0x327c0
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4b461
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x4b3f2
jmp 0x4b3fa
movq %rax, %rbx
movq %r14, %rdi
callq 0x327c0
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4b461
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4b41b
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4b446
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4b43c
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x30(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x4b459
jmp 0x4b461
jmp 0x4b44f
movq %rax, %rbx
jmp 0x4b461
jmp 0x4b456
movq %rax, %rbx
movq %r14, %rdi
callq 0x327c0
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop