// File: /workspace/github_cpp_makefile_star2_O2/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 $0xa8, %rsp
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0x70(%rsp), %r15
pushq $0x9
popq %rcx
movq %r15, %rdi
callq 0x34150
movq (%r15), %r14
movq 0x8(%r15), %r13
leaq 0x50(%rsp), %r12
leaq 0x88(%rsp), %rbp
leaq 0x20d3a(%rip), %r15     # 0x78490
cmpq %r13, %r14
je 0x5784c
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
pushq $0x2
popq %rcx
callq 0x332a0
movq %rbp, %rdi
movq %r14, %rsi
pushq $0x3
popq %rdx
pushq $-0x1
popq %rcx
callq 0x332a0
movq %r12, %rdi
movq %r15, %rsi
callq 0x32220
testb %al, %al
je 0x57794
movq (%rbx), %rdi
jmp 0x577ca
movq %r12, %rdi
leaq 0x20d12(%rip), %rsi     # 0x784b0
callq 0x32220
testb %al, %al
je 0x577b0
movq (%rbx), %rdi
addq $0x20, %rdi
jmp 0x577ca
movq %r12, %rdi
leaq 0x20d16(%rip), %rsi     # 0x784d0
callq 0x32220
testb %al, %al
je 0x577eb
movq (%rbx), %rdi
addq $0x40, %rdi
movq %rbp, %rsi
callq 0x32060
movq %rbp, %rdi
callq 0x33a00
movq %r12, %rdi
callq 0x33a00
addq $0x20, %r14
jmp 0x57756
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
xorl %ecx, %ecx
movb %cl, 0x20(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
andq $0x0, 0x38(%rsp)
movb %cl, 0x40(%rsp)
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x32060
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0x32060
movq (%rbx), %rdi
addq $0x60, %rdi
leaq 0x10(%rsp), %rsi
callq 0x32380
leaq 0x10(%rsp), %rdi
callq 0x32d30
jmp 0x577d2
movq (%rbx), %rdi
callq 0x33a30
testb %al, %al
je 0x57874
leaq 0x70(%rsp), %rdi
callq 0x32810
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %r14
leaq 0x5b48(%rip), %rsi      # 0x5d3ce
leaq 0x10(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x31b30
leaq 0x5b4c(%rip), %rsi      # 0x5d3eb
leaq 0x50(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movq %r14, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x1d66c(%rip), %rsi     # 0x74f38
movq 0x1d6a5(%rip), %rdx     # 0x74f78
movq %r14, %rdi
callq 0x34c90
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x33a00
jmp 0x578f0
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x10(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x57904
jmp 0x57945
movq %rax, %rbx
movq %r14, %rdi
callq 0x327c0
jmp 0x57945
jmp 0x57921
jmp 0x5792b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x32d30
jmp 0x5792e
movq %rax, %rbx
jmp 0x57945
movq %rax, %rbx
jmp 0x5793b
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x33a00
leaq 0x50(%rsp), %rdi
callq 0x33a00
leaq 0x70(%rsp), %rdi
callq 0x32810
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop