// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3c9230
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3c9210
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x3c78a0
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x9c(%rcx), %eax
jle 0x462e25
movq -0x8(%rbp), %rdi
leaq 0x14b8d1(%rip), %rsi    # 0x5ae6e7
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3c8120
jmp 0x462f4d
cmpl $0x3, -0xc(%rbp)
jne 0x462ee3
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x3c7880
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x462e4c
jmp 0x462f4d
movq -0x50(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x412190
cmpl $0x1, %eax
je 0x462e79
movq -0x8(%rbp), %rdi
leaq 0x14b89e(%rip), %rsi    # 0x5ae708
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3c8120
jmp 0x462f4d
leaq -0x50(%rbp), %rdi
callq 0x411dc0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x462ea2
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jne 0x462ee1
movq -0x40(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
leaq -0x44(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x462ec8
movq -0x40(%rbp), %rax
movb $0x0, (%rax)
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jne 0x462edf
movq -0x40(%rbp), %rax
movb $0x0, 0x1(%rax)
jmp 0x462ee1
jmp 0x462eee
movq -0x40(%rbp), %rax
movzbl 0x2(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x3c7880
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3c7880
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x462f4d
cmpq $0x0, -0x28(%rbp)
je 0x462f4d
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x2c(%rbp), %ecx
callq 0x3cc9b0
movq -0x58(%rbp), %rdi
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x3c8480
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)