// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk/./exprtk.hpp
// Function: exprtk::details::sequence_match(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&, unsigned long&, char&)
inline bool sequence_match(const std::string& pattern,
                                 const std::string& str,
                                 std::size_t&       diff_index,
                                 char_t&            diff_value)
      {
         if (str.empty())
         {
            return ("Z" == pattern);
         }
         else if ('*' == pattern[0])
            return false;

         typedef std::string::const_iterator itr_t;

         itr_t p_itr = pattern.begin();
         itr_t s_itr = str    .begin();

         const itr_t p_end = pattern.end();
         const itr_t s_end = str    .end();

         while ((s_end != s_itr) && (p_end != p_itr))
         {
            if ('*' == (*p_itr))
            {
               const char_t target = static_cast<char_t>(std::toupper(*(p_itr - 1)));

               if ('*' == target)
               {
                  diff_index = static_cast<std::size_t>(std::distance(str.begin(),s_itr));
                  diff_value = static_cast<char_t>(std::toupper(*p_itr));

                  return false;
               }
               else
                  ++p_itr;

               while (s_itr != s_end)
               {
                  if (target != std::toupper(*s_itr))
                     break;
                  else
                     ++s_itr;
               }

               continue;
            }
            else if (
                      ('?' != *p_itr) &&
                      std::toupper(*p_itr) != std::toupper(*s_itr)
                    )
            {
               diff_index = static_cast<std::size_t>(std::distance(str.begin(),s_itr));
               diff_value = static_cast<char_t>(std::toupper(*p_itr));

               return false;
            }

            ++p_itr;
            ++s_itr;
         }

         return (
                  (s_end == s_itr) &&
                  (
                    (p_end ==  p_itr) ||
                    ('*'   == *p_itr)
                  )
                );
      }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rax
movq 0x8(%rsi), %r14
testq %r14, %r14
je 0x2b6fa7
movq (%rax), %r15
cmpb $0x2a, (%r15)
je 0x2b6ff2
movq %rdx, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movq (%rsi), %r13
movq 0x8(%rax), %rbx
addq %r15, %rbx
addq %r13, %r14
movq %r13, %r12
cmpq %r12, %r14
je 0x2b6fc4
cmpq %r15, %rbx
je 0x2b6fc4
movzbl (%r15), %eax
cmpl $0x3f, %eax
je 0x2b6f9a
cmpl $0x2a, %eax
jne 0x2b6f82
movsbl -0x1(%r15), %edi
callq 0x118130
movl %eax, %ecx
shll $0x18, %ecx
cmpl $0x2a000000, %ecx       # imm = 0x2A000000
je 0x2b6fd7
movsbl %al, %ebp
cmpq %r14, %r12
je 0x2b6fa2
movsbl (%r12), %edi
callq 0x118130
cmpl %eax, %ebp
jne 0x2b6f9d
incq %r12
jmp 0x2b6f6a
movsbl %al, %edi
callq 0x118130
movl %eax, %ebp
movsbl (%r12), %edi
callq 0x118130
cmpl %eax, %ebp
jne 0x2b6fd7
incq %r12
incq %r15
jmp 0x2b6f30
movq %r14, %r12
jmp 0x2b6f9d
leaq 0x2c9a2(%rip), %rdi     # 0x2e3950
movq %rax, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2b6b71
cmpq %r12, %r14
jne 0x2b6ff2
cmpq %r15, %rbx
je 0x2b7003
cmpb $0x2a, (%r15)
sete %al
jmp 0x2b6ff4
subq %r13, %r12
movq 0x8(%rsp), %rax
movq %r12, (%rax)
movsbl (%r15), %edi
callq 0x118130
movq 0x10(%rsp), %rcx
movb %al, (%rcx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
jmp 0x2b6ff4
nop