// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: indexMightHelpWithOrderBy
static int indexMightHelpWithOrderBy(
  WhereLoopBuilder *pBuilder,
  Index *pIndex,
  int iCursor
){
  ExprList *pOB;
  ExprList *aColExpr;
  int ii, jj;

  if( pIndex->bUnordered ) return 0;
  if( (pOB = pBuilder->pWInfo->pOrderBy)==0 ) return 0;
  for(ii=0; ii<pOB->nExpr; ii++){
    Expr *pExpr = sqlite3ExprSkipCollateAndLikely(pOB->a[ii].pExpr);
    if( pExpr->op==TK_COLUMN && pExpr->iTable==iCursor ){
      if( pExpr->iColumn<0 ) return 1;
      for(jj=0; jj<pIndex->nKeyCol; jj++){
        if( pExpr->iColumn==pIndex->aiColumn[jj] ) return 1;
      }
    }else if( (aColExpr = pIndex->aColExpr)!=0 ){
      for(jj=0; jj<pIndex->nKeyCol; jj++){
        if( pIndex->aiColumn[jj]!=XN_EXPR ) continue;
        if( sqlite3ExprCompareSkip(pExpr,aColExpr->a[jj].pExpr,iCursor)==0 ){
          return 1;
        }
      }
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movw 0x63(%rax), %ax
shrw $0x2, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x453b97
movl $0x0, -0x4(%rbp)
jmp 0x453d07
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x453bb8
movl $0x0, -0x4(%rbp)
jmp 0x453d07
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x453d00
movq -0x28(%rbp), %rax
addq $0x8, %rax
movslq -0x34(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x42f120
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xa4, %eax
jne 0x453c70
movq -0x40(%rbp), %rax
movl 0x2c(%rax), %eax
cmpl -0x1c(%rbp), %eax
jne 0x453c70
movq -0x40(%rbp), %rax
movswl 0x30(%rax), %eax
cmpl $0x0, %eax
jge 0x453c20
movl $0x1, -0x4(%rbp)
jmp 0x453d07
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x18(%rbp), %rcx
movzwl 0x5e(%rcx), %ecx
cmpl %ecx, %eax
jge 0x453c6b
movq -0x40(%rbp), %rax
movswl 0x30(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x38(%rbp), %rdx
movswl (%rcx,%rdx,2), %ecx
cmpl %ecx, %eax
jne 0x453c5e
movl $0x1, -0x4(%rbp)
jmp 0x453d07
jmp 0x453c60
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x453c27
jmp 0x453cf0
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x453cee
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x18(%rbp), %rcx
movzwl 0x5e(%rcx), %ecx
cmpl %ecx, %eax
jge 0x453cec
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x38(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
cmpl $-0x2, %eax
je 0x453caf
jmp 0x453ce1
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rax
addq $0x8, %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movl -0x1c(%rbp), %edx
callq 0x4500b0
cmpl $0x0, %eax
jne 0x453cdf
movl $0x1, -0x4(%rbp)
jmp 0x453d07
jmp 0x453ce1
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x453c89
jmp 0x453cee
jmp 0x453cf0
jmp 0x453cf2
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x453bbf
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq