// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: patternCompare
static int patternCompare(
  const u8 *zPattern,              /* The glob pattern */
  const u8 *zString,               /* The string to compare against the glob */
  const struct compareInfo *pInfo, /* Information about how to do the compare */
  u32 esc                          /* The escape character */
){
  u32 c, c2;                       /* Next pattern and input string chars */
  u32 matchOne = pInfo->matchOne;  /* "?" or "_" */
  u32 matchAll = pInfo->matchAll;  /* "*" or "%" */
  u32 matchOther;                  /* "[" or the escape character */
  u8 noCase = pInfo->noCase;       /* True if uppercase==lowercase */
  const u8 *zEscaped = 0;          /* One past the last escaped input char */
  
  /* The GLOB operator does not have an ESCAPE clause.  And LIKE does not
  ** have the matchSet operator.  So we either have to look for one or
  ** the other, never both.  Hence the single variable matchOther is used
  ** to store the one we have to look for.
  */
  matchOther = esc ? esc : pInfo->matchSet;

  while( (c = Utf8Read(zPattern))!=0 ){
    if( c==matchAll ){  /* Match "*" */
      /* Skip over multiple "*" characters in the pattern.  If there
      ** are also "?" characters, skip those as well, but consume a
      ** single character of the input string for each "?" skipped */
      while( (c=Utf8Read(zPattern)) == matchAll || c == matchOne ){
        if( c==matchOne && sqlite3Utf8Read(&zString)==0 ){
          return 0;
        }
      }
      if( c==0 ){
        return 1;   /* "*" at the end of the pattern matches */
      }else if( c==matchOther ){
        if( esc ){
          c = sqlite3Utf8Read(&zPattern);
          if( c==0 ) return 0;
        }else{
          /* "[...]" immediately follows the "*".  We have to do a slow
          ** recursive search in this case, but it is an unusual case. */
          assert( matchOther<0x80 );  /* '[' is a single-byte character */
          while( *zString
                 && patternCompare(&zPattern[-1],zString,pInfo,esc)==0 ){
            SQLITE_SKIP_UTF8(zString);
          }
          return *zString!=0;
        }
      }

      /* At this point variable c contains the first character of the
      ** pattern string past the "*".  Search in the input string for the
      ** first matching character and recursively contine the match from
      ** that point.
      **
      ** For a case-insensitive search, set variable cx to be the same as
      ** c but in the other case and search the input string for either
      ** c or cx.
      */
      if( c<=0x80 ){
        u32 cx;
        if( noCase ){
          cx = sqlite3Toupper(c);
          c = sqlite3Tolower(c);
        }else{
          cx = c;
        }
        while( (c2 = *(zString++))!=0 ){
          if( c2!=c && c2!=cx ) continue;
          if( patternCompare(zPattern,zString,pInfo,esc) ) return 1;
        }
      }else{
        while( (c2 = Utf8Read(zString))!=0 ){
          if( c2!=c ) continue;
          if( patternCompare(zPattern,zString,pInfo,esc) ) return 1;
        }
      }
      return 0;
    }
    if( c==matchOther ){
      if( esc ){
        c = sqlite3Utf8Read(&zPattern);
        if( c==0 ) return 0;
        zEscaped = zPattern;
      }else{
        u32 prior_c = 0;
        int seen = 0;
        int invert = 0;
        c = sqlite3Utf8Read(&zString);
        if( c==0 ) return 0;
        c2 = sqlite3Utf8Read(&zPattern);
        if( c2=='^' ){
          invert = 1;
          c2 = sqlite3Utf8Read(&zPattern);
        }
        if( c2==']' ){
          if( c==']' ) seen = 1;
          c2 = sqlite3Utf8Read(&zPattern);
        }
        while( c2 && c2!=']' ){
          if( c2=='-' && zPattern[0]!=']' && zPattern[0]!=0 && prior_c>0 ){
            c2 = sqlite3Utf8Read(&zPattern);
            if( c>=prior_c && c<=c2 ) seen = 1;
            prior_c = 0;
          }else{
            if( c==c2 ){
              seen = 1;
            }
            prior_c = c2;
          }
          c2 = sqlite3Utf8Read(&zPattern);
        }
        if( c2==0 || (seen ^ invert)==0 ){
          return 0;
        }
        continue;
      }
    }
    c2 = Utf8Read(zString);
    if( c==c2 ) continue;
    if( noCase && c<0x80 && c2<0x80 && sqlite3Tolower(c)==sqlite3Tolower(c2) ){
      continue;
    }
    if( c==matchOne && zPattern!=zEscaped && c2!=0 ) continue;
    return 0;
  }
  return *zString==0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movb 0x3(%rax), %al
movb %al, -0x39(%rbp)
movq $0x0, -0x48(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x18c7f
movl -0x24(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x18c8a
movq -0x20(%rbp), %rax
movzbl 0x2(%rax), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x80, %eax
jge 0x18cb5
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x60(%rbp)
jmp 0x18cc1
leaq -0x10(%rbp), %rdi
callq 0x57a90
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, %eax
je 0x19182
movl -0x28(%rbp), %eax
cmpl -0x34(%rbp), %eax
jne 0x18f60
jmp 0x18cde
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x80, %eax
jge 0x18d03
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x64(%rbp)
jmp 0x18d0f
leaq -0x10(%rbp), %rdi
callq 0x57a90
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %ecx
movl %ecx, -0x28(%rbp)
movb $0x1, %al
cmpl -0x34(%rbp), %ecx
movb %al, -0x65(%rbp)
je 0x18d2b
movl -0x28(%rbp), %eax
cmpl -0x30(%rbp), %eax
sete %al
movb %al, -0x65(%rbp)
movb -0x65(%rbp), %al
testb $0x1, %al
jne 0x18d34
jmp 0x18d58
movl -0x28(%rbp), %eax
cmpl -0x30(%rbp), %eax
jne 0x18d56
leaq -0x18(%rbp), %rdi
callq 0x57a90
cmpl $0x0, %eax
jne 0x18d56
movl $0x0, -0x4(%rbp)
jmp 0x19197
jmp 0x18cde
cmpl $0x0, -0x28(%rbp)
jne 0x18d6a
movl $0x1, -0x4(%rbp)
jmp 0x19197
movl -0x28(%rbp), %eax
cmpl -0x38(%rbp), %eax
jne 0x18e38
cmpl $0x0, -0x24(%rbp)
je 0x18d9f
leaq -0x10(%rbp), %rdi
callq 0x57a90
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x18d9a
movl $0x0, -0x4(%rbp)
jmp 0x19197
jmp 0x18e36
jmp 0x18da1
movq -0x18(%rbp), %rax
movzbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x66(%rbp)
je 0x18dd3
movq -0x10(%rbp), %rdi
addq $-0x1, %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x18c30
cmpl $0x0, %eax
sete %al
movb %al, -0x66(%rbp)
movb -0x66(%rbp), %al
testb $0x1, %al
jne 0x18ddc
jmp 0x18e1c
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movzbl (%rax), %eax
cmpl $0xc0, %eax
jl 0x18e1a
jmp 0x18df7
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
jne 0x18e18
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x18df7
jmp 0x18e1a
jmp 0x18da1
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x19197
jmp 0x18e38
jmp 0x18e3a
cmpl $0x80, -0x28(%rbp)
ja 0x18ee3
cmpb $0x0, -0x39(%rbp)
je 0x18e86
movl -0x28(%rbp), %eax
movl -0x28(%rbp), %ecx
movzbl %cl, %ecx
movl %ecx, %edx
leaq 0x89f41(%rip), %rcx     # 0xa2da0
movzbl (%rcx,%rdx), %ecx
andl $0x20, %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
movl %eax, -0x4c(%rbp)
movl -0x28(%rbp), %eax
movzbl %al, %eax
movl %eax, %ecx
leaq 0x89dc3(%rip), %rax     # 0xa2c40
movzbl (%rax,%rcx), %eax
movl %eax, -0x28(%rbp)
jmp 0x18e8c
movl -0x28(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x18e8e
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
je 0x18ee1
movl -0x2c(%rbp), %eax
cmpl -0x28(%rbp), %eax
je 0x18eba
movl -0x2c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
je 0x18eba
jmp 0x18e8e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x18c30
cmpl $0x0, %eax
je 0x18edf
movl $0x1, -0x4(%rbp)
jmp 0x19197
jmp 0x18e8e
jmp 0x18f54
jmp 0x18ee5
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x80, %eax
jge 0x18f0a
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movzbl (%rax), %eax
movl %eax, -0x6c(%rbp)
jmp 0x18f16
leaq -0x18(%rbp), %rdi
callq 0x57a90
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
je 0x18f52
movl -0x2c(%rbp), %eax
cmpl -0x28(%rbp), %eax
je 0x18f2b
jmp 0x18ee5
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x18c30
cmpl $0x0, %eax
je 0x18f50
movl $0x1, -0x4(%rbp)
jmp 0x19197
jmp 0x18ee5
jmp 0x18f54
movl $0x0, -0x4(%rbp)
jmp 0x19197
movl -0x28(%rbp), %eax
cmpl -0x38(%rbp), %eax
jne 0x190ce
cmpl $0x0, -0x24(%rbp)
je 0x18f9d
leaq -0x10(%rbp), %rdi
callq 0x57a90
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x18f90
movl $0x0, -0x4(%rbp)
jmp 0x19197
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x190cc
movl $0x0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x57a90
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x18fd0
movl $0x0, -0x4(%rbp)
jmp 0x19197
leaq -0x10(%rbp), %rdi
callq 0x57a90
movl %eax, -0x2c(%rbp)
cmpl $0x5e, -0x2c(%rbp)
jne 0x18ff5
movl $0x1, -0x58(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x57a90
movl %eax, -0x2c(%rbp)
cmpl $0x5d, -0x2c(%rbp)
jne 0x19014
cmpl $0x5d, -0x28(%rbp)
jne 0x19008
movl $0x1, -0x54(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x57a90
movl %eax, -0x2c(%rbp)
jmp 0x19016
xorl %eax, %eax
cmpl $0x0, -0x2c(%rbp)
movb %al, -0x6d(%rbp)
je 0x1902b
cmpl $0x5d, -0x2c(%rbp)
setne %al
movb %al, -0x6d(%rbp)
movb -0x6d(%rbp), %al
testb $0x1, %al
jne 0x19034
jmp 0x190aa
cmpl $0x2d, -0x2c(%rbp)
jne 0x19084
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x5d, %eax
je 0x19084
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
je 0x19084
cmpl $0x0, -0x50(%rbp)
jbe 0x19084
leaq -0x10(%rbp), %rdi
callq 0x57a90
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x50(%rbp), %eax
jb 0x1907b
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
ja 0x1907b
movl $0x1, -0x54(%rbp)
movl $0x0, -0x50(%rbp)
jmp 0x19099
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jne 0x19093
movl $0x1, -0x54(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x50(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x57a90
movl %eax, -0x2c(%rbp)
jmp 0x19016
cmpl $0x0, -0x2c(%rbp)
je 0x190bb
movl -0x54(%rbp), %eax
xorl -0x58(%rbp), %eax
cmpl $0x0, %eax
jne 0x190c7
movl $0x0, -0x4(%rbp)
jmp 0x19197
jmp 0x18c90
jmp 0x190ce
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x80, %eax
jge 0x190f3
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movzbl (%rax), %eax
movl %eax, -0x74(%rbp)
jmp 0x190ff
leaq -0x18(%rbp), %rdi
callq 0x57a90
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jne 0x19112
jmp 0x18c90
movzbl -0x39(%rbp), %eax
cmpl $0x0, %eax
je 0x1915c
cmpl $0x80, -0x28(%rbp)
jae 0x1915c
cmpl $0x80, -0x2c(%rbp)
jae 0x1915c
movl -0x28(%rbp), %eax
movzbl %al, %eax
movl %eax, %ecx
leaq 0x89b04(%rip), %rax     # 0xa2c40
movzbl (%rax,%rcx), %eax
movl -0x2c(%rbp), %ecx
movzbl %cl, %ecx
movl %ecx, %edx
leaq 0x89af1(%rip), %rcx     # 0xa2c40
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x1915c
jmp 0x18c90
movl -0x28(%rbp), %eax
cmpl -0x30(%rbp), %eax
jne 0x19179
movq -0x10(%rbp), %rax
cmpq -0x48(%rbp), %rax
je 0x19179
cmpl $0x0, -0x2c(%rbp)
je 0x19179
jmp 0x18c90
movl $0x0, -0x4(%rbp)
jmp 0x19197
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)