// File: zeeev[P]DASVC/bamtools/src/utils/bamtools_filter_engine.h
// Function: bool BamTools::FilterEngine<BamTools::BamAlignmentChecker>::setProperty<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, BamTools::PropertyFilterValue::ValueCompareType const&)
bool FilterEngine<FilterChecker>::setProperty(const std::string& filterName, 
                                              const std::string& propertyName, 
                                              const T& value,
                                              const PropertyFilterValue::ValueCompareType& type)
{
    // lookup filter by name, return false if not found
    FilterMap::iterator filterIter = m_filters.find(filterName);
    if ( filterIter == m_filters.end() ) return false;
      
    // lookup property for filter, add new PropertyFilterValue if not found, modify if already exists
    PropertyFilter& filter = (*filterIter).second;
    PropertyMap::iterator propertyIter = filter.Properties.find(propertyName);
    
    bool success;
    
    // property not found for this filter, create new entry
    if ( propertyIter == filter.Properties.end() )
        success = (filter.Properties.insert(std::make_pair(propertyName, PropertyFilterValue(value, type)))).second;
    
    // property already exists, modify
    else {
        PropertyFilterValue& filterValue = (*propertyIter).second;
        filterValue.Value = value;
        filterValue.Type  = type;
        success = true;
    }
    
    // if error so far, return false
    if ( !success ) return false;
    
    // --------------------------------------------
    // otherwise, set Property.IsEnabled to true
    
    // lookup property
    std::vector<Property>::iterator knownPropertyIter = std::find( m_properties.begin(), m_properties.end(), propertyName);
    
    // if not found, create a new (enabled) entry (& re-sort list)
    if ( knownPropertyIter == m_properties.end() ) {
        m_properties.push_back( Property(propertyName, true) );
        std::sort( m_properties.begin(), m_properties.end() );
    } 
    
    // property already known, set as enabled
    else (*knownPropertyIter).IsEnabled = true;

    // return success
    return true;
}

// Assembly:
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, 0x1e8(%rsp)
movq %rsi, 0x1e0(%rsp)
movq %rdx, 0x1d8(%rsp)
movq %rcx, 0x1d0(%rsp)
movq %r8, 0x1c8(%rsp)
movq 0x1e8(%rsp), %rdi
movq %rdi, 0x30(%rsp)
movq 0x1e0(%rsp), %rsi
callq 0xabc00
movq 0x30(%rsp), %rdi
movq %rax, 0x1c0(%rsp)
callq 0xabc50
movq %rax, 0x1b8(%rsp)
leaq 0x1c0(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0xabc30
testb $0x1, %al
jne 0xa6cce
jmp 0xa6cdb
movb $0x0, 0x1f7(%rsp)
jmp 0xa71a9
leaq 0x1c0(%rsp), %rdi
callq 0xabc80
addq $0x20, %rax
movq %rax, 0x1b0(%rsp)
movq 0x1b0(%rsp), %rdi
movq 0x1d8(%rsp), %rsi
callq 0xabca0
movq %rax, 0x1a8(%rsp)
movq 0x1b0(%rsp), %rdi
callq 0xabcf0
movq %rax, 0x198(%rsp)
leaq 0x1a8(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0xabcd0
testb $0x1, %al
jne 0xa6d44
jmp 0xa6f7c
movq 0x1b0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x1d8(%rsp), %rsi
leaq 0x118(%rsp), %rdi
callq 0x86350
movq 0x1d0(%rsp), %rsi
leaq 0xe0(%rsp), %rdi
callq 0x86350
jmp 0xa6d7d
leaq 0x100(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x94910
jmp 0xa6d94
movq 0x1c8(%rsp), %rdx
leaq 0x108(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0xabda0
jmp 0xa6db3
leaq 0x138(%rsp), %rdi
leaq 0x118(%rsp), %rsi
leaq 0x108(%rsp), %rdx
callq 0xabd70
jmp 0xa6dd2
leaq 0x168(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0xabde0
jmp 0xa6de9
movq 0x28(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0xabd20
movb %dl, 0x1f(%rsp)
movq %rax, 0x20(%rsp)
jmp 0xa6e06
movb 0x1f(%rsp), %al
movq 0x20(%rsp), %rcx
movq %rcx, 0xc0(%rsp)
movb %al, 0xc8(%rsp)
movb 0xc8(%rsp), %al
andb $0x1, %al
movb %al, 0x1a7(%rsp)
leaq 0x168(%rsp), %rdi
callq 0xab880
jmp 0xa6e3d
leaq 0x138(%rsp), %rdi
callq 0xabe50
jmp 0xa6e4c
leaq 0x108(%rsp), %rdi
callq 0xab8e0
jmp 0xa6e5b
leaq 0x100(%rsp), %rdi
callq 0x94a50
jmp 0xa6e6a
leaq 0xe0(%rsp), %rdi
callq 0x86f68
jmp 0xa6e79
leaq 0x118(%rsp), %rdi
callq 0x86f68
jmp 0xa7064
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0xa6f68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0xa6f57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0xa6f46
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0xa6f35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0xa6f24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
leaq 0x168(%rsp), %rdi
callq 0xab880
jmp 0xa6f22
jmp 0xa6f24
leaq 0x138(%rsp), %rdi
callq 0xabe50
jmp 0xa6f33
jmp 0xa6f35
leaq 0x108(%rsp), %rdi
callq 0xab8e0
jmp 0xa6f44
jmp 0xa6f46
leaq 0x100(%rsp), %rdi
callq 0x94a50
jmp 0xa6f55
jmp 0xa6f57
leaq 0xe0(%rsp), %rdi
callq 0x86f68
jmp 0xa6f66
jmp 0xa6f68
leaq 0x118(%rsp), %rdi
callq 0x86f68
jmp 0xa6f77
jmp 0xa71ba
leaq 0x1a8(%rsp), %rdi
callq 0xabeb0
addq $0x20, %rax
movq %rax, 0xb8(%rsp)
movq 0x1d0(%rsp), %rsi
leaq 0x90(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x86350
movq 0x10(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x94910
jmp 0xa6fc3
movq 0xb8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x949f0
jmp 0xa6fda
leaq 0xb0(%rsp), %rdi
callq 0x94a50
jmp 0xa6fe9
leaq 0x90(%rsp), %rdi
callq 0x86f68
movq 0x1c8(%rsp), %rax
movl (%rax), %ecx
movq 0xb8(%rsp), %rax
movl %ecx, 0x8(%rax)
movb $0x1, 0x1a7(%rsp)
jmp 0xa7064
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
jmp 0xa7050
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x94a50
jmp 0xa704e
jmp 0xa7050
leaq 0x90(%rsp), %rdi
callq 0x86f68
jmp 0xa705f
jmp 0xa71ba
testb $0x1, 0x1a7(%rsp)
jne 0xa707b
movb $0x0, 0x1f7(%rsp)
jmp 0xa71a9
movq 0x30(%rsp), %rdi
addq $0x30, %rdi
callq 0xabf30
movq 0x30(%rsp), %rdi
movq %rax, 0x80(%rsp)
addq $0x30, %rdi
callq 0xabf60
movq %rax, 0x78(%rsp)
movq 0x1d8(%rsp), %rdx
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0xabed0
movq 0x30(%rsp), %rdi
movq %rax, 0x88(%rsp)
addq $0x30, %rdi
callq 0xabf60
movq %rax, 0x70(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0xabf90
testb $0x1, %al
jne 0xa70f4
jmp 0xa7190
movq 0x30(%rsp), %rax
addq $0x30, %rax
movq %rax, (%rsp)
movq 0x1d8(%rsp), %rsi
leaq 0x48(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl $0x1, %edx
callq 0xac040
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0xabfd0
jmp 0xa712d
leaq 0x48(%rsp), %rdi
callq 0xab1e0
movq 0x30(%rsp), %rdi
addq $0x30, %rdi
callq 0xabf30
movq 0x30(%rsp), %rdi
movq %rax, 0x40(%rsp)
addq $0x30, %rdi
callq 0xabf60
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0xac080
jmp 0xa71a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd8(%rsp)
movl %eax, 0xd4(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xab1e0
jmp 0xa718e
jmp 0xa71ba
leaq 0x88(%rsp), %rdi
callq 0xac0c0
movb $0x1, 0x20(%rax)
movb $0x1, 0x1f7(%rsp)
movb 0x1f7(%rsp), %al
andb $0x1, %al
addq $0x1f8, %rsp            # imm = 0x1F8
retq
movq 0xd8(%rsp), %rdi
callq 0x86d80
movq %rax, %rdi
callq 0x91290
nop