// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
movq (%rdi), %r13
leaq 0x238(%r13), %r14
xorl %r15d, %r15d
testq %r12, %r12
je 0x2b3456
movb (%r12), %al
cmpb $-0x53, %al
jne 0x2b32d4
movb 0x2(%r12), %al
movzbl %al, %eax
cmpl $0xa3, %eax
jle 0x2b32fc
cmpl $0xaa, %eax
jg 0x2b338e
cmpl $0xa4, %eax
je 0x2b3332
cmpl $0xa6, %eax
je 0x2b3332
jmp 0x2b33d9
cmpl $0x24, %eax
je 0x2b33c7
cmpl $0x4d, %eax
je 0x2b3332
cmpl $0x6f, %eax
jne 0x2b33d9
movzbl 0x5e(%r13), %esi
movq 0x8(%r12), %rcx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2b3491
movq %rax, %r15
movb $0x1, %bpl
jmp 0x2b33ce
movq 0x40(%r12), %rcx
testq %rcx, %rcx
je 0x2b33a7
movswq 0x30(%r12), %rax
movb $0x1, %bpl
testq %rax, %rax
js 0x2b33ce
movq 0x8(%rcx), %rcx
shlq $0x5, %rax
movq 0x10(%rcx,%rax), %rsi
testq %rsi, %rsi
je 0x2b3441
movzbl 0x5e(%r13), %r15d
movq %r14, %rdi
xorl %edx, %edx
callq 0x2aefdf
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x2b344e
leaq (%r15,%r15,4), %rcx
leaq (%rax,%rcx,8), %r15
addq $-0x28, %r15
jmp 0x2b33ce
cmpl $0xab, %eax
je 0x2b33c7
cmpl $0xae, %eax
jne 0x2b33d9
movq 0x20(%r12), %rax
movq 0x8(%rax), %r12
jmp 0x2b33cc
cmpl $0xaa, %eax
jg 0x2b33b9
cmpl $0x24, %eax
jne 0x2b330a
jmp 0x2b33c7
cmpl $0xae, %eax
je 0x2b339c
cmpl $0xab, %eax
jne 0x2b33d9
movq 0x10(%r12), %r12
xorl %ebp, %ebp
testb %bpl, %bpl
je 0x2b32be
jmp 0x2b3456
movl 0x4(%r12), %edx
movb $0x1, %bpl
btl $0x8, %edx
jae 0x2b33ce
movq 0x10(%r12), %rax
testq %rax, %rax
je 0x2b33f7
testb $0x1, 0x5(%rax)
jne 0x2b3447
movq 0x18(%r12), %rax
movq 0x20(%r12), %rcx
testq %rcx, %rcx
je 0x2b3447
xorl %ebp, %ebp
btl $0xb, %edx
jb 0x2b3449
cmpb $0x0, 0x61(%r13)
jne 0x2b3449
movslq (%rcx), %rdx
testq %rdx, %rdx
jle 0x2b3447
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
movq 0x8(%rcx,%rsi), %r12
testb $0x1, 0x5(%r12)
jne 0x2b33cc
addq $0x18, %rsi
xorl %ebp, %ebp
cmpq %rsi, %rdx
jne 0x2b3427
jmp 0x2b3449
movq 0x10(%r13), %r15
jmp 0x2b33ce
xorl %ebp, %ebp
movq %rax, %r12
jmp 0x2b33ce
xorl %r15d, %r15d
jmp 0x2b33ce
testq %r15, %r15
je 0x2b347f
cmpq $0x0, 0x18(%r15)
jne 0x2b347f
movq (%r15), %rcx
movq (%rbx), %rax
movzbl 0x5e(%rax), %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x2b3491
testq %rax, %rax
jne 0x2b347f
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq