LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/BgzfStream_p.cpp
// Function: BamTools::Internal::BgzfStream::Close()
void BgzfStream::Close(void) {

    // skip if no device open
    if ( m_device == 0 ) return;

    // if writing to file, flush the current BGZF block,
    // then write an empty block (as EOF marker)
    if ( m_device->IsOpen() && (m_device->Mode() == IBamIODevice::WriteOnly) ) {
        FlushBlock();
        const size_t blockLength = DeflateBlock(0);
        m_device->Write(m_compressedBlock.Buffer, blockLength);
    }

    // close device
    m_device->Close();
    delete m_device;
    m_device = 0;

    // ensure our buffers are cleared out
    m_uncompressedBlock.Clear();
    m_compressedBlock.Clear();

    // reset state
    m_blockLength = 0;
    m_blockOffset = 0;
    m_blockAddress = 0;
    m_isWriteCompressed = true;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x18(%rax)
jne 0xcd0af
jmp 0xcd180
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
testb $0x1, %al
jne 0xcd0c4
jmp 0xcd110
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
cmpl $0x2, %eax
jne 0xcd110
movq 0x10(%rsp), %rdi
callq 0x77c00
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x72790
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rsp)
movq 0x18(%rax), %rdi
movq 0x30(%rax), %rsi
movq 0x18(%rsp), %rax
movl %eax, %edx
movq (%rdi), %rax
callq *0x40(%rax)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0xcd13e
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x10(%rsp), %rdi
movq $0x0, 0x18(%rdi)
addq $0x20, %rdi
callq 0x72930
movq 0x10(%rsp), %rdi
addq $0x30, %rdi
callq 0x72930
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
movl $0x0, 0x4(%rax)
movq $0x0, 0x8(%rax)
movb $0x1, 0x10(%rax)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/BgzfStream_p.cpp
// Function: BamTools::Internal::BgzfStream::CheckBlockHeader(char*)
bool BgzfStream::CheckBlockHeader(char* header) {
    return (header[0] == Constants::GZIP_ID1 &&
            header[1] == Constants::GZIP_ID2 &&
            header[2] == Z_DEFLATED &&
            (header[3] & Constants::FLG_FEXTRA) != 0 &&
            BamTools::UnpackUnsignedShort(&header[10]) == Constants::BGZF_XLEN &&
            header[12] == Constants::BGZF_ID1 &&
            header[13] == Constants::BGZF_ID2 &&
            BamTools::UnpackUnsignedShort(&header[14]) == Constants::BGZF_LEN );
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x1f, %ecx
movb %al, 0xf(%rsp)
jne 0xcd252
movq 0x10(%rsp), %rax
movsbl 0x1(%rax), %ecx
xorl %eax, %eax
cmpl $-0x75, %ecx
movb %al, 0xf(%rsp)
jne 0xcd252
movq 0x10(%rsp), %rax
movsbl 0x2(%rax), %ecx
xorl %eax, %eax
cmpl $0x8, %ecx
movb %al, 0xf(%rsp)
jne 0xcd252
movq 0x10(%rsp), %rax
movsbl 0x3(%rax), %ecx
andl $0x4, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xf(%rsp)
je 0xcd252
movq 0x10(%rsp), %rdi
addq $0xa, %rdi
callq 0x71680
movzwl %ax, %ecx
xorl %eax, %eax
cmpl $0x6, %ecx
movb %al, 0xf(%rsp)
jne 0xcd252
movq 0x10(%rsp), %rax
movsbl 0xc(%rax), %ecx
xorl %eax, %eax
cmpl $0x42, %ecx
movb %al, 0xf(%rsp)
jne 0xcd252
movq 0x10(%rsp), %rax
movsbl 0xd(%rax), %ecx
xorl %eax, %eax
cmpl $0x43, %ecx
movb %al, 0xf(%rsp)
jne 0xcd252
movq 0x10(%rsp), %rdi
addq $0xe, %rdi
callq 0x71680
movzwl %ax, %eax
cmpl $0x2, %eax
sete %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopl (%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/BgzfStream_p.cpp
// Function: BamTools::Internal::BgzfStream::Open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, BamTools::IBamIODevice::OpenMode)
void BgzfStream::Open(const string& filename, const IBamIODevice::OpenMode mode) {

    // close current device if necessary
    Close();
    BT_ASSERT_X( (m_device == 0), "BgzfStream::Open() - unable to properly close previous IO device" );

    // retrieve new IO device depending on filename
    m_device = BamDeviceFactory::CreateDevice(filename);
    BT_ASSERT_X( m_device, "BgzfStream::Open() - unable to create IO device from filename" );

    // if device fails to open
    if ( !m_device->Open(mode) ) {
        const string deviceError = m_device->GetErrorString();
        const string message = string("could not open BGZF stream: \n\t") + deviceError;
        throw BamException("BgzfStream::Open", message);
    }
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
movl %edx, 0xc4(%rsp)
movq 0xd0(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x75340
callq 0x761a0
movq 0xc8(%rsp), %rdi
callq 0x75a00
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
callq 0x761a0
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rdi
movl 0xc4(%rsp), %esi
movq (%rdi), %rax
callq *0x20(%rax)
testb $0x1, %al
jne 0xcea19
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rsi
movq (%rsi), %rax
movq 0x48(%rax), %rax
leaq 0xa0(%rsp), %rdi
callq *%rax
leaq 0x5f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x7b5f0
movq 0x10(%rsp), %rdx
leaq 0x1d82a(%rip), %rsi     # 0xec0f0
leaq 0x60(%rsp), %rdi
callq 0x78e70
jmp 0xce8d2
leaq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
callq 0x7c720
jmp 0xce8ee
leaq 0x60(%rsp), %rdi
callq 0x7cce8
jmp 0xce8fa
leaq 0x5f(%rsp), %rdi
callq 0x76f80
movb $0x1, 0x26(%rsp)
movl $0x28, %edi
callq 0x737c0
movq %rax, (%rsp)
leaq 0x27(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x7b5f0
movq 0x8(%rsp), %rdx
leaq 0x1d7dd(%rip), %rsi     # 0xec10f
leaq 0x28(%rsp), %rdi
callq 0x78e70
jmp 0xce93e
movq (%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x79cd0
jmp 0xce956
movq (%rsp), %rdi
movb $0x0, 0x26(%rsp)
movq 0x435aa(%rip), %rsi     # 0x111f10
movq 0x435f3(%rip), %rdx     # 0x111f60
callq 0x7b010
jmp 0xcea33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
jmp 0xce9a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x7cce8
jmp 0xce9a1
jmp 0xce9a3
leaq 0x5f(%rsp), %rdi
callq 0x76f80
jmp 0xcea08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
jmp 0xce9db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x7cce8
jmp 0xce9d9
jmp 0xce9db
leaq 0x27(%rsp), %rdi
callq 0x76f80
testb $0x1, 0x26(%rsp)
jne 0xce9ee
jmp 0xce9f7
movq (%rsp), %rdi
callq 0x74e00
leaq 0x80(%rsp), %rdi
callq 0x7cce8
jmp 0xcea06
jmp 0xcea08
leaq 0xa0(%rsp), %rdi
callq 0x7cce8
jmp 0xcea17
jmp 0xcea21
addq $0xd8, %rsp
retq
movq 0x50(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/BgzfStream_p.cpp
// Function: BamTools::Internal::BgzfStream::Write(char const*, unsigned long)
size_t BgzfStream::Write(const char* data, const size_t dataLength) {

    BT_ASSERT_X( m_device, "BgzfStream::Write() - trying to write to null IO device");
    BT_ASSERT_X( (m_device->Mode() == IBamIODevice::WriteOnly),
                 "BgzfStream::Write() - trying to write to non-writable IO device");

    // skip if file not open for writing
    if ( !IsOpen() )
        return 0;

    // write blocks as needed til all data is written
    size_t numBytesWritten = 0;
    const char* input = data;
    const size_t blockLength = Constants::BGZF_DEFAULT_BLOCK_SIZE;
    while ( numBytesWritten < dataLength ) {

        // copy data contents to uncompressed output buffer
        unsigned int copyLength = min(blockLength - m_blockOffset, dataLength - numBytesWritten);
        char* buffer = m_uncompressedBlock.Buffer;
        memcpy(buffer + m_blockOffset, input, copyLength);

        // update counter
        m_blockOffset   += copyLength;
        input           += copyLength;
        numBytesWritten += copyLength;

        // flush (& compress) output buffer when full
        if ( m_blockOffset == static_cast<int32_t>(blockLength) )
            FlushBlock();
    }

    // return actual number of bytes written
    return numBytesWritten;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
callq 0x761a0
callq 0x761a0
movq 0x8(%rsp), %rdi
callq 0x7a940
testb $0x1, %al
jne 0xcf953
movq $0x0, 0x60(%rsp)
jmp 0xcfa39
movq $0x0, 0x40(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x38(%rsp)
movq $0x10000, 0x30(%rsp)    # imm = 0x10000
movq 0x40(%rsp), %rax
cmpq 0x48(%rsp), %rax
jae 0xcfa2f
movq 0x8(%rsp), %rax
movslq 0x4(%rax), %rcx
movl $0x10000, %eax          # imm = 0x10000
subq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rax
subq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x74f40
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq (%rcx), %rcx
movl %ecx, 0x2c(%rsp)
movq 0x20(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movslq 0x4(%rax), %rax
addq %rax, %rdi
movq 0x38(%rsp), %rsi
movl 0x2c(%rsp), %eax
movl %eax, %edx
callq 0x757c0
movq 0x8(%rsp), %rax
movl 0x2c(%rsp), %ecx
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movl 0x2c(%rsp), %edx
movq 0x38(%rsp), %rcx
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, 0x38(%rsp)
movl 0x2c(%rsp), %ecx
addq 0x40(%rsp), %rcx
movq %rcx, 0x40(%rsp)
cmpl $0x10000, 0x4(%rax)     # imm = 0x10000
jne 0xcfa2a
movq 0x8(%rsp), %rdi
callq 0x77c00
jmp 0xcf96f
movq 0x40(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: zeeev[P]DASVC/bamtools/src/api/BamAux.h
// Function: BamTools::PackUnsignedInt(char*, unsigned int)
API_EXPORT inline void PackUnsignedInt(char* buffer, unsigned int value) {
    buffer[0] = (char)value;
    buffer[1] = (char)(value >> 8);
    buffer[2] = (char)(value >> 16);
    buffer[3] = (char)(value >> 24);
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movl -0xc(%rsp), %eax
movb %al, %cl
movq -0x8(%rsp), %rax
movb %cl, (%rax)
movl -0xc(%rsp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x8(%rsp), %rax
movb %cl, 0x1(%rax)
movl -0xc(%rsp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x8(%rsp), %rax
movb %cl, 0x2(%rax)
movl -0xc(%rsp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x8(%rsp), %rax
movb %cl, 0x3(%rax)
retq
nopw (%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/ByteArray_p.cpp
// Function: BamTools::Internal::ByteArray::IndexOf(char, unsigned long, unsigned long) const
size_t ByteArray::IndexOf(const char c, const size_t from, const size_t to) const {
    const size_t size = ( (to == 0 ) ? m_data.size() : to );
    for ( size_t i = from; i < size; ++i ) {
        if ( m_data.at(i) == c ) 
            return i;
    }
    return m_data.size();
}

// Assembly:
subq $0x48, %rsp
movb %sil, %al
movq %rdi, 0x38(%rsp)
movb %al, 0x37(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0xcfebc
movq 0x8(%rsp), %rdi
callq 0x71c30
movq %rax, (%rsp)
jmp 0xcfec5
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0xcff1d
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x7a760
movsbl (%rax), %eax
movsbl 0x37(%rsp), %ecx
cmpl %ecx, %eax
jne 0xcff0b
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0xcff2c
jmp 0xcff0d
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0xcfed8
movq 0x8(%rsp), %rdi
callq 0x71c30
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/ByteArray_p.cpp
// Function: BamTools::Internal::ByteArray::Remove(unsigned long, unsigned long)
ByteArray& ByteArray::Remove(size_t from, size_t n) {

    // if 'from' outside range, just return
    const size_t originalSize = m_data.size();
    if ( from >= originalSize )
        return *this;

    // if asked to clip from 'from' to end (or beyond), simply resize
    if ( from + n >= originalSize )
        Resize(from);

    // otherwise, shift data & resize
    else {
        memmove( &m_data[from], &m_data[from+n], (originalSize-from-n) );
        Resize(originalSize - n);
    }

    // return reference to modified byte array
    return *this;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x71c30
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x10(%rsp), %rax
jb 0xcff82
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0xd0004
movq 0x20(%rsp), %rax
addq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
jb 0xcffa4
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x744c0
jmp 0xcfffa
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x77910
movq 0x8(%rsp), %rdi
movq %rax, (%rsp)
movq 0x20(%rsp), %rsi
addq 0x18(%rsp), %rsi
callq 0x77910
movq (%rsp), %rdi
movq %rax, %rsi
movq 0x10(%rsp), %rdx
subq 0x20(%rsp), %rdx
subq 0x18(%rsp), %rdx
callq 0x7a730
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
subq 0x18(%rsp), %rsi
callq 0x744c0
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nop
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::SetAddress(unsigned char const*)
void HostAddress::SetAddress(const uint8_t* ip6Address) {
    for ( uint8_t i = 0; i < 16; ++i )
        m_ip6Address[i] = ip6Address[i];
    m_protocol = HostAddress::IPv6Protocol;
    m_hasIpAddress = true;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movb $0x0, 0x17(%rsp)
movzbl 0x17(%rsp), %eax
cmpl $0x10, %eax
jge 0xd2d3f
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rax
movzbl 0x17(%rsp), %ecx
movb (%rax,%rcx), %al
movb %al, 0x7(%rsp)
addq $0x8, %rdi
movzbl 0x17(%rsp), %eax
movl %eax, %esi
callq 0x78f60
movb 0x7(%rsp), %cl
movb %cl, (%rax)
movb 0x17(%rsp), %al
addb $0x1, %al
movb %al, 0x17(%rsp)
jmp 0xd2cfd
movq 0x8(%rsp), %rax
movl $0x1, (%rax)
movb $0x1, 0x38(%rax)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::SetAddress(BamTools::Internal::IPv6Address const&)
void HostAddress::SetAddress(const IPv6Address& ip6Address) {
    m_ip6Address = ip6Address;
    m_ip4Address = 0;
    m_protocol = HostAddress::IPv6Protocol;
    m_hasIpAddress = true;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq -0x10(%rsp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, 0x4(%rax)
movl $0x1, (%rax)
movb $0x1, 0x38(%rax)
retq
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::operator==(BamTools::Internal::HostAddress const&) const
bool HostAddress::operator==(const HostAddress& other) const {

    // if self is IPv4
    if ( m_protocol == HostAddress::IPv4Protocol ) {
        return ( other.m_protocol == HostAddress::IPv4Protocol &&
                 m_ip4Address == other.m_ip4Address
               );
    }

    // if self is IPv6
    else if ( m_protocol == HostAddress::IPv6Protocol ) {
        return ( other.m_protocol == HostAddress::IPv6Protocol &&
                 memcmp(&m_ip6Address, &other.m_ip6Address, sizeof(IPv6Address)) == 0
               );
    }

    // otherwise compare protocols
    else return m_protocol == other.m_protocol;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x20(%rsp)
cmpl $0x0, (%rax)
jne 0xd2fdc
movq -0x18(%rsp), %rcx
xorl %eax, %eax
cmpl $0x0, (%rcx)
movb %al, -0x21(%rsp)
jne 0xd2fd0
movq -0x20(%rsp), %rax
movl 0x4(%rax), %eax
movq -0x18(%rsp), %rcx
cmpl 0x4(%rcx), %eax
sete %al
movb %al, -0x21(%rsp)
movb -0x21(%rsp), %al
andb $0x1, %al
movb %al, -0x1(%rsp)
jmp 0xd304e
movq -0x20(%rsp), %rax
cmpl $0x1, (%rax)
jne 0xd3037
movq -0x18(%rsp), %rcx
xorl %eax, %eax
cmpl $0x1, (%rcx)
movb %al, -0x22(%rsp)
jne 0xd302b
movq -0x20(%rsp), %rax
addq $0x8, %rax
movq -0x18(%rsp), %rcx
addq $0x8, %rcx
movups (%rcx), %xmm1
movups (%rax), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x22(%rsp)
movb -0x22(%rsp), %al
andb $0x1, %al
movb %al, -0x1(%rsp)
jmp 0xd304e
movq -0x20(%rsp), %rax
movl (%rax), %eax
movq -0x18(%rsp), %rcx
cmpl (%rcx), %eax
sete %al
andb $0x1, %al
movb %al, -0x1(%rsp)
movb -0x1(%rsp), %al
andb $0x1, %al
retq
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::operator<(BamTools::Internal::HostAddress const&) const
bool HostAddress::operator<(const HostAddress& other) const {

    // if self is IPv4
    if ( m_protocol == HostAddress::IPv4Protocol ) {
        if ( other.m_protocol == HostAddress::IPv4Protocol )
            return m_ip4Address < other.m_ip4Address;
    }

    // if self is IPv6
    else if ( m_protocol == HostAddress::IPv6Protocol ) {
        if ( other.m_protocol == HostAddress::IPv6Protocol )
            return (memcmp(&m_ip6Address, &other.m_ip6Address, sizeof(IPv6Address)) < 0);
    }

    // otherwise compare protocol types
    return m_protocol < other.m_protocol;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, (%rax)
jne 0xd30a4
movq 0x10(%rsp), %rax
cmpl $0x0, (%rax)
jne 0xd30a2
movq 0x8(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x10(%rsp), %rcx
cmpl 0x4(%rcx), %eax
setb %al
andb $0x1, %al
movb %al, 0x27(%rsp)
jmp 0xd30fd
jmp 0xd30e6
movq 0x8(%rsp), %rax
cmpl $0x1, (%rax)
jne 0xd30e4
movq 0x10(%rsp), %rax
cmpl $0x1, (%rax)
jne 0xd30e2
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
movq 0x10(%rsp), %rsi
addq $0x8, %rsi
movl $0x10, %edx
callq 0x733f0
cmpl $0x0, %eax
setl %al
andb $0x1, %al
movb %al, 0x27(%rsp)
jmp 0xd30fd
jmp 0xd30e4
jmp 0xd30e6
movq 0x8(%rsp), %rax
movl (%rax), %eax
movq 0x10(%rsp), %rcx
cmpl (%rcx), %eax
setl %al
andb $0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::Clear()
void HostAddress::Clear(void) {

    m_protocol = HostAddress::UnknownNetworkProtocol;
    m_ip4Address = 0;
    memset(&m_ip6Address, 0, sizeof(IPv6Address));
    m_ipString.clear();

    // this may feel funny, but cleared IP (equivalent to '0.0.0.0') is technically valid
    // and that's not really what this flag is checking anyway
    //
    // this flag is false *iff* the string passed in is a 'plain-text' hostname (www.foo.bar)
    m_hasIpAddress = true;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl $0xffffffff, (%rdi)     # imm = 0xFFFFFFFF
movl $0x0, 0x4(%rdi)
addq $0x8, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x73d00
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
callq 0x78800
movq 0x8(%rsp), %rax
movb $0x1, 0x38(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::ParseAddress()
bool HostAddress::ParseAddress(void) {

    // all IPv6 addresses should have a ':'
    string s = m_ipString;
    size_t found = s.find(':');
    if ( found != string::npos ) {
        // try parse IP6 address
        uint8_t maybeIp6[16];
        if ( ParseIp6(s, maybeIp6) ) {
            SetAddress(maybeIp6);
            m_protocol = HostAddress::IPv6Protocol;
            return true;
        }
    }

    // all IPv4 addresses should have a '.'
    found = s.find('.');
    if ( found != string::npos ) {
        uint32_t maybeIp4(0);
        if ( ParseIp4(s, maybeIp4) ) {
            SetAddress(maybeIp4);
            m_protocol = HostAddress::IPv4Protocol;
            return true;
        }
    }

    // else likely just a plain-text host name "www.foo.bar"
    // will need to look up IP address info later
    m_protocol = HostAddress::UnknownNetworkProtocol;
    return false;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x88(%rsp)
movq 0x88(%rsp), %rsi
movq %rsi, 0x20(%rsp)
addq $0x18, %rsi
leaq 0x68(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x73370
movq 0x28(%rsp), %rdi
xorl %eax, %eax
movl %eax, %edx
movl $0x3a, %esi
callq 0x787f0
movq %rax, 0x30(%rsp)
jmp 0xd34f9
movq 0x30(%rsp), %rax
movq %rax, 0x60(%rsp)
cmpq $-0x1, 0x60(%rsp)
je 0xd357a
leaq 0x68(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xd3650
movb %al, 0x1f(%rsp)
jmp 0xd3520
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0xd352a
jmp 0xd3578
movq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x770c0
jmp 0xd353b
movq 0x20(%rsp), %rax
movl $0x1, (%rax)
movb $0x1, 0x97(%rsp)
movl $0x1, 0x3c(%rsp)
jmp 0xd3617
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x7cce8
jmp 0xd3632
jmp 0xd357a
xorl %eax, %eax
movl %eax, %edx
leaq 0x68(%rsp), %rdi
movl $0x2e, %esi
callq 0x787f0
movq %rax, 0x10(%rsp)
jmp 0xd3594
movq 0x10(%rsp), %rax
movq %rax, 0x60(%rsp)
cmpq $-0x1, 0x60(%rsp)
je 0xd35fc
movl $0x0, 0x38(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0xd3ea0
movb %al, 0xf(%rsp)
jmp 0xd35c3
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0xd35cd
jmp 0xd35fa
movq 0x20(%rsp), %rdi
movl 0x38(%rsp), %esi
callq 0x7c690
jmp 0xd35dd
movq 0x20(%rsp), %rax
movl $0x0, (%rax)
movb $0x1, 0x97(%rsp)
movl $0x1, 0x3c(%rsp)
jmp 0xd3617
jmp 0xd35fc
movq 0x20(%rsp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movb $0x0, 0x97(%rsp)
movl $0x1, 0x3c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x7cce8
movb 0x97(%rsp), %al
andb $0x1, %al
addq $0x98, %rsp
retq
jmp 0xd3634
movq 0x58(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::ParseIp4(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int&)
static
bool ParseIp4(const string& address, uint32_t& maybeIp4 ) {

    // split IP address into string fields
    vector<string> addressFields = Split(address, '.');
    if ( addressFields.size() != 4 )
        return false;

    // convert each field to integer value
    uint32_t ipv4(0);
    for ( uint8_t i = 0; i < 4; ++i ) {

        const string& field = addressFields.at(i);
        const size_t fieldSize = field.size();
        for ( size_t j = 0; j < fieldSize; ++j ) {
            if ( !isdigit(field[j]) )
                return false;
        }

        int value = atoi( addressFields.at(i).c_str() );
        if ( value < 0 || value > 255 )
            return false;

        // append byte value
        ipv4 <<= 8;
        ipv4 += value;
    }

    // store 32-bit IP address & return success
    maybeIp4 = ipv4;
    return true;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x88(%rsp)
movq %rsi, 0x80(%rsp)
movq 0x88(%rsp), %rsi
leaq 0x68(%rsp), %rdi
movl $0x2e, %edx
callq 0xd40a0
leaq 0x68(%rsp), %rdi
callq 0x7bb00
cmpq $0x4, %rax
je 0xd3ef3
movb $0x0, 0x97(%rsp)
movl $0x1, 0x64(%rsp)
jmp 0xd4068
movl $0x0, 0x60(%rsp)
movb $0x0, 0x5f(%rsp)
movzbl 0x5f(%rsp), %eax
cmpl $0x4, %eax
jge 0xd404a
movzbl 0x5f(%rsp), %eax
movl %eax, %esi
leaq 0x68(%rsp), %rdi
callq 0x72720
movq %rax, 0x20(%rsp)
jmp 0xd3f26
movq 0x20(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0x74cd0
movq %rax, 0x18(%rsp)
jmp 0xd3f41
movq 0x18(%rsp), %rax
movq %rax, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0xd3fcc
movq 0x50(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x771c0
movq %rax, 0x10(%rsp)
jmp 0xd3f76
movq 0x10(%rsp), %rax
movsbl (%rax), %edi
callq 0x75e50
cmpl $0x0, %eax
jne 0xd3fba
movb $0x0, 0x97(%rsp)
movl $0x1, 0x64(%rsp)
jmp 0xd4068
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x74e60
jmp 0xd4083
jmp 0xd3fbc
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0xd3f54
movzbl 0x5f(%rsp), %eax
movl %eax, %esi
leaq 0x68(%rsp), %rdi
callq 0x72720
movq %rax, 0x8(%rsp)
jmp 0xd3fe4
movq 0x8(%rsp), %rdi
callq 0x73020
movq %rax, (%rsp)
jmp 0xd3ff4
movq (%rsp), %rdi
callq 0x7a180
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jl 0xd4012
cmpl $0xff, 0x2c(%rsp)
jle 0xd4024
movb $0x0, 0x97(%rsp)
movl $0x1, 0x64(%rsp)
jmp 0xd4068
movl 0x60(%rsp), %eax
shll $0x8, %eax
movl %eax, 0x60(%rsp)
movl 0x2c(%rsp), %eax
addl 0x60(%rsp), %eax
movl %eax, 0x60(%rsp)
movb 0x5f(%rsp), %al
addb $0x1, %al
movb %al, 0x5f(%rsp)
jmp 0xd3f00
movl 0x60(%rsp), %ecx
movq 0x80(%rsp), %rax
movl %ecx, (%rax)
movb $0x1, 0x97(%rsp)
movl $0x1, 0x64(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x74e60
movb 0x97(%rsp), %al
andb $0x1, %al
addq $0x98, %rsp
retq
jmp 0xd4085
movq 0x48(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopw (%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::Split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char)
static inline
vector<string> Split(const string& source, char delim) {
    stringstream ss(source);
    string field;
    vector<string> fields;
    while ( getline(ss, field, delim) )
        fields.push_back(field);
    return fields;
}

// Assembly:
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, 0x10(%rsp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, 0x18(%rsp)
movq %rdi, 0x1f0(%rsp)
movq %rsi, 0x1e8(%rsp)
movb %al, 0x1e7(%rsp)
movq 0x1e8(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x10, %edi
movl $0x8, %esi
callq 0x7b8d0
movq 0x20(%rsp), %rsi
movl %eax, %edx
leaq 0x58(%rsp), %rdi
callq 0x7a4b0
leaq 0x38(%rsp), %rdi
callq 0x79100
jmp 0xd4106
movq 0x10(%rsp), %rdi
movb $0x0, 0x2b(%rsp)
callq 0x7b6e0
jmp 0xd4117
jmp 0xd4119
movsbl 0x1e7(%rsp), %edx
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x7be00
movq %rax, 0x8(%rsp)
jmp 0xd4137
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x7a210
movq %rax, (%rsp)
jmp 0xd4151
movq (%rsp), %rax
cmpq $0x0, %rax
je 0xd41a8
movq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x73a70
jmp 0xd416c
jmp 0xd4119
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
jmp 0xd41f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
jmp 0xd41e7
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
callq 0x74e60
jmp 0xd41ce
movb $0x1, 0x2b(%rsp)
testb $0x1, 0x2b(%rsp)
jne 0xd41c2
movq 0x10(%rsp), %rdi
callq 0x74e60
jmp 0xd41c0
jmp 0xd41c2
leaq 0x38(%rsp), %rdi
callq 0x7cce8
jmp 0xd41d0
jmp 0xd41e7
leaq 0x58(%rsp), %rdi
callq 0x74f60
movq 0x18(%rsp), %rax
addq $0x1f8, %rsp            # imm = 0x1F8
retq
leaq 0x38(%rsp), %rdi
callq 0x7cce8
jmp 0xd41f3
jmp 0xd41f5
leaq 0x58(%rsp), %rdi
callq 0x74f60
jmp 0xd4201
jmp 0xd4203
movq 0x30(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::CountHits(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static inline
uint8_t CountHits(const string& source, const string& pattern) {

    uint8_t count(0);
    size_t found = source.find(pattern);
    while ( found != string::npos ) {
        ++count;
        found = source.find(pattern, found+1);
    }
    return count;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movb $0x0, 0x17(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x7cb90
movq %rax, 0x8(%rsp)
cmpq $-0x1, 0x8(%rsp)
je 0xd427c
movb 0x17(%rsp), %al
addb $0x1, %al
movb %al, 0x17(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdx
addq $0x1, %rdx
callq 0x7cb90
movq %rax, 0x8(%rsp)
jmp 0xd424b
movb 0x17(%rsp), %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HttpHeader_p.cpp
// Function: BamTools::Internal::Trim(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static string Trim(const string& source) {

    // skip if empty string
    if ( source.empty() )
        return source;

    // fetch string data
    const char*  s    = source.data(); // ignoring null-term on purpose
    const size_t size = source.size();
    size_t start = 0;
    size_t end   = size-1;

    // skip if no spaces at start or end
    if ( !IsSpace(s[start]) && !IsSpace( s[end] ) )
        return source;

    // remove leading whitespace
    while ( (start != end) && IsSpace(s[start]) )
        ++start;

    // remove trailing whitespace
    if ( start <= end ) {
        while ( end && IsSpace(s[end]) )
            --end;
    }

    // return result
    return string(s + start, (end-start) + 1);
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x20(%rsp)
movq %rdi, %rax
movq %rax, 0x28(%rsp)
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq 0x68(%rsp), %rdi
callq 0x7aba0
testb $0x1, %al
jne 0xd81ab
jmp 0xd81bf
movq 0x20(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x73370
jmp 0xd833a
movq 0x68(%rsp), %rdi
callq 0x785e0
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rdi
callq 0x74cd0
movq %rax, 0x58(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x58(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x48(%rsp)
movq 0x60(%rsp), %rax
movq 0x50(%rsp), %rcx
movsbl (%rax,%rcx), %edi
callq 0xd9c40
testb $0x1, %al
jne 0xd8236
movq 0x60(%rsp), %rax
movq 0x48(%rsp), %rcx
movsbl (%rax,%rcx), %edi
callq 0xd9c40
testb $0x1, %al
jne 0xd8236
movq 0x20(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x73370
jmp 0xd833a
jmp 0xd8238
movq 0x50(%rsp), %rcx
xorl %eax, %eax
cmpq 0x48(%rsp), %rcx
movb %al, 0x1f(%rsp)
je 0xd8261
movq 0x60(%rsp), %rax
movq 0x50(%rsp), %rcx
movsbl (%rax,%rcx), %edi
callq 0xd9c40
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0xd826b
jmp 0xd827b
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0xd8238
movq 0x50(%rsp), %rax
cmpq 0x48(%rsp), %rax
ja 0xd82ca
jmp 0xd8289
xorl %eax, %eax
cmpq $0x0, 0x48(%rsp)
movb %al, 0x1e(%rsp)
je 0xd82ae
movq 0x60(%rsp), %rax
movq 0x48(%rsp), %rcx
movsbl (%rax,%rcx), %edi
callq 0xd9c40
movb %al, 0x1e(%rsp)
movb 0x1e(%rsp), %al
testb $0x1, %al
jne 0xd82b8
jmp 0xd82c8
movq 0x48(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0xd8289
jmp 0xd82ca
movq 0x60(%rsp), %rax
movq 0x50(%rsp), %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movq 0x48(%rsp), %rax
subq %rcx, %rax
incq %rax
movq %rax, 0x8(%rsp)
leaq 0x47(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x7b5f0
movq 0x20(%rsp), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
callq 0x77510
jmp 0xd8314
leaq 0x47(%rsp), %rdi
callq 0x76f80
jmp 0xd833a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
leaq 0x47(%rsp), %rdi
callq 0x76f80
jmp 0xd8344
movq 0x28(%rsp), %rax
addq $0x78, %rsp
retq
movq 0x38(%rsp), %rdi
callq 0x7b550
nop
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HttpHeader_p.cpp
// Function: BamTools::Internal::Split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char)
static vector<string> Split(const string& source, const char delim) {
    stringstream ss(source);
    string field;
    vector<string> fields;
    while ( getline(ss, field, delim) )
        fields.push_back(field);
    return fields;
}

// Assembly:
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, 0x10(%rsp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, 0x18(%rsp)
movq %rdi, 0x1f0(%rsp)
movq %rsi, 0x1e8(%rsp)
movb %al, 0x1e7(%rsp)
movq 0x1e8(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x10, %edi
movl $0x8, %esi
callq 0x7b8d0
movq 0x20(%rsp), %rsi
movl %eax, %edx
leaq 0x58(%rsp), %rdi
callq 0x7a4b0
leaq 0x38(%rsp), %rdi
callq 0x79100
jmp 0xd83b6
movq 0x10(%rsp), %rdi
movb $0x0, 0x2b(%rsp)
callq 0x7b6e0
jmp 0xd83c7
jmp 0xd83c9
movsbl 0x1e7(%rsp), %edx
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x7be00
movq %rax, 0x8(%rsp)
jmp 0xd83e7
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x7a210
movq %rax, (%rsp)
jmp 0xd8401
movq (%rsp), %rax
cmpq $0x0, %rax
je 0xd8458
movq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x73a70
jmp 0xd841c
jmp 0xd83c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
jmp 0xd84a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
jmp 0xd8497
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
callq 0x74e60
jmp 0xd847e
movb $0x1, 0x2b(%rsp)
testb $0x1, 0x2b(%rsp)
jne 0xd8472
movq 0x10(%rsp), %rdi
callq 0x74e60
jmp 0xd8470
jmp 0xd8472
leaq 0x38(%rsp), %rdi
callq 0x7cce8
jmp 0xd8480
jmp 0xd8497
leaq 0x58(%rsp), %rdi
callq 0x74f60
movq 0x18(%rsp), %rax
addq $0x1f8, %rsp            # imm = 0x1F8
retq
leaq 0x38(%rsp), %rdi
callq 0x7cce8
jmp 0xd84a3
jmp 0xd84a5
leaq 0x58(%rsp), %rdi
callq 0x74f60
jmp 0xd84b1
jmp 0xd84b3
movq 0x30(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/HttpHeader_p.cpp
// Function: BamTools::Internal::HttpHeader::ParseLine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
bool HttpHeader::ParseLine(const string& line, int) {

    // find colon position, return failure if not found
    const size_t colonFound = line.find(Constants::COLON_CHAR);
    if ( colonFound == string::npos )
        return false;

    // store key/value (without leading/trailing whitespace) & return success
    const string key   = Trim(line.substr(0, colonFound));
    const string value = Trim(line.substr(colonFound+1));
    m_fields[key] = value;
    return true;
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xc8(%rsp)
movq %rsi, 0xc0(%rsp)
movl %edx, 0xbc(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xc0(%rsp), %rdi
movl $0x3a, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x787f0
movq %rax, 0xb0(%rsp)
cmpq $-0x1, 0xb0(%rsp)
jne 0xd8531
movb $0x0, 0xd7(%rsp)
jmp 0xd867b
movq 0xc0(%rsp), %rsi
movq 0xb0(%rsp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq 0x70(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x76c50
movq 0x10(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0xd8180
jmp 0xd8568
leaq 0x70(%rsp), %rdi
callq 0x7cce8
movq 0xc0(%rsp), %rsi
movq 0xb0(%rsp), %rdx
incq %rdx
leaq 0x20(%rsp), %rdi
movq $-0x1, %rcx
callq 0x76c50
jmp 0xd8598
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xd8180
jmp 0xd85a9
leaq 0x20(%rsp), %rdi
callq 0x7cce8
jmp 0xd85b5
movq 0x18(%rsp), %rdi
addq $0x8, %rdi
leaq 0x90(%rsp), %rsi
callq 0x712e0
movq %rax, 0x8(%rsp)
jmp 0xd85d2
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x71240
jmp 0xd85e3
movb $0x1, 0xd7(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x7cce8
jmp 0xd8659
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x7cce8
jmp 0xd8611
jmp 0xd868c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0xd866a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x7cce8
jmp 0xd863d
jmp 0xd866a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x7cce8
jmp 0xd8668
leaq 0x90(%rsp), %rdi
callq 0x7cce8
jmp 0xd867b
jmp 0xd866a
leaq 0x90(%rsp), %rdi
callq 0x7cce8
jmp 0xd8679
jmp 0xd868c
movb 0xd7(%rsp), %al
andb $0x1, %al
addq $0xd8, %rsp
retq
movq 0x68(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nop
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/ILocalIODevice_p.cpp
// Function: BamTools::Internal::ILocalIODevice::Close()
void ILocalIODevice::Close(void) {

    // skip if not open
    if ( !IsOpen() )
        return;

    // flush & close FILE*
    fflush(m_stream);
    fclose(m_stream);
    m_stream = 0;

    // reset other device state
    m_mode = IBamIODevice::NotOpen;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq (%rdi), %rax
callq *0x50(%rax)
testb $0x1, %al
jne 0xdba6f
jmp 0xdba9f
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x77af0
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x76940
movq 0x8(%rsp), %rax
movq $0x0, 0x30(%rax)
movl $0x0, 0x8(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::RollingBuffer(unsigned long)
RollingBuffer::RollingBuffer(size_t growth)
    : m_bufferGrowth(growth)
{
    // buffer always contains at least 1 (maybe empty) byte array
    m_data.push_back( ByteArray() );

    // set cleared state
    Clear();
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x20(%rdi)
addq $0x28, %rdi
movq %rdi, 0x10(%rsp)
movq %rdi, %rax
movq %rax, 0x18(%rsp)
callq 0x7cb80
leaq 0x30(%rsp), %rdi
callq 0x78440
jmp 0xdbbc3
movq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x76360
jmp 0xdbbd4
leaq 0x30(%rsp), %rdi
callq 0x76060
jmp 0xdbbe0
movq 0x8(%rsp), %rdi
callq 0x77c40
jmp 0xdbbec
addq $0x58, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
jmp 0xdbc1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x76060
jmp 0xdbc1b
jmp 0xdbc1d
movq 0x18(%rsp), %rdi
callq 0x786e0
jmp 0xdbc29
jmp 0xdbc2b
movq 0x28(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopl (%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::Clear()
void RollingBuffer::Clear(void) {

    // remove all byte arrays (except first)
    m_data.erase( m_data.begin()+1, m_data.end() );

    // clear out first byte array
    m_data[0].Resize(0);
    m_data[0].Squeeze();

    // reset index & size markers
    m_head = 0;
    m_tail = 0;
    m_tailBufferIndex = 0;
    m_totalBufferSize = 0;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq 0x90(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq %rsi, %rax
addq $0x28, %rax
movq %rax, (%rsp)
addq $0x28, %rsi
leaq 0x50(%rsp), %rdi
callq 0x7adc0
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
movl $0x1, %edx
callq 0x74e20
movq 0x8(%rsp), %rsi
addq $0x28, %rsi
leaq 0x30(%rsp), %rdi
callq 0x771d0
movq (%rsp), %rsi
leaq 0x10(%rsp), %rdi
leaq 0x70(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0x7b890
movq 0x8(%rsp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x79510
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x744c0
movq 0x8(%rsp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x79510
movq %rax, %rdi
callq 0x7b070
movq 0x8(%rsp), %rax
movq $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
addq $0x98, %rsp
retq
nopl (%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::BlockSize() const
size_t RollingBuffer::BlockSize(void) const {

    // if only one byte array in buffer <- needed?
    if ( m_tailBufferIndex == 0 )
        return m_tail - m_head;

    // otherwise return remaining num bytes in first array
    const ByteArray& first = m_data.front();
    return first.Size() - m_head;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x10(%rax)
jne 0xdbd6d
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
movq %rax, 0x20(%rsp)
jmp 0xdbd97
movq 0x8(%rsp), %rdi
addq $0x28, %rdi
callq 0x7a240
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x75810
movq 0x8(%rsp), %rcx
subq (%rcx), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::IndexOf(char) const
size_t RollingBuffer::IndexOf(char c) const {

    // skip processing if empty buffer
    if ( IsEmpty() )
        return string::npos;

    size_t index(0);

    // iterate over byte arrays
    const size_t numBuffers = m_data.size();
    for ( size_t i = 0; i < numBuffers; ++i ) {
        const ByteArray& current = m_data.at(i);

        // if on first array, use head; else 0
        const size_t start = ( (i==0) ? m_head : 0 );

        // if on last array, set end; else use current byte array size
        const size_t end   = ( (i==m_tailBufferIndex) ? m_tail : current.Size());

        // look through this iteration's byte array for @c
        const char* p = current.ConstData()+start;
        for ( size_t j = start; j < end; ++j ) {
            if ( *p++ == c )
                return index;
            ++index;
        }
    }

    // no match found
    return string::npos;
}

// Assembly:
subq $0x78, %rsp
movb %sil, %al
movq %rdi, 0x68(%rsp)
movb %al, 0x67(%rsp)
movq 0x68(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x74cf0
testb $0x1, %al
jne 0xdbdf5
jmp 0xdbe03
movq $-0x1, 0x70(%rsp)
jmp 0xdbf42
movq 0x18(%rsp), %rdi
movq $0x0, 0x58(%rsp)
addq $0x28, %rdi
callq 0x73830
movq %rax, 0x50(%rsp)
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x50(%rsp), %rax
jae 0xdbf39
movq 0x18(%rsp), %rdi
addq $0x28, %rdi
movq 0x48(%rsp), %rsi
callq 0x76f90
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0xdbe67
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0xdbe70
xorl %eax, %eax
movq %rax, 0x10(%rsp)
jmp 0xdbe70
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x10(%rcx), %rax
jne 0xdbe9a
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0xdbea9
movq 0x40(%rsp), %rdi
callq 0x75810
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rdi
callq 0x71e90
addq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x30(%rsp), %rax
jae 0xdbf24
movq 0x28(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rsp)
movsbl (%rax), %eax
movsbl 0x67(%rsp), %ecx
cmpl %ecx, %eax
jne 0xdbf06
movq 0x58(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0xdbf42
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0xdbed1
jmp 0xdbf26
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0xdbe28
movq $-0x1, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopl (%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::Chop(unsigned long)
void RollingBuffer::Chop(size_t n) {

    // update buffer size
    if ( n > m_totalBufferSize )
        m_totalBufferSize = 0;
    else
        m_totalBufferSize -= n;

    // loop until target case hit
    for ( ; ; ) {

        // if only one array, decrement tail
        if ( m_tailBufferIndex == 0 ) {
            m_tail -= n;

            // if all data chopped
            if ( m_tail <= m_head ) {
                m_head = 0;
                m_tail = 0;
            }
            return;
        }

        // if there's room in last byte array to 'chop', just decrement tail
        if ( n <= m_tail ) {
            m_tail -= n;
            return;
        }

        // otherwise we're going to overlap our internal byte arrays
        // reduce our chop amount by the amount of data in the last byte array
        n -= m_tail;

        // remove last byte array & set tail to it's end
        m_data.pop_back();
        --m_tailBufferIndex;
        m_tail = m_data.at(m_tailBufferIndex).Size();
    }

    // if buffer is now empty, reset state & clear up memory
    if ( IsEmpty() )
        Clear();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rcx
movq %rcx, (%rsp)
movq 0x8(%rsp), %rax
cmpq 0x18(%rcx), %rax
jbe 0xdbf80
movq (%rsp), %rax
movq $0x0, 0x18(%rax)
jmp 0xdbf94
movq (%rsp), %rax
movq 0x8(%rsp), %rdx
movq 0x18(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x18(%rax)
jmp 0xdbf96
movq (%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0xdbfd3
movq (%rsp), %rcx
movq 0x8(%rsp), %rdx
movq 0x8(%rcx), %rax
subq %rdx, %rax
movq %rax, 0x8(%rcx)
movq 0x8(%rcx), %rax
cmpq (%rcx), %rax
ja 0xdbfd1
movq (%rsp), %rax
movq $0x0, (%rax)
movq $0x0, 0x8(%rax)
jmp 0xdc04e
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
cmpq 0x8(%rcx), %rax
ja 0xdbff8
movq (%rsp), %rax
movq 0x8(%rsp), %rdx
movq 0x8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x8(%rax)
jmp 0xdc04e
movq (%rsp), %rdi
movq 0x8(%rdi), %rcx
movq 0x8(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x8(%rsp)
addq $0x28, %rdi
callq 0x73630
movq (%rsp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
movq %rax, %rdi
addq $0x28, %rdi
movq 0x10(%rax), %rsi
callq 0x74d90
movq %rax, %rdi
callq 0x75810
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0xdbf96
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/internal/io/RollingBuffer_p.cpp
// Function: BamTools::Internal::RollingBuffer::Free(unsigned long)
void RollingBuffer::Free(size_t n) {

    // update buffer size
    if ( n > m_totalBufferSize )
        m_totalBufferSize = 0;
    else
        m_totalBufferSize -= n;

    // loop until target case hit
    for ( ; ; ) {

        const size_t blockSize = BlockSize();

        // if there's room in current array
        if ( n < blockSize ) {

            // shift 'head' over @n bytes
            m_head += n;

            // check for emptied, single byte array
            if ( m_head == m_tail && m_tailBufferIndex == 0 ) {
                m_head = 0;
                m_tail = 0;
            }

            break;
        }

        // otherwise we need to check next byte array
        // first update amount to remove
        n -= blockSize;

        // special case - there was only 1 array
        if ( m_data.size() == 1 ) {
            if ( m_data.at(0).Size() != m_bufferGrowth )
                m_data[0].Resize(m_bufferGrowth);
            m_head = 0;
            m_tail = 0;
            m_tailBufferIndex = 0;
            break;
        }

        // otherwise, remove first array and move to next iteration
        m_data.pop_front();
        --m_tailBufferIndex;
        m_head = 0;
    }

    // if buffer is now empty, reset state & clear up memory
    if ( IsEmpty() )
        Clear();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x18(%rcx), %rax
jbe 0xdc092
movq 0x8(%rsp), %rax
movq $0x0, 0x18(%rax)
jmp 0xdc0a7
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rdx
movq 0x18(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x18(%rax)
jmp 0xdc0a9
movq 0x8(%rsp), %rdi
callq 0x73cd0
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
jae 0xdc102
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
addq (%rcx), %rax
movq %rax, (%rcx)
movq (%rcx), %rax
cmpq 0x8(%rcx), %rax
jne 0xdc0fd
movq 0x8(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0xdc0fd
movq 0x8(%rsp), %rax
movq $0x0, (%rax)
movq $0x0, 0x8(%rax)
jmp 0xdc1b9
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x18(%rsp)
addq $0x28, %rdi
callq 0x73830
cmpq $0x1, %rax
jne 0xdc18e
movq 0x8(%rsp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x74d90
movq %rax, %rdi
callq 0x75810
movq 0x8(%rsp), %rcx
cmpq 0x20(%rcx), %rax
je 0xdc170
movq 0x8(%rsp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x79510
movq %rax, %rdi
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rsi
callq 0x744c0
movq 0x8(%rsp), %rax
movq $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
jmp 0xdc1b9
movq 0x8(%rsp), %rdi
addq $0x28, %rdi
callq 0x76e00
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
movq $0x0, (%rax)
jmp 0xdc0a9
movq 0x8(%rsp), %rdi
callq 0x74cf0
testb $0x1, %al
jne 0xdc1c9
jmp 0xdc1d3
movq 0x8(%rsp), %rdi
callq 0x77c40
addq $0x28, %rsp
retq
nopl (%rax,%rax)