// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: whereRangeVectorLen
static int whereRangeVectorLen(
  Parse *pParse,       /* Parsing context */
  int iCur,            /* Cursor open on pIdx */
  Index *pIdx,         /* The index to be used for a inequality constraint */
  int nEq,             /* Number of prior equality constraints on same index */
  WhereTerm *pTerm     /* The vector inequality constraint */
){
  int nCmp = sqlite3ExprVectorSize(pTerm->pExpr->pLeft);
  int i;

  nCmp = MIN(nCmp, (pIdx->nColumn - nEq));
  for(i=1; i<nCmp; i++){
    /* Test if comparison i of pTerm is compatible with column (i+nEq)
    ** of the index. If not, exit the loop.  */
    char aff;                     /* Comparison affinity */
    char idxaff = 0;              /* Indexed columns affinity */
    CollSeq *pColl;               /* Comparison collation sequence */
    Expr *pLhs = pTerm->pExpr->pLeft->x.pList->a[i].pExpr;
    Expr *pRhs = pTerm->pExpr->pRight;
    if( pRhs->flags & EP_xIsSelect ){
      pRhs = pRhs->x.pSelect->pEList->a[i].pExpr;
    }else{
      pRhs = pRhs->x.pList->a[i].pExpr;
    }

    /* Check that the LHS of the comparison is a column reference to
    ** the right column of the right source table. And that the sort
    ** order of the index column is the same as the sort order of the
    ** leftmost index column.  */
    if( pLhs->op!=TK_COLUMN
     || pLhs->iTable!=iCur
     || pLhs->iColumn!=pIdx->aiColumn[i+nEq]
     || pIdx->aSortOrder[i+nEq]!=pIdx->aSortOrder[nEq]
    ){
      break;
    }

    testcase( pLhs->iColumn==XN_ROWID );
    aff = sqlite3CompareAffinity(pRhs, sqlite3ExprAffinity(pLhs));
    idxaff = sqlite3TableColumnAffinity(pIdx->pTable, pLhs->iColumn);
    if( aff!=idxaff ) break;

    pColl = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs);
    if( pColl==0 ) break;
    if( sqlite3StrICmp(pColl->zName, pIdx->azColl[i+nEq]) ) break;
  }
  return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %r15d
movq %rdx, %r14
movl %esi, 0x4(%rsp)
movq %rdi, 0x10(%rsp)
movq %r8, 0x30(%rsp)
movq (%r8), %rax
movq 0x10(%rax), %rdi
callq 0x26697d
movzwl 0x60(%r14), %ecx
subl %r15d, %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %r15d, %eax
movq %rax, 0x20(%rsp)
movslq %ecx, %rbp
movslq %r15d, %rcx
cmpl $0x2, %ebp
pushq $0x1
popq %rax
cmovgel %ebp, %eax
movl %eax, (%rsp)
leaq (%rcx,%rcx), %rax
movq %rax, 0x28(%rsp)
movq %rcx, 0x18(%rsp)
leaq (,%rcx,8), %rax
movq %rax, 0x8(%rsp)
pushq $0x1
popq %r12
pushq $0x8
popq %rbx
cmpq %rbp, %r12
jge 0x27b80c
movq 0x30(%rsp), %rax
movq (%rax), %rcx
movq 0x18(%rcx), %rax
testb $0x8, 0x5(%rax)
je 0x27b72b
movq 0x20(%rax), %rax
movq 0x10(%rcx), %rcx
movq 0x20(%rcx), %rcx
movq (%rcx,%rbx,4), %r13
cmpb $-0x5c, (%r13)
jne 0x27b7fa
movl 0x4(%rsp), %ecx
cmpl %ecx, 0x2c(%r13)
jne 0x27b7fa
movzwl 0x30(%r13), %ecx
movq 0x8(%r14), %rdx
addq 0x28(%rsp), %rdx
cmpw (%rdx,%r12,2), %cx
jne 0x27b7fa
movq 0x38(%r14), %rcx
movq 0x18(%rsp), %rdx
addq %rcx, %rdx
movb (%r12,%rdx), %dl
movq 0x20(%rsp), %rsi
cmpb (%rcx,%rsi), %dl
jne 0x27b7fa
movq 0x20(%rax), %rax
movq (%rax,%rbx,4), %r15
movq %r13, %rdi
callq 0x267d81
movsbl %al, %esi
movq %r15, %rdi
callq 0x267e25
movswq 0x30(%r13), %rcx
testq %rcx, %rcx
js 0x27b7ba
movq 0x18(%r14), %rdx
movq 0x8(%rdx), %rdx
shlq $0x5, %rcx
movb 0x19(%rdx,%rcx), %cl
jmp 0x27b7bc
movb $0x44, %cl
cmpb %cl, %al
jne 0x27b7fa
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x24e4fd
testq %rax, %rax
je 0x27b7fa
movq (%rax), %rdi
movq 0x40(%r14), %rax
addq 0x8(%rsp), %rax
movq (%rax,%r12,8), %rsi
callq 0x221779
testl %eax, %eax
jne 0x27b7fa
incq %r12
addq $0x6, %rbx
jmp 0x27b70c
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl (%rsp), %eax
jmp 0x27b7fd