// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: copyNodeContent
static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){
  if( (*pRC)==SQLITE_OK ){
    BtShared * const pBt = pFrom->pBt;
    u8 * const aFrom = pFrom->aData;
    u8 * const aTo = pTo->aData;
    int const iFromHdr = pFrom->hdrOffset;
    int const iToHdr = ((pTo->pgno==1) ? 100 : 0);
    int rc;
    int iData;
  
  
    assert( pFrom->isInit );
    assert( pFrom->nFree>=iToHdr );
    assert( get2byte(&aFrom[iFromHdr+5]) <= (int)pBt->usableSize );
  
    /* Copy the b-tree node content from page pFrom to page pTo. */
    iData = get2byte(&aFrom[iFromHdr+5]);
    memcpy(&aTo[iData], &aFrom[iData], pBt->usableSize-iData);
    memcpy(&aTo[iToHdr], &aFrom[iFromHdr], pFrom->cellOffset + 2*pFrom->nCell);
  
    /* Reinitialize page pTo so that the contents of the MemPage structure
    ** match the new data. The initialization of pTo can actually fail under
    ** fairly obscure circumstances, even though it is a copy of initialized 
    ** page pFrom.
    */
    pTo->isInit = 0;
    rc = btreeInitPage(pTo);
    if( rc!=SQLITE_OK ){
      *pRC = rc;
      return;
    }
  
    /* If this is an auto-vacuum database, update the pointer-map entries
    ** for any b-tree or overflow pages that pTo now contains the pointers to.
    */
    if( ISAUTOVACUUM ){
      *pRC = setChildPtrmaps(pTo);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x44d5e
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x5(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movl 0x70(%rax), %edx
xorl %eax, %eax
movl $0x64, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x5, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x8, %eax
movq -0x28(%rbp), %rcx
movl -0x34(%rbp), %edx
addl $0x5, %edx
movslq %edx, %rdx
movzbl 0x1(%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x40(%rbp), %rax
addq %rax, %rdi
movq -0x28(%rbp), %rsi
movslq -0x40(%rbp), %rax
addq %rax, %rsi
movq -0x20(%rbp), %rax
movl 0x34(%rax), %eax
subl -0x40(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
callq 0x82f0
movq -0x30(%rbp), %rdi
movslq -0x38(%rbp), %rax
addq %rax, %rdi
movq -0x28(%rbp), %rsi
movslq -0x34(%rbp), %rax
addq %rax, %rsi
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0x10(%rcx), %ecx
shll %ecx
addl %ecx, %eax
movslq %eax, %rdx
callq 0x82f0
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rdi
callq 0x24a60
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x44d41
movl -0x3c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x44d5e
movq -0x20(%rbp), %rax
cmpb $0x0, 0x21(%rax)
je 0x44d5c
movq -0x10(%rbp), %rdi
callq 0x2dbf0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x44d5e
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)