// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/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( !sqlite3VdbeMemIsRowSet(pMem1) && !sqlite3VdbeMemIsRowSet(pMem2) );

  /* 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|MEM_IntReal) ){
    testcase( combined_flags & MEM_Int );
    testcase( combined_flags & MEM_Real );
    testcase( combined_flags & MEM_IntReal );
    if( (f1 & f2 & (MEM_Int|MEM_IntReal))!=0 ){
      testcase( f1 & f2 & MEM_Int );
      testcase( f1 & f2 & MEM_IntReal );
      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|MEM_IntReal))!=0 ){
      testcase( f1 & MEM_Int );
      testcase( f1 & MEM_IntReal );
      if( (f2&MEM_Real)!=0 ){
        return sqlite3IntFloatCompare(pMem1->u.i, pMem2->u.r);
      }else if( (f2&(MEM_Int|MEM_IntReal))!=0 ){
        if( pMem1->u.i < pMem2->u.i ) return -1;
        if( pMem1->u.i > pMem2->u.i ) return +1;
        return 0;
      }else{
        return -1;
      }
    }
    if( (f1&MEM_Real)!=0 ){
      if( (f2&(MEM_Int|MEM_IntReal))!=0 ){
        testcase( f2 & MEM_Int );
        testcase( f2 & MEM_IntReal );
        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
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x8(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movzwl 0x8(%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
orl -0x28(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3fa1a4
movl -0x28(%rbp), %eax
andl $0x1, %eax
movl -0x24(%rbp), %ecx
andl $0x1, %ecx
subl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x3fa39d
movl -0x2c(%rbp), %eax
andl $0x2c, %eax
cmpl $0x0, %eax
je 0x3fa337
movl -0x24(%rbp), %eax
andl -0x28(%rbp), %eax
andl $0x24, %eax
cmpl $0x0, %eax
je 0x3fa205
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jge 0x3fa1dd
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3fa39d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jle 0x3fa1f9
movl $0x1, -0x4(%rbp)
jmp 0x3fa39d
movl $0x0, -0x4(%rbp)
jmp 0x3fa39d
movl -0x24(%rbp), %eax
andl -0x28(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x3fa25f
movq -0x10(%rbp), %rax
movsd (%rax), %xmm1
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x3fa235
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3fa39d
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movq -0x18(%rbp), %rax
ucomisd (%rax), %xmm0
jbe 0x3fa253
movl $0x1, -0x4(%rbp)
jmp 0x3fa39d
movl $0x0, -0x4(%rbp)
jmp 0x3fa39d
movl -0x24(%rbp), %eax
andl $0x24, %eax
cmpl $0x0, %eax
je 0x3fa2f0
movl -0x28(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x3fa295
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
callq 0x400410
movl %eax, -0x4(%rbp)
jmp 0x3fa39d
movl -0x28(%rbp), %eax
andl $0x24, %eax
cmpl $0x0, %eax
je 0x3fa2e4
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jge 0x3fa2bc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3fa39d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jle 0x3fa2d8
movl $0x1, -0x4(%rbp)
jmp 0x3fa39d
movl $0x0, -0x4(%rbp)
jmp 0x3fa39d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3fa39d
movl -0x24(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x3fa32e
movl -0x28(%rbp), %eax
andl $0x24, %eax
cmpl $0x0, %eax
je 0x3fa325
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
callq 0x400410
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x3fa39d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3fa39d
movl $0x1, -0x4(%rbp)
jmp 0x3fa39d
movl -0x2c(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3fa38d
movl -0x24(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x3fa356
movl $0x1, -0x4(%rbp)
jmp 0x3fa39d
movl -0x28(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x3fa36a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3fa39d
cmpq $0x0, -0x20(%rbp)
je 0x3fa38b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x400470
movl %eax, -0x4(%rbp)
jmp 0x3fa39d
jmp 0x3fa38d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4005d0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)