// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movq %rdi, %r14
movq (%rdi), %rdi
xorl %ebx, %ebx
leaq 0x1d69f(%rip), %rax     # 0x691c0
testq %rsi, %rsi
je 0x4bc59
movq %rsi, %rdx
movl 0x4(%rsi), %ecx
btl $0x9, %ecx
jb 0x4bc59
movzbl (%rdx), %esi
leal -0x98(%rsi), %r8d
cmpl $0x5, %r8d
ja 0x4bb5e
movslq (%rax,%r8,4), %rsi
addq %rax, %rsi
jmpq *%rsi
cmpb $0x5f, 0x36(%rdx)
jne 0x4bb76
jmp 0x4bc1f
cmpl $0x26, %esi
je 0x4bbea
cmpl $0x3e, %esi
je 0x4bb76
cmpl $0x5f, %esi
jne 0x4bb7f
jmp 0x4bc1f
movq 0x40(%rdx), %rsi
testq %rsi, %rsi
jne 0x4bbfb
btl $0x8, %ecx
jae 0x4bc59
movq 0x10(%rdx), %rsi
testq %rsi, %rsi
je 0x4bb98
testb $0x1, 0x5(%rsi)
jne 0x4bb21
movq 0x18(%rdx), %r8
movq 0x20(%rdx), %rdx
testq %rdx, %rdx
sete %sil
shrl $0xb, %ecx
andl $0x1, %ecx
orb %sil, %cl
movq %r8, %rsi
jne 0x4bb21
movl (%rdx), %ecx
testl %ecx, %ecx
cmovlel %ebx, %ecx
shlq $0x5, %rcx
addq $0x20, %rcx
xorl %r9d, %r9d
leaq 0x20(%r9), %r10
cmpq %r10, %rcx
je 0x4bbf3
movq 0x8(%rdx), %rsi
movq (%rsi,%r9), %rsi
testb $0x1, 0x5(%rsi)
movq %r10, %r9
je 0x4bbcb
jmp 0x4bb21
movq 0x10(%rdx), %rsi
jmp 0x4bb21
movq %r8, %rsi
jmp 0x4bb21
movswq 0x30(%rdx), %rax
testq %rax, %rax
js 0x4bc57
movq 0x8(%rsi), %rcx
imulq $0x30, %rax, %rax
movq 0x20(%rcx,%rax), %rdx
movzbl 0x4e(%rdi), %esi
xorl %ecx, %ecx
callq 0x4a430
jmp 0x4bc31
movzbl 0x4e(%rdi), %esi
movq 0x8(%rdx), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x4a526
movq %rax, %rbx
testq %rax, %rax
je 0x4bc57
movq (%rbx), %rcx
movq (%r14), %rax
movzbl 0x4e(%rax), %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4a526
testq %rax, %rax
cmoveq %rax, %rbx
jmp 0x4bc59
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq