// File: /workspace/github_c_makefile_star2_O3/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: vdbeSorterCompareInt
static int vdbeSorterCompareInt(
  SortSubtask *pTask,             /* Subtask context (for pKeyInfo) */
  int *pbKey2Cached,              /* True if pTask->pUnpacked is pKey2 */
  const void *pKey1, int nKey1,   /* Left side of comparison */
  const void *pKey2, int nKey2    /* Right side of comparison */
){
  const u8 * const p1 = (const u8 * const)pKey1;
  const u8 * const p2 = (const u8 * const)pKey2;
  const int s1 = p1[1];                 /* Left hand serial type */
  const int s2 = p2[1];                 /* Right hand serial type */
  const u8 * const v1 = &p1[ p1[0] ];   /* Pointer to value 1 */
  const u8 * const v2 = &p2[ p2[0] ];   /* Pointer to value 2 */
  int res;                              /* Return value */

  assert( (s1>0 && s1<7) || s1==8 || s1==9 );
  assert( (s2>0 && s2<7) || s2==8 || s2==9 );

  if( s1>7 && s2>7 ){
    res = s1 - s2;
  }else{
    if( s1==s2 ){
      if( (*v1 ^ *v2) & 0x80 ){
        /* The two values have different signs */
        res = (*v1 & 0x80) ? -1 : +1;
      }else{
        /* The two values have the same sign. Compare using memcmp(). */
        static const u8 aLen[] = {0, 1, 2, 3, 4, 6, 8 };
        int i;
        res = 0;
        for(i=0; i<aLen[s1]; i++){
          if( (res = v1[i] - v2[i]) ) break;
        }
      }
    }else{
      if( s2>7 ){
        res = +1;
      }else if( s1>7 ){
        res = -1;
      }else{
        res = s1 - s2;
      }
      assert( res!=0 );

      if( res>0 ){
        if( *v1 & 0x80 ) res = -1;
      }else{
        if( *v2 & 0x80 ) res = +1;
      }
    }
  }

  if( res==0 ){
    if( pTask->pSorter->pKeyInfo->nField>1 ){
      res = vdbeSorterCompareTail(
          pTask, pbKey2Cached, pKey1, nKey1, pKey2, nKey2
      );
    }
  }else if( pTask->pSorter->pKeyInfo->aSortOrder[0] ){
    res = res * -1;
  }

  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
movzbl 0x1(%rdx), %r11d
cmpl $0x8, %r11d
setae %al
movb 0x1(%r8), %r14b
movzbl %r14b, %r15d
cmpb $0x8, %r14b
setae %r10b
andb %al, %r10b
cmpb $0x1, %r10b
jne 0x3a996
subl %r15d, %r11d
movl %r11d, %ebx
jmp 0x3aa3c
movzbl (%rdx), %eax
addq %rdx, %rax
movzbl (%r8), %r10d
addq %r8, %r10
cmpb %r14b, %r11b
jne 0x3a9ef
movb (%rax), %bl
movb (%r10), %r14b
xorb %bl, %r14b
js 0x3aa25
testl %r11d, %r11d
je 0x3aa5d
leaq 0x3de8e(%rip), %rbx     # 0x78850
movzbl (%r11,%rbx), %r11d
cmpb $0x1, %r11b
adcl $0x0, %r11d
movzbl %r11b, %r11d
xorl %r14d, %r14d
movzbl (%rax,%r14), %ebx
movzbl (%r10,%r14), %r15d
subl %r15d, %ebx
jne 0x3aa3c
incq %r14
cmpq %r14, %r11
jne 0x3a9d6
jmp 0x3aa5d
movl %r11d, %ebx
subl %r15d, %ebx
cmpb $0x8, %r11b
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmovael %r15d, %ebx
cmpb $0x8, %r14b
movl $0x1, %r11d
movl %ebx, %r14d
cmovael %r11d, %r14d
testl %r14d, %r14d
jle 0x3aa36
cmpb $0x0, (%rax)
cmovnsl %r14d, %r15d
movl %r15d, %ebx
jmp 0x3aa3c
xorl %eax, %eax
testb %bl, %bl
setns %al
leal -0x1(,%rax,2), %r11d
jmp 0x3aa43
cmpb $0x0, (%r10)
js 0x3aa43
movl %ebx, %r11d
testl %ebx, %ebx
je 0x3aa5d
movq 0x10(%rdi), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rcx
movl %r11d, %eax
negl %eax
cmpb $0x0, (%rcx)
cmovel %r11d, %eax
jmp 0x3aa7a
movq 0x10(%rdi), %rax
movq 0x28(%rax), %r10
xorl %eax, %eax
cmpw $0x2, 0x6(%r10)
jb 0x3aa7a
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3abdb
popq %rbx
popq %r14
popq %r15
popq %rbp
retq