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

    // read magic number
    char magic[4];
    const int64_t numBytesRead = m_resources.Device->Read(magic, 4);
    if ( numBytesRead != 4 )
        throw BamException("BamToolsIndex::CheckMagicNumber", "could not read BTI magic number");

    // validate expected magic number
    if ( strncmp(magic, BamToolsIndex::BTI_MAGIC, 4) != 0 )
        throw BamException("BamToolsIndex::CheckMagicNumber", "invalid BTI magic number");
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq 0xf0(%rsp), %rax
movq 0x60(%rax), %rdi
leaq 0xec(%rsp), %rsi
movq (%rdi), %rax
movl $0x4, %edx
callq *0x28(%rax)
movq %rax, 0xe0(%rsp)
cmpq $0x4, 0xe0(%rsp)
je 0xc065e
movb $0x1, 0x86(%rsp)
movl $0x28, %edi
callq 0x737c0
movq %rax, 0x20(%rsp)
leaq 0xbf(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x7b5f0
movq 0x28(%rsp), %rdx
leaq 0x2b19c(%rip), %rsi     # 0xeb6e6
leaq 0xc0(%rsp), %rdi
callq 0x78e70
jmp 0xc0559
leaq 0x87(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x7b5f0
movq 0x18(%rsp), %rdx
leaq 0x2b18f(%rip), %rsi     # 0xeb706
leaq 0x88(%rsp), %rdi
callq 0x78e70
jmp 0xc0586
movq 0x20(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x79cd0
jmp 0xc05a2
movq 0x20(%rsp), %rdi
movb $0x0, 0x86(%rsp)
movq 0x5195a(%rip), %rsi     # 0x111f10
movq 0x519a3(%rip), %rdx     # 0x111f60
callq 0x7b010
jmp 0xc07ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0xc0636
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0xc0618
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x7cce8
jmp 0xc0616
jmp 0xc0618
leaq 0x87(%rsp), %rdi
callq 0x76f80
leaq 0xc0(%rsp), %rdi
callq 0x7cce8
jmp 0xc0634
jmp 0xc0636
leaq 0xbf(%rsp), %rdi
callq 0x76f80
testb $0x1, 0x86(%rsp)
jne 0xc064f
jmp 0xc0659
movq 0x20(%rsp), %rdi
callq 0x74e00
jmp 0xc07a5
leaq 0xec(%rsp), %rdi
leaq 0x2b074(%rip), %rsi     # 0xeb6e1
movl $0x4, %edx
callq 0x735f0
cmpl $0x0, %eax
je 0xc079d
movb $0x1, 0x36(%rsp)
movl $0x28, %edi
callq 0x737c0
movq %rax, 0x8(%rsp)
leaq 0x5f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x7b5f0
movq 0x10(%rsp), %rdx
leaq 0x2b037(%rip), %rsi     # 0xeb6e6
leaq 0x60(%rsp), %rdi
callq 0x78e70
jmp 0xc06bb
leaq 0x37(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x7b5f0
movq (%rsp), %rdx
leaq 0x2b052(%rip), %rsi     # 0xeb726
leaq 0x38(%rsp), %rdi
callq 0x78e70
jmp 0xc06e0
movq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x79cd0
jmp 0xc06f6
movq 0x8(%rsp), %rdi
movb $0x0, 0x36(%rsp)
movq 0x51809(%rip), %rsi     # 0x111f10
movq 0x51852(%rip), %rdx     # 0x111f60
callq 0x7b010
jmp 0xc07ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0xc077e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0xc0766
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x7cce8
jmp 0xc0764
jmp 0xc0766
leaq 0x37(%rsp), %rdi
callq 0x76f80
leaq 0x60(%rsp), %rdi
callq 0x7cce8
jmp 0xc077c
jmp 0xc077e
leaq 0x5f(%rsp), %rdi
callq 0x76f80
testb $0x1, 0x36(%rsp)
jne 0xc0791
jmp 0xc079b
movq 0x8(%rsp), %rdi
callq 0x74e00
jmp 0xc07a5
addq $0xf8, %rsp
retq
movq 0xb0(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopw (%rax,%rax)