// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: lhash_kv_init
static int lhash_kv_init(unqlite_kv_engine *pEngine,int iPageSize)
{
	lhash_kv_engine *pHash = (lhash_kv_engine *)pEngine;
	int rc;

	/* This structure is always zeroed, go to the initialization directly */
	SyMemBackendInitFromParent(&pHash->sAllocator,unqliteExportMemBackend());
#if defined(UNQLITE_ENABLE_THREADS)
	/* Already protected by the upper layers */
	SyMemBackendDisbaleMutexing(&pHash->sAllocator);
#endif
	pHash->iPageSize = iPageSize;
	/* Default hash function */
	pHash->xHash = lhash_bin_hash;
	/* Default comparison function */
	pHash->xCmp = SyMemcmp;
	/* Allocate a new record map */
	pHash->nBuckSize = 32;
	pHash->apMap = (lhash_bmap_rec **)SyMemBackendAlloc(&pHash->sAllocator,pHash->nBuckSize *sizeof(lhash_bmap_rec *));
	if( pHash->apMap == 0 ){
		rc = UNQLITE_NOMEM;
		goto err;
	}
	/* Zero the table */
	SyZero(pHash->apMap,pHash->nBuckSize * sizeof(lhash_bmap_rec *));
	/* Linear hashing components */
	pHash->split_bucket = 0; /* Logical not real bucket number */
	pHash->max_split_bucket = 1;
	pHash->nmax_split_nucket = 2;
	pHash->nMagic = L_HASH_MAGIC;
	/* Install the cache unpin and reload callbacks */
	pHash->pIo->xSetUnpin(pHash->pIo->pHandle,lhash_page_release);
	pHash->pIo->xSetReload(pHash->pIo->pHandle,lhash_page_release);
	return UNQLITE_OK;
err:
	SyMemBackendRelease(&pHash->sAllocator);
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
callq 0x5bf60
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x60230
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x602f0
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x110(%rax)
movq -0x20(%rbp), %rax
leaq 0xa27(%rip), %rcx       # 0x61670
movq %rcx, 0xc0(%rax)
movq -0x20(%rbp), %rax
leaq -0x389b(%rip), %rcx     # 0x5d3c0
movq %rcx, 0xc8(%rax)
movq -0x20(%rbp), %rax
movl $0x20, 0xe4(%rax)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
movq -0x20(%rbp), %rax
movl 0xe4(%rax), %eax
shlq $0x3, %rax
movl %eax, %esi
callq 0x5bf70
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0xd8(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0xd8(%rax)
jne 0x60cb5
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
jmp 0x60d55
movq -0x20(%rbp), %rax
movq 0xd8(%rax), %rdi
movq -0x20(%rbp), %rax
movl 0xe4(%rax), %eax
shlq $0x3, %rax
movl %eax, %esi
callq 0x54280
movq -0x20(%rbp), %rax
movq $0x0, 0x120(%rax)
movq -0x20(%rbp), %rax
movq $0x1, 0x128(%rax)
movq -0x20(%rbp), %rax
movq $0x2, 0x130(%rax)
movq -0x20(%rbp), %rax
movl $0xfa782dcb, 0x138(%rax) # imm = 0xFA782DCB
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x70(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
movq (%rcx), %rdi
leaq 0xa34(%rip), %rsi       # 0x61760
callq *%rax
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x78(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
movq (%rcx), %rdi
leaq 0xa16(%rip), %rsi       # 0x61760
callq *%rax
movl $0x0, -0x4(%rbp)
jmp 0x60d68
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x543e0
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)