// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/BamHttp_p.cpp
// Function: BamTools::Internal::BamHttp::ReceiveResponse()
bool BamHttp::ReceiveResponse(void) {

    // fetch header, up until double new line
    string responseHeader;
    do {

        // make sure we can read a line
        if ( !m_socket->WaitForReadLine() )
            return false;

        // read line & append to full header
        const string headerLine = m_socket->ReadLine();
        responseHeader += headerLine;

    } while ( !endsWith(responseHeader, DOUBLE_NEWLINE) );

    // sanity check
    if ( responseHeader.empty() ) {
        SetErrorString("BamHttp::ReceiveResponse", "empty HTTP response");
        Close();
        return false;
    }

    // create response from header text
    m_response = new HttpResponseHeader(responseHeader);
    if ( !m_response->IsValid() ) {
        SetErrorString("BamHttp::ReceiveResponse", "could not parse HTTP response");
        Close();
        return false;
    }

    // if we get here, success
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x10(%rsp), %r14
leaq 0x50(%rsp), %r15
leaq 0x28789(%rip), %r12     # 0x782e0
movq 0x30(%rbx), %rdi
callq 0x31740
testb %al, %al
je 0x4fc94
movq 0x30(%rbx), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x32730
movq %r15, %rdi
movq %r14, %rsi
callq 0x35680
movq %r14, %rdi
callq 0x33a00
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x35770
movq 0x58(%rsp), %rcx
movq %rcx, %rdx
subq 0x28743(%rip), %rdx     # 0x782e8
cmpq %rdx, %rax
jne 0x4fb57
testq %rcx, %rcx
je 0x4fc39
pushq $0x68
popq %rdi
callq 0x33130
movq %rax, %r14
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x325c0
movq %r14, 0xa0(%rbx)
movq %r14, %rdi
callq 0x31c70
movb $0x1, %bpl
testb %al, %al
jne 0x4fc96
leaq 0xcfca(%rip), %rsi      # 0x5cbb6
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0xcfe1(%rip), %rsi      # 0x5cbe3
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x30(%rsp), %rdi
callq 0x33a00
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4fc8b
leaq 0xcf76(%rip), %rsi      # 0x5cbb6
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0xcf79(%rip), %rsi      # 0x5cbcf
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x31b30
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x34ab0
leaq 0x30(%rsp), %rdi
callq 0x33a00
leaq 0x10(%rsp), %rdi
callq 0x33a00
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
xorl %ebp, %ebp
leaq 0x50(%rsp), %rdi
callq 0x33a00
movl %ebp, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4fcd2
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x4fcf0
jmp 0x4fd0f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4fd12
movq %rax, %rbx
movq %r14, %rdi
callq 0x32fa0
jmp 0x4fd12
jmp 0x4fd0f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4fd12
jmp 0x4fd0f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4fd12
jmp 0x4fd0f
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f