// File: zeeev[P]DASVC/bamtools/src/api/internal/sam/SamHeaderValidator_p.cpp
// Function: BamTools::Internal::SamHeaderValidator::ContainsUniqueSequenceNames()
bool SamHeaderValidator::ContainsUniqueSequenceNames(void) {

    bool isValid = true;
    set<string> sequenceNames;
    set<string>::iterator nameIter;

    // iterate over sequences
    const SamSequenceDictionary& sequences = m_header.Sequences;
    SamSequenceConstIterator seqIter = sequences.ConstBegin();
    SamSequenceConstIterator seqEnd  = sequences.ConstEnd();
    for ( ; seqIter != seqEnd; ++seqIter ) {
        const SamSequence& seq = (*seqIter);

        // lookup sequence name
        const string& name = seq.Name;
        nameIter = sequenceNames.find(name);

        // error if found (duplicate entry)
        if ( nameIter != sequenceNames.end() ) {
            AddError("Sequence name (SN): " + name + " is not unique");
            isValid = false;
        }

        // otherwise ok, store name
        sequenceNames.insert(name);
    }

    // return validation state
    return isValid;
}

// Assembly:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0x130(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x50(%rsp)
movb $0x1, 0x12f(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x75d80
leaq 0xf0(%rsp), %rdi
callq 0x74ef0
jmp 0xe6ec0
movq 0x50(%rsp), %rax
movq (%rax), %rax
addq $0x78, %rax
movq %rax, 0xd8(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x79d20
movq %rax, 0x48(%rsp)
jmp 0xe6ee8
movq 0x48(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x7bfb0
movq %rax, 0x40(%rsp)
jmp 0xe6f09
movq 0x40(%rsp), %rax
movq %rax, 0xc8(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x75e90
movb %al, 0x3f(%rsp)
jmp 0xe6f31
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0xe6f3e
jmp 0xe710c
leaq 0xd0(%rsp), %rdi
callq 0x767c0
movq %rax, 0x30(%rsp)
jmp 0xe6f52
movq 0x30(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
addq $0x60, %rax
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x78740
movq %rax, 0x28(%rsp)
jmp 0xe6f8f
movq 0x28(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0xf0(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x714b0
movq %rax, 0x20(%rsp)
jmp 0xe6fc0
movq 0x20(%rsp), %rax
movq %rax, 0xa8(%rsp)
leaq 0xf0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x713b0
movb %al, 0x1f(%rsp)
jmp 0xe6fe8
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0xe6ff5
jmp 0xe70c6
movq 0xb8(%rsp), %rdx
leaq 0x580a(%rip), %rsi      # 0xec80e
leaq 0x68(%rsp), %rdi
callq 0x75e70
jmp 0xe7010
leaq 0x580c(%rip), %rdx      # 0xec823
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x785a0
jmp 0xe702b
movq 0x50(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x763a0
jmp 0xe703f
leaq 0x88(%rsp), %rdi
callq 0x7cce8
jmp 0xe704e
leaq 0x68(%rsp), %rdi
callq 0x7cce8
jmp 0xe705a
movb $0x0, 0x12f(%rsp)
jmp 0xe70c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
jmp 0xe7132
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
jmp 0xe70b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x7cce8
jmp 0xe70b6
jmp 0xe70b8
leaq 0x68(%rsp), %rdi
callq 0x7cce8
jmp 0xe70c4
jmp 0xe7132
movq 0xb8(%rsp), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x76af0
movb %dl, 0xf(%rsp)
movq %rax, 0x10(%rsp)
jmp 0xe70e6
movb 0xf(%rsp), %al
movq 0x10(%rsp), %rcx
movq %rcx, 0x58(%rsp)
movb %al, 0x60(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x76200
jmp 0xe7107
jmp 0xe6f16
movb 0x12f(%rsp), %al
movb %al, 0xe(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x724c0
movb 0xe(%rsp), %al
andb $0x1, %al
addq $0x138, %rsp            # imm = 0x138
retq
leaq 0xf8(%rsp), %rdi
callq 0x724c0
jmp 0xe7141
jmp 0xe7143
movq 0xe8(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopl (%rax,%rax)