// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbeRecordCompareInt
static int vdbeRecordCompareInt(
  int nKey1, const void *pKey1, /* Left key */
  UnpackedRecord *pPKey2        /* Right key */
){
  const u8 *aKey = &((const u8*)pKey1)[*(const u8*)pKey1 & 0x3F];
  int serial_type = ((const u8*)pKey1)[1];
  int res;
  u32 y;
  u64 x;
  i64 v;
  i64 lhs;

  vdbeAssertFieldCountWithinLimits(nKey1, pKey1, pPKey2->pKeyInfo);
  assert( (*(u8*)pKey1)<=0x3F || CORRUPT_DB );
  switch( serial_type ){
    case 1: { /* 1-byte signed integer */
      lhs = ONE_BYTE_INT(aKey);
      testcase( lhs<0 );
      break;
    }
    case 2: { /* 2-byte signed integer */
      lhs = TWO_BYTE_INT(aKey);
      testcase( lhs<0 );
      break;
    }
    case 3: { /* 3-byte signed integer */
      lhs = THREE_BYTE_INT(aKey);
      testcase( lhs<0 );
      break;
    }
    case 4: { /* 4-byte signed integer */
      y = FOUR_BYTE_UINT(aKey);
      lhs = (i64)*(int*)&y;
      testcase( lhs<0 );
      break;
    }
    case 5: { /* 6-byte signed integer */
      lhs = FOUR_BYTE_UINT(aKey+2) + (((i64)1)<<32)*TWO_BYTE_INT(aKey);
      testcase( lhs<0 );
      break;
    }
    case 6: { /* 8-byte signed integer */
      x = FOUR_BYTE_UINT(aKey);
      x = (x<<32) | FOUR_BYTE_UINT(aKey+4);
      lhs = *(i64*)&x;
      testcase( lhs<0 );
      break;
    }
    case 8:
      lhs = 0;
      break;
    case 9:
      lhs = 1;
      break;

    /* This case could be removed without changing the results of running
    ** this code. Including it causes gcc to generate a faster switch
    ** statement (since the range of switch targets now starts at zero and
    ** is contiguous) but does not cause any duplicate code to be generated
    ** (as gcc is clever enough to combine the two like cases). Other
    ** compilers might be similar.  */
    case 0: case 7:
      return sqlite3VdbeRecordCompare(nKey1, pKey1, pPKey2);

    default:
      return sqlite3VdbeRecordCompare(nKey1, pKey1, pPKey2);
  }

  v = pPKey2->aMem[0].u.i;
  if( v>lhs ){
    res = pPKey2->r1;
  }else if( v<lhs ){
    res = pPKey2->r2;
  }else if( pPKey2->nField>1 ){
    /* The first fields of the two keys are equal. Compare the trailing
    ** fields.  */
    res = sqlite3VdbeRecordCompareWithSkip(nKey1, pKey1, pPKey2, 1);
  }else{
    /* The first fields of the two keys are equal and there are no trailing
    ** fields. Return pPKey2->default_rc in this case. */
    res = pPKey2->default_rc;
    pPKey2->eqSeen = 1;
  }

  assert( vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, res) );
  return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %ecx
andl $0x3f, %ecx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq %rax, -0x50(%rbp)
subq $0x9, %rax
ja 0x402590
movq -0x50(%rbp), %rax
leaq 0x1a29e1(%rip), %rcx    # 0x5a4dcc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movsbq (%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x4025a8
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
shll $0x8, %eax
movq -0x20(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
orl %ecx, %eax
cltq
movq %rax, -0x48(%rbp)
jmp 0x4025a8
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
shll $0x10, %eax
movq -0x20(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x20(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
orl %ecx, %eax
cltq
movq %rax, -0x48(%rbp)
jmp 0x4025a8
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
shll $0x18, %eax
movq -0x20(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x20(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x20(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x4025a8
movq -0x20(%rbp), %rax
movzbl 0x2(%rax), %eax
shll $0x18, %eax
movq -0x20(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x20(%rbp), %rcx
movzbl 0x4(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x20(%rbp), %rcx
movzbl 0x5(%rcx), %ecx
orl %ecx, %eax
movl %eax, %eax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
shll $0x8, %ecx
movq -0x20(%rbp), %rdx
movzbl 0x1(%rdx), %edx
orl %edx, %ecx
movslq %ecx, %rcx
shlq $0x20, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0x4025a8
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
shll $0x18, %eax
movq -0x20(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x20(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x20(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
orl %ecx, %eax
movl %eax, %eax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
shlq $0x20, %rax
movq -0x20(%rbp), %rcx
movzbl 0x4(%rcx), %ecx
shll $0x18, %ecx
movq -0x20(%rbp), %rdx
movzbl 0x5(%rdx), %edx
shll $0x10, %edx
orl %edx, %ecx
movq -0x20(%rbp), %rdx
movzbl 0x6(%rdx), %edx
shll $0x8, %edx
orl %edx, %ecx
movq -0x20(%rbp), %rdx
movzbl 0x7(%rdx), %edx
orl %edx, %ecx
movl %ecx, %ecx
orq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x4025a8
movq $0x0, -0x48(%rbp)
jmp 0x4025a8
movq $0x1, -0x48(%rbp)
jmp 0x4025a8
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x402370
movl %eax, -0x4(%rbp)
jmp 0x402629
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x402370
movl %eax, -0x4(%rbp)
jmp 0x402629
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
jle 0x4025ce
movq -0x18(%rbp), %rax
movsbl 0x14(%rax), %eax
movl %eax, -0x28(%rbp)
jmp 0x402623
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
jge 0x4025e5
movq -0x18(%rbp), %rax
movsbl 0x15(%rax), %eax
movl %eax, -0x28(%rbp)
jmp 0x402621
movq -0x18(%rbp), %rax
movzwl 0x10(%rax), %eax
cmpl $0x1, %eax
jle 0x40260c
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
callq 0x402800
movl %eax, -0x28(%rbp)
jmp 0x40261f
movq -0x18(%rbp), %rax
movsbl 0x12(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movb $0x1, 0x16(%rax)
jmp 0x402621
jmp 0x402623
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)