// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::ReadBlock(BamTools::Internal::BtiBlock&)
void BamToolsIndex::ReadBlock(BtiBlock& block) {

    // read in block data members
    int64_t numBytesRead = 0;
    numBytesRead += m_resources.Device->Read((char*)&block.MaxEndPosition, sizeof(block.MaxEndPosition));
    numBytesRead += m_resources.Device->Read((char*)&block.StartOffset,    sizeof(block.StartOffset));
    numBytesRead += m_resources.Device->Read((char*)&block.StartPosition,  sizeof(block.StartPosition));

    // swap endian-ness if necessary
    if ( m_isBigEndian ) {
        SwapEndian_32(block.MaxEndPosition);
        SwapEndian_64(block.StartOffset);
        SwapEndian_32(block.StartPosition);
    }

    // check block read ok
    const int expectedBytes = sizeof(block.MaxEndPosition) +
                              sizeof(block.StartOffset) +
                              sizeof(block.StartPosition);
    if ( numBytesRead != expectedBytes )
        throw BamException("BamToolsIndex::ReadBlock", "could not read block");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x60(%rdi), %rdi
movq (%rdi), %rax
movl $0x4, %edx
callq *0x28(%rax)
movq %rax, %r15
movq 0x60(%r14), %rdi
leaq 0x8(%rbx), %rsi
movq (%rdi), %rax
movl $0x8, %edx
callq *0x28(%rax)
movq %rax, %r12
addq %r15, %r12
movq 0x60(%r14), %rdi
leaq 0x10(%rbx), %rsi
movq (%rdi), %rax
movl $0x4, %edx
callq *0x28(%rax)
addq %r12, %rax
cmpb $0x1, 0x30(%r14)
jne 0x4499a
movl (%rbx), %esi
movl %esi, %edi
sarl $0x18, %edi
movl %esi, %r8d
shll $0x8, %r8d
movl $0xff0000, %ecx         # imm = 0xFF0000
andl %ecx, %r8d
movl %esi, %r9d
shrl $0x8, %r9d
movl $0xff00, %edx           # imm = 0xFF00
andl %edx, %r9d
shll $0x18, %esi
orl %edi, %esi
orl %r8d, %esi
orl %r9d, %esi
movl %esi, (%rbx)
movq 0x8(%rbx), %rsi
movq %rsi, %rdi
sarq $0x38, %rdi
movl %esi, %r8d
andl $0xff00, %r8d           # imm = 0xFF00
shlq $0x28, %r8
movl %esi, %r10d
andl $0xff0000, %r10d        # imm = 0xFF0000
shlq $0x18, %r10
movl %esi, %r9d
andl $0xff000000, %r9d       # imm = 0xFF000000
shlq $0x8, %r9
orq %r10, %r9
movq %rsi, %r10
shrq $0x8, %r10
andl $0xff000000, %r10d      # imm = 0xFF000000
movq %rsi, %r11
shrq $0x18, %r11
andl $0xff0000, %r11d        # imm = 0xFF0000
orq %r10, %r11
movq %rsi, %r10
shrq $0x28, %r10
andl $0xff00, %r10d          # imm = 0xFF00
orq %r11, %r10
shlq $0x38, %rsi
orq %rdi, %rsi
orq %r8, %rsi
orq %r9, %rsi
orq %r10, %rsi
movq %rsi, 0x8(%rbx)
movl 0x10(%rbx), %esi
movl %esi, %edi
sarl $0x18, %edi
movl %esi, %r8d
shll $0x8, %r8d
andl %ecx, %r8d
movl %esi, %ecx
shrl $0x8, %ecx
andl %edx, %ecx
shll $0x18, %esi
orl %edi, %esi
orl %r8d, %esi
orl %ecx, %esi
movl %esi, 0x10(%rbx)
cmpq $0x10, %rax
jne 0x449ad
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x11de7(%rip), %rsi     # 0x567b1
leaq 0x11df8(%rip), %rdx     # 0x567c9
leaq 0x20(%rsp), %rdi
callq 0x26750
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x11dde(%rip), %rsi     # 0x567ca
leaq 0x11deb(%rip), %rdx     # 0x567de
movq %rsp, %rdi
callq 0x26750
movb $0x1, %bpl
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x28490
xorl %ebp, %ebp
movq 0x26521(%rip), %rsi     # 0x6af38
movq 0x2655a(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a30
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x44a3f
callq 0x27560
jmp 0x44a3f
movq %rax, %r14
movb $0x1, %bpl
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x44a56
callq 0x27560
jmp 0x44a56
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x44a63
movq %rbx, %rdi
callq 0x27070
movq %r14, %rdi
callq 0x28c20
nop