// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
movq (%rdi), %r13
leaq 0x218(%r13), %r14
xorl %r15d, %r15d
testq %r12, %r12
je 0x42d24
movb (%r12), %cl
cmpb $-0x55, %cl
jne 0x42be9
movb 0x36(%r12), %cl
movzbl %cl, %eax
cmpl $0xa1, %eax
jg 0x42c0f
cmpl $0x24, %eax
je 0x42c8c
cmpl $0x4d, %eax
je 0x42c24
cmpl $0x6d, %eax
je 0x42cfa
jmp 0x42c98
cmpl $0xa2, %eax
je 0x42c24
cmpl $0xa9, %eax
je 0x42c8c
cmpl $0xa4, %eax
jne 0x42c98
movq 0x40(%r12), %rdx
testq %rdx, %rdx
je 0x42c7d
movswq 0x30(%r12), %rax
movb $0x1, %bpl
testq %rax, %rax
js 0x42d1b
movq 0x8(%rdx), %rcx
shlq $0x5, %rax
movq 0x10(%rcx,%rax), %rsi
movzbl 0x5e(%r13), %r15d
movq %r13, %rax
testq %rsi, %rsi
je 0x42c64
movq %r14, %rdi
xorl %edx, %edx
callq 0x3ee06
movq 0x10(%rax), %rax
testq %rax, %rax
leaq (%r15,%r15,4), %rcx
leaq -0x28(%rax,%rcx,8), %r15
cmoveq %rax, %r15
jmp 0x42d1b
cmpb $-0x57, %cl
je 0x42c8c
cmpl $0x6d, %eax
je 0x42cfa
cmpl $0x24, %eax
jne 0x42c98
movq 0x10(%r12), %r12
xorl %ebp, %ebp
jmp 0x42d1b
movl 0x4(%r12), %edx
movb $0x1, %bpl
btl $0x8, %edx
jae 0x42d1b
movq 0x10(%r12), %rax
testq %rax, %rax
je 0x42cb6
testb $0x1, 0x5(%rax)
jne 0x42d16
movq 0x18(%r12), %rax
movq 0x20(%r12), %rcx
testq %rcx, %rcx
sete %sil
shrl $0xb, %edx
andl $0x1, %edx
orb %sil, %dl
jne 0x42d16
movslq (%rcx), %rdx
testq %rdx, %rdx
jle 0x42d16
shlq $0x5, %rdx
xorl %esi, %esi
movq 0x8(%rcx,%rsi), %r12
testb $0x1, 0x5(%r12)
jne 0x42c91
addq $0x20, %rsi
xorl %ebp, %ebp
cmpq %rsi, %rdx
jne 0x42ce0
jmp 0x42d18
movzbl 0x5e(%r13), %esi
movq 0x8(%r12), %rcx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x42e58
movq %rax, %r15
movb $0x1, %bpl
jmp 0x42d1b
xorl %ebp, %ebp
movq %rax, %r12
testb %bpl, %bpl
je 0x42bd2
testq %r15, %r15
je 0x42d4d
cmpq $0x0, 0x18(%r15)
jne 0x42d4d
movq (%r15), %rcx
movq (%rbx), %rax
movzbl 0x5e(%rax), %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x42e58
testq %rax, %rax
jne 0x42d4d
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq