// File: /workspace/github_c_makefile_star2_O1/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
movq %rdx, %r14
movl %esi, 0xc(%rsp)
movq %rdi, 0x28(%rsp)
movq %r8, 0x30(%rsp)
movq (%r8), %rax
movq 0x10(%rax), %rax
movb (%rax), %dl
cmpb $-0x53, %dl
jne 0x2e5a8c
movb 0x2(%rax), %dl
cmpb $-0x52, %dl
je 0x2e5aa5
movzbl %dl, %esi
movl $0x1, %edx
cmpl $0x88, %esi
jne 0x2e5aab
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
movl (%rax), %edx
movzwl 0x60(%r14), %eax
subl %ecx, %eax
cmpl %eax, %edx
cmovll %edx, %eax
movl $0x1, %r12d
cmpl $0x2, %eax
jl 0x2e5bfd
movl %ecx, %edx
movq %rdx, 0x18(%rsp)
movslq %ecx, %rcx
movq %rcx, 0x20(%rsp)
movl %eax, 0x8(%rsp)
movl %eax, %eax
movq %rax, 0x10(%rsp)
movl $0x1, %r12d
leaq 0xf4f73(%rip), %rbx     # 0x3daa60
movq 0x30(%rsp), %rax
movq (%rax), %rcx
movq 0x18(%rcx), %rax
testb $0x8, 0x5(%rax)
je 0x2e5b03
movq 0x20(%rax), %rax
movq 0x10(%rcx), %rcx
movq 0x20(%rcx), %rdx
leaq (%r12,%r12,2), %rcx
movq 0x8(%rdx,%rcx,8), %r13
cmpb $-0x5c, (%r13)
jne 0x2e5bfd
movl 0xc(%rsp), %edx
cmpl %edx, 0x2c(%r13)
jne 0x2e5bfd
movzwl 0x30(%r13), %edx
movq 0x8(%r14), %rsi
movq 0x20(%rsp), %rdi
leaq (%r12,%rdi), %rbp
cmpw (%rsi,%rbp,2), %dx
jne 0x2e5bfd
movq 0x38(%r14), %rdx
movb (%rdx,%rbp), %sil
movq 0x18(%rsp), %rdi
cmpb (%rdx,%rdi), %sil
jne 0x2e5bfd
movq 0x20(%rax), %rax
movq 0x8(%rax,%rcx,8), %r15
movq %r13, %rdi
callq 0x2ca042
movsbl %al, %esi
movq %r15, %rdi
callq 0x2ca0e4
movswq 0x30(%r13), %rcx
testq %rcx, %rcx
js 0x2e5b98
movq 0x18(%r14), %rdx
movq 0x8(%rdx), %rdx
shlq $0x5, %rcx
movb 0x19(%rdx,%rcx), %cl
jmp 0x2e5b9a
movb $0x44, %cl
cmpb %cl, %al
jne 0x2e5bfd
movq 0x28(%rsp), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x2b325c
testq %rax, %rax
je 0x2e5bfd
movq (%rax), %rax
movq 0x40(%r14), %rcx
movq (%rcx,%rbp,8), %rcx
xorl %edx, %edx
movzbl (%rax,%rdx), %esi
movzbl (%rcx,%rdx), %edi
cmpb %dil, %sil
jne 0x2e5bd4
testq %rsi, %rsi
jne 0x2e5bde
jmp 0x2e5be3
movb (%rsi,%rbx), %r8b
cmpb (%rdi,%rbx), %r8b
jne 0x2e5be3
incq %rdx
jmp 0x2e5bc0
cmpb %dil, %sil
jne 0x2e5bfd
incq %r12
cmpq 0x10(%rsp), %r12
jne 0x2e5aed
movl 0x8(%rsp), %eax
movl %eax, %r12d
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq