// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: whereIndexExprTrans
static void whereIndexExprTrans(
  Index *pIdx,      /* The Index */
  int iTabCur,      /* Cursor of the table that is being indexed */
  int iIdxCur,      /* Cursor of the index itself */
  WhereInfo *pWInfo /* Transform expressions in this WHERE clause */
){
  int iIdxCol;               /* Column number of the index */
  ExprList *aColExpr;        /* Expressions that are indexed */
  Table *pTab;
  Walker w;
  IdxExprTrans x;
  aColExpr = pIdx->aColExpr;
  if( aColExpr==0 && !pIdx->bHasVCol ){
    /* The index does not reference any expressions or virtual columns
    ** so no translations are needed. */
    return;
  }
  pTab = pIdx->pTable;
  memset(&w, 0, sizeof(w));
  w.u.pIdxTrans = &x;
  x.iTabCur = iTabCur;
  x.iIdxCur = iIdxCur;
  x.pWInfo = pWInfo;
  x.db = pWInfo->pParse->db;
  for(iIdxCol=0; iIdxCol<pIdx->nColumn; iIdxCol++){
    i16 iRef = pIdx->aiColumn[iIdxCol];
    if( iRef==XN_EXPR ){
      assert( aColExpr->a[iIdxCol].pExpr!=0 );
      x.pIdxExpr = aColExpr->a[iIdxCol].pExpr;
      if( sqlite3ExprIsConstant(x.pIdxExpr) ) continue;
      w.xExprCallback = whereIndexExprTransNode;
#ifndef SQLITE_OMIT_GENERATED_COLUMNS
    }else if( iRef>=0
       && (pTab->aCol[iRef].colFlags & COLFLAG_VIRTUAL)!=0
       && (pTab->aCol[iRef].zColl==0
           || sqlite3StrICmp(pTab->aCol[iRef].zColl, sqlite3StrBINARY)==0)
    ){
      /* Check to see if there are direct references to generated columns
      ** that are contained in the index.  Pulling the generated column
      ** out of the index is an optimization only - the main table is always
      ** available if the index cannot be used.  To avoid unnecessary
      ** complication, omit this optimization if the collating sequence for
      ** the column is non-standard */
      x.iTabCol = iRef;
      w.xExprCallback = whereIndexExprTransColumn;
#endif /* SQLITE_OMIT_GENERATED_COLUMNS */
    }else{
      continue;
    }
    x.iIdxCol = iIdxCol;
    sqlite3WalkExpr(&w, pWInfo->pWhere);
    sqlite3WalkExprList(&w, pWInfo->pOrderBy);
    sqlite3WalkExprList(&w, pWInfo->pResultSet);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, %rbx
movq %rdi, %r14
movq 0x50(%rdi), %r13
testq %r13, %r13
jne 0x2ddedd
testb $0x4, 0x64(%r14)
je 0x2de05c
movq 0x18(%r14), %rax
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x38(%rsp)
movl %esi, 0x8(%rax)
movl %edx, 0xc(%rax)
movq %rbx, 0x18(%rax)
movq (%rbx), %rcx
movq (%rcx), %rcx
movq %rcx, 0x20(%rax)
cmpw $0x0, 0x60(%r14)
je 0x2de05c
addq $0x8, %r13
xorl %r15d, %r15d
leaq 0x10(%rsp), %rdi
leaq 0xf3c27(%rip), %rbp     # 0x3d1b60
leaq 0xf33a0(%rip), %r12     # 0x3d12e0
movq 0x8(%r14), %rax
movswl (%rax,%r15,2), %eax
cmpl $-0x2, %eax
jne 0x2ddfb0
leaq (%r15,%r15,2), %rax
movq (%r13,%rax,8), %rsi
movq %rsi, 0x70(%rsp)
movw $0x1, 0x64(%rsp)
leaq -0x1d5e3(%rip), %rax    # 0x2c0987
movq %rax, 0x48(%rsp)
leaq -0x1d4f6(%rip), %rax    # 0x2c0a80
movq %rax, 0x50(%rsp)
movl $0x0, 0x68(%rsp)
testq %rsi, %rsi
je 0x2de04b
leaq 0x40(%rsp), %rdi
callq 0x2c0a8c
leaq 0x10(%rsp), %rdi
cmpw $0x0, 0x64(%rsp)
leaq 0x1d7(%rip), %rax       # 0x2de17f
jne 0x2de04b
jmp 0x2de00f
testw %ax, %ax
js 0x2de04b
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
movzwl %ax, %edx
shll $0x5, %edx
testb $0x20, 0x1c(%rcx,%rdx)
je 0x2de04b
addq %rdx, %rcx
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
je 0x2de001
xorl %edx, %edx
movzbl (%rcx,%rdx), %esi
movzbl (%rdx,%rbp), %r8d
cmpb %r8b, %sil
jne 0x2ddff2
testq %rsi, %rsi
jne 0x2ddffc
jmp 0x2de001
movb (%rsi,%r12), %sil
cmpb (%r8,%r12), %sil
jne 0x2de04b
incq %rdx
jmp 0x2ddfdd
movl %eax, 0x84(%rsp)
leaq 0x1d8(%rip), %rax       # 0x2de1e7
movq %rax, 0x18(%rsp)
movl %r15d, 0x80(%rsp)
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0x2de02f
callq 0x2c0a8c
leaq 0x10(%rsp), %rdi
movq 0x10(%rbx), %rsi
callq 0x2c0cc0
movq 0x18(%rbx), %rsi
leaq 0x10(%rsp), %rdi
callq 0x2c0cc0
leaq 0x10(%rsp), %rdi
incq %r15
movzwl 0x60(%r14), %eax
cmpq %rax, %r15
jb 0x2ddf40
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq