// File: /workspace/github_cpp_makefile_star2_O3/attractivechaos[P]udb2/stb/./stb.h
// Function: stb__wildmatch_raw2
int stb__wildmatch_raw2(char *expr, char *candidate, int search, int insensitive)
{
   int where=0;
   int start = -1;
   
   if (!search) {
      // parse to first '*'
      if (*expr != '*')
         start = 0;
      while (*expr != '*') {
         if (!*expr)
            return *candidate == 0 ? 0 : -1;
         if (*expr == '?') {
            if (!*candidate) return -1;
         } else {
            if (insensitive) {
               if (tolower(*candidate) != tolower(*expr))
                  return -1;
            } else 
               if (*candidate != *expr)
                  return -1;
         }
         ++candidate, ++expr, ++where;
      }
   } else {
      // 0-length search string
      if (!*expr)
         return 0;
   }

   assert(search || *expr == '*');
   if (!search)
      ++expr;

   // implicit '*' at this point
      
   while (*expr) {
      int o=0;
      // combine redundant * characters
      while (expr[0] == '*') ++expr;

      // ok, at this point, expr[-1] == '*',
      // and expr[0] != '*'

      if (!expr[0]) return start >= 0 ? start : 0;

      // now find next '*'
      o = 0;
      while (expr[o] != '*') {
         if (expr[o] == 0)
            break;
         ++o;
      }
      // if no '*', scan to end, then match at end
      if (expr[o] == 0 && !search) {
         int z;
         for (z=0; z < o; ++z)
            if (candidate[z] == 0)
               return -1;
         while (candidate[z])
            ++z;
         // ok, now check if they match
         if (stb__match_qstring(candidate+z-o, expr, o, insensitive))
            return start >= 0 ? start : 0;
         return -1; 
      } else {
         // if yes '*', then do stb__find_qmatch on the intervening chars
         int n = stb__find_qstring(candidate, expr, o, insensitive);
         if (n < 0)
            return -1;
         if (start < 0)
            start = where + n;
         expr += o;
         candidate += n+o;
      }

      if (*expr == 0) {
         assert(search);
         return start;
      }

      assert(*expr == '*');
      ++expr;
   }

   return start >= 0 ? start : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, 0xc(%rsp)
movl %edx, %r14d
movq %rsi, %r12
movq %rdi, %r13
movb (%rdi), %bl
testl %edx, %edx
je 0xd348
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq $0x0, 0x38(%rsp)
movl $0x0, %edi
testb %bl, %bl
je 0xd414
movl %r14d, 0x1c(%rsp)
cmpl $0x1, %r14d
adcq $0x0, %r13
movb (%r13), %r14b
movl %eax, %edi
testb %r14b, %r14b
jne 0xd1d7
jmp 0xd33c
movb (%r13), %r14b
incq %r13
cmpb $0x2a, %r14b
je 0xd1d3
movzbl %r14b, %eax
testl %eax, %eax
je 0xd33c
movq %r13, 0x10(%rsp)
leaq -0x1(%r13), %rax
xorl %edx, %edx
movzbl %r14b, %r13d
testb %r13b, %r13b
je 0xd214
cmpl $0x2a, %r13d
je 0xd214
movq 0x10(%rsp), %rcx
movb (%rcx,%rdx), %r14b
incq %rdx
jmp 0xd1f7
cmpl $0x0, 0x1c(%rsp)
jne 0xd224
testb %r14b, %r14b
je 0xd3c6
movq %rdx, 0x28(%rsp)
leaq -0x1(%rdx), %rcx
movq %r12, 0x30(%rsp)
leaq 0x1(%r12), %rdx
movq %rdx, %rbp
xorl %r12d, %r12d
movsbq (%rax), %r15
cmpq $0x3f, %r15
jne 0xd267
cmpl %r12d, %ecx
je 0xd2fa
incq %rax
incq %rbp
cmpb $0x0, (%rdx,%r12)
leaq 0x1(%r12), %r12
jne 0xd23d
jmp 0xd40f
movl %edi, 0x20(%rsp)
cmpl $0x0, 0xc(%rsp)
je 0xd27e
callq 0x23a0
movq (%rax), %rax
movb (%rax,%r15,4), %r15b
movq 0x30(%rsp), %rax
movb (%rax,%r12), %bl
testb %bl, %bl
je 0xd40f
movq 0x10(%rsp), %rax
addq %r12, %rax
movq %rax, 0x40(%rsp)
notq %r12
addq 0x28(%rsp), %r12
movsbl %r15b, %eax
movl %eax, 0x24(%rsp)
xorl %r15d, %r15d
cmpl $0x0, 0xc(%rsp)
je 0xd2c7
callq 0x23a0
movq (%rax), %rax
movsbq %bl, %rcx
movl (%rax,%rcx,4), %eax
jmp 0xd2ca
movsbl %bl, %eax
cmpl 0x24(%rsp), %eax
jne 0xd2e8
movq %rbp, %rdi
movq 0x40(%rsp), %rsi
movl %r12d, %edx
movl 0xc(%rsp), %ecx
callq 0xd46f
testl %eax, %eax
jne 0xd2ff
movb (%rbp), %bl
incq %rbp
incl %r15d
testb %bl, %bl
jne 0xd2af
jmp 0xd40f
xorl %r15d, %r15d
jmp 0xd303
movl 0x20(%rsp), %edi
movq 0x38(%rsp), %rax
addl %r15d, %eax
testl %edi, %edi
cmovsl %eax, %edi
cmpb $0x2a, %r14b
movq 0x30(%rsp), %r12
movq 0x28(%rsp), %rcx
jne 0xd425
addl %ecx, %r15d
addq %r15, %r12
movq 0x10(%rsp), %rax
movb (%rax,%rcx), %r14b
leaq (%rax,%rcx), %r13
jmp 0xd1c9
xorl %eax, %eax
testl %edi, %edi
cmovgl %edi, %eax
jmp 0xd416
xorl %eax, %eax
cmpb $0x2a, %bl
sete %al
negl %eax
movl %eax, 0x10(%rsp)
xorl %r15d, %r15d
cmpb $0x3f, %bl
je 0xd38f
movzbl %bl, %eax
cmpl $0x2a, %eax
je 0xd3b2
testl %eax, %eax
je 0xd3a8
cmpl $0x0, 0xc(%rsp)
je 0xd398
callq 0x23a0
movq (%rax), %rax
movsbq (%r12,%r15), %rcx
movl (%rax,%rcx,4), %ecx
movsbq %bl, %rdx
cmpl (%rax,%rdx,4), %ecx
je 0xd39e
jmp 0xd40f
cmpb $0x0, (%r12,%r15)
jne 0xd39e
jmp 0xd40f
cmpb %bl, (%r12,%r15)
jne 0xd40f
movb 0x1(%r13,%r15), %bl
incq %r15
jmp 0xd359
xorl %edi, %edi
cmpb (%r12,%r15), %dil
sbbl %edi, %edi
jmp 0xd414
addq %r15, %r12
movq %r15, 0x38(%rsp)
addq %r15, %r13
movl 0x10(%rsp), %eax
jmp 0xd1b6
testq %rdx, %rdx
movq 0x10(%rsp), %rsi
je 0xd3e1
xorl %eax, %eax
cmpb $0x0, (%r12,%rax)
je 0xd40f
incq %rax
cmpq %rax, %rdx
jne 0xd3d2
movl %edi, %ebx
decq %rsi
decq %r12
cmpb $0x0, 0x1(%r12,%rdx)
leaq 0x1(%r12), %r12
jne 0xd3e9
movq %r12, %rdi
movl 0xc(%rsp), %ecx
callq 0xd46f
testl %eax, %eax
je 0xd40f
xorl %eax, %eax
testl %ebx, %ebx
cmovgl %ebx, %eax
jmp 0xd416
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl %edi, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %r13d, %r13d
jne 0xd450
cmpl $0x0, 0x1c(%rsp)
jne 0xd414
leaq 0x58d3(%rip), %rdi      # 0x12d0b
leaq 0x5072(%rip), %rsi      # 0x124b1
leaq 0x5893(%rip), %rcx      # 0x12cd9
movl $0x2325, %edx           # imm = 0x2325
callq 0x2140
leaq 0x58bb(%rip), %rdi      # 0x12d12
leaq 0x5053(%rip), %rsi      # 0x124b1
leaq 0x5874(%rip), %rcx      # 0x12cd9
movl $0x2329, %edx           # imm = 0x2329
callq 0x2140