// File: 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:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0x130(%rsp)
movq %rsi, 0x128(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x128(%rsp), %rsi
leaq 0x108(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0xd8180
movq 0x78(%rsp), %rsi
leaq 0xf0(%rsp), %rdi
movl $0xa, %edx
callq 0xd8350
jmp 0xd7c67
leaq 0xc8(%rsp), %rdi
callq 0x7b6e0
jmp 0xd7c76
leaq 0xf0(%rsp), %rdi
callq 0x7bb00
movq %rax, 0x68(%rsp)
jmp 0xd7c8a
movq 0x68(%rsp), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x78130
jmp 0xd7c9e
leaq 0xf0(%rsp), %rdi
callq 0x7aa40
movq %rax, 0x60(%rsp)
jmp 0xd7cb2
movq 0x60(%rsp), %rax
movq %rax, 0xc0(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x7ad60
movq %rax, 0x58(%rsp)
jmp 0xd7cd3
movq 0x58(%rsp), %rax
movq %rax, 0xb8(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x789b0
movb %al, 0x57(%rsp)
jmp 0xd7cfb
movb 0x57(%rsp), %al
testb $0x1, %al
jne 0xd7d08
jmp 0xd7e39
leaq 0xc0(%rsp), %rdi
callq 0x7c2c0
movq %rax, 0x48(%rsp)
jmp 0xd7d1c
movq 0x48(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x7aba0
movb %al, 0x47(%rsp)
jmp 0xd7d3c
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0xd7d46
jmp 0xd7da3
jmp 0xd7e25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
jmp 0xd7fd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
jmp 0xd7fc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x74e60
jmp 0xd7fc1
movq 0xb0(%rsp), %rdi
callq 0x74cd0
movq %rax, 0x38(%rsp)
jmp 0xd7db7
movq 0x38(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
decq %rsi
callq 0x7cb00
movq %rax, 0x30(%rsp)
jmp 0xd7de3
movq 0x30(%rsp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
jne 0xd7e0c
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
decq %rsi
callq 0x79090
jmp 0xd7e0a
jmp 0xd7e0c
movq 0xb0(%rsp), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x73a70
jmp 0xd7e23
jmp 0xd7e25
leaq 0xc0(%rsp), %rdi
callq 0x77490
jmp 0xd7e34
jmp 0xd7ce0
leaq 0xc8(%rsp), %rdi
callq 0x7b320
movb %al, 0x2f(%rsp)
jmp 0xd7e4c
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0xd7e56
jmp 0xd7e66
movl $0x1, 0xa4(%rsp)
jmp 0xd7f8e
movl $0x0, 0xa0(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x7aa40
movq %rax, 0x20(%rsp)
jmp 0xd7e85
movq 0x20(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x98(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x76ee0
jmp 0xd7ea9
leaq 0xc8(%rsp), %rdi
callq 0x7ad60
movq %rax, 0x18(%rsp)
jmp 0xd7ebd
movq 0x18(%rsp), %rax
movq %rax, 0x80(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x76ee0
jmp 0xd7ee1
jmp 0xd7ee3
leaq 0x98(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x750f0
movb %al, 0x17(%rsp)
jmp 0xd7efe
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0xd7f08
jmp 0xd7f83
leaq 0x98(%rsp), %rdi
callq 0x71410
movq %rax, 0x8(%rsp)
jmp 0xd7f1c
movq 0x8(%rsp), %rsi
movq 0x70(%rsp), %rdi
movl 0xa0(%rsp), %edx
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movb %al, 0x7(%rsp)
jmp 0xd7f3c
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0xd7f5c
jmp 0xd7f46
movq 0x70(%rsp), %rax
movb $0x0, 0x38(%rax)
movl $0x1, 0xa4(%rsp)
jmp 0xd7f8e
jmp 0xd7f5e
leaq 0x98(%rsp), %rdi
callq 0x75880
jmp 0xd7f6d
movl 0xa0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa0(%rsp)
jmp 0xd7ee3
movl $0x0, 0xa4(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x74e60
jmp 0xd7f9d
leaq 0xf0(%rsp), %rdi
callq 0x74e60
jmp 0xd7fac
leaq 0x108(%rsp), %rdi
callq 0x7cce8
addq $0x138, %rsp            # imm = 0x138
retq
jmp 0xd7fc3
leaq 0xf0(%rsp), %rdi
callq 0x74e60
jmp 0xd7fd2
jmp 0xd7fd4
leaq 0x108(%rsp), %rdi
callq 0x7cce8
jmp 0xd7fe3
jmp 0xd7fe5
movq 0xe8(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopw (%rax,%rax)