// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: likeFunc
static void likeFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  const unsigned char *zA, *zB;
  u32 escape;
  int nPat;
  sqlite3 *db = sqlite3_context_db_handle(context);
  struct compareInfo *pInfo = sqlite3_user_data(context);
  struct compareInfo backupInfo;

#ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS
  if( sqlite3_value_type(argv[0])==SQLITE_BLOB
   || sqlite3_value_type(argv[1])==SQLITE_BLOB
  ){
#ifdef SQLITE_TEST
    sqlite3_like_count++;
#endif
    sqlite3_result_int(context, 0);
    return;
  }
#endif

  /* Limit the length of the LIKE or GLOB pattern to avoid problems
  ** of deep recursion and N*N behavior in patternCompare().
  */
  nPat = sqlite3_value_bytes(argv[0]);
  testcase( nPat==db->aLimit[SQLITE_LIMIT_LIKE_PATTERN_LENGTH] );
  testcase( nPat==db->aLimit[SQLITE_LIMIT_LIKE_PATTERN_LENGTH]+1 );
  if( nPat > db->aLimit[SQLITE_LIMIT_LIKE_PATTERN_LENGTH] ){
    sqlite3_result_error(context, "LIKE or GLOB pattern too complex", -1);
    return;
  }
  if( argc==3 ){
    /* The escape character string must consist of a single UTF-8 character.
    ** Otherwise, return an error.
    */
    const unsigned char *zEsc = sqlite3_value_text(argv[2]);
    if( zEsc==0 ) return;
    if( sqlite3Utf8CharLen((char*)zEsc, -1)!=1 ){
      sqlite3_result_error(context,
          "ESCAPE expression must be a single character", -1);
      return;
    }
    escape = sqlite3Utf8Read(&zEsc);
    if( escape==pInfo->matchAll || escape==pInfo->matchOne ){
      memcpy(&backupInfo, pInfo, sizeof(backupInfo));
      pInfo = &backupInfo;
      if( escape==pInfo->matchAll ) pInfo->matchAll = 0;
      if( escape==pInfo->matchOne ) pInfo->matchOne = 0;
    }
  }else{
    escape = pInfo->matchSet;
  }
  zB = sqlite3_value_text(argv[0]);
  zA = sqlite3_value_text(argv[1]);
  if( zA && zB ){
#ifdef SQLITE_TEST
    sqlite3_like_count++;
#endif
    sqlite3_result_int(context,
                      patternCompare(zB, zA, pInfo, escape)==SQLITE_MATCH);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq 0x28(%rax), %r12
movq 0x8(%rcx), %r14
movq (%rdx), %rdi
movl $0x1, %esi
callq 0x278229
cmpl 0x9c(%r12), %eax
jle 0x2e7c90
movl $0x1, 0x24(%rbx)
movq (%rbx), %rdi
leaq 0xf15df(%rip), %rsi     # 0x3d924d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x278594
cmpl $0x3, %ebp
jne 0x2e7d28
movq 0x10(%r15), %rdi
movl $0x1, %esi
callq 0x278305
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x2e7d8f
movb (%rax), %cl
testb %cl, %cl
sete %dl
cmpq $-0x1, %rax
sete %sil
orb %dl, %sil
jne 0x2e7cff
xorl %esi, %esi
movl %esi, %edx
cmpb $-0x40, %cl
jb 0x2e7ce5
movb 0x1(%rax), %cl
incq %rax
movl %ecx, %esi
andb $-0x40, %sil
negb %sil
jo 0x2e7cd2
jmp 0x2e7cea
incq %rax
movb (%rax), %cl
testb %cl, %cl
je 0x2e7cf7
leal 0x1(%rdx), %esi
cmpq $-0x1, %rax
jne 0x2e7ccb
testl %edx, %edx
je 0x2e7d9c
movl $0x1, 0x24(%rbx)
movq (%rbx), %rdi
leaq 0xf155e(%rip), %rsi     # 0x3d926e
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
callq 0x278594
jmp 0x2e7d8f
movzbl 0x2(%r14), %ebp
movq (%r15), %rdi
movl $0x1, %esi
callq 0x278305
movq %rax, %r12
movq 0x8(%r15), %rdi
movl $0x1, %esi
callq 0x278305
testq %rax, %rax
setne %cl
testq %r12, %r12
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2e7d8f
movq %r12, %rdi
movq %rax, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x27c120
xorl %esi, %esi
testl %eax, %eax
sete %sil
movq (%rbx), %rdi
testb $0x24, 0x9(%rdi)
je 0x2e7d86
callq 0x2929ee
jmp 0x2e7d8f
movq %rsi, (%rdi)
movw $0x4, 0x8(%rdi)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %rdi
callq 0x2a945f
movl %eax, %ebp
movzbl (%r14), %eax
cmpl %eax, %ebp
je 0x2e7dbd
movzbl 0x1(%r14), %eax
cmpl %eax, %ebp
jne 0x2e7d2d
movl (%r14), %eax
movl %eax, 0x4(%rsp)
movzbl %al, %ecx
shrl $0x8, %eax
cmpl %ecx, %ebp
jne 0x2e7dd3
movb $0x0, 0x4(%rsp)
movzbl %al, %eax
leaq 0x4(%rsp), %r14
cmpl %eax, %ebp
jne 0x2e7d2d
movb $0x0, 0x5(%rsp)
jmp 0x2e7d2d