// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x4, %eax
jne 0x34cb9
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x26b20
cmpl -0x14(%rbp), %eax
je 0x34ca4
movl $0xe453, %edi           # imm = 0xE453
callq 0x2a650
movl %eax, -0x4(%rbp)
jmp 0x34e85
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
movl -0x18(%rbp), %esi
callq 0x28290
jmp 0x34e7e
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, -0x1a(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2af00
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x34cdf
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x34e85
movq -0x10(%rbp), %rax
movzwl 0x12(%rax), %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x34e13
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x10(%rbp), %rcx
movzwl 0x14(%rcx), %ecx
movq -0x10(%rbp), %rdx
movq 0x60(%rdx), %rdx
movl -0x20(%rbp), %esi
shll %esi
movslq %esi, %rsi
movzbl (%rdx,%rsi), %edx
shll $0x8, %edx
movq -0x10(%rbp), %rsi
movq 0x60(%rsi), %rsi
movl -0x20(%rbp), %edi
shll %edi
movslq %edi, %rdi
movzbl 0x1(%rsi,%rdi), %esi
orl %esi, %edx
andl %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x3, %eax
jne 0x34de5
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq *%rax
movzwl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jae 0x34de3
movq -0x30(%rbp), %rax
movzwl -0x32(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq -0x10(%rbp), %rcx
movq 0x50(%rcx), %rcx
movq -0x10(%rbp), %rdx
movzwl 0x14(%rdx), %edx
movslq %edx, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
ja 0x34de3
movl -0x14(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rdi
movzwl -0x32(%rbp), %eax
cltq
addq %rax, %rdi
addq $-0x4, %rdi
callq 0x26b20
movl %eax, %ecx
movl -0x4c(%rbp), %eax
cmpl %ecx, %eax
jne 0x34de3
movq -0x30(%rbp), %rdi
movzwl -0x32(%rbp), %eax
cltq
addq %rax, %rdi
addq $-0x4, %rdi
movl -0x18(%rbp), %esi
callq 0x28290
jmp 0x34e13
jmp 0x34e03
movq -0x30(%rbp), %rdi
callq 0x26b20
cmpl -0x14(%rbp), %eax
jne 0x34e01
movq -0x30(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x28290
jmp 0x34e13
jmp 0x34e03
jmp 0x34e05
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x34cf1
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0x34e75
movzbl -0x19(%rbp), %eax
cmpl $0x5, %eax
jne 0x34e46
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x10(%rbp), %rax
movzbl 0x6(%rax), %eax
addl $0x8, %eax
cltq
addq %rax, %rdi
callq 0x26b20
cmpl -0x14(%rbp), %eax
je 0x34e55
movl $0xe477, %edi           # imm = 0xE477
callq 0x2a650
movl %eax, -0x4(%rbp)
jmp 0x34e85
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x10(%rbp), %rax
movzbl 0x6(%rax), %eax
addl $0x8, %eax
cltq
addq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x28290
movb -0x1a(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop