// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/io/HttpHeader_p.cpp
// Function: BamTools::Internal::HttpHeader::Parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void HttpHeader::Parse(const string& s) {

    // trim whitespace from input string
    const string trimmed = Trim(s);

    // split into list of header lines
    vector<string> rawFields = Split(trimmed, Constants::NEWLINE_CHAR);

    // prep our 'cleaned' fields container
    vector<string> cleanFields;
    cleanFields.reserve(rawFields.size());

    // remove any empty fields and clean any trailing windows-style carriage returns ('\r')
    vector<string>::iterator rawFieldIter = rawFields.begin();
    vector<string>::iterator rawFieldEnd  = rawFields.end();
    for ( ; rawFieldIter != rawFieldEnd; ++rawFieldIter ) {
        string& field = (*rawFieldIter);

        // skip empty fields
        if ( field.empty() )
            continue;

        // remove carriage returns
        const size_t fieldSize = field.size();
        if ( field[fieldSize-1] == Constants::CAR_RET_CHAR )
            field.resize(fieldSize-1);

        // store cleaned field
        cleanFields.push_back(field);
    }

    // skip add'l processing if nothing here
    if ( cleanFields.empty() )
        return;

    // parse header lines
    int lineNumber = 0;
    vector<string>::const_iterator fieldIter = cleanFields.begin();
    vector<string>::const_iterator fieldEnd  = cleanFields.end();
    for ( ; fieldIter != fieldEnd; ++fieldIter, ++lineNumber ) {
        if ( !ParseLine( (*fieldIter), lineNumber ) ) {
            m_isValid = false;
            return;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, %rbx
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x537ca
leaq 0x60(%rsp), %rdi
pushq $0x18
popq %rdx
movq %r14, %rsi
callq 0x34880
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorps %xmm0, %xmm0
movq %rsp, %r14
andq $0x0, 0x10(%r14)
movaps %xmm0, (%r14)
leaq 0x60(%rsp), %r15
leaq 0x20(%rsp), %r12
pushq $0xa
popq %rbp
movq %r15, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x35260
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x535ce
movq %r14, %rdi
movq %r12, %rsi
callq 0x31f80
jmp 0x535a6
leaq 0x20(%rsp), %rdi
callq 0x33a00
leaq 0x60(%rsp), %rdi
callq 0x32870
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq 0x8(%rsp), %rsi
subq (%rsp), %rsi
sarq $0x5, %rsi
callq 0x33a40
movq (%rsp), %r14
movq 0x8(%rsp), %r12
leaq 0x60(%rsp), %r15
cmpq %r12, %r14
je 0x53646
movq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0x53640
movq (%r14), %rax
cmpb $0xd, -0x1(%rax,%rsi)
jne 0x53635
decq %rsi
movq %r14, %rdi
callq 0x34000
movq %r15, %rdi
movq %r14, %rsi
callq 0x31f80
addq $0x20, %r14
jmp 0x53612
movq 0x60(%rsp), %r14
movq 0x68(%rsp), %r15
cmpq %r15, %r14
je 0x5367a
xorl %ebp, %ebp
cmpq %r15, %r14
je 0x5367a
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq *0x18(%rax)
testb %al, %al
je 0x53676
addq $0x20, %r14
incl %ebp
jmp 0x53657
movb $0x0, 0x38(%rbx)
leaq 0x60(%rsp), %rdi
callq 0x32810
movq %rsp, %rdi
callq 0x32810
leaq 0x40(%rsp), %rdi
callq 0x33a00
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x536c6
jmp 0x536b9
movq %rax, %rbx
jmp 0x536e5
movq %rax, %rbx
jmp 0x536ef
jmp 0x536b9
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x32810
movq %rsp, %rdi
callq 0x32810
jmp 0x536ef
movq %rax, %rbx
movq %rsp, %rdi
callq 0x32810
leaq 0x20(%rsp), %rdi
callq 0x33a00
leaq 0x60(%rsp), %rdi
callq 0x32870
leaq 0x40(%rsp), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x34ed0
jmp 0x53703
movq %rax, %rdi
callq 0x39b2f
nop