// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: pcache1InitBulk
static int pcache1InitBulk(PCache1 *pCache){
  i64 szBulk;
  char *zBulk;
  if( pcache1.nInitPage==0 ) return 0;
  /* Do not bother with a bulk allocation if the cache size very small */
  if( pCache->nMax<3 ) return 0;
  sqlite3BeginBenignMalloc();
  if( pcache1.nInitPage>0 ){
    szBulk = pCache->szAlloc * (i64)pcache1.nInitPage;
  }else{
    szBulk = -1024 * (i64)pcache1.nInitPage;
  }
  if( szBulk > pCache->szAlloc*(i64)pCache->nMax ){
    szBulk = pCache->szAlloc*(i64)pCache->nMax;
  }
  zBulk = pCache->pBulk = sqlite3Malloc( szBulk );
  sqlite3EndBenignMalloc();
  if( zBulk ){
    int nBulk = sqlite3MallocSize(zBulk)/pCache->szAlloc;
    do{
      PgHdr1 *pX = (PgHdr1*)&zBulk[pCache->szPage];
      pX->page.pBuf = zBulk;
      pX->page.pExtra = &pX[1];
      pX->isBulkLocal = 1;
      pX->isAnchor = 0;
      pX->pNext = pCache->pFree;
      pX->pLruPrev = 0;           /* Initializing this saves a valgrind error */
      pCache->pFree = pX;
      zBulk += pCache->szAlloc;
    }while( --nBulk );
  }
  return pCache->pFree!=0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
cmpl $0x0, 0x1d530d(%rip)    # 0x643470
jne 0x46e171
movl $0x0, -0x4(%rbp)
jmp 0x46e2d3
movq -0x10(%rbp), %rax
cmpl $0x3, 0x24(%rax)
jae 0x46e187
movl $0x0, -0x4(%rbp)
jmp 0x46e2d3
callq 0x3e01d0
cmpl $0x0, 0x1d52dd(%rip)    # 0x643470
jle 0x46e1ae
movq -0x10(%rbp), %rax
movslq 0x18(%rax), %rax
movslq 0x1d52cc(%rip), %rcx    # 0x643470
imulq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x46e1c0
movslq 0x1d52bb(%rip), %rax    # 0x643470
imulq $-0x400, %rax, %rax     # imm = 0xFC00
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x18(%rcx), %rcx
movq -0x10(%rbp), %rdx
movl 0x24(%rdx), %edx
imulq %rdx, %rcx
cmpq %rcx, %rax
jle 0x46e1f3
movq -0x10(%rbp), %rax
movslq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x24(%rcx), %ecx
imulq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3c0760
movq -0x10(%rbp), %rcx
movq %rax, 0x50(%rcx)
movq %rax, -0x20(%rbp)
callq 0x3e0220
cmpq $0x0, -0x20(%rbp)
je 0x46e2bf
movq -0x20(%rbp), %rdi
callq 0x3c08a0
movq -0x10(%rbp), %rcx
cltd
idivl 0x18(%rcx)
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x10(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
addq $0x38, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movw $0x1, 0x14(%rax)
movq -0x30(%rbp), %rax
movw $0x0, 0x16(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
jne 0x46e22c
jmp 0x46e2bf
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)