// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamFormatParser_p.cpp
// Function: BamTools::Internal::SamFormatParser::ParseHDLine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void SamFormatParser::ParseHDLine(const string& line) {

    // split HD lines into tokens
    vector<string> tokens = Split(line, Constants::SAM_TAB);

    // iterate over tokens
    vector<string>::const_iterator tokenIter = tokens.begin();
    vector<string>::const_iterator tokenEnd  = tokens.end();
    for ( ; tokenIter != tokenEnd; ++tokenIter ) {

        // get tag/value
        const string tokenTag = (*tokenIter).substr(0,2);
        const string tokenValue = (*tokenIter).substr(3);

        // set header contents
        if      ( tokenTag == Constants::SAM_HD_VERSION_TAG    ) m_header.Version    = tokenValue;
        else if ( tokenTag == Constants::SAM_HD_SORTORDER_TAG  ) m_header.SortOrder  = tokenValue;
        else if ( tokenTag == Constants::SAM_HD_GROUPORDER_TAG ) m_header.GroupOrder = tokenValue;
        else { // custom tag
            CustomHeaderTag otherTag;
            otherTag.TagName  = tokenTag;
            otherTag.TagValue = tokenValue;
            m_header.CustomTags.push_back(otherTag);
        }
    }

    // check for required tags
    if ( !m_header.HasVersion() )
        throw BamException("SamFormatParser::ParseHDLine", "@HD line is missing VN tag");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0x80(%rsp), %r15
movq %r15, %rdi
movl $0x9, %ecx
callq 0x28190
movq (%r15), %r14
movq 0x8(%r15), %rbp
cmpq %rbp, %r14
je 0x512b1
movq %rsp, %r12
leaq 0x60(%rsp), %r13
movl $0x2, %ecx
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x277f0
movl $0x3, %edx
movq %r13, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x277f0
movq 0x8(%rsp), %r15
cmpq 0x1c88d(%rip), %r15     # 0x6d9f0
jne 0x51189
testq %r15, %r15
je 0x51260
movq 0x1c873(%rip), %rsi     # 0x6d9e8
movq (%rsp), %rdi
movq %r15, %rdx
callq 0x277e0
testl %eax, %eax
je 0x51260
cmpq 0x1c880(%rip), %r15     # 0x6da10
jne 0x511b6
testq %r15, %r15
je 0x51265
movq 0x1c866(%rip), %rsi     # 0x6da08
movq (%rsp), %rdi
movq %r15, %rdx
callq 0x277e0
testl %eax, %eax
je 0x51265
cmpq 0x1c873(%rip), %r15     # 0x6da30
jne 0x511e3
testq %r15, %r15
je 0x5126e
movq 0x1c859(%rip), %rsi     # 0x6da28
movq (%rsp), %rdi
movq %r15, %rdx
callq 0x277e0
testl %eax, %eax
je 0x5126e
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x28(%rsp)
movb %cl, 0x30(%rsp)
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq %rcx, 0x48(%rsp)
movb %cl, 0x50(%rsp)
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x26b80
leaq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x26b80
movq (%rbx), %rdi
addq $0x60, %rdi
leaq 0x20(%rsp), %rsi
callq 0x26d60
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x5124a
callq 0x27560
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x5127d
callq 0x27560
jmp 0x5127d
movq (%rbx), %rdi
jmp 0x51275
movq (%rbx), %rdi
addq $0x20, %rdi
jmp 0x51275
movq (%rbx), %rdi
addq $0x40, %rdi
movq %r13, %rsi
callq 0x26b80
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x51291
callq 0x27560
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x512a4
callq 0x27560
addq $0x20, %r14
cmpq %rbp, %r14
jne 0x5112e
movq (%rbx), %rdi
callq 0x27cc0
testb %al, %al
je 0x512dc
leaq 0x80(%rsp), %rdi
callq 0x270a0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x269d0
movq %rax, %r14
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x60a5(%rip), %rsi      # 0x5739e
leaq 0x60ba(%rip), %rdx      # 0x573ba
leaq 0x20(%rsp), %rdi
callq 0x26750
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x60a0(%rip), %rsi      # 0x573bb
leaq 0x60b3(%rip), %rdx      # 0x573d5
movq %rsp, %rdi
callq 0x26750
movb $0x1, %bpl
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %r14, %rdi
callq 0x28480
xorl %ebp, %ebp
movq 0x19bf2(%rip), %rsi     # 0x6af38
movq 0x19c2b(%rip), %rdx     # 0x6af78
movq %r14, %rdi
callq 0x28a20
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x51366
callq 0x27560
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x51375
callq 0x27560
testb %bpl, %bpl
jne 0x51393
jmp 0x513e2
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x51393
callq 0x27560
jmp 0x51393
movq %rax, %rbx
movq %r14, %rdi
callq 0x27070
jmp 0x513e2
jmp 0x513a4
movq %rax, %rbx
jmp 0x513bb
movq %rax, %rbx
jmp 0x513e2
movq %rax, %rbx
jmp 0x513cf
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x273b0
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x513cf
callq 0x27560
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x513e2
callq 0x27560
leaq 0x80(%rsp), %rdi
callq 0x270a0
movq %rbx, %rdi
callq 0x28c10
movq %rax, %rdi
callq 0x2f047
nop