// File: /workspace/github_c_makefile_star2_O0/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
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl (%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movq -0x40(%rbp), %rcx
movzbl (%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
cmpl $0x7, -0x44(%rbp)
jle 0x4fdf3
cmpl $0x7, -0x48(%rbp)
jle 0x4fdf3
movl -0x44(%rbp), %eax
subl -0x48(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x4fefb
movl -0x44(%rbp), %eax
cmpl -0x48(%rbp), %eax
jne 0x4fe94
movq -0x50(%rbp), %rax
movzbl (%rax), %eax
movq -0x58(%rbp), %rcx
movzbl (%rcx), %ecx
xorl %ecx, %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x4fe3b
movq -0x50(%rbp), %rax
movzbl (%rax), %edx
andl $0x80, %edx
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x5c(%rbp)
jmp 0x4fe92
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movslq -0x44(%rbp), %rdx
leaq 0x5337d(%rip), %rcx     # 0xa31d4
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jge 0x4fe90
movq -0x50(%rbp), %rax
movslq -0x60(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x58(%rbp), %rcx
movslq -0x60(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
subl %ecx, %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, %eax
je 0x4fe83
jmp 0x4fe90
jmp 0x4fe85
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x4fe49
jmp 0x4fe92
jmp 0x4fef9
cmpl $0x7, -0x48(%rbp)
jle 0x4fea3
movl $0x1, -0x5c(%rbp)
jmp 0x4febd
cmpl $0x7, -0x44(%rbp)
jle 0x4feb2
movl $0xffffffff, -0x5c(%rbp) # imm = 0xFFFFFFFF
jmp 0x4febb
movl -0x44(%rbp), %eax
subl -0x48(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x4febd
cmpl $0x0, -0x5c(%rbp)
jle 0x4fedd
movq -0x50(%rbp), %rax
movzbl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x4fedb
movl $0xffffffff, -0x5c(%rbp) # imm = 0xFFFFFFFF
jmp 0x4fef7
movq -0x58(%rbp), %rax
movzbl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x4fef5
movl $0x1, -0x5c(%rbp)
jmp 0x4fef7
jmp 0x4fef9
jmp 0x4fefb
cmpl $0x0, -0x5c(%rbp)
jne 0x4ff37
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rax), %rax
movzwl 0x6(%rax), %eax
cmpl $0x1, %eax
jle 0x4ff35
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %r8
movl -0x2c(%rbp), %r9d
callq 0x50180
movl %eax, -0x5c(%rbp)
jmp 0x4ff55
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rax
cmpb $0x0, (%rax)
je 0x4ff53
imull $-0x1, -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x4ff55
movl -0x5c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nop