// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3ExprCompare
SQLITE_PRIVATE int sqlite3ExprCompare(Expr *pA, Expr *pB, int iTab){
  if( pA==0||pB==0 ){
    return pB==pA ? 0 : 2;
  }
  assert( !ExprHasAnyProperty(pA, EP_TokenOnly|EP_Reduced) );
  assert( !ExprHasAnyProperty(pB, EP_TokenOnly|EP_Reduced) );
  if( ExprHasProperty(pA, EP_xIsSelect) || ExprHasProperty(pB, EP_xIsSelect) ){
    return 2;
  }
  if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 2;
  if( pA->op!=pB->op && (pA->op!=TK_REGISTER || pA->op2!=pB->op) ){
    if( pA->op==TK_COLLATE && sqlite3ExprCompare(pA->pLeft, pB, iTab)<2 ){
      return 1;
    }
    if( pB->op==TK_COLLATE && sqlite3ExprCompare(pA, pB->pLeft, iTab)<2 ){
      return 1;
    }
    return 2;
  }
  if( sqlite3ExprCompare(pA->pLeft, pB->pLeft, iTab) ) return 2;
  if( sqlite3ExprCompare(pA->pRight, pB->pRight, iTab) ) return 2;
  if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList, iTab) ) return 2;
  if( pA->iColumn!=pB->iColumn ) return 2;
  if( pA->iTable!=pB->iTable 
   && pA->op!=TK_REGISTER
   && (pA->iTable!=iTab || NEVER(pB->iTable>=0)) ) return 2;
  if( ExprHasProperty(pA, EP_IntValue) ){
    if( !ExprHasProperty(pB, EP_IntValue) || pA->u.iValue!=pB->u.iValue ){
      return 2;
    }
  }else if( pA->op!=TK_COLUMN && ALWAYS(pA->op!=TK_AGG_COLUMN) && pA->u.zToken){
    if( ExprHasProperty(pB, EP_IntValue) || NEVER(pB->u.zToken==0) ) return 2;
    if( strcmp(pA->u.zToken,pB->u.zToken)!=0 ){
      return pA->op==TK_COLLATE ? 1 : 2;
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
testq %rdi, %rdi
setne %al
testq %rsi, %rsi
setne %cl
testb %cl, %al
jne 0x4b6b1
xorl %ebx, %ebx
cmpq %r15, %r14
setne %bl
addl %ebx, %ebx
jmp 0x4b839
movzwl 0x2(%r15), %r13d
movl $0x2, %ebx
btl $0xb, %r13d
jb 0x4b839
movzwl 0x2(%r14), %ecx
btl $0xb, %ecx
jb 0x4b839
movl %ecx, %eax
xorl %r13d, %eax
testb $0x10, %al
jne 0x4b839
movl %edx, %r12d
movzbl (%r15), %eax
movb (%r14), %dl
cmpb %dl, %al
jne 0x4b7de
movl %ecx, -0x2c(%rbp)
movl %eax, -0x30(%rbp)
movq 0x10(%r15), %rdi
movq 0x10(%r14), %rsi
movl %r12d, %edx
callq 0x4b67e
testl %eax, %eax
jne 0x4b839
movq 0x18(%r15), %rdi
movq 0x18(%r14), %rsi
movl %r12d, %edx
callq 0x4b67e
testl %eax, %eax
jne 0x4b839
movq 0x20(%r15), %rdi
movq 0x20(%r14), %rsi
movl %r12d, %edx
callq 0x4b92b
testl %eax, %eax
jne 0x4b839
movzwl 0x30(%r15), %eax
cmpw 0x30(%r14), %ax
jne 0x4b839
movl 0x2c(%r15), %ecx
movl 0x2c(%r14), %eax
cmpl %eax, %ecx
sete %dl
movl -0x30(%rbp), %edi
cmpl $0x84, %edi
sete %sil
orb %dl, %sil
jne 0x4b784
cmpl %r12d, %ecx
setne %cl
testl %eax, %eax
setns %al
orb %cl, %al
jne 0x4b839
btl $0xa, %r13d
jb 0x4b84a
movl %edi, %eax
orl $0x2, %eax
cmpl $0x9a, %eax
movl -0x2c(%rbp), %eax
je 0x4b85b
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x4b85b
btl $0xa, %eax
jb 0x4b839
movq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0x4b839
callq 0x8530
movl -0x30(%rbp), %ecx
testl %eax, %eax
je 0x4b85b
xorl %ebx, %ebx
cmpl $0x5c, %ecx
setne %bl
incl %ebx
jmp 0x4b839
cmpl $0x5c, %eax
je 0x4b7f9
cmpl $0x84, %eax
jne 0x4b816
cmpb %dl, 0x37(%r15)
je 0x4b6f4
cmpl $0x5c, %eax
jne 0x4b816
movq 0x10(%r15), %rdi
movq %r14, %rsi
movl %edx, %ebx
movl %r12d, %edx
callq 0x4b67e
movl %ebx, %edx
movl $0x1, %ebx
cmpl $0x2, %eax
jb 0x4b839
cmpb $0x5c, %dl
jne 0x4b834
movq 0x10(%r14), %rsi
movq %r15, %rdi
movl %r12d, %edx
callq 0x4b67e
movl $0x1, %ebx
cmpl $0x2, %eax
jb 0x4b839
movl $0x2, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
btl $0xa, -0x2c(%rbp)
jae 0x4b839
movl 0x8(%r15), %eax
cmpl 0x8(%r14), %eax
jne 0x4b839
xorl %ebx, %ebx
jmp 0x4b839