// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3ExprCollSeq
SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, const Expr *pExpr){
  sqlite3 *db = pParse->db;
  CollSeq *pColl = 0;
  const Expr *p = pExpr;
  while( p ){
    int op = p->op;
    if( op==TK_REGISTER ) op = p->op2;
    if( (op==TK_AGG_COLUMN || op==TK_COLUMN || op==TK_TRIGGER)
     && p->y.pTab!=0
    ){
      /* op==TK_REGISTER && p->y.pTab!=0 happens when pExpr was originally
      ** a TK_COLUMN but was previously evaluated and cached in a register */
      int j = p->iColumn;
      if( j>=0 ){
        const char *zColl = p->y.pTab->aCol[j].zColl;
        pColl = sqlite3FindCollSeq(db, ENC(db), zColl, 0);
      }
      break;
    }
    if( op==TK_CAST || op==TK_UPLUS ){
      p = p->pLeft;
      continue;
    }
    if( op==TK_VECTOR ){
      p = p->x.pList->a[0].pExpr;
      continue;
    }
    if( op==TK_COLLATE ){
      pColl = sqlite3GetCollSeq(pParse, ENC(db), 0, p->u.zToken);
      break;
    }
    if( p->flags & EP_Collate ){
      if( p->pLeft && (p->pLeft->flags & EP_Collate)!=0 ){
        p = p->pLeft;
      }else{
        Expr *pNext  = p->pRight;
        /* The Expr.x union is never used at the same time as Expr.pRight */
        assert( p->x.pList==0 || p->pRight==0 );
        if( p->x.pList!=0
         && !db->mallocFailed
         && ALWAYS(!ExprHasProperty(p, EP_xIsSelect))
        ){
          int i;
          for(i=0; ALWAYS(i<p->x.pList->nExpr); i++){
            if( ExprHasProperty(p->x.pList->a[i].pExpr, EP_Collate) ){
              pNext = p->x.pList->a[i].pExpr;
              break;
            }
          }
        }
        p = pNext;
      }
    }else{
      break;
    }
  }
  if( sqlite3CheckCollSeq(pParse, pColl) ){
    pColl = 0;
  }
  return pColl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x2a980f
movq %rdi, %rbx
movq (%rdi), %rdi
xorl %r14d, %r14d
movb (%rsi), %al
cmpb $-0x53, %al
jne 0x2a9698
movb 0x2(%rsi), %al
movzbl %al, %ecx
cmpl $0xa5, %ecx
jg 0x2a96b4
cmpl $0x6e, %ecx
jg 0x2a96db
cmpl $0x24, %ecx
je 0x2a96d2
cmpl $0x4d, %ecx
je 0x2a96e7
jmp 0x2a96fc
cmpl $0xae, %ecx
je 0x2a9760
cmpl $0xab, %ecx
je 0x2a96d2
cmpl $0xa6, %ecx
je 0x2a96e7
jmp 0x2a96fc
addq $0x10, %rsi
jmp 0x2a9768
cmpl $0xa4, %ecx
jne 0x2a977c
movq 0x40(%rsi), %rcx
testq %rcx, %rcx
jne 0x2a97c6
cmpb $0x6f, %al
je 0x2a9785
movl 0x4(%rsi), %r8d
btl $0x8, %r8d
jae 0x2a9812
movq 0x10(%rsi), %rdx
testq %rdx, %rdx
je 0x2a971a
testb $0x1, 0x5(%rdx)
jne 0x2a976b
movq 0x18(%rsi), %rax
movq 0x20(%rsi), %rcx
testq %rcx, %rcx
je 0x2a975b
btl $0xb, %r8d
jb 0x2a975b
cmpb $0x0, 0x61(%rdi)
jne 0x2a975b
movslq (%rcx), %rdx
testq %rdx, %rdx
jle 0x2a975b
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rsi
xorl %r8d, %r8d
movq 0x8(%rcx,%r8), %rdx
testb $0x1, 0x5(%rdx)
jne 0x2a976b
addq $0x18, %r8
cmpq %r8, %rsi
jne 0x2a9747
movq %rax, %rdx
jmp 0x2a976b
movq 0x20(%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rdx
movq %rdx, %rsi
testq %rdx, %rdx
jne 0x2a968f
jmp 0x2a9812
cmpl $0x6f, %ecx
jne 0x2a96fc
movzbl 0x5e(%rdi), %eax
movq 0x8(%rsi), %rcx
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x2a9824
movq %rax, %r14
testq %r14, %r14
je 0x2a980f
cmpq $0x0, 0x18(%r14)
jne 0x2a9812
movq (%r14), %rcx
movq (%rbx), %rax
movzbl 0x5e(%rax), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2a9824
testq %rax, %rax
cmoveq %rax, %r14
jmp 0x2a9812
movswq 0x30(%rsi), %rax
testq %rax, %rax
js 0x2a980f
movq 0x8(%rcx), %rcx
shlq $0x5, %rax
movq 0x10(%rcx,%rax), %rsi
testq %rsi, %rsi
je 0x2a981b
movzbl 0x5e(%rdi), %r15d
addq $0x238, %rdi            # imm = 0x238
xorl %r14d, %r14d
xorl %edx, %edx
callq 0x2a547e
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x2a9812
leaq (%r15,%r15,4), %rcx
leaq (%rax,%rcx,8), %r14
addq $-0x28, %r14
jmp 0x2a979c
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0x10(%rdi), %r14
jmp 0x2a979c