// File: /workspace/github_c_makefile_star2_O3/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: getAndInitPage
static int getAndInitPage(
  BtShared *pBt,                  /* The database file */
  Pgno pgno,                      /* Number of the page to get */
  MemPage **ppPage,               /* Write the page pointer here */
  BtCursor *pCur,                 /* Cursor to receive the page, or NULL */
  int bReadOnly                   /* True for a read-only page */
){
  int rc;
  DbPage *pDbPage;
  assert( sqlite3_mutex_held(pBt->mutex) );
  assert( pCur==0 || ppPage==&pCur->apPage[pCur->iPage] );
  assert( pCur==0 || bReadOnly==pCur->curPagerFlags );
  assert( pCur==0 || pCur->iPage>0 );

  if( pgno>btreePagecount(pBt) ){
    rc = SQLITE_CORRUPT_BKPT;
    goto getAndInitPage_error;
  }
  rc = sqlite3PagerGet(pBt->pPager, pgno, (DbPage**)&pDbPage, bReadOnly);
  if( rc ){
    goto getAndInitPage_error;
  }
  *ppPage = (MemPage*)sqlite3PagerGetExtra(pDbPage);
  if( (*ppPage)->isInit==0 ){
    btreePageFromDbPage(pDbPage, pgno, pBt);
    rc = btreeInitPage(*ppPage);
    if( rc!=SQLITE_OK ){
      releasePage(*ppPage);
      goto getAndInitPage_error;
    }
  }
  assert( (*ppPage)->pgno==pgno );
  assert( (*ppPage)->aData==sqlite3PagerGetData(pDbPage) );

  /* If obtaining a child page for a cursor, we must verify that the page is
  ** compatible with the root page. */
  if( pCur && ((*ppPage)->nCell<1 || (*ppPage)->intKey!=pCur->curIntKey) ){
    rc = SQLITE_CORRUPT_BKPT;
    releasePage(*ppPage);
    goto getAndInitPage_error;
  }
  return SQLITE_OK;

getAndInitPage_error:
  if( pCur ) pCur->iPage--;
  testcase( pgno==0 );
  assert( pgno!=0 || rc==SQLITE_CORRUPT );
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
cmpl %esi, 0x3c(%rdi)
jae 0x36963
leaq 0x44ba5(%rip), %rsi     # 0x7b4e8
leaq 0x44843(%rip), %rcx     # 0x7b18d
movl $0xb, %r15d
movl $0xb, %edi
movl $0xdf1d, %edx           # imm = 0xDF1D
xorl %eax, %eax
callq 0xa4c0
jmp 0x36982
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %r13
movq (%rdi), %rdi
leaq -0x30(%rbp), %rdx
movl %r8d, %ecx
callq 0x100df
movl %eax, %r15d
testl %eax, %eax
je 0x3699c
testq %rbx, %rbx
je 0x3698a
decb 0x58(%rbx)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq %rdi, (%r14)
cmpb $0x0, (%rdi)
je 0x369fe
xorl %r15d, %r15d
testq %rbx, %rbx
je 0x3698a
movq (%r14), %rax
cmpw $0x0, 0x12(%rax)
je 0x369c6
movb 0x2(%rax), %al
cmpb 0x59(%rbx), %al
je 0x3698a
leaq 0x44b1b(%rip), %rsi     # 0x7b4e8
leaq 0x447b9(%rip), %rcx     # 0x7b18d
movl $0xb, %r15d
movl $0xb, %edi
movl $0xdf33, %edx           # imm = 0xDF33
xorl %eax, %eax
callq 0xa4c0
movq (%r14), %rax
testq %rax, %rax
je 0x36987
movq 0x70(%rax), %rdi
callq 0x24e28
jmp 0x36987
cmpl %r12d, 0x88(%rdi)
je 0x36a32
movq 0x8(%rax), %rcx
movq %rcx, 0x50(%rdi)
movq %rax, 0x70(%rdi)
movq %r13, 0x48(%rdi)
movl %r12d, 0x88(%rdi)
xorl %eax, %eax
cmpl $0x1, %r12d
movl $0x64, %ecx
cmovnel %eax, %ecx
movb %cl, 0x6(%rdi)
movq (%r14), %rdi
callq 0x21c91
testl %eax, %eax
je 0x369ac
movl %eax, %r15d
movq (%r14), %rax
testq %rax, %rax
je 0x36982
movq 0x70(%rax), %rdi
callq 0x24e28
jmp 0x36982