// File: zeeev[P]DASVC/bamtools/src/utils/bamtools_filter_properties.h
// Function: BamTools::PropertyFilterValue::check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
inline
bool PropertyFilterValue::check(const std::string& query) const {
  
    // ensure filter value & query are same type
    if ( !Value.is_type<std::string>() ) {
        std::cerr << "Cannot compare different types!" << std::endl;
        return false;
    }
  
    // localize string version of our filter value
    const std::string& valueString = Value.get<std::string>();
    
    // string matching based on our filter type
    switch ( Type ) {
        case ( PropertyFilterValue::CONTAINS)           : return ( query.find(valueString) != std::string::npos );
        case ( PropertyFilterValue::ENDS_WITH)          : return ( query.find(valueString) == (query.length() - valueString.length()) ); 
        case ( PropertyFilterValue::EXACT)              : return ( query == valueString );
        case ( PropertyFilterValue::GREATER_THAN)       : return ( query >  valueString ); 
        case ( PropertyFilterValue::GREATER_THAN_EQUAL) : return ( query >= valueString ); 
        case ( PropertyFilterValue::LESS_THAN)          : return ( query <  valueString );
        case ( PropertyFilterValue::LESS_THAN_EQUAL)    : return ( query <= valueString );
        case ( PropertyFilterValue::NOT)                : return ( query != valueString );
        case ( PropertyFilterValue::STARTS_WITH)        : return ( query.find(valueString) == 0 );
        default : BAMTOOLS_ASSERT_UNREACHABLE;
    }
    return false;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xa9640
testb $0x1, %al
jne 0xb9c9d
movq 0xab368(%rip), %rdi     # 0x164fe0
leaq 0x76168(%rip), %rsi     # 0x12fde7
callq 0x86700
movq %rax, %rdi
movq 0xab2e2(%rip), %rsi     # 0x164f70
callq 0x86770
movb $0x0, 0x47(%rsp)
jmp 0xb9e0e
movq 0x20(%rsp), %rdi
callq 0xbb160
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x28(%rsp)
movl 0x8(%rax), %eax
movq %rax, 0x18(%rsp)
subq $0x8, %rax
ja 0xb9e04
movq 0x18(%rsp), %rax
leaq 0x75212(%rip), %rcx     # 0x12eee4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x86f50
cmpq $-0x1, %rax
setne %al
andb $0x1, %al
movb %al, 0x47(%rsp)
jmp 0xb9e0e
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x86f50
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rdi
callq 0x86ac0
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
callq 0x86ac0
movq 0x8(%rsp), %rcx
movq %rax, %rdx
movq 0x10(%rsp), %rax
subq %rdx, %rcx
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movb %al, 0x47(%rsp)
jmp 0xb9e0e
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x91630
andb $0x1, %al
movb %al, 0x47(%rsp)
jmp 0xb9e0e
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xbb180
andb $0x1, %al
movb %al, 0x47(%rsp)
jmp 0xb9e0e
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xbb1b0
andb $0x1, %al
movb %al, 0x47(%rsp)
jmp 0xb9e0e
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x96810
andb $0x1, %al
movb %al, 0x47(%rsp)
jmp 0xb9e0e
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xbb1e0
andb $0x1, %al
movb %al, 0x47(%rsp)
jmp 0xb9e0e
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xbb210
andb $0x1, %al
movb %al, 0x47(%rsp)
jmp 0xb9e0e
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x86f50
cmpq $0x0, %rax
sete %al
andb $0x1, %al
movb %al, 0x47(%rsp)
jmp 0xb9e0e
callq 0xafa50
movb $0x0, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
nopl (%rax)