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

    SamProgram pg;

    // split string 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 token tag/value
        const string tokenTag = (*tokenIter).substr(0,2);
        const string tokenValue = (*tokenIter).substr(3);

        // set program record contents
        if      ( tokenTag == Constants::SAM_PG_ID_TAG              ) pg.ID = tokenValue;
        else if ( tokenTag == Constants::SAM_PG_NAME_TAG            ) pg.Name = tokenValue;
        else if ( tokenTag == Constants::SAM_PG_COMMANDLINE_TAG     ) pg.CommandLine = tokenValue;
        else if ( tokenTag == Constants::SAM_PG_PREVIOUSPROGRAM_TAG ) pg.PreviousProgramID = tokenValue;
        else if ( tokenTag == Constants::SAM_PG_VERSION_TAG         ) pg.Version = tokenValue;
        else { // custom tag
            CustomHeaderTag otherTag;
            otherTag.TagName  = tokenTag;
            otherTag.TagValue = tokenValue;
            pg.CustomTags.push_back(otherTag);
        }
    }

    // check for required tags
    if ( !pg.HasID() )
        throw BamException("SamFormatParser::ParsePGLine", "@PG line is missing ID tag");

    // store SAM program entry
    m_header.Programs.Add(pg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x340e0
leaq 0x58(%rsp), %rdi
pushq $0x9
popq %rcx
movq %rbx, %rdx
callq 0x34150
movq 0x58(%rsp), %r15
movq 0x60(%rsp), %rbx
leaq 0x70(%rsp), %rbp
leaq 0x90(%rsp), %r13
pushq $-0x1
popq %r14
leaq 0x206aa(%rip), %r12     # 0x787b0
cmpq %rbx, %r15
je 0x58236
movq %rbp, %rdi
movq %r15, %rsi
xorl %edx, %edx
pushq $0x2
popq %rcx
callq 0x332a0
movq %r13, %rdi
movq %r15, %rsi
pushq $0x3
popq %rdx
movq %r14, %rcx
callq 0x332a0
movq %rbp, %rdi
movq %r12, %rsi
callq 0x32220
leaq 0xd0(%rsp), %rdi
testb %al, %al
jne 0x581b3
movq %rbp, %rdi
leaq 0x2067f(%rip), %rsi     # 0x787d0
callq 0x32220
leaq 0xf0(%rsp), %rdi
testb %al, %al
jne 0x581b3
movq %rbp, %rdi
leaq 0x20624(%rip), %rsi     # 0x78790
callq 0x32220
leaq 0xb0(%rsp), %rdi
testb %al, %al
jne 0x581b3
movq %rbp, %rdi
leaq 0x20669(%rip), %rsi     # 0x787f0
callq 0x32220
leaq 0x110(%rsp), %rdi
testb %al, %al
jne 0x581b3
movq %rbp, %rdi
leaq 0x2066e(%rip), %rsi     # 0x78810
callq 0x32220
leaq 0x130(%rsp), %rdi
testb %al, %al
je 0x581d4
movq %r13, %rsi
callq 0x32060
movq %r13, %rdi
callq 0x33a00
movq %rbp, %rdi
callq 0x33a00
addq $0x20, %r15
jmp 0x58106
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
andq $0x0, 0x20(%rsp)
xorl %ecx, %ecx
movb %cl, 0x28(%rsp)
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
andq $0x0, 0x40(%rsp)
movb %cl, 0x48(%rsp)
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x32060
leaq 0x38(%rsp), %rdi
movq %r13, %rsi
callq 0x32060
leaq 0x150(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x32380
leaq 0x18(%rsp), %rdi
callq 0x32d30
jmp 0x581bb
leaq 0xb0(%rsp), %rdi
callq 0x31220
testb %al, %al
je 0x5828a
movl $0x108, %edi            # imm = 0x108
movq 0x10(%rsp), %rax
addq (%rax), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x33050
leaq 0x58(%rsp), %rdi
callq 0x32810
leaq 0xb0(%rsp), %rdi
callq 0x346a0
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x31e70
movq %rax, %r14
leaq 0x51f5(%rip), %rsi      # 0x5d491
leaq 0x18(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x31b30
leaq 0x51f9(%rip), %rsi      # 0x5d4ae
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
leaq 0x70(%rsp), %rdx
movq %r14, %rdi
callq 0x344c0
xorl %ebp, %ebp
movq 0x1cc56(%rip), %rsi     # 0x74f38
movq 0x1cc8f(%rip), %rdx     # 0x74f78
movq %r14, %rdi
callq 0x34c90
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x33a00
jmp 0x58306
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x18(%rsp), %rdi
callq 0x33a00
testb %bpl, %bpl
jne 0x5831a
jmp 0x58360
movq %rax, %rbx
movq %r14, %rdi
callq 0x327c0
jmp 0x58360
jmp 0x58346
jmp 0x5833c
movq %rax, %rbx
jmp 0x5836a
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x32d30
jmp 0x58349
movq %rax, %rbx
jmp 0x58360
movq %rax, %rbx
jmp 0x58356
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x33a00
leaq 0x70(%rsp), %rdi
callq 0x33a00
leaq 0x58(%rsp), %rdi
callq 0x32810
leaq 0xb0(%rsp), %rdi
callq 0x346a0
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop