// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: zeroPage
static void zeroPage(MemPage *pPage, int flags){
  unsigned char *data = pPage->aData;
  BtShared *pBt = pPage->pBt;
  u8 hdr = pPage->hdrOffset;
  u16 first;

  assert( sqlite3PagerPagenumber(pPage->pDbPage)==pPage->pgno );
  assert( sqlite3PagerGetExtra(pPage->pDbPage) == (void*)pPage );
  assert( sqlite3PagerGetData(pPage->pDbPage) == data );
  assert( sqlite3PagerIswriteable(pPage->pDbPage) );
  assert( sqlite3_mutex_held(pBt->mutex) );
  if( pBt->btsFlags & BTS_SECURE_DELETE ){
    memset(&data[hdr], 0, pBt->usableSize - hdr);
  }
  data[hdr] = (char)flags;
  first = hdr + 8 + 4*((flags&PTF_LEAF)==0 ?1:0);
  memset(&data[hdr+1], 0, 4);
  data[hdr+7] = 0;
  put2byte(&data[hdr+5], pBt->usableSize);
  pPage->nFree = (u16)(pBt->usableSize - first);
  decodeFlags(pPage, flags);
  pPage->hdrOffset = hdr;
  pPage->cellOffset = first;
  pPage->aDataEnd = &data[pBt->usableSize];
  pPage->aCellIdx = &data[first];
  pPage->nOverflow = 0;
  assert( pBt->pageSize>=512 && pBt->pageSize<=65536 );
  pPage->maskPage = (u16)(pBt->pageSize - 1);
  pPage->nCell = 0;
  pPage->isInit = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movb 0x5(%rax), %al
movb %al, -0x21(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x26(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x2a984
movq -0x18(%rbp), %rdi
movzbl -0x21(%rbp), %eax
addq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x34(%rax), %eax
movzbl -0x21(%rbp), %ecx
subl %ecx, %eax
movl %eax, %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x8200
movl -0xc(%rbp), %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movzbl -0x21(%rbp), %ecx
movb %dl, (%rax,%rcx)
movzbl -0x21(%rbp), %eax
addl $0x8, %eax
movl -0xc(%rbp), %esi
andl $0x8, %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovel %edx, %ecx
shll $0x2, %ecx
addl %ecx, %eax
movw %ax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
movzbl -0x21(%rbp), %eax
addl $0x1, %eax
cltq
addq %rax, %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x8200
movq -0x18(%rbp), %rax
movzbl -0x21(%rbp), %ecx
addl $0x7, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rax
movl 0x34(%rax), %eax
shrl $0x8, %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movzbl -0x21(%rbp), %ecx
addl $0x5, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x20(%rbp), %rax
movl 0x34(%rax), %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movzbl -0x21(%rbp), %ecx
addl $0x5, %ecx
movslq %ecx, %rcx
movb %dl, 0x1(%rax,%rcx)
movq -0x20(%rbp), %rax
movl 0x34(%rax), %eax
movzwl -0x24(%rbp), %ecx
subl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0xe(%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x24d80
movb -0x21(%rbp), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x5(%rax)
movw -0x24(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0xc(%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movl 0x34(%rax), %eax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x18(%rbp), %rcx
movzwl -0x24(%rbp), %eax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x1(%rax)
movq -0x20(%rbp), %rax
movl 0x30(%rax), %eax
subl $0x1, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x12(%rax)
movq -0x8(%rbp), %rax
movw $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movb $0x1, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)