// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3IsLikeFunction
SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){
  FuncDef *pDef;
  int nExpr;
  if( pExpr->op!=TK_FUNCTION || !pExpr->x.pList ){
    return 0;
  }
  assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
  nExpr = pExpr->x.pList->nExpr;
  pDef = sqlite3FindFunction(db, pExpr->u.zToken, nExpr, SQLITE_UTF8, 0);
#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
  if( pDef==0 ) return 0;
#endif
  if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){
    return 0;
  }

  /* The memcpy() statement assumes that the wildcard characters are
  ** the first three statements in the compareInfo structure.  The
  ** asserts() that follow verify that assumption
  */
  memcpy(aWc, pDef->pUserData, 3);
  assert( (char*)&likeInfoAlt == (char*)&likeInfoAlt.matchAll );
  assert( &((char*)&likeInfoAlt)[1] == (char*)&likeInfoAlt.matchOne );
  assert( &((char*)&likeInfoAlt)[2] == (char*)&likeInfoAlt.matchSet );

  if( nExpr<3 ){
    aWc[3] = 0;
  }else{
    Expr *pEscape = pExpr->x.pList->a[2].pExpr;
    char *zEscape;
    if( pEscape->op!=TK_STRING ) return 0;
    zEscape = pEscape->u.zToken;
    if( zEscape[0]==0 || zEscape[1]!=0 ) return 0;
    if( zEscape[0]==aWc[0] ) return 0;
    if( zEscape[0]==aWc[1] ) return 0;
    aWc[3] = zEscape[0];
  }

  *pIsNocase = (pDef->funcFlags & SQLITE_FUNC_CASE)==0;
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xa9, %eax
jne 0x4503b1
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x4503bd
movl $0x0, -0x4(%rbp)
jmp 0x4504f3
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
movl -0x34(%rbp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x3d1cd0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x450400
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x45040c
movl $0x0, -0x4(%rbp)
jmp 0x4504f3
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
movw (%rcx), %dx
movw %dx, (%rax)
movb 0x2(%rcx), %cl
movb %cl, 0x2(%rax)
cmpl $0x3, -0x34(%rbp)
jge 0x450437
movq -0x28(%rbp), %rax
movb $0x0, 0x3(%rax)
jmp 0x4504d1
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x38(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x73, %eax
je 0x45045f
movl $0x0, -0x4(%rbp)
jmp 0x4504f3
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x450484
movq -0x48(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x45048d
movl $0x0, -0x4(%rbp)
jmp 0x4504f3
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
movq -0x28(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x4504a8
movl $0x0, -0x4(%rbp)
jmp 0x4504f3
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
movq -0x28(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jne 0x4504c4
movl $0x0, -0x4(%rbp)
jmp 0x4504f3
movq -0x48(%rbp), %rax
movb (%rax), %cl
movq -0x28(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)