// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: vdbeSorterCompareText
static int vdbeSorterCompareText(
  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 u8 * const v1 = &p1[ p1[0] ];   /* Pointer to value 1 */
  const u8 * const v2 = &p2[ p2[0] ];   /* Pointer to value 2 */

  int n1;
  int n2;
  int res;

  getVarint32(&p1[1], n1); n1 = (n1 - 13) / 2;
  getVarint32(&p2[1], n2); n2 = (n2 - 13) / 2;
  res = memcmp(v1, v2, MIN(n1, n2));
  if( res==0 ){
    res = n1 - n2;
  }

  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 $0x80, %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
movq -0x38(%rbp), %rcx
movzbl (%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq -0x40(%rbp), %rcx
movzbl (%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x80, %eax
jge 0x4ffda
movq -0x38(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0x54(%rbp)
movl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x4fff1
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
leaq -0x54(%rbp), %rsi
callq 0x43410
movzbl %al, %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl -0x54(%rbp), %eax
subl $0xd, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x54(%rbp)
movq -0x40(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x80, %eax
jge 0x50029
movq -0x40(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0x58(%rbp)
movl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x50040
movq -0x40(%rbp), %rdi
addq $0x1, %rdi
leaq -0x58(%rbp), %rsi
callq 0x43410
movzbl %al, %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl -0x58(%rbp), %eax
subl $0xd, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x58(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x70(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x50074
movl -0x54(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x5007a
movl -0x58(%rbp), %eax
movl %eax, -0x7c(%rbp)
movq -0x70(%rbp), %rsi
movq -0x78(%rbp), %rdi
movl -0x7c(%rbp), %eax
movslq %eax, %rdx
callq 0xb350
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x5009f
movl -0x54(%rbp), %eax
subl -0x58(%rbp), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x500db
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rax), %rax
movzwl 0x6(%rax), %eax
cmpl $0x1, %eax
jle 0x500d9
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 0x500f9
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rax
cmpb $0x0, (%rax)
je 0x500f7
imull $-0x1, -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x500f9
movl -0x5c(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)