// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/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_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( p->pTab!=0
     && (op==TK_AGG_COLUMN || op==TK_COLUMN
          || op==TK_REGISTER || op==TK_TRIGGER)
    ){
      /* 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( ALWAYS(p->pLeft) && (p->pLeft->flags & EP_Collate)!=0 ){
        p = p->pLeft;
      }else{
        p = p->pRight;
      }
    }else{
      break;
    }
  }
  if( sqlite3CheckCollSeq(pParse, pColl) ){ 
    pColl = 0;
  }
  return pColl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x65b30
movq -0x28(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x25, -0x2c(%rbp)
je 0x659ff
cmpl $0x9d, -0x2c(%rbp)
jne 0x65a0d
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x659db
cmpl $0x5c, -0x2c(%rbp)
je 0x65a29
cmpl $0x84, -0x2c(%rbp)
jne 0x65a57
movq -0x28(%rbp), %rax
movzbl 0x37(%rax), %eax
cmpl $0x5c, %eax
jne 0x65a57
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movb 0x71(%rax), %al
movq -0x28(%rbp), %rcx
movq 0x8(%rcx), %rcx
xorl %edx, %edx
movzbl %al, %esi
callq 0x65c90
movq %rax, -0x20(%rbp)
jmp 0x65b30
movq -0x28(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x65ada
cmpl $0x9a, -0x2c(%rbp)
je 0x65a83
cmpl $0x98, -0x2c(%rbp)
je 0x65a83
cmpl $0x84, -0x2c(%rbp)
je 0x65a83
cmpl $0x3c, -0x2c(%rbp)
jne 0x65ada
movq -0x28(%rbp), %rax
movswl 0x30(%rax), %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jl 0x65ad8
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x30(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movb 0x71(%rax), %al
movq -0x38(%rbp), %rdx
xorl %ecx, %ecx
movzbl %al, %esi
callq 0x65d70
movq %rax, -0x20(%rbp)
jmp 0x65b30
movq -0x28(%rbp), %rax
movzwl 0x2(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x65b29
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x65b1b
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movzwl 0x2(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x65b1b
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x65b27
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x65b2b
jmp 0x65b30
jmp 0x659db
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x65de0
cmpl $0x0, %eax
je 0x65b4a
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)