// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x31b90
movl %eax, %ecx
movl -0x3c(%rbp), %eax
cmpl %ecx, %eax
jbe 0x49135
movl $0xdf1d, %edi           # imm = 0xDF1D
callq 0x2a650
movl %eax, -0x30(%rbp)
jmp 0x49202
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
movl -0x2c(%rbp), %ecx
leaq -0x38(%rbp), %rdx
callq 0x12380
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0x49159
jmp 0x49202
movq -0x38(%rbp), %rdi
callq 0x2aec0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x491b0
movq -0x38(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
callq 0x313a0
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x2af00
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0x491ae
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x30e20
jmp 0x49202
jmp 0x491b0
cmpq $0x0, -0x28(%rbp)
je 0x491f9
movq -0x20(%rbp), %rax
movq (%rax), %rax
movzwl 0x12(%rax), %eax
cmpl $0x1, %eax
jl 0x491de
movq -0x20(%rbp), %rax
movq (%rax), %rax
movzbl 0x2(%rax), %eax
movq -0x28(%rbp), %rcx
movzbl 0x59(%rcx), %ecx
cmpl %ecx, %eax
je 0x491f9
movl $0xdf33, %edi           # imm = 0xDF33
callq 0x2a650
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x30e20
jmp 0x49202
movl $0x0, -0x4(%rbp)
jmp 0x4921c
cmpq $0x0, -0x28(%rbp)
je 0x49216
movq -0x28(%rbp), %rax
movb 0x58(%rax), %cl
addb $-0x1, %cl
movb %cl, 0x58(%rax)
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)