// File: /workspace/github_cpp_makefile_star2_O1/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 0x486fc
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 0x485ce
callq 0x27560
movq 0x2526b(%rip), %rsi     # 0x6d840
movq 0x2526c(%rip), %rcx     # 0x6d848
movq %r15, %rdi
xorl %edx, %edx
callq 0x28b00
movq 0x50(%rsp), %rcx
movq %rcx, %rdx
subq 0x25253(%rip), %rdx     # 0x6d848
cmpq %rdx, %rax
jne 0x4858e
testq %rcx, %rcx
je 0x48687
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 0x486fe
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0xe541(%rip), %rsi      # 0x56b87
leaq 0xe552(%rip), %rdx      # 0x56b9f
callq 0x26750
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xe552(%rip), %rsi      # 0x56bb4
leaq 0xe568(%rip), %rdx      # 0x56bd1
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x288c0
jmp 0x486d5
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0xe4f1(%rip), %rsi      # 0x56b87
leaq 0xe502(%rip), %rdx      # 0x56b9f
callq 0x26750
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xe4ee(%rip), %rsi      # 0x56ba0
leaq 0xe4fa(%rip), %rdx      # 0x56bb3
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x288c0
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x486e4
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x486f3
callq 0x27560
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
xorl %ebp, %ebp
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x4870d
callq 0x27560
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x48724
jmp 0x48746
jmp 0x4875c
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x48749
callq 0x27560
jmp 0x48749
jmp 0x48746
jmp 0x4875c
movq %rax, %rbx
movq %r14, %rdi
jmp 0x48753
jmp 0x4875c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x4875f
callq 0x27560
jmp 0x4875f
jmp 0x4875c
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x4876e
callq 0x27560
movq %rbx, %rdi
callq 0x28c20