// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/deps/jemalloc/src/ckh.c
// Function: je_ckh_new
bool
ckh_new(tsd_t *tsd, ckh_t *ckh, size_t minitems, ckh_hash_t *hash,
    ckh_keycomp_t *keycomp)
{
	bool ret;
	size_t mincells, usize;
	unsigned lg_mincells;

	assert(minitems > 0);
	assert(hash != NULL);
	assert(keycomp != NULL);

#ifdef CKH_COUNT
	ckh->ngrows = 0;
	ckh->nshrinks = 0;
	ckh->nshrinkfails = 0;
	ckh->ninserts = 0;
	ckh->nrelocs = 0;
#endif
	ckh->prng_state = 42; /* Value doesn't really matter. */
	ckh->count = 0;

	/*
	 * Find the minimum power of 2 that is large enough to fit minitems
	 * entries.  We are using (2+,2) cuckoo hashing, which has an expected
	 * maximum load factor of at least ~0.86, so 0.75 is a conservative load
	 * factor that will typically allow mincells items to fit without ever
	 * growing the table.
	 */
	assert(LG_CKH_BUCKET_CELLS > 0);
	mincells = ((minitems + (3 - (minitems % 3))) / 3) << 2;
	for (lg_mincells = LG_CKH_BUCKET_CELLS;
	    (ZU(1) << lg_mincells) < mincells;
	    lg_mincells++)
		; /* Do nothing. */
	ckh->lg_minbuckets = lg_mincells - LG_CKH_BUCKET_CELLS;
	ckh->lg_curbuckets = lg_mincells - LG_CKH_BUCKET_CELLS;
	ckh->hash = hash;
	ckh->keycomp = keycomp;

	usize = sa2u(sizeof(ckhc_t) << lg_mincells, CACHELINE);
	if (usize == 0) {
		ret = true;
		goto label_return;
	}
	ckh->tab = (ckhc_t *)ipallocztm(tsd, usize, CACHELINE, true, NULL, true,
	    NULL);
	if (ckh->tab == NULL) {
		ret = true;
		goto label_return;
	}

	ret = false;
label_return:
	return (ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r9
movq %rdx, %rcx
movq %rsi, %rbx
movq %rdi, %r10
movl $0x2a, (%rsi)
movq $0x0, 0x8(%rsi)
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
movq %rdx, %rax
mulq %rsi
shrq %rdx
leaq (%rdx,%rdx,2), %rdx
movq %rcx, %rax
subq %rdx, %rax
xorq $0x3, %rax
addq %rcx, %rax
mulq %rsi
addq %rdx, %rdx
andq $-0x4, %rdx
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
leal 0x3(%r15), %r12d
movl $0x1, %eax
movl %r12d, %ecx
shlq %cl, %rax
incl %r15d
cmpq %rdx, %rax
jb 0x3e8c5
movl %r15d, 0x10(%rbx)
movl %r15d, 0x14(%rbx)
movq %r9, 0x18(%rbx)
movq %r8, 0x20(%rbx)
movl $0x10, %r13d
movl %r12d, %ecx
shlq %cl, %r13
cmpq $0x3800, %r13           # imm = 0x3800
ja 0x3e942
leal 0x3f(%r13), %edi
andl $0x7fc0, %edi           # imm = 0x7FC0
cmpl $0x1000, %edi           # imm = 0x1000
ja 0x3ea77
leaq -0x1(%rdi), %rax
shrq $0x3, %rax
leaq 0x969a(%rip), %rcx      # 0x47fc0
movzbl (%rcx,%rax), %eax
leaq 0x8f0f(%rip), %rcx      # 0x47840
movq (%rcx,%rax,8), %rdx
cmpq $0x4000, %rdx           # imm = 0x4000
jb 0x3ea2c
addl $0x2, %r15d
leaq 0x1cbf3(%rip), %rdx     # 0x5b540
leaq 0x1cd54(%rip), %rax     # 0x5b6a8
movq (%rax), %rax
movl $0x40, %ecx
cmpq %r13, (%rdx)
jb 0x3e9cf
cmpq $0x41, %rax
jb 0x3e9cf
movl $0x4000, %edx           # imm = 0x4000
cmpq $0x4001, %r13           # imm = 0x4001
jb 0x3e9b7
testq %r13, %r13
js 0x3ea91
movl $0x20, %edx
movl %r12d, %ecx
shlq %cl, %rdx
decq %rdx
bsrq %rdx, %rdx
leal -0x3(%rdx), %ecx
movq $-0x1, %rsi
shlq %cl, %rsi
cmpq $0x6, %rdx
notq %rsi
movl $0x7, %edx
cmovaeq %rsi, %rdx
leaq (%rdx,%r13), %rcx
notq %rdx
andq %rcx, %rdx
leaq 0x1000(%rdx), %rsi
leaq 0x1cba3(%rip), %rdi     # 0x5b568
movl $0x1000, %ecx           # imm = 0x1000
cmpq (%rdi), %rsi
jbe 0x3ea2c
leaq 0x1ccda(%rip), %rdx     # 0x5b6b0
movq (%rdx), %r14
addq %r14, %rcx
notq %r14
movb $0x1, %bpl
andq %rcx, %r14
je 0x3ea66
cmpq %r13, %rax
jae 0x3ea1c
cmpq $0x1000, %r13           # imm = 0x1000
ja 0x3eaa0
leaq -0x1(%r13), %rax
shrq $0x3, %rax
leaq 0x95b8(%rip), %rcx      # 0x47fc0
movzbl (%rcx,%rax), %eax
leaq 0x8e2d(%rip), %rcx      # 0x47840
movq (%rcx,%rax,8), %rax
cmpq %r13, %rax
jb 0x3ea66
movl $0xfff, %ecx            # imm = 0xFFF
subq %r14, %rcx
movq %rax, %rdx
cmpq %rax, %rcx
jb 0x3ea66
testq %rdx, %rdx
je 0x3ea63
movl $0x40, %ecx
movq %r10, %rdi
xorl %esi, %esi
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x28c3d
movq %rax, %r14
testq %rax, %rax
sete %bpl
je 0x3ea5d
movq %r14, %rdi
callq 0x14705
movq %r14, 0x28(%rbx)
jmp 0x3ea66
movb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rbp
movq %rbp, %rsi
movq %r10, %r14
callq 0x1468f
movq %r14, %r10
movq (%rbp), %rdx
jmp 0x3e935
xorl %edx, %edx
cmpl $0x3b, %r15d
adcq $0x3f, %rdx
jmp 0x3e990
movq %rsp, %rax
movq %r13, %rdi
movl %r15d, %esi
movq %r12, %rdx
movq %rax, %r12
movq %rax, %rcx
movq %r10, %r15
callq 0x146bf
movq %r15, %r10
movq (%r12), %rax
jmp 0x3ea17