// File: /workspace/github_c_makefile_star2_O2/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
callq 0x2243eb
cmpl 0x9c(%r12), %eax
jle 0x283895
leaq 0xf5def(%rip), %rsi     # 0x37966d
pushq $-0x1
popq %rdx
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2246d3
cmpl $0x3, %ebp
jne 0x28390b
movq 0x10(%r15), %rdi
callq 0x2243e3
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x28396b
pushq $-0x1
popq %rsi
movq %rax, %rdi
callq 0x24e3fa
cmpl $0x1, %eax
jne 0x283959
leaq 0x8(%rsp), %rdi
callq 0x24e375
movl %eax, %ebp
movzbl (%r14), %eax
cmpl %eax, %ebp
je 0x2838e2
movzbl 0x1(%r14), %eax
cmpl %eax, %ebp
jne 0x283910
movl (%r14), %eax
movl %eax, 0x4(%rsp)
movzbl %al, %ecx
shrl $0x8, %eax
cmpl %ecx, %ebp
jne 0x2838f8
movb $0x0, 0x4(%rsp)
movzbl %al, %eax
leaq 0x4(%rsp), %r14
cmpl %eax, %ebp
jne 0x283910
movb $0x0, 0x5(%rsp)
jmp 0x283910
movzbl 0x2(%r14), %ebp
movq (%r15), %rdi
callq 0x2243e3
movq %rax, %r12
movq 0x8(%r15), %rdi
callq 0x2243e3
testq %rax, %rax
setne %cl
testq %r12, %r12
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x28396b
movq %r12, %rdi
movq %rax, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x22794b
xorl %esi, %esi
testl %eax, %eax
sete %sil
movq %rbx, %rdi
callq 0x224920
jmp 0x28396b
leaq 0xf5d2e(%rip), %rsi     # 0x37968e
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x2246d3
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq