// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %rdi, %r14
testq %rdi, %rdi
setne %al
testq %rsi, %rsi
setne %cl
testb %cl, %al
jne 0x46c12
xorl %r12d, %r12d
cmpq %r14, %rbx
setne %r12b
addl %r12d, %r12d
jmp 0x46d99
movzwl 0x2(%r14), %r13d
pushq $0x2
popq %rcx
btl $0xb, %r13d
jb 0x46d96
movl %edx, %r15d
movzwl 0x2(%rbx), %edx
btl $0xb, %edx
jb 0x46d96
movl %edx, %eax
xorl %r13d, %eax
testb $0x10, %al
jne 0x46d96
movzbl (%r14), %eax
movb (%rbx), %sil
cmpb %sil, %al
jne 0x46d3f
movl %edx, -0x2c(%rbp)
movl %eax, -0x30(%rbp)
movl %ecx, %r12d
movq 0x10(%r14), %rdi
movq 0x10(%rbx), %rsi
movl %r15d, %edx
callq 0x46bdc
testl %eax, %eax
jne 0x46d99
movq 0x18(%r14), %rdi
movq 0x18(%rbx), %rsi
movl %r15d, %edx
callq 0x46bdc
testl %eax, %eax
jne 0x46d99
movq 0x20(%r14), %rdi
movq 0x20(%rbx), %rsi
movl %r15d, %edx
callq 0x46e76
testl %eax, %eax
jne 0x46d99
movzwl 0x30(%r14), %eax
cmpw 0x30(%rbx), %ax
jne 0x46d99
movl 0x2c(%r14), %ecx
movl 0x2c(%rbx), %eax
cmpl %eax, %ecx
sete %dl
movl -0x30(%rbp), %edi
cmpl $0x84, %edi
sete %sil
orb %dl, %sil
jne 0x46ce4
cmpl %r15d, %ecx
setne %cl
testl %eax, %eax
setns %al
orb %cl, %al
jne 0x46d99
btl $0xa, %r13d
jb 0x46dab
movl %edi, %eax
orl $0x2, %eax
cmpl $0x9a, %eax
je 0x46dbb
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x46dbb
btl $0xa, -0x2c(%rbp)
jb 0x46d99
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x46d99
callq 0x8510
movl -0x30(%rbp), %ecx
testl %eax, %eax
je 0x46dbb
xorl %r12d, %r12d
cmpl $0x5c, %ecx
setne %r12b
incl %r12d
jmp 0x46d99
pushq $0x1
popq %r12
cmpl $0x5c, %eax
je 0x46d5b
cmpl $0x84, %eax
jne 0x46d78
cmpb %sil, 0x37(%r14)
je 0x46c53
jmp 0x46d78
movq 0x10(%r14), %rdi
movl %esi, %r13d
movq %rbx, %rsi
movl %r15d, %edx
callq 0x46bdc
movl %r13d, %esi
pushq $0x2
popq %rcx
cmpl $0x2, %eax
jb 0x46d99
cmpb $0x5c, %sil
jne 0x46d96
movq 0x10(%rbx), %rsi
movq %r14, %rdi
movl %r15d, %edx
movl %ecx, %ebx
callq 0x46bdc
movl %ebx, %ecx
cmpl $0x2, %eax
jb 0x46d99
movl %ecx, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
btl $0xa, -0x2c(%rbp)
jae 0x46d99
movl 0x8(%r14), %eax
cmpl 0x8(%rbx), %eax
jne 0x46d99
xorl %r12d, %r12d
jmp 0x46d99