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

    SamSequence seq;

    // split SQ line 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 sequence contents
        if      ( tokenTag == Constants::SAM_SQ_NAME_TAG       ) seq.Name = tokenValue;
        else if ( tokenTag == Constants::SAM_SQ_LENGTH_TAG     ) seq.Length = tokenValue;
        else if ( tokenTag == Constants::SAM_SQ_ASSEMBLYID_TAG ) seq.AssemblyID = tokenValue;
        else if ( tokenTag == Constants::SAM_SQ_CHECKSUM_TAG   ) seq.Checksum = tokenValue;
        else if ( tokenTag == Constants::SAM_SQ_SPECIES_TAG    ) seq.Species = tokenValue;
        else if ( tokenTag == Constants::SAM_SQ_URI_TAG        ) seq.URI = tokenValue;
        else { // custom tag
            CustomHeaderTag otherTag;
            otherTag.TagName  = tokenTag;
            otherTag.TagValue = tokenValue;
            seq.CustomTags.push_back(otherTag);
        }
    }

    // check for required tags
    if ( !seq.HasName() )
        throw BamException("SamFormatParser::ParseSQLine", "@SQ line is missing SN tag");
    if ( !seq.HasLength() )
        throw BamException("SamFormatParser::ParseSQLine", "@SQ line is missing LN tag");

    // store SAM sequence entry
    m_header.Sequences.Add(seq);
}

// Assembly:
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rdi, 0x2c0(%rsp)
movq %rsi, 0x2b8(%rsp)
movq 0x2c0(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0x724a0
movq 0x70(%rsp), %rsi
movq 0x2b8(%rsp), %rdx
leaq 0x1c8(%rsp), %rdi
movl $0x9, %ecx
callq 0x793a0
jmp 0xe2702
leaq 0x1c8(%rsp), %rdi
callq 0x7aa40
movq %rax, 0x68(%rsp)
jmp 0xe2716
movq 0x68(%rsp), %rax
movq %rax, 0x1a8(%rsp)
leaq 0x1b0(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x76ee0
jmp 0xe273a
leaq 0x1c8(%rsp), %rdi
callq 0x7ad60
movq %rax, 0x60(%rsp)
jmp 0xe274e
movq 0x60(%rsp), %rax
movq %rax, 0x198(%rsp)
leaq 0x1a0(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0x76ee0
jmp 0xe2772
jmp 0xe2774
leaq 0x1b0(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x750f0
movb %al, 0x5f(%rsp)
jmp 0xe278f
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0xe279c
jmp 0xe2ad5
leaq 0x1b0(%rsp), %rdi
callq 0x71410
movq %rax, 0x50(%rsp)
jmp 0xe27b0
movq 0x50(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
leaq 0x178(%rsp), %rdi
movl $0x2, %ecx
callq 0x76c50
jmp 0xe27cd
leaq 0x1b0(%rsp), %rdi
callq 0x71410
movq %rax, 0x48(%rsp)
jmp 0xe27e1
movq 0x48(%rsp), %rsi
leaq 0x158(%rsp), %rdi
movl $0x3, %edx
movq $-0x1, %rcx
callq 0x76c50
jmp 0xe2801
leaq 0x36800(%rip), %rsi     # 0x119008
leaq 0x178(%rsp), %rdi
callq 0x74120
movb %al, 0x47(%rsp)
jmp 0xe281b
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0xe2828
jmp 0xe28a8
leaq 0x240(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x71240
jmp 0xe283f
jmp 0xe2a7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xe2de7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xe2dd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xe2ac1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xe2ab0
leaq 0x36739(%rip), %rsi     # 0x118fe8
leaq 0x178(%rsp), %rdi
callq 0x74120
movb %al, 0x46(%rsp)
jmp 0xe28c2
movb 0x46(%rsp), %al
testb $0x1, %al
jne 0xe28cc
jmp 0xe28e8
leaq 0x220(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x71240
jmp 0xe28e3
jmp 0xe2a7a
leaq 0x366b9(%rip), %rsi     # 0x118fa8
leaq 0x178(%rsp), %rdi
callq 0x74120
movb %al, 0x45(%rsp)
jmp 0xe2902
movb 0x45(%rsp), %al
testb $0x1, %al
jne 0xe290c
jmp 0xe2928
leaq 0x1e0(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x71240
jmp 0xe2923
jmp 0xe2a78
leaq 0x36699(%rip), %rsi     # 0x118fc8
leaq 0x178(%rsp), %rdi
callq 0x74120
movb %al, 0x44(%rsp)
jmp 0xe2942
movb 0x44(%rsp), %al
testb $0x1, %al
jne 0xe294c
jmp 0xe2968
leaq 0x200(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x71240
jmp 0xe2963
jmp 0xe2a76
leaq 0x366b9(%rip), %rsi     # 0x119028
leaq 0x178(%rsp), %rdi
callq 0x74120
movb %al, 0x43(%rsp)
jmp 0xe2982
movb 0x43(%rsp), %al
testb $0x1, %al
jne 0xe298c
jmp 0xe29a8
leaq 0x260(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x71240
jmp 0xe29a3
jmp 0xe2a74
leaq 0x36699(%rip), %rsi     # 0x119048
leaq 0x178(%rsp), %rdi
callq 0x74120
movb %al, 0x42(%rsp)
jmp 0xe29c2
movb 0x42(%rsp), %al
testb $0x1, %al
jne 0xe29cc
jmp 0xe29e8
leaq 0x280(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x71240
jmp 0xe29e3
jmp 0xe2a72
leaq 0x118(%rsp), %rdi
callq 0x7a640
jmp 0xe29f7
leaq 0x118(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x71240
jmp 0xe2a0e
leaq 0x138(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x71240
jmp 0xe2a25
leaq 0x2a0(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x743e0
jmp 0xe2a3c
leaq 0x118(%rsp), %rdi
callq 0x75d70
jmp 0xe2a4b
jmp 0xe2a72
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x118(%rsp), %rdi
callq 0x75d70
jmp 0xe2a70
jmp 0xe2ab0
jmp 0xe2a74
jmp 0xe2a76
jmp 0xe2a78
jmp 0xe2a7a
jmp 0xe2a7c
leaq 0x158(%rsp), %rdi
callq 0x7cce8
jmp 0xe2a8b
leaq 0x178(%rsp), %rdi
callq 0x7cce8
jmp 0xe2a9a
jmp 0xe2a9c
leaq 0x1b0(%rsp), %rdi
callq 0x75880
jmp 0xe2aab
jmp 0xe2774
leaq 0x158(%rsp), %rdi
callq 0x7cce8
jmp 0xe2abf
jmp 0xe2ac1
leaq 0x178(%rsp), %rdi
callq 0x7cce8
jmp 0xe2ad0
jmp 0xe2dd6
leaq 0x1e0(%rsp), %rdi
callq 0x72c60
movb %al, 0x41(%rsp)
jmp 0xe2ae8
movb 0x41(%rsp), %al
testb $0x1, %al
jne 0xe2c3f
jmp 0xe2af6
movb $0x1, 0xce(%rsp)
movl $0x28, %edi
callq 0x737c0
movq %rax, 0x30(%rsp)
leaq 0xf7(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x7b5f0
movq 0x38(%rsp), %rdx
leaq 0x9b18(%rip), %rsi      # 0xec643
leaq 0xf8(%rsp), %rdi
callq 0x78e70
jmp 0xe2b3a
leaq 0xcf(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x7b5f0
movq 0x28(%rsp), %rdx
leaq 0x9b08(%rip), %rsi      # 0xec660
leaq 0xd0(%rsp), %rdi
callq 0x78e70
jmp 0xe2b67
movq 0x30(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x79cd0
jmp 0xe2b83
movq 0x30(%rsp), %rdi
movb $0x0, 0xce(%rsp)
movq 0x2f379(%rip), %rsi     # 0x111f10
movq 0x2f3c2(%rip), %rdx     # 0x111f60
callq 0x7b010
jmp 0xe2e0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xe2c17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xe2bf9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x7cce8
jmp 0xe2bf7
jmp 0xe2bf9
leaq 0xcf(%rsp), %rdi
callq 0x76f80
leaq 0xf8(%rsp), %rdi
callq 0x7cce8
jmp 0xe2c15
jmp 0xe2c17
leaq 0xf7(%rsp), %rdi
callq 0x76f80
testb $0x1, 0xce(%rsp)
jne 0xe2c30
jmp 0xe2c3a
movq 0x30(%rsp), %rdi
callq 0x74e00
jmp 0xe2dd6
leaq 0x1e0(%rsp), %rdi
callq 0x7cb10
movb %al, 0x27(%rsp)
jmp 0xe2c52
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0xe2d97
jmp 0xe2c60
movb $0x1, 0x7e(%rsp)
movl $0x28, %edi
callq 0x737c0
movq %rax, 0x10(%rsp)
leaq 0xa7(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x7b5f0
movq 0x18(%rsp), %rdx
leaq 0x99b1(%rip), %rsi      # 0xec643
leaq 0xa8(%rsp), %rdi
callq 0x78e70
jmp 0xe2ca1
leaq 0x7f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x7b5f0
movq 0x8(%rsp), %rdx
leaq 0x99bf(%rip), %rsi      # 0xec67b
leaq 0x80(%rsp), %rdi
callq 0x78e70
jmp 0xe2ccb
movq 0x10(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x79cd0
jmp 0xe2ce7
movq 0x10(%rsp), %rdi
movb $0x0, 0x7e(%rsp)
movq 0x2f218(%rip), %rsi     # 0x111f10
movq 0x2f261(%rip), %rdx     # 0x111f60
callq 0x7b010
jmp 0xe2e0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xe2d75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0xe2d5a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x7cce8
jmp 0xe2d58
jmp 0xe2d5a
leaq 0x7f(%rsp), %rdi
callq 0x76f80
leaq 0xa8(%rsp), %rdi
callq 0x7cce8
jmp 0xe2d73
jmp 0xe2d75
leaq 0xa7(%rsp), %rdi
callq 0x76f80
testb $0x1, 0x7e(%rsp)
jne 0xe2d8b
jmp 0xe2d95
movq 0x10(%rsp), %rdi
callq 0x74e00
jmp 0xe2dd6
movq 0x70(%rsp), %rax
movq (%rax), %rdi
addq $0x78, %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x79580
jmp 0xe2db2
leaq 0x1c8(%rsp), %rdi
callq 0x74e60
jmp 0xe2dc1
leaq 0x1e0(%rsp), %rdi
callq 0x7c470
addq $0x2c8, %rsp            # imm = 0x2C8
retq
leaq 0x1c8(%rsp), %rdi
callq 0x74e60
jmp 0xe2de5
jmp 0xe2de7
leaq 0x1e0(%rsp), %rdi
callq 0x7c470
jmp 0xe2df6
jmp 0xe2df8
movq 0x1c0(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopl (%rax)