// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/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_FAST_SECURE ){
    memset(&data[hdr], 0, pBt->usableSize - hdr);
  }
  data[hdr] = (char)flags;
  first = hdr + ((flags&PTF_LEAF)==0 ? 12 : 8);
  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->cellOffset = first;
  pPage->aDataEnd = &data[pBt->usableSize];
  pPage->aCellIdx = &data[first];
  pPage->aDataOfst = &data[pPage->childPtrSize];
  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 0x9(%rax), %al
movb %al, -0x21(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x28(%rax), %eax
andl $0xc, %eax
cmpl $0x0, %eax
je 0x3e7a54
movq -0x18(%rbp), %rdi
movzbl -0x21(%rbp), %eax
addq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x38(%rax), %eax
movzbl -0x21(%rbp), %ecx
subl %ecx, %eax
movl %eax, %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x19360
movl -0xc(%rbp), %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movzbl -0x21(%rbp), %ecx
movb %dl, (%rax,%rcx)
movzbl -0x21(%rbp), %eax
movl -0xc(%rbp), %esi
andl $0x8, %esi
movl $0x8, %ecx
movl $0xc, %edx
cmpl $0x0, %esi
cmovel %edx, %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 0x19360
movq -0x18(%rbp), %rax
movzbl -0x21(%rbp), %ecx
addl $0x7, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rax
movl 0x38(%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 0x38(%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 0x38(%rax), %eax
movzwl -0x24(%rbp), %ecx
subl %ecx, %eax
movzwl %ax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x3e42c0
movw -0x24(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x12(%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movl 0x38(%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 -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movzbl 0xa(%rax), %eax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0xc(%rax)
movq -0x20(%rbp), %rax
movl 0x34(%rax), %eax
subl $0x1, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1a(%rax)
movq -0x8(%rbp), %rax
movw $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movb $0x1, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)