// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
callq 0x42d4d0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
movzwl 0x60(%rcx), %ecx
subl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x454cf7
movl -0x2c(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x454d05
movq -0x18(%rbp), %rax
movzwl 0x60(%rax), %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl $0x1, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x454eae
movb $0x0, -0x32(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rax
addq $0x8, %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x454d8b
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
addq $0x8, %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x454da9
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
addq $0x8, %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xa4, %eax
jne 0x454e0d
movq -0x48(%rbp), %rax
movl 0x2c(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x454e0d
movq -0x48(%rbp), %rax
movswl 0x30(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl -0x30(%rbp), %edx
addl -0x1c(%rbp), %edx
movslq %edx, %rdx
movswl (%rcx,%rdx,2), %ecx
cmpl %ecx, %eax
jne 0x454e0d
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movl -0x30(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
movq 0x38(%rcx), %rcx
movslq -0x1c(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x454e12
jmp 0x454eae
movq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rdi
callq 0x42f230
movq -0x60(%rbp), %rdi
movsbl %al, %esi
callq 0x42f370
movb %al, -0x31(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x48(%rbp), %rax
movswl 0x30(%rax), %esi
callq 0x42baa0
movb %al, -0x32(%rbp)
movsbl -0x31(%rbp), %eax
movsbl -0x32(%rbp), %ecx
cmpl %ecx, %eax
je 0x454e58
jmp 0x454eae
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x412420
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x454e76
jmp 0x454eae
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x30(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x3c3e60
cmpl $0x0, %eax
je 0x454e9e
jmp 0x454eae
jmp 0x454ea0
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x454d12
movl -0x30(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)