// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3MallocInit
SQLITE_PRIVATE int sqlite3MallocInit(void){
  int rc;
  if( sqlite3GlobalConfig.m.xMalloc==0 ){
    sqlite3MemSetDefault();
  }
  memset(&mem0, 0, sizeof(mem0));
  mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);
  if( sqlite3GlobalConfig.pScratch && sqlite3GlobalConfig.szScratch>=100
      && sqlite3GlobalConfig.nScratch>0 ){
    int i, n, sz;
    ScratchFreeslot *pSlot;
    sz = ROUNDDOWN8(sqlite3GlobalConfig.szScratch);
    sqlite3GlobalConfig.szScratch = sz;
    pSlot = (ScratchFreeslot*)sqlite3GlobalConfig.pScratch;
    n = sqlite3GlobalConfig.nScratch;
    mem0.pScratchFree = pSlot;
    mem0.nScratchFree = n;
    for(i=0; i<n-1; i++){
      pSlot->pNext = (ScratchFreeslot*)(sz+(char*)pSlot);
      pSlot = pSlot->pNext;
    }
    pSlot->pNext = 0;
    mem0.pScratchEnd = (void*)&pSlot[1];
  }else{
    mem0.pScratchEnd = 0;
    sqlite3GlobalConfig.pScratch = 0;
    sqlite3GlobalConfig.szScratch = 0;
    sqlite3GlobalConfig.nScratch = 0;
  }
  if( sqlite3GlobalConfig.pPage==0 || sqlite3GlobalConfig.szPage<512
      || sqlite3GlobalConfig.nPage<=0 ){
    sqlite3GlobalConfig.pPage = 0;
    sqlite3GlobalConfig.szPage = 0;
  }
  rc = sqlite3GlobalConfig.m.xInit(sqlite3GlobalConfig.m.pAppData);
  if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0));
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
cmpq $0x0, 0xa3bc8(%rip)     # 0xbf4e8
jne 0x1b927
callq 0x1c970
leaq 0xa595a(%rip), %rdi     # 0xc1288
xorl %esi, %esi
movl $0x28, %edx
callq 0xb2b0
movl $0x3, %edi
callq 0xd5f0
movq %rax, 0xa593d(%rip)     # 0xc1288
cmpq $0x0, 0xa3cad(%rip)     # 0xbf600
je 0x1ba09
cmpl $0x64, 0xa3ca8(%rip)    # 0xbf608
jl 0x1ba09
cmpl $0x0, 0xa3c9f(%rip)     # 0xbf60c
jle 0x1ba09
movl 0xa3c8f(%rip), %eax     # 0xbf608
andl $-0x8, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, 0xa3c80(%rip)     # 0xbf608
movq 0xa3c71(%rip), %rax     # 0xbf600
movq %rax, -0x18(%rbp)
movl 0xa3c73(%rip), %eax     # 0xbf60c
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
movq %rax, 0xa58f9(%rip)     # 0xc12a0
movl -0xc(%rbp), %eax
movl %eax, 0xa58f8(%rip)     # 0xc12a8
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1b9ed
movl -0x10(%rbp), %eax
movq -0x18(%rbp), %rcx
cltq
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x1b9b7
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, 0xa5891(%rip)     # 0xc1298
jmp 0x1ba33
movq $0x0, 0xa5884(%rip) # 0xc1298
movq $0x0, 0xa3be1(%rip) # 0xbf600
movl $0x0, 0xa3bdf(%rip)     # 0xbf608
movl $0x0, 0xa3bd9(%rip)     # 0xbf60c
cmpq $0x0, 0xa3bd5(%rip)     # 0xbf610
je 0x1ba52
cmpl $0x200, 0xa3bd1(%rip)   # imm = 0x200
jl 0x1ba52
cmpl $0x0, 0xa3bcc(%rip)     # 0xbf61c
jg 0x1ba67
movq $0x0, 0xa3bb3(%rip) # 0xbf610
movl $0x0, 0xa3bb1(%rip)     # 0xbf618
movq 0xa3aa2(%rip), %rax     # 0xbf510
movq 0xa3aab(%rip), %rdi     # 0xbf520
callq *%rax
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
je 0x1ba93
leaq 0xa5801(%rip), %rdi     # 0xc1288
xorl %esi, %esi
movl $0x28, %edx
callq 0xb2b0
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)