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

    // disconnect socket
    m_commandSocket->DisconnectFromHost();
    m_dataSocket->DisconnectFromHost();

    // reset state - necessary??
    m_isUrlParsed = false;
    m_filePosition = -1;
    m_username = DEFAULT_USER;
    m_password = DEFAULT_PASS;
    m_dataHostname.clear();
    m_dataPort = 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x28c50
movq 0x38(%rbx), %rdi
callq 0x28c50
xorl %ebp, %ebp
movb %bpl, 0x110(%rbx)
movq $-0x1, 0x118(%rbx)
leaq 0xb0(%rbx), %rdi
leaq 0x27960(%rip), %rsi     # 0x6d6b8
callq 0x26b80
leaq 0xd0(%rbx), %rdi
leaq 0x2796d(%rip), %rsi     # 0x6d6d8
callq 0x26b80
movq $0x0, 0x70(%rbx)
movq 0x68(%rbx), %rax
movb %bpl, (%rax)
movw $0x0, 0x88(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::SendCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
bool BamFtp::SendCommand(const string& command, bool waitForReply) {

    // failure if not connected
    if ( !m_commandSocket->IsConnected() ) {
        SetErrorString("BamFtp::SendCommand", "command socket not connected");
        return false;
    }

    // write command to 'command socket'
    if ( WriteCommandSocket(command.c_str(), command.length()) == -1 ) {
        SetErrorString("BamFtp::SendCommand", "error writing to socket");
        // get actual error from command socket??
        return false;
    }

    // if we sent a command that receives a response
    if ( waitForReply )
        return ReceiveReply();

    // return success
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x27370
testb %al, %al
je 0x46439
movq (%r14), %rsi
movl 0x8(%r14), %edx
movq %rbx, %rdi
callq 0x26ef0
cmpq $-0x1, %rax
je 0x4648f
movb $0x1, %al
testb %bpl, %bpl
je 0x46503
movq %rbx, %rdi
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x27af0
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1062f(%rip), %rsi     # 0x56a78
leaq 0x1063b(%rip), %rdx     # 0x56a8b
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x105c1(%rip), %rsi     # 0x56a2b
leaq 0x105d6(%rip), %rdx     # 0x56a47
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x288c0
jmp 0x464e3
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x105d9(%rip), %rsi     # 0x56a78
leaq 0x105e5(%rip), %rdx     # 0x56a8b
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x105cc(%rip), %rsi     # 0x56a8c
leaq 0x105dc(%rip), %rdx     # 0x56aa3
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x288c0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x464f2
callq 0x27560
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x46501
callq 0x27560
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x46514
jmp 0x46528
jmp 0x4653c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4652b
callq 0x27560
jmp 0x4652b
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x4653f
callq 0x27560
jmp 0x4653f
movq %rax, %rbx
movq %rbx, %rdi
callq 0x28c20
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::Open(BamTools::IBamIODevice::OpenMode)
bool BamFtp::Open(const IBamIODevice::OpenMode mode) {

    // BamFtp only supports read-only access
    if ( mode != IBamIODevice::ReadOnly ) {
        SetErrorString("BamFtp::Open", "writing on this device is not supported");
        return false;
    }

    // initialize basic valid state
    m_mode = mode;
    m_filePosition = 0;

    // attempt connection to command & data sockets
    return ( ConnectCommandSocket() && ConnectDataSocket() );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
cmpl $0x1, %esi
jne 0x46de0
movl $0x1, 0x8(%rbx)
movq $0x0, 0x118(%rbx)
movq %rbx, %rdi
callq 0x26380
testb %al, %al
je 0x46e4d
movq %rbx, %rdi
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x28db0
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xfbef(%rip), %rsi      # 0x569df
leaq 0xfbf4(%rip), %rdx      # 0x569eb
leaq 0x20(%rsp), %rdi
callq 0x26750
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xfbdb(%rip), %rsi      # 0x569ec
leaq 0xfbfb(%rip), %rdx      # 0x56a13
movq %rsp, %rdi
callq 0x26750
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x288c0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x46e3e
callq 0x27560
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x46e4d
callq 0x27560
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x46e6f
callq 0x27560
jmp 0x46e6f
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x46e7e
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::Read(char*, unsigned int)
int64_t BamFtp::Read(char* data, const unsigned int numBytes) {

    // if BamHttp not in a valid state
    if ( !IsOpen() )
        return -1;

    // read until hit desired @numBytes
    int64_t bytesReadSoFar = 0;
    while ( bytesReadSoFar < numBytes ) {

        // calculate number of bytes we're going to try to read this iteration
        const size_t remainingBytes = ( numBytes - bytesReadSoFar );

        // if either disconnected somehow, or (more likely) we have seeked since last read
        if ( !m_dataSocket->IsConnected() ) {
            if ( !ConnectDataSocket() ) {
                // TODO: set error string
                return -1;
            }
        }

        // read bytes from data socket
        const int64_t socketBytesRead = ReadDataSocket(data+bytesReadSoFar, remainingBytes);
        if ( socketBytesRead < 0 ) // error
            return -1;
        else if ( socketBytesRead == 0 ) // EOF
            return bytesReadSoFar;
        bytesReadSoFar += socketBytesRead;
        m_filePosition += socketBytesRead;
    }

    // return actual number bytes successfully read
    return bytesReadSoFar;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
callq *0x50(%rax)
movq $-0x1, %r12
testb %al, %al
je 0x46f0c
movl %ebx, %r13d
xorl %ebp, %ebp
cmpq %r13, %rbp
jge 0x46f09
movq 0x38(%r15), %rdi
callq 0x27370
testb %al, %al
jne 0x46ecd
movq %r15, %rdi
callq 0x28db0
testb %al, %al
je 0x46ef3
leaq (%r14,%rbp), %rsi
movl %ebx, %edx
subl %ebp, %edx
movq 0x38(%r15), %rdi
callq 0x26bd0
testq %rax, %rax
js 0x46ef3
je 0x46efe
addq %rax, %rbp
addq %rax, 0x118(%r15)
movb $0x1, %al
jmp 0x46f03
movq $-0x1, %r12
xorl %eax, %eax
jmp 0x46f03
xorl %eax, %eax
movq %rbp, %r12
testb %al, %al
jne 0x46eaf
jmp 0x46f0c
movq %rbp, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::Seek(long const&, int)
bool BamFtp::Seek(const int64_t& position, const int origin) {

    // if FTP device not in a valid state
    if ( !IsOpen() ) {
        // TODO: set error string
        return false;
    }

    // ----------------------
    // UGLY !! but works??
    // ----------------------
    // disconnect from server
    m_dataSocket->DisconnectFromHost();
    m_commandSocket->DisconnectFromHost();

    // update file position & return success
    if ( origin == SEEK_CUR )
        m_filePosition += position;
    else if ( origin == SEEK_SET)
        m_filePosition = position;
    else {
        // TODO: set error string
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x46f6f
movq 0x38(%rbx), %rdi
callq 0x28c50
movq 0x30(%rbx), %rdi
callq 0x28c50
testl %ebp, %ebp
je 0x46f73
cmpl $0x1, %ebp
jne 0x46f6f
movq (%r14), %rax
addq %rax, 0x118(%rbx)
jmp 0x46f7d
xorl %eax, %eax
jmp 0x46f7f
movq (%r14), %rax
movq %rax, 0x118(%rbx)
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::WriteCommandSocket(char const*, unsigned int)
int64_t BamFtp::WriteCommandSocket(const char* data, const unsigned int numBytes) {
    if ( !m_commandSocket->IsConnected() )
        return -1;
    m_commandSocket->ClearBuffer();
    return m_commandSocket->Write(data, numBytes);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq 0x30(%rdi), %rdi
callq 0x27370
testb %al, %al
je 0x46fba
movq 0x30(%r15), %rdi
callq 0x28c60
movq 0x30(%r15), %rdi
movq %r14, %rsi
movl %ebx, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x26af0
movq $-0x1, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::Write(char const*, unsigned int)
int64_t BamFtp::Write(const char* data, const unsigned int numBytes) {
    (void)data;
    (void)numBytes;
    BT_ASSERT_X(false, "BamFtp::Write : write-mode not supported on this device");
    SetErrorString("BamFtp::Write", "write-mode not supported on this device");
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xfaa0(%rip), %rsi      # 0x56aa4
leaq 0xfaa6(%rip), %rdx      # 0x56ab1
leaq 0x20(%rsp), %rdi
callq 0x26750
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xfa8d(%rip), %rsi      # 0x56ab2
leaq 0xfaad(%rip), %rdx      # 0x56ad9
movq %rsp, %rdi
callq 0x26750
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x288c0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x47052
callq 0x27560
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x47061
callq 0x27560
movq $-0x1, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x47088
callq 0x27560
jmp 0x47088
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x47097
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::WriteDataSocket(char const*, unsigned int)
int64_t BamFtp::WriteDataSocket(const char* data, const unsigned int numBytes) {
    (void)data;
    (void)numBytes;
    BT_ASSERT_X(false, "BamFtp::WriteDataSocket: write-mode not supported on this device");
    SetErrorString("BamFtp::Write", "write-mode not supported on this device");
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xf9e8(%rip), %rsi      # 0x56aa4
leaq 0xf9ee(%rip), %rdx      # 0x56ab1
leaq 0x20(%rsp), %rdi
callq 0x26750
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xf9d5(%rip), %rsi      # 0x56ab2
leaq 0xf9f5(%rip), %rdx      # 0x56ad9
movq %rsp, %rdi
callq 0x26750
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x288c0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x4710a
callq 0x27560
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x47119
callq 0x27560
movq $-0x1, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x47140
callq 0x27560
jmp 0x47140
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x4714f
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::~BamHttp()
BamHttp::~BamHttp(void) {

    // close connection & clean up
    Close();
    if ( m_socket )
        delete m_socket;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x23a41(%rip), %rax     # 0x6af98
addq $0x10, %rax
movq %rax, (%rdi)
callq 0x26b30
movb $0x0, 0xa8(%rbx)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0xb0(%rbx)
movq $-0x1, 0xc0(%rbx)
movl $0x0, 0x8(%rbx)
movq 0x30(%rbx), %r14
testq %r14, %r14
je 0x475a1
movq %r14, %rdi
callq 0x26880
movq %r14, %rdi
callq 0x27560
movq 0x78(%rbx), %rdi
leaq 0x88(%rbx), %rax
cmpq %rax, %rdi
je 0x475b6
callq 0x27560
movq 0x58(%rbx), %rdi
leaq 0x68(%rbx), %rax
cmpq %rax, %rdi
je 0x475c8
callq 0x27560
movq 0x38(%rbx), %rdi
leaq 0x48(%rbx), %rax
cmpq %rax, %rdi
je 0x475da
callq 0x27560
movq 0x23937(%rip), %rax     # 0x6af18
addq $0x10, %rax
movq %rax, (%rbx)
movq 0x10(%rbx), %rdi
addq $0x20, %rbx
cmpq %rbx, %rdi
je 0x475ff
popq %rbx
popq %r14
popq %r15
jmp 0x27560
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r15
movq %r14, %rdi
callq 0x27560
jmp 0x47615
movq %rax, %r15
movq %rbx, %rdi
callq 0x29649
movq %r15, %rdi
callq 0x28c20
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::DisconnectSocket()
void BamHttp::DisconnectSocket(void) {

    // disconnect socket & clean up
    m_socket->DisconnectFromHost();
    ClearResponse();
    if ( m_request )  {
        delete m_request;
        m_request = 0;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x28c50
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x476d2
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0xa0(%rbx)
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x476ef
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x98(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::ConnectSocket()
bool BamHttp::ConnectSocket(void) {

    BT_ASSERT_X(m_socket, "null socket?");

    // any state checks, etc?
    if ( !m_socket->ConnectToHost(m_hostname, m_port, m_mode) ) {
        SetErrorString("BamHttp::ConnectSocket", m_socket->GetErrorString());
        return false;
    }

    // return success
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %r14
movq 0x30(%rdi), %rdi
leaq 0x38(%r14), %rsi
leaq 0x58(%r14), %rdx
movl 0x8(%r14), %ecx
callq 0x26b60
movl %eax, %ebx
testb %al, %al
jne 0x47777
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xf407(%rip), %rsi      # 0x56b30
leaq 0xf416(%rip), %rdx      # 0x56b46
movq %rsp, %rdi
callq 0x26750
movq 0x30(%r14), %rsi
leaq 0x20(%rsp), %rdi
callq 0x27b50
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x288c0
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x47769
callq 0x27560
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x47777
callq 0x27560
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4779e
callq 0x27560
jmp 0x4779e
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x477ac
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::Open(BamTools::IBamIODevice::OpenMode)
bool BamHttp::Open(const IBamIODevice::OpenMode mode) {

    // BamHttp only supports read-only access
    if ( mode != IBamIODevice::ReadOnly ) {
        SetErrorString("BamHttp::Open", "writing on this device is not supported");
        return false;
    }
    m_mode = mode;

    // attempt connection to socket
    if ( !ConnectSocket() ) {
        SetErrorString("BamHttp::Open", m_socket->GetErrorString());
        return false;
    }

    // initialize our file positions
    m_filePosition     = 0;
    m_fileEndPosition  = 0;
    m_rangeEndPosition = 0;

    // attempt to send initial request (just 'HEAD' to check connection)
    if ( !SendHeadRequest() ) {
        SetErrorString("BamHttp::Open", m_socket->GetErrorString());
        return false;
    }

    // clear response from HEAD request, not needed
    ClearResponse();

    // return success
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
cmpl $0x1, %esi
jne 0x47858
movl $0x1, 0x8(%rbx)
movq %rbx, %rdi
callq 0x28840
testb %al, %al
je 0x478d9
xorps %xmm0, %xmm0
movups %xmm0, 0xb0(%rbx)
movq $0x0, 0xc0(%rbx)
movq %rbx, %rdi
callq 0x27460
testb %al, %al
je 0x4791c
movq 0xa0(%rbx), %rdi
movb $0x1, %bpl
testq %rdi, %rdi
je 0x478cc
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0xa0(%rbx)
jmp 0x478cc
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xf2df(%rip), %rsi      # 0x56b47
leaq 0xf2e5(%rip), %rdx      # 0x56b54
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xf163(%rip), %rsi      # 0x569ec
leaq 0xf183(%rip), %rdx      # 0x56a13
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x288c0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x478bb
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x478ca
callq 0x27560
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xf25e(%rip), %rsi      # 0x56b47
leaq 0xf264(%rip), %rdx      # 0x56b54
leaq 0x8(%rsp), %rdi
callq 0x26750
movq 0x30(%rbx), %rsi
leaq 0x28(%rsp), %rdi
callq 0x27b50
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x288c0
jmp 0x4795d
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xf21b(%rip), %rsi      # 0x56b47
leaq 0xf221(%rip), %rdx      # 0x56b54
leaq 0x8(%rsp), %rdi
callq 0x26750
movq 0x30(%rbx), %rsi
leaq 0x28(%rsp), %rdi
callq 0x27b50
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x288c0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x478b6
jmp 0x478bb
jmp 0x4797a
jmp 0x479a5
jmp 0x479b9
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x4799e
jmp 0x479a8
jmp 0x479a5
jmp 0x479b9
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x479a8
callq 0x27560
jmp 0x479a8
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x479bc
callq 0x27560
jmp 0x479bc
movq %rax, %rbx
movq %rbx, %rdi
callq 0x28c20
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::Seek(long const&, int)
bool BamHttp::Seek(const int64_t& position, const int origin) {

    // if HTTP device not in a valid state
    if ( !IsOpen() ) {
        SetErrorString("BamHttp::Seek", "cannot seek on unopen connection");
        return false;
    }

    // reset the connection
    DisconnectSocket();
    if ( !ConnectSocket() ) {
        SetErrorString("BamHttp::Seek", m_socket->GetErrorString());
        return false;
    }

    // udpate file position
    switch ( origin ) {
        case SEEK_CUR : m_filePosition += position; break;
        case SEEK_SET : m_filePosition  = position; break;
        default :
            SetErrorString("BamHttp::Seek", "unsupported seek origin");
            return false;
    }

    // return success
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x487ca
movq %rbx, %rdi
callq 0x26b30
movq %rbx, %rdi
callq 0x28840
testb %al, %al
je 0x48849
testl %ebp, %ebp
je 0x4889a
cmpl $0x1, %ebp
jne 0x488a8
movq (%r14), %rax
addq %rax, 0xb0(%rbx)
jmp 0x488a4
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xe3f8(%rip), %rsi      # 0x56bd2
leaq 0xe3fe(%rip), %rdx      # 0x56bdf
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xe3e5(%rip), %rsi      # 0x56be0
leaq 0xe3fe(%rip), %rdx      # 0x56c00
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x288c0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4882d
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x4883c
callq 0x27560
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xe379(%rip), %rsi      # 0x56bd2
leaq 0xe37f(%rip), %rdx      # 0x56bdf
leaq 0x8(%rsp), %rdi
callq 0x26750
movq 0x30(%rbx), %rsi
leaq 0x28(%rsp), %rdi
callq 0x27b50
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x288c0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x48828
jmp 0x4882d
movq (%r14), %rax
movq %rax, 0xb0(%rbx)
movb $0x1, %al
jmp 0x4883e
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xe31a(%rip), %rsi      # 0x56bd2
leaq 0xe320(%rip), %rdx      # 0x56bdf
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xe328(%rip), %rsi      # 0x56c01
leaq 0xe338(%rip), %rdx      # 0x56c18
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x288c0
jmp 0x4881e
jmp 0x4891e
jmp 0x48932
jmp 0x48946
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x4892b
jmp 0x48935
jmp 0x48932
jmp 0x48946
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x48935
callq 0x27560
jmp 0x48935
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x48949
callq 0x27560
jmp 0x48949
movq %rax, %rbx
movq %rbx, %rdi
callq 0x28c20
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::WriteToSocket(char const*, unsigned int)
int64_t BamHttp::WriteToSocket(const char* data, const unsigned int numBytes) {
    if ( !m_socket->IsConnected() )
        return -1;
    m_socket->ClearBuffer();
    return m_socket->Write(data, numBytes);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq 0x30(%rdi), %rdi
callq 0x27370
testb %al, %al
je 0x48988
movq 0x30(%r15), %rdi
callq 0x28c60
movq 0x30(%r15), %rdi
movq %r14, %rsi
movl %ebx, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x26af0
movq $-0x1, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::Write(char const*, unsigned int)
int64_t BamHttp::Write(const char* data, const unsigned int numBytes) {
    (void)data;
    (void)numBytes;
    BT_ASSERT_X(false, "BamHttp::Write : write-mode not supported on this device");
    SetErrorString("BamHttp::Write", "write-mode not supported on this device");
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xe278(%rip), %rsi      # 0x56c4a
leaq 0xe27f(%rip), %rdx      # 0x56c58
leaq 0x20(%rsp), %rdi
callq 0x26750
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xe0bf(%rip), %rsi      # 0x56ab2
leaq 0xe0df(%rip), %rdx      # 0x56ad9
movq %rsp, %rdi
callq 0x26750
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x288c0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x48a20
callq 0x27560
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x48a2f
callq 0x27560
movq $-0x1, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x48a56
callq 0x27560
jmp 0x48a56
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x48a65
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x48efb
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x48eb2
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
cmpl $0x2, %eax
jne 0x48eb2
movq %rbx, %rdi
callq 0x27bc0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x265b0
movq 0x18(%rbx), %rdi
movq 0x30(%rbx), %rsi
movq (%rdi), %rcx
movl %eax, %edx
callq *0x40(%rcx)
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x48ecb
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x18(%rbx)
movq 0x20(%rbx), %rdi
movq 0x28(%rbx), %rdx
xorl %esi, %esi
callq 0x26bc0
movq 0x30(%rbx), %rdi
movq 0x38(%rbx), %rdx
xorl %esi, %esi
callq 0x26bc0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movb $0x1, 0x10(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpb $0x1f, (%rdi)
jne 0x48f31
cmpb $-0x75, 0x1(%rdi)
jne 0x48f31
cmpb $0x8, 0x2(%rdi)
jne 0x48f31
testb $0x4, 0x3(%rdi)
je 0x48f31
cmpw $0x6, 0xa(%rdi)
jne 0x48f31
cmpb $0x42, 0xc(%rdi)
jne 0x48f31
cmpb $0x43, 0xd(%rdi)
jne 0x48f31
cmpw $0x2, 0xe(%rdi)
sete %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x27180
movq %r14, %rdi
callq 0x272b0
movq %rax, 0x18(%rbx)
movq (%rax), %rcx
movq %rax, %rdi
movl %ebp, %esi
callq *0x20(%rcx)
testb %al, %al
je 0x49aa7
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rbx), %rsi
movq (%rsi), %rax
leaq 0x48(%rsp), %rdi
callq *0x48(%rax)
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xd39d(%rip), %rsi      # 0x56e63
leaq 0xd3b4(%rip), %rdx      # 0x56e81
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x29130
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x49afa
callq 0x27560
movl $0x28, %edi
callq 0x269d0
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0xd36c(%rip), %rsi      # 0x56e82
leaq 0xd375(%rip), %rdx      # 0x56e92
callq 0x26750
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r14, %rdi
callq 0x28490
xorl %ebp, %ebp
movq 0x213f8(%rip), %rsi     # 0x6af38
movq 0x21431(%rip), %rdx     # 0x6af78
movq %r14, %rdi
callq 0x28a30
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x49b69
callq 0x27560
jmp 0x49b69
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x49b76
movq %r14, %rdi
callq 0x27070
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x49b93
jmp 0x49b9d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x49b9d
callq 0x27560
jmp 0x49b9d
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x49bb0
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BgzfStream_p.cpp
// Function: BamTools::Internal::BgzfStream::Read(char*, unsigned long)
size_t BgzfStream::Read(char* data, const size_t dataLength) {

    if ( dataLength == 0 )
        return 0;

    // if stream not open for reading
    BT_ASSERT_X( m_device, "BgzfStream::Read() - trying to read from null device");
    if ( !m_device->IsOpen() || (m_device->Mode() != IBamIODevice::ReadOnly) )
        return 0;

    // read blocks as needed until desired data length is retrieved
    char* output = data;
    size_t numBytesRead = 0;
    while ( numBytesRead < dataLength ) {

        // determine bytes available in current block
        int bytesAvailable = m_blockLength - m_blockOffset;

        // read (and decompress) next block if needed
        if ( bytesAvailable <= 0 ) {
            ReadBlock();
            bytesAvailable = m_blockLength - m_blockOffset;
            if ( bytesAvailable <= 0 )
                break;
        }

        // copy data from uncompressed source buffer into data destination buffer
        const size_t copyLength = min( (dataLength-numBytesRead), (size_t)bytesAvailable );
        memcpy(output, m_uncompressedBlock.Buffer + m_blockOffset, copyLength);

        // update counters
        m_blockOffset += copyLength;
        output        += copyLength;
        numBytesRead  += copyLength;
    }

    // update block data
    if ( m_blockOffset == m_blockLength ) {
        m_blockAddress = m_device->Tell();
        m_blockOffset  = 0;
        m_blockLength  = 0;
    }

    // return actual number of bytes read
    return numBytesRead;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x49c42
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x49c42
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
cmpl $0x1, %eax
jne 0x49c42
xorl %r14d, %r14d
movq %r15, %rbp
subq %r14, %rbp
jbe 0x49c57
movl (%rbx), %eax
subl 0x4(%rbx), %eax
jg 0x49c0f
movq %rbx, %rdi
callq 0x26830
movl (%rbx), %eax
subl 0x4(%rbx), %eax
jle 0x49c3e
movl %eax, %r13d
cmpq %r13, %rbp
cmovbq %rbp, %r13
movslq 0x4(%rbx), %rsi
addq 0x20(%rbx), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x27260
addl %r13d, 0x4(%rbx)
addq %r13, %r12
addq %r13, %r14
movb $0x1, %al
testb %al, %al
jne 0x49bf1
jmp 0x49c57
xorl %eax, %eax
jmp 0x49c38
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rbx), %eax
cmpl (%rbx), %eax
jne 0x49c45
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
callq *0x38(%rax)
movq %rax, 0x8(%rbx)
movq $0x0, (%rbx)
jmp 0x49c45
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/BgzfStream_p.cpp
// Function: BamTools::Internal::BgzfStream::Seek(long const&)
void BgzfStream::Seek(const int64_t& position) {

    BT_ASSERT_X( m_device, "BgzfStream::Seek() - trying to seek on null IO device");

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

    // determine adjusted offset & address
    int     blockOffset  = (position & 0xFFFF);
    int64_t blockAddress = (position >> 16) & 0xFFFFFFFFFFFFLL;

    // attempt seek in file
    if ( m_device->IsRandomAccess() && m_device->Seek(blockAddress) ) {

        // update block data & return success
        m_blockLength  = 0;
        m_blockAddress = blockAddress;
        m_blockOffset  = blockOffset;
    }
    else {
        stringstream s("");
        s << "unable to seek to position: " << position;
        throw BamException("BgzfStream::Seek", s.str());
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x4a16e
movq %rsi, %rbx
movq (%rdi), %rax
callq *0x50(%rax)
testb %al, %al
je 0x4a16e
movq (%rbx), %r15
movq %r15, %rax
shrq $0x10, %rax
movq %rax, 0x8(%rsp)
movq 0x18(%r14), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
je 0x4a17c
movq 0x18(%r14), %rdi
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
xorl %edx, %edx
callq *0x30(%rax)
testb %al, %al
je 0x4a17c
movzwl %r15w, %eax
movl $0x0, (%r14)
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%r14)
movl %eax, 0x4(%r14)
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xbd03(%rip), %rdx      # 0x55e8f
leaq 0x10(%rsp), %rdi
movq %rdx, %rsi
callq 0x26750
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0x18, %edx
callq 0x28750
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x4a1bc
callq 0x27560
leaq 0x60(%rsp), %r14
leaq 0xcd38(%rip), %rsi      # 0x56f00
movl $0x1c, %edx
movq %r14, %rdi
callq 0x27a70
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x27570
movl $0x28, %edi
callq 0x269d0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
movq %r15, (%rdi)
leaq 0xcd21(%rip), %rsi      # 0x56f1d
leaq 0xcd2a(%rip), %rdx      # 0x56f2d
callq 0x26750
leaq 0x68(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x28740
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x28490
xorl %ebp, %ebp
movq 0x20d03(%rip), %rsi     # 0x6af38
movq 0x20d3c(%rip), %rdx     # 0x6af78
movq %rbx, %rdi
callq 0x28a30
movq %rax, %r14
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a262
callq 0x27560
jmp 0x4a262
movq %rax, %r14
movb $0x1, %bpl
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x4a279
callq 0x27560
jmp 0x4a279
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x4a28b
movq %rbx, %rdi
callq 0x27070
jmp 0x4a28b
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x270d0
jmp 0x4a2b6
movq %rax, %rdi
callq 0x2f0bd
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x4a2b6
callq 0x27560
jmp 0x4a2b6
movq %rax, %r14
movq %r14, %rdi
callq 0x28c20
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x4a372
movq %rdx, %rbx
movq %rsi, %r14
movq (%rdi), %rax
callq *0x50(%rax)
xorb $0x1, %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x4a372
xorl %r12d, %r12d
movslq 0x4(%r15), %rdi
movl $0x10000, %eax          # imm = 0x10000
subq %rdi, %rax
movq %rbx, %rbp
subq %r12, %rbp
cmpq %rax, %rbp
cmovaeq %rax, %rbp
addq 0x20(%r15), %rdi
movl %ebp, %r13d
movq %r14, %rsi
movq %r13, %rdx
callq 0x27260
addl 0x4(%r15), %ebp
movl %ebp, 0x4(%r15)
cmpl $0x10000, %ebp          # imm = 0x10000
jne 0x4a365
movq %r15, %rdi
callq 0x27bc0
addq %r13, %r14
addq %r13, %r12
cmpq %rbx, %r12
jb 0x4a322
jmp 0x4a375
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rax
movq 0x8(%rdi), %r8
subq (%rdi), %r8
testq %rcx, %rcx
cmovneq %rcx, %r8
cmpq %rdx, %r8
jbe 0x4a4ba
movq (%rdi), %r9
movq 0x8(%rdi), %rcx
subq %r9, %rcx
movq %rdx, %rax
cmpq %rax, %rcx
jbe 0x4a4c3
cmpb %sil, (%r9,%rax)
je 0x4a4c1
incq %rax
cmpq %rax, %r8
jne 0x4a4a7
movq 0x8(%rdi), %rax
subq (%rdi), %rax
popq %rcx
retq
cmpq %rcx, %rdx
cmovbeq %rcx, %rdx
leaq 0xadd1(%rip), %rdi      # 0x552a2
movq %rdx, %rsi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x284f0
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rcx
movq 0x8(%rdi), %r15
subq %rcx, %r15
cmpq %rsi, %r15
jbe 0x4a525
movq %rdx, %r14
leaq (%rdx,%rsi), %rax
movq %r15, %rdx
subq %rax, %rdx
jbe 0x4a51b
addq %rcx, %rsi
addq %rcx, %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x287d0
subq %r14, %r15
movq %r15, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x29070
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
xorl %eax, %eax
movb (%rsi,%rax), %cl
movb %cl, 0x8(%rdi,%rax)
incq %rax
cmpq $0x10, %rax
jne 0x4ab64
movl $0x1, (%rdi)
movb $0x1, 0x38(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
movl (%rdi), %ecx
movl (%rsi), %eax
cmpl $0x1, %ecx
je 0x4acc5
testl %ecx, %ecx
jne 0x4ace3
movl 0x4(%rsi), %ecx
xorl 0x4(%rdi), %ecx
orl %ecx, %eax
jmp 0x4ace5
cmpl $0x1, %eax
jne 0x4ace9
movdqu 0x8(%rdi), %xmm0
movdqu 0x8(%rsi), %xmm1
pcmpeqb %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jmp 0x4ace5
cmpl %eax, %ecx
sete %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
movl (%rdi), %eax
cmpl $0x1, %eax
je 0x4ad06
testl %eax, %eax
jne 0x4ad41
cmpl $0x0, (%rsi)
jne 0x4ad41
movl 0x4(%rdi), %eax
cmpl 0x4(%rsi), %eax
setb %al
retq
cmpl $0x1, (%rsi)
jne 0x4ad41
movq 0x8(%rdi), %rcx
bswapq %rcx
movq 0x8(%rsi), %rdx
bswapq %rdx
cmpq %rdx, %rcx
jne 0x4ad33
movq 0x10(%rdi), %rcx
movq 0x10(%rsi), %rdx
bswapq %rcx
bswapq %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
je 0x4ad3d
xorl %eax, %eax
cmpq %rdx, %rcx
sbbl %eax, %eax
orl $0x1, %eax
shrl $0x1f, %eax
retq
cmpl (%rsi), %eax
setl %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/io/HostAddress_p.cpp
// Function: BamTools::Internal::HostAddress::GetIPString[abi:cxx11]() const
std::string HostAddress::GetIPString(void) const {

    stringstream ss("");

    // IPv4 format
    if ( m_protocol == HostAddress::IPv4Protocol ) {
        ss << ( (m_ip4Address>>24) & 0xff ) << '.'
           << ( (m_ip4Address>>16) & 0xff ) << '.'
           << ( (m_ip4Address>> 8) & 0xff ) << '.'
           << (  m_ip4Address      & 0xff );

    }

    // IPv6 format
    else if ( m_protocol == HostAddress::IPv6Protocol ) {
        for ( uint8_t i = 0; i < 8; ++i ) {
            if ( i != 0 )
                ss << ':';
                ss << hex << ( (uint16_t(m_ip6Address[2*i]) << 8) |
                               (uint16_t(m_ip6Address[2*i+1]))
                             );
        }
    }

    // return result (empty string if unknown protocol)
    return ss.str();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xb0df(%rip), %rdx      # 0x55e8f
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x26750
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x18, %edx
callq 0x28750
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4ade0
callq 0x27560
movl (%r14), %eax
testl %eax, %eax
je 0x4ae4e
cmpl $0x1, %eax
jne 0x4aec3
leaq 0x38(%rsp), %r15
xorl %r13d, %r13d
leaq 0x8(%rsp), %r12
testq %r13, %r13
je 0x4ae17
movb $0x3a, 0x8(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x27a70
movq 0x38(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x50(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x50(%rsp,%rax)
movzwl 0x8(%r14,%r13,2), %eax
rolw $0x8, %ax
movzwl %ax, %esi
movq %r15, %rdi
callq 0x28aa0
incq %r13
cmpq $0x8, %r13
jne 0x4adfd
jmp 0x4aec3
leaq 0x38(%rsp), %rdi
movzbl 0x7(%r14), %esi
callq 0x26fb0
leaq 0x8(%rsp), %rsi
movb $0x2e, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x27a70
movzbl 0x6(%r14), %esi
movq %rax, %rdi
callq 0x26fb0
leaq 0x8(%rsp), %rsi
movb $0x2e, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x27a70
movzbl 0x5(%r14), %esi
movq %rax, %rdi
callq 0x26fb0
leaq 0x8(%rsp), %rsi
movb $0x2e, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x27a70
movzbl 0x4(%r14), %esi
movq %rax, %rdi
callq 0x26fb0
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x28740
leaq 0x28(%rsp), %rdi
callq 0x270d0
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4af16
callq 0x27560
jmp 0x4af16
movq %rax, %rbx
jmp 0x4af16
jmp 0x4af09
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x270d0
movq %rbx, %rdi
callq 0x28c20
movq %rax, %rdi
callq 0x2f0bd
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
movq %rsp, %r14
movq %r14, %rdi
movl $0x2e, %edx
callq 0x4b4af
movq (%r14), %r13
movq 0x8(%r14), %r14
subq %r13, %r14
xorl %r12d, %r12d
movl $0x0, %r15d
cmpq $0x80, %r14
jne 0x4b462
sarq $0x5, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpq %r14, %rbp
je 0x4b480
movq %rbp, %rcx
shlq $0x5, %rcx
leaq (%rcx,%r13), %rax
movq 0x8(%r13,%rcx), %rcx
testq %rcx, %rcx
je 0x4b41d
movq (%rax), %rdx
xorl %esi, %esi
movsbl (%rdx,%rsi), %edi
addl $-0x30, %edi
cmpl $0xa, %edi
jae 0x4b43b
incq %rsi
cmpq %rsi, %rcx
jne 0x4b409
movq (%rax), %rdi
callq 0x28650
movl %r12d, %ecx
shll $0x8, %ecx
addl %eax, %ecx
cmpl $0x100, %eax            # imm = 0x100
setb %al
cmovbl %ecx, %r12d
jmp 0x4b43d
xorl %eax, %eax
testb %al, %al
je 0x4b456
cmpq $0x3, %rbp
leaq 0x1(%rbp), %rax
setae %r15b
movq %rax, %rbp
cmpq $0x4, %rax
jne 0x4b3e6
testb $0x1, %r15b
je 0x4b462
movl %r12d, (%rbx)
movb $0x1, %r15b
movq %rsp, %rdi
callq 0x270a0
andb $0x1, %r15b
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9e1b(%rip), %rdi      # 0x552a2
movq %r14, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x284f0
movq %rax, %rbx
movq %rsp, %rdi
callq 0x270a0
movq %rbx, %rdi
callq 0x28c20
movq %rax, %rdi
callq 0x2f0bd