// File: /workspace/github_c_makefile_star2_O1/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 0x37533
leaq 0x45fc5(%rip), %rsi     # 0x7d4d8
leaq 0x45c63(%rip), %rcx     # 0x7d17d
movl $0xb, %r15d
movl $0xb, %edi
movl $0xdf1d, %edx           # imm = 0xDF1D
xorl %eax, %eax
callq 0xa4b0
jmp 0x37552
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %r13
movq (%rdi), %rdi
leaq -0x30(%rbp), %rdx
movl %r8d, %ecx
callq 0xfff8
movl %eax, %r15d
testl %eax, %eax
je 0x3756c
testq %rbx, %rbx
je 0x3755a
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), %rcx
movq 0x10(%rcx), %rax
movq %rax, (%r14)
cmpb $0x0, (%rax)
je 0x375bd
xorl %r15d, %r15d
testq %rbx, %rbx
je 0x3755a
movq (%r14), %rax
cmpw $0x0, 0x12(%rax)
je 0x37596
movb 0x2(%rax), %al
cmpb 0x59(%rbx), %al
je 0x3755a
leaq 0x45f3b(%rip), %rsi     # 0x7d4d8
leaq 0x45bd9(%rip), %rcx     # 0x7d17d
movl $0xb, %r15d
movl $0xb, %edi
movl $0xdf33, %edx           # imm = 0xDF33
xorl %eax, %eax
callq 0xa4b0
jmp 0x37605
movq 0x10(%rcx), %rax
cmpl %r12d, 0x88(%rax)
je 0x375f2
movq 0x8(%rcx), %rdx
movq %rdx, 0x50(%rax)
movq %rcx, 0x70(%rax)
movq %r13, 0x48(%rax)
movl %r12d, 0x88(%rax)
xorl %ecx, %ecx
cmpl $0x1, %r12d
movl $0x64, %edx
cmovnel %ecx, %edx
movb %dl, 0x6(%rax)
movq (%r14), %rdi
callq 0x21dda
testl %eax, %eax
je 0x3757c
movl %eax, %r15d
movq (%r14), %rax
testq %rax, %rax
je 0x37552
movq 0x70(%rax), %rdi
callq 0x25020
jmp 0x37552