// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x18(%rsp), %r13
leaq 0x8(%rsp), %r14
leaq 0x48(%rsp), %r15
movq 0x30(%rbx), %rdi
callq 0x264d0
testb %al, %al
je 0x48620
movq 0x30(%rbx), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x27020
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x265d0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x484f2
callq 0x27560
movq 0x2533f(%rip), %rsi     # 0x6d838
movq 0x25340(%rip), %rcx     # 0x6d840
movq %r15, %rdi
xorl %edx, %edx
callq 0x28af0
movq 0x50(%rsp), %rcx
movq %rcx, %rdx
subq 0x25327(%rip), %rdx     # 0x6d840
cmpq %rdx, %rax
jne 0x484b2
testq %rcx, %rcx
je 0x485ab
movl $0x68, %edi
callq 0x276b0
movq %rax, %r14
leaq 0x48(%rsp), %rsi
movq %rax, %rdi
callq 0x26ee0
movq %r14, 0xa0(%rbx)
movq %r14, %rdi
callq 0x26850
movb $0x1, %bpl
testb %al, %al
jne 0x48622
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0xe61d(%rip), %rsi      # 0x56b87
leaq 0xe62e(%rip), %rdx      # 0x56b9f
callq 0x26750
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xe62e(%rip), %rsi      # 0x56bb4
leaq 0xe644(%rip), %rdx      # 0x56bd1
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x288b0
jmp 0x485f9
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0xe5cd(%rip), %rsi      # 0x56b87
leaq 0xe5de(%rip), %rdx      # 0x56b9f
callq 0x26750
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xe5ca(%rip), %rsi      # 0x56ba0
leaq 0xe5d6(%rip), %rdx      # 0x56bb3
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x288b0
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x48608
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x48617
callq 0x27560
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
xorl %ebp, %ebp
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x48631
callq 0x27560
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x48648
jmp 0x4866a
jmp 0x48680
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x4866d
callq 0x27560
jmp 0x4866d
jmp 0x4866a
jmp 0x48680
movq %rax, %rbx
movq %r14, %rdi
jmp 0x48677
jmp 0x48680
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x48683
callq 0x27560
jmp 0x48683
jmp 0x48680
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x48692
callq 0x27560
movq %rbx, %rdi
callq 0x28c10