// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/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( p->flags & EP_Generic ) break;
    if( op==TK_CAST || op==TK_UPLUS ){
      p = p->pLeft;
      continue;
    }
    if( op==TK_COLLATE || (op==TK_REGISTER && p->op2==TK_COLLATE) ){
      pColl = sqlite3GetCollSeq(pParse, ENC(db), 0, p->u.zToken);
      break;
    }
    if( (op==TK_AGG_COLUMN || op==TK_COLUMN
          || op==TK_REGISTER || op==TK_TRIGGER)
     && p->pTab!=0
    ){
      /* op==TK_REGISTER && p->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->pTab->aCol[j].zColl;
        pColl = sqlite3FindCollSeq(db, ENC(db), zColl, 0);
      }
      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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, -0x30(%rbp)
movq (%rdi), %r15
xorl %r14d, %r14d
leaq 0x277ba(%rip), %r13     # 0x7a1c0
testq %r12, %r12
je 0x52b3f
movl 0x4(%r12), %eax
movb $0x1, %bl
btl $0x9, %eax
jb 0x52b37
movzbl (%r12), %ecx
cmpl $0x97, %ecx
jle 0x52a64
leal -0x98(%rcx), %edx
cmpl $0x5, %edx
ja 0x52acc
movslq (%r13,%rdx,4), %rsi
addq %r13, %rsi
jmpq *%rsi
cmpb $0x5f, 0x36(%r12)
je 0x52a77
cmpl $0x5, %edx
ja 0x52a5d
movl $0x25, %esi
btl %edx, %esi
jb 0x52a8e
cmpl $0x3e, %ecx
je 0x52a8e
jmp 0x52acc
cmpl $0x26, %ecx
je 0x52b29
cmpl $0x3e, %ecx
je 0x52a8e
cmpl $0x5f, %ecx
jne 0x52acc
movzbl 0x4e(%r15), %esi
movq 0x8(%r12), %rcx
movq -0x30(%rbp), %rdi
xorl %edx, %edx
callq 0x50fc6
jmp 0x52ac7
movq 0x40(%r12), %rcx
testq %rcx, %rcx
je 0x52acc
movswq 0x30(%r12), %rax
testq %rax, %rax
js 0x52b37
movq 0x8(%rcx), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movq 0x20(%rcx,%rax), %rdx
movzbl 0x4e(%r15), %esi
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x50e9b
movq %rax, %r14
jmp 0x52b37
btl $0x8, %eax
jae 0x52b37
movq 0x10(%r12), %rcx
testq %rcx, %rcx
je 0x52ae2
testb $0x1, 0x5(%rcx)
jne 0x52b32
movq 0x18(%r12), %rcx
movq 0x20(%r12), %rdx
testq %rdx, %rdx
sete %sil
shrl $0xb, %eax
andl $0x1, %eax
orb %sil, %al
jne 0x52b32
movslq (%rdx), %rax
testq %rax, %rax
jle 0x52b32
movq 0x8(%rdx), %rdx
shlq $0x5, %rax
xorl %esi, %esi
movq (%rdx,%rsi), %r12
testb $0x1, 0x5(%r12)
jne 0x52b2e
addq $0x20, %rsi
xorl %ebx, %ebx
cmpq %rsi, %rax
jne 0x52b10
jmp 0x52b34
movq 0x10(%r12), %r12
xorl %ebx, %ebx
jmp 0x52b37
xorl %ebx, %ebx
movq %rcx, %r12
testb %bl, %bl
je 0x52a06
testq %r14, %r14
je 0x52b62
movq (%r14), %rcx
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
movzbl 0x4e(%rax), %esi
movq %r14, %rdx
callq 0x50fc6
testq %rax, %rax
jne 0x52b62
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq