// File: /workspace/github_c_makefile_star2_O2/jkbenaim[P]psfrag/sqlite3.c
// Function: sqlite3ExprCollSeq
SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){
  sqlite3 *db = pParse->db;
  CollSeq *pColl = 0;
  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_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 );
        /* p->flags holds EP_Collate and p->pLeft->flags does not.  And
        ** p->x.pSelect cannot.  So if p->x.pLeft exists, it must hold at
        ** least one EP_Collate. Thus the following two ALWAYS. */
        if( p->x.pList!=0 && 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 0x3a58d
movq %rsi, %rax
movb (%rsi), %cl
cmpb $-0x55, %cl
jne 0x3a463
movb 0x36(%rax), %cl
cmpb $0x24, %cl
je 0x3a517
movzbl %cl, %edx
cmpl $0x4d, %edx
je 0x3a49a
cmpl $0xa2, %edx
je 0x3a49a
cmpl $0xa4, %edx
je 0x3a49a
cmpl $0xa9, %edx
je 0x3a517
cmpl $0x6d, %edx
jne 0x3a4ac
jmp 0x3a528
movq 0x40(%rax), %rdx
testq %rdx, %rdx
jne 0x3a53c
cmpb $0x6d, %cl
je 0x3a528
movl 0x4(%rax), %edx
btl $0x8, %edx
jae 0x3a58d
movq 0x10(%rax), %rsi
testq %rsi, %rsi
je 0x3a4c8
testb $0x1, 0x5(%rsi)
jne 0x3a44d
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
testq %rax, %rax
sete %sil
shrl $0xb, %edx
andl $0x1, %edx
orb %sil, %dl
movq %rcx, %rsi
jne 0x3a44d
movl (%rax), %edx
testl %edx, %edx
cmovlel %ebx, %edx
shlq $0x5, %rdx
addq $0x20, %rdx
xorl %r8d, %r8d
leaq 0x20(%r8), %r9
cmpq %r9, %rdx
je 0x3a520
movq 0x8(%rax,%r8), %rsi
testb $0x1, 0x5(%rsi)
movq %r9, %r8
je 0x3a4fb
jmp 0x3a44d
movq 0x10(%rax), %rsi
jmp 0x3a44d
movq %rcx, %rsi
jmp 0x3a44d
movzbl 0x5e(%rdi), %esi
movq 0x8(%rax), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x3a687
jmp 0x3a55e
movswq 0x30(%rax), %rax
testq %rax, %rax
js 0x3a58b
movq 0x8(%rdx), %rcx
shlq $0x5, %rax
movq 0x10(%rcx,%rax), %rdx
movzbl 0x5e(%rdi), %esi
xorl %ecx, %ecx
callq 0x3a598
movq %rax, %rbx
testq %rax, %rax
je 0x3a58b
cmpq $0x0, 0x18(%rbx)
jne 0x3a58d
movq (%rbx), %rcx
movq (%r14), %rax
movzbl 0x5e(%rax), %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x3a687
testq %rax, %rax
cmoveq %rax, %rbx
jmp 0x3a58d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq