// File: /workspace/github_c_makefile_star2_O3/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
testq %rsi, %rsi
je 0x5198b
movq %rdi, %r14
movq (%rdi), %rdi
xorl %ebx, %ebx
leaq 0x26990(%rip), %rax     # 0x781f4
movl 0x4(%rsi), %ecx
btl $0x9, %ecx
jb 0x5198d
movzbl (%rsi), %edx
cmpl $0x97, %edx
jle 0x5189b
addl $0xffffff68, %edx       # imm = 0xFFFFFF68
cmpl $0x5, %edx
ja 0x518b2
movslq (%rax,%rdx,4), %rdx
addq %rax, %rdx
jmpq *%rdx
cmpb $0x5f, 0x36(%rsi)
jne 0x518a5
jmp 0x51929
cmpl $0x26, %edx
je 0x51912
cmpl $0x3e, %edx
jne 0x51924
movq 0x40(%rsi), %rdx
testq %rdx, %rdx
jne 0x5193f
btl $0x8, %ecx
jae 0x5198d
movq 0x10(%rsi), %r8
testq %r8, %r8
je 0x518cc
testb $0x1, 0x5(%r8)
jne 0x51916
movq 0x18(%rsi), %rdx
movq 0x20(%rsi), %rsi
testq %rsi, %rsi
sete %r8b
shrl $0xb, %ecx
andl $0x1, %ecx
orb %r8b, %cl
jne 0x5190d
movslq (%rsi), %rcx
testq %rcx, %rcx
jle 0x5190d
movq 0x8(%rsi), %rsi
shlq $0x5, %rcx
xorl %r9d, %r9d
movq (%rsi,%r9), %r8
testb $0x1, 0x5(%r8)
jne 0x51916
addq $0x20, %r9
cmpq %r9, %rcx
jne 0x518f9
movq %rdx, %r8
jmp 0x51916
movq 0x10(%rsi), %r8
movq %r8, %rsi
testq %r8, %r8
jne 0x51864
jmp 0x5198d
cmpl $0x5f, %edx
jne 0x518b2
movzbl 0x4e(%rdi), %eax
movq 0x8(%rsi), %rcx
movq %r14, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x4fe52
jmp 0x51965
movswq 0x30(%rsi), %rax
testq %rax, %rax
js 0x5198b
movq 0x8(%rdx), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movq 0x20(%rcx,%rax), %rdx
movzbl 0x4e(%rdi), %esi
xorl %ecx, %ecx
callq 0x4fd27
movq %rax, %rbx
testq %rax, %rax
je 0x5198b
movq (%rbx), %rcx
movq (%r14), %rax
movzbl 0x4e(%rax), %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4fe52
testq %rax, %rax
cmoveq %rax, %rbx
jmp 0x5198d
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq