// File: /workspace/github_c_makefile_star2_O0/ukontainer[P]sqlite-bench/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);
  getVarint32(&p2[1], n2);
  res = memcmp(v1, v2, (MIN(n1, n2) - 13)/2);
  if( res==0 ){
    res = n1 - n2;
  }

  if( res==0 ){
    if( pTask->pSorter->pKeyInfo->nKeyField>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 0x44c5ba
movq -0x38(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0x54(%rbp)
movl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x44c5d1
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
leaq -0x54(%rbp), %rsi
callq 0x43eb10
movzbl %al, %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0x40(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x80, %eax
jge 0x44c5f8
movq -0x40(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0x58(%rbp)
movl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x44c60f
movq -0x40(%rbp), %rdi
addq $0x1, %rdi
leaq -0x58(%rbp), %rsi
callq 0x43eb10
movzbl %al, %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
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 0x44c632
movl -0x54(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x44c638
movl -0x58(%rbp), %eax
movl %eax, -0x7c(%rbp)
movq -0x70(%rbp), %rsi
movq -0x78(%rbp), %rdi
movl -0x7c(%rbp), %eax
subl $0xd, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movslq %eax, %rdx
callq 0x401098
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x44c668
movl -0x54(%rbp), %eax
subl -0x58(%rbp), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x44c6a4
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rax), %rax
movzwl 0x6(%rax), %eax
cmpl $0x1, %eax
jle 0x44c6a2
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 0x44c740
movl %eax, -0x5c(%rbp)
jmp 0x44c6c2
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rax
cmpb $0x0, (%rax)
je 0x44c6c0
imull $-0x1, -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x44c6c2
movl -0x5c(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nop