// File: /workspace/github_c_makefile_star2_O1/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), %r8d
movzwl 0x8(%rsi), %ecx
movl %ecx, %eax
orl %r8d, %eax
testb $0x1, %al
jne 0x32c99
testb $0xc, %al
je 0x32ca7
movl %ecx, %eax
andl %r8d, %eax
testb $0x4, %al
jne 0x32cb1
testb $0x8, %al
jne 0x32ce8
testb $0x4, %r8b
jne 0x32d06
movl $0x1, %eax
testb $0x8, %r8b
je 0x32ca5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x4, %cl
je 0x32ca5
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 0x32d30
andl $0x1, %ecx
andl $0x1, %r8d
subl %r8d, %ecx
movl %ecx, %eax
popq %rbp
retq
testb $0x2, %al
jne 0x32cc6
popq %rbp
jmp 0x36f61
movq (%rsi), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rcx, (%rdi)
jl 0x32ca5
setg %al
movzbl %al, %eax
jmp 0x32ca5
movl $0x1, %eax
testb $0x2, %r8b
je 0x32ca5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x2, %cl
je 0x32ca5
testq %rdx, %rdx
je 0x32cab
xorl %ecx, %ecx
popq %rbp
jmp 0x36e0c
movsd (%rdi), %xmm0
movsd (%rsi), %xmm1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
ucomisd %xmm0, %xmm1
ja 0x32ca5
xorl %eax, %eax
ucomisd %xmm1, %xmm0
seta %al
jmp 0x32ca5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x8, %cl
je 0x32ca5
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 0x32ca5