// File: /workspace/github_c_makefile_star2_O3/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeIdxRowid
SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){
  i64 nCellKey = 0;
  int rc;
  u32 szHdr;        /* Size of the header */
  u32 typeRowid;    /* Serial type of the rowid */
  u32 lenRowid;     /* Size of the rowid */
  Mem m, v;

  /* Get the size of the index entry.  Only indices entries of less
  ** than 2GiB are support - anything large must be database corruption.
  ** Any corruption is detected in sqlite3BtreeParseCellPtr(), though, so
  ** this code can safely assume that nCellKey is 32-bits  
  */
  assert( sqlite3BtreeCursorIsValid(pCur) );
  VVA_ONLY(rc =) sqlite3BtreeKeySize(pCur, &nCellKey);
  assert( rc==SQLITE_OK );     /* pCur is always valid so KeySize cannot fail */
  assert( (nCellKey & SQLITE_MAX_U32)==(u64)nCellKey );

  /* Read in the complete content of the index entry */
  sqlite3VdbeMemInit(&m, db, 0);
  rc = sqlite3VdbeMemFromBtree(pCur, 0, (u32)nCellKey, 1, &m);
  if( rc ){
    return rc;
  }

  /* The index entry must begin with a header size */
  (void)getVarint32((u8*)m.z, szHdr);
  testcase( szHdr==3 );
  testcase( szHdr==m.n );
  if( unlikely(szHdr<3 || (int)szHdr>m.n) ){
    goto idx_rowid_corruption;
  }

  /* The last field of the index should be an integer - the ROWID.
  ** Verify that the last entry really is an integer. */
  (void)getVarint32((u8*)&m.z[szHdr-1], typeRowid);
  testcase( typeRowid==1 );
  testcase( typeRowid==2 );
  testcase( typeRowid==3 );
  testcase( typeRowid==4 );
  testcase( typeRowid==5 );
  testcase( typeRowid==6 );
  testcase( typeRowid==8 );
  testcase( typeRowid==9 );
  if( unlikely(typeRowid<1 || typeRowid>9 || typeRowid==7) ){
    goto idx_rowid_corruption;
  }
  lenRowid = sqlite3SmallTypeSizes[typeRowid];
  testcase( (u32)m.n==szHdr+lenRowid );
  if( unlikely((u32)m.n<szHdr+lenRowid) ){
    goto idx_rowid_corruption;
  }

  /* Fetch the integer off the end of the index record */
  sqlite3VdbeSerialGet((u8*)&m.z[m.n-lenRowid], typeRowid, &v);
  *rowid = v.u.i;
  sqlite3VdbeMemRelease(&m);
  return SQLITE_OK;

  /* Jump here if database corruption is detected after m has been
  ** allocated.  Free the m object and return SQLITE_CORRUPT. */
idx_rowid_corruption:
  testcase( m.szMalloc!=0 );
  sqlite3VdbeMemRelease(&m);
  return SQLITE_CORRUPT_BKPT;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x26c17
movl 0x20(%r14), %edx
leaq -0x68(%rbp), %r8
movw $0x0, 0x8(%r8)
movq %r15, 0x28(%r8)
movl $0x0, 0x20(%r8)
movq %r14, %rdi
xorl %esi, %esi
movl $0x1, %ecx
callq 0x3227c
movl %eax, %r14d
testl %eax, %eax
jne 0x3428a
movq -0x58(%rbp), %r14
movsbl (%r14), %r12d
testl %r12d, %r12d
jns 0x341f4
leaq -0x30(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3220d
movl (%r15), %r12d
cmpl $0x3, %r12d
jb 0x3424b
movl -0x5c(%rbp), %r13d
cmpl %r13d, %r12d
jg 0x3424b
leal -0x1(%r12), %edi
movsbl (%r14,%rdi), %esi
testl %esi, %esi
jns 0x34223
addq %r14, %rdi
leaq -0x2c(%rbp), %r15
movq %r15, %rsi
callq 0x3220d
movl (%r15), %esi
leal -0xa(%rsi), %eax
cmpl $-0x9, %eax
setb %al
cmpl $0x7, %esi
sete %cl
orb %al, %cl
jne 0x3424b
movl %esi, %eax
leaq 0x44591(%rip), %rcx     # 0x787d0
movzbl (%rax,%rcx), %eax
addl %eax, %r12d
cmpl %r12d, %r13d
jae 0x3429c
movzwl -0x60(%rbp), %eax
testl $0x2460, %eax           # imm = 0x2460
jne 0x3425c
cmpl $0x0, -0x48(%rbp)
je 0x34265
leaq -0x68(%rbp), %rdi
callq 0x2a1cb
leaq 0x4727c(%rip), %rsi     # 0x7b4e8
leaq 0x46f1a(%rip), %rcx     # 0x7b18d
movl $0xb, %r14d
movl $0xb, %edi
movl $0x117c7, %edx          # imm = 0x117C7
xorl %eax, %eax
callq 0xa4c0
movl %r14d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subl %eax, %r13d
addq %r13, %r14
leaq -0xa0(%rbp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x322cb
movq (%r15), %rax
movq %rax, (%rbx)
movzwl -0x60(%rbp), %eax
xorl %r14d, %r14d
testl $0x2460, %eax           # imm = 0x2460
jne 0x342ce
cmpl $0x0, -0x48(%rbp)
je 0x3428a
leaq -0x68(%rbp), %rdi
callq 0x2a1cb
jmp 0x3428a