// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3MemCompare
SQLITE_PRIVATE int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){
  int f1, f2;
  int combined_flags;

  f1 = pMem1->flags;
  f2 = pMem2->flags;
  combined_flags = f1|f2;
  assert( (combined_flags & MEM_RowSet)==0 );
 
  /* If one value is NULL, it is less than the other. If both values
  ** are NULL, return 0.
  */
  if( combined_flags&MEM_Null ){
    return (f2&MEM_Null) - (f1&MEM_Null);
  }

  /* At least one of the two values is a number
  */
  if( combined_flags&(MEM_Int|MEM_Real) ){
    if( (f1 & f2 & MEM_Int)!=0 ){
      if( pMem1->u.i < pMem2->u.i ) return -1;
      if( pMem1->u.i > pMem2->u.i ) return +1;
      return 0;
    }
    if( (f1 & f2 & MEM_Real)!=0 ){
      if( pMem1->u.r < pMem2->u.r ) return -1;
      if( pMem1->u.r > pMem2->u.r ) return +1;
      return 0;
    }
    if( (f1&MEM_Int)!=0 ){
      if( (f2&MEM_Real)!=0 ){
        return sqlite3IntFloatCompare(pMem1->u.i, pMem2->u.r);
      }else{
        return -1;
      }
    }
    if( (f1&MEM_Real)!=0 ){
      if( (f2&MEM_Int)!=0 ){
        return -sqlite3IntFloatCompare(pMem2->u.i, pMem1->u.r);
      }else{
        return -1;
      }
    }
    return +1;
  }

  /* If one value is a string and the other is a blob, the string is less.
  ** If both are strings, compare using the collating functions.
  */
  if( combined_flags&MEM_Str ){
    if( (f1 & MEM_Str)==0 ){
      return 1;
    }
    if( (f2 & MEM_Str)==0 ){
      return -1;
    }

    assert( pMem1->enc==pMem2->enc || pMem1->db->mallocFailed );
    assert( pMem1->enc==SQLITE_UTF8 || 
            pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE );

    /* The collation sequence must be defined at this point, even if
    ** the user deletes the collation sequence after the vdbe program is
    ** compiled (this was not always the case).
    */
    assert( !pColl || pColl->xCmp );

    if( pColl ){
      return vdbeCompareMemString(pMem1, pMem2, pColl, 0);
    }
    /* If a NULL pointer was passed as the collate function, fall through
    ** to the blob case and use memcmp().  */
  }
 
  /* Both values must be blobs.  Compare using memcmp().  */
  return sqlite3BlobCompare(pMem1, pMem2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0x8(%rdi), %ecx
movzwl 0x8(%rsi), %eax
movl %eax, %r8d
orl %ecx, %r8d
testb $0x1, %r8b
jne 0x2ee65
testb $0xc, %r8b
je 0x2ee6f
movl %eax, %edx
andl %ecx, %edx
testb $0x4, %dl
jne 0x2ee7b
testb $0x8, %dl
jne 0x2ee97
testb $0x4, %cl
jne 0x2eec1
testb $0x8, %cl
je 0x2ee90
testb $0x4, %al
je 0x2eec5
movq (%rsi), %rax
movq %rax, -0x8(%rbp)
fildll -0x8(%rbp)
fldl (%rdi)
xorl %ecx, %ecx
fxch %st(1)
fucomi %st(1), %st
seta %cl
negl %ecx
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
movl $0x1, %eax
jmp 0x2eeec
andl $0x1, %eax
andl $0x1, %ecx
subl %ecx, %eax
jmp 0x2eeca
testb $0x2, %r8b
jne 0x2ee8b
popq %rbp
jmp 0x30b69
movq (%rsi), %rax
cmpq %rax, (%rdi)
jl 0x2eec5
setg %al
movzbl %al, %eax
jmp 0x2eeca
testb $0x2, %cl
jne 0x2eeb0
movl $0x1, %eax
jmp 0x2eeca
movsd (%rdi), %xmm0
movsd (%rsi), %xmm1
ucomisd %xmm0, %xmm1
ja 0x2eec5
xorl %eax, %eax
ucomisd %xmm1, %xmm0
seta %al
jmp 0x2eeca
testb $0x2, %al
je 0x2eec5
testq %rdx, %rdx
je 0x2ee75
xorl %ecx, %ecx
popq %rbp
jmp 0x30a35
testb $0x8, %al
jne 0x2eecc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbp
retq
movq (%rdi), %rax
movq %rax, -0x10(%rbp)
fildll -0x10(%rbp)
fldl (%rsi)
xorl %ecx, %ecx
fxch %st(1)
fucomi %st(1), %st
seta %cl
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovbel %ecx, %eax
jmp 0x2eeca