// File: /workspace/github_c_makefile_star2_O3/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: modifyPagePointer
static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){
  assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  assert( sqlite3PagerIswriteable(pPage->pDbPage) );
  if( eType==PTRMAP_OVERFLOW2 ){
    /* The pointer is always the first 4 bytes of the page in this case.  */
    if( get4byte(pPage->aData)!=iFrom ){
      return SQLITE_CORRUPT_BKPT;
    }
    put4byte(pPage->aData, iTo);
  }else{
    u8 isInitOrig = pPage->isInit;
    int i;
    int nCell;
    int rc;

    rc = btreeInitPage(pPage);
    if( rc ) return rc;
    nCell = pPage->nCell;

    for(i=0; i<nCell; i++){
      u8 *pCell = findCell(pPage, i);
      if( eType==PTRMAP_OVERFLOW1 ){
        CellInfo info;
        pPage->xParseCell(pPage, pCell, &info);
        if( info.nLocal<info.nPayload
         && pCell+info.nSize-1<=pPage->aData+pPage->maskPage
         && iFrom==get4byte(pCell+info.nSize-4)
        ){
          put4byte(pCell+info.nSize-4, iTo);
          break;
        }
      }else{
        if( get4byte(pCell)==iFrom ){
          put4byte(pCell, iTo);
          break;
        }
      }
    }
  
    if( i==nCell ){
      if( eType!=PTRMAP_BTREE || 
          get4byte(&pPage->aData[pPage->hdrOffset+8])!=iFrom ){
        return SQLITE_CORRUPT_BKPT;
      }
      put4byte(&pPage->aData[pPage->hdrOffset+8], iTo);
    }

    pPage->isInit = isInitOrig;
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movq %rdi, %r14
cmpl $0x4, %ecx
jne 0x27fa2
movq 0x50(%r14), %rax
movl (%rax), %ecx
bswapl %ecx
cmpl %esi, %ecx
jne 0x2805f
bswapl %ebx
movl %ebx, (%rax)
jmp 0x280f0
movl %ecx, %r12d
movl %esi, -0x34(%rbp)
movb (%r14), %r15b
movq %r14, %rdi
callq 0x21c91
movl %eax, %r13d
testl %eax, %eax
jne 0x280f3
movb %r15b, -0x29(%rbp)
movl %ebx, -0x30(%rbp)
movzwl 0x12(%r14), %eax
testl %eax, %eax
je 0x2807f
movl %eax, -0x38(%rbp)
movl %eax, %r15d
xorl %ebx, %ebx
movl -0x34(%rbp), %esi
movzwl 0x14(%r14), %eax
movq 0x60(%r14), %rcx
movzbl (%rcx,%rbx,2), %edx
shll $0x8, %edx
movzbl 0x1(%rcx,%rbx,2), %r13d
orl %edx, %r13d
andl %eax, %r13d
addq 0x50(%r14), %r13
cmpb $0x3, %r12b
jne 0x2804b
movq %r14, %rdi
movq %r13, %rsi
leaq -0x50(%rbp), %rdx
callq *0x80(%r14)
movl -0x34(%rbp), %esi
movzwl -0x3c(%rbp), %eax
cmpl %eax, -0x40(%rbp)
jbe 0x28055
movzwl -0x3a(%rbp), %eax
leaq (%rax,%r13), %rcx
decq %rcx
movzwl 0x14(%r14), %edx
addq 0x50(%r14), %rdx
cmpq %rdx, %rcx
ja 0x28055
addq %rax, %r13
movl -0x4(%r13), %eax
bswapl %eax
cmpl %esi, %eax
jne 0x28055
jmp 0x280e1
movl (%r13), %eax
bswapl %eax
cmpl %esi, %eax
je 0x28086
incq %rbx
cmpq %rbx, %r15
jne 0x27fdd
jmp 0x28096
leaq 0x53482(%rip), %rsi     # 0x7b4e8
leaq 0x53120(%rip), %rcx     # 0x7b18d
movl $0xb, %r13d
movl $0xb, %edi
movl $0xe453, %edx           # imm = 0xE453
jmp 0x280d8
xorl %ebx, %ebx
movl -0x34(%rbp), %esi
jmp 0x28092
movl -0x30(%rbp), %eax
bswapl %eax
movl %eax, (%r13)
movl -0x38(%rbp), %eax
cmpl %eax, %ebx
jne 0x280ea
cmpb $0x5, %r12b
jne 0x280ba
movq 0x50(%r14), %rax
movzbl 0x6(%r14), %ecx
movl 0x8(%rax,%rcx), %edx
bswapl %edx
cmpl %esi, %edx
jne 0x280ba
movl -0x30(%rbp), %edx
bswapl %edx
movl %edx, 0x8(%rax,%rcx)
jmp 0x280ea
leaq 0x53427(%rip), %rsi     # 0x7b4e8
leaq 0x530c5(%rip), %rcx     # 0x7b18d
movl $0xb, %r13d
movl $0xb, %edi
movl $0xe477, %edx           # imm = 0xE477
xorl %eax, %eax
callq 0xa4c0
jmp 0x280f3
movl -0x30(%rbp), %eax
bswapl %eax
movl %eax, -0x4(%r13)
movb -0x29(%rbp), %al
movb %al, (%r14)
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq