// File: /workspace/github_c_makefile_star2_O0/ukontainer[P]sqlite-bench/sqlite3.c
// Function: btreeOverwriteContent
static int btreeOverwriteContent(
  MemPage *pPage,           /* MemPage on which writing will occur */
  u8 *pDest,                /* Pointer to the place to start writing */
  const BtreePayload *pX,   /* Source of data to write */
  int iOffset,              /* Offset of first byte to write */
  int iAmt                  /* Number of bytes to be written */
){
  int nData = pX->nData - iOffset;
  if( nData<=0 ){
    /* Overwritting with zeros */
    int i;
    for(i=0; i<iAmt && pDest[i]==0; i++){}
    if( i<iAmt ){
      int rc = sqlite3PagerWrite(pPage->pDbPage);
      if( rc ) return rc;
      memset(pDest + i, 0, iAmt - i);
    }
  }else{
    if( nData<iAmt ){
      /* Mixed read data and zeros at the end.  Make a recursive call
      ** to write the zeros then fall through to write the real data */
      int rc = btreeOverwriteContent(pPage, pDest+nData, pX, iOffset+nData,
                                 iAmt-nData);
      if( rc ) return rc;
      iAmt = nData;
    }
    if( memcmp(pDest, ((u8*)pX->pData) + iOffset, iAmt)!=0 ){
      int rc = sqlite3PagerWrite(pPage->pDbPage);
      if( rc ) return rc;
      memcpy(pDest, ((u8*)pX->pData) + iOffset, iAmt);
    }
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x24(%rax), %eax
subl -0x24(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jg 0x447cda
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %ecx
xorl %eax, %eax
cmpl -0x28(%rbp), %ecx
movb %al, -0x3d(%rbp)
jge 0x447c7b
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x3d(%rbp)
movb -0x3d(%rbp), %al
testb $0x1, %al
jne 0x447c84
jmp 0x447c91
jmp 0x447c86
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x447c59
movl -0x30(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x447cd5
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x40bed0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x447cba
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x447d83
movq -0x18(%rbp), %rdi
movslq -0x30(%rbp), %rax
addq %rax, %rdi
movl -0x28(%rbp), %eax
subl -0x30(%rbp), %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0x4010b0
jmp 0x447d7c
movl -0x2c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x447d1f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movslq -0x2c(%rbp), %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
addl -0x2c(%rbp), %ecx
movl -0x28(%rbp), %r8d
subl -0x2c(%rbp), %r8d
callq 0x447c20
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x447d19
movl -0x38(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x447d83
movl -0x2c(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movslq -0x24(%rbp), %rax
addq %rax, %rsi
movslq -0x28(%rbp), %rdx
callq 0x401098
cmpl $0x0, %eax
je 0x447d7a
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x40bed0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x447d5e
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x447d83
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movslq -0x24(%rbp), %rax
addq %rax, %rsi
movslq -0x28(%rbp), %rdx
callq 0x401040
jmp 0x447d7c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)