// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rdi
xorl %ebx, %ebx
testq %rsi, %rsi
je 0x24e6bb
movq %rsi, %rax
movb (%rsi), %cl
cmpb $-0x53, %cl
jne 0x24e563
movb 0x2(%rax), %cl
cmpb $0x24, %cl
je 0x24e638
movzbl %cl, %edx
cmpl $0x4d, %edx
je 0x24e5a6
cmpl $0xa4, %edx
je 0x24e5a6
cmpl $0xa6, %edx
je 0x24e5a6
cmpl $0xab, %edx
je 0x24e638
cmpl $0xae, %edx
je 0x24e63e
cmpl $0x6f, %edx
jne 0x24e5bc
jmp 0x24e656
movq 0x40(%rax), %rdx
testq %rdx, %rdx
jne 0x24e66a
cmpb $0x6f, %cl
je 0x24e656
movl 0x4(%rax), %edx
btl $0x8, %edx
jae 0x24e6bb
movq 0x10(%rax), %rsi
testq %rsi, %rsi
je 0x24e5dc
testb $0x1, 0x5(%rsi)
jne 0x24e54d
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
movq %rcx, %rsi
testq %rax, %rax
je 0x24e54d
btl $0xb, %edx
movq %rcx, %rsi
jb 0x24e54d
cmpb $0x0, 0x61(%rdi)
movq %rcx, %rsi
jne 0x24e54d
movl (%rax), %edx
testl %edx, %edx
cmovlel %ebx, %edx
imulq $0x18, %rdx, %rdx
addq $0x18, %rdx
xorl %r8d, %r8d
leaq 0x18(%r8), %r9
cmpq %r9, %rdx
je 0x24e64e
movq 0x8(%rax,%r8), %rsi
testb $0x1, 0x5(%rsi)
movq %r9, %r8
je 0x24e61c
jmp 0x24e54d
addq $0x10, %rax
jmp 0x24e646
movq 0x20(%rax), %rax
addq $0x8, %rax
movq (%rax), %rsi
jmp 0x24e54d
movq %rcx, %rsi
jmp 0x24e54d
movzbl 0x5e(%rdi), %esi
movq 0x8(%rax), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x24e6c6
jmp 0x24e68c
movswq 0x30(%rax), %rax
testq %rax, %rax
js 0x24e6b9
movq 0x8(%rdx), %rcx
shlq $0x5, %rax
movq 0x10(%rcx,%rax), %rdx
movzbl 0x5e(%rdi), %esi
xorl %ecx, %ecx
callq 0x24a7f0
movq %rax, %rbx
testq %rax, %rax
je 0x24e6b9
cmpq $0x0, 0x18(%rbx)
jne 0x24e6bb
movq (%rbx), %rcx
movq (%r14), %rax
movzbl 0x5e(%rax), %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x24e6c6
testq %rax, %rax
cmoveq %rax, %rbx
jmp 0x24e6bb
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq