// File: /workspace/github_c_makefile_star2_O3/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
testq %rsi, %rsi
je 0x41f7c
movq %rdi, %rbx
movq (%rdi), %rax
xorl %r14d, %r14d
movb (%rsi), %cl
cmpb $-0x55, %cl
jne 0x41e2e
movb 0x36(%rsi), %cl
movzbl %cl, %edx
cmpl $0xa1, %edx
jle 0x41e57
cmpl $0xa2, %edx
je 0x41e65
cmpl $0xa9, %edx
je 0x41ed9
cmpl $0xa4, %edx
je 0x41e65
jmp 0x41e77
cmpl $0x24, %edx
je 0x41ed9
cmpl $0x4d, %edx
jne 0x41eee
movq 0x40(%rsi), %rdx
testq %rdx, %rdx
jne 0x41f0c
cmpb $0x6d, %cl
je 0x41ef3
movl 0x4(%rsi), %r8d
btl $0x8, %r8d
jae 0x41f7f
movq 0x10(%rsi), %rdi
testq %rdi, %rdi
je 0x41e95
testb $0x1, 0x5(%rdi)
jne 0x41edd
movq 0x18(%rsi), %rcx
movq 0x20(%rsi), %rdx
testq %rdx, %rdx
sete %sil
shrl $0xb, %r8d
andl $0x1, %r8d
orb %sil, %r8b
jne 0x41ed4
movslq (%rdx), %rsi
testq %rsi, %rsi
jle 0x41ed4
shlq $0x5, %rsi
xorl %r8d, %r8d
movq 0x8(%rdx,%r8), %rdi
testb $0x1, 0x5(%rdi)
jne 0x41edd
addq $0x20, %r8
cmpq %r8, %rsi
jne 0x41ec0
movq %rcx, %rdi
jmp 0x41edd
movq 0x10(%rsi), %rdi
movq %rdi, %rsi
testq %rdi, %rdi
jne 0x41e24
jmp 0x41f7f
cmpl $0x6d, %edx
jne 0x41e77
movzbl 0x5e(%rax), %eax
movq 0x8(%rsi), %rcx
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x42083
movq %rax, %r14
jmp 0x41f52
movswq 0x30(%rsi), %rcx
testq %rcx, %rcx
js 0x41f7c
movq 0x8(%rdx), %rdx
shlq $0x5, %rcx
movq 0x10(%rdx,%rcx), %rsi
movzbl 0x5e(%rax), %r14d
testq %rsi, %rsi
je 0x41f3d
addq $0x218, %rax            # imm = 0x218
movq %rax, %rdi
xorl %edx, %edx
callq 0x3e093
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x41f7c
leaq (%r14,%r14,4), %rcx
leaq (%rax,%rcx,8), %r14
addq $-0x28, %r14
testq %r14, %r14
je 0x41f7c
cmpq $0x0, 0x18(%r14)
jne 0x41f7f
movq (%r14), %rcx
movq (%rbx), %rax
movzbl 0x5e(%rax), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x42083
testq %rax, %rax
cmoveq %rax, %r14
jmp 0x41f7f
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq