// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
movq %rcx, %r9
movq %rsi, %rbx
movl $0x2a, (%rsi)
andq $0x0, 0x8(%rsi)
movq %rdx, %rcx
pushq $0x3
popq %rsi
movq %rdx, %rax
xorl %edx, %edx
divq %rsi
xorq $0x3, %rdx
addq %rdx, %rcx
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
shlq $0x2, %rax
pushq $-0x1
popq %r10
pushq $0x1
popq %rdx
leal 0x3(%r10), %esi
movq %rdx, %r11
movl %esi, %ecx
shlq %cl, %r11
incl %r10d
cmpq %rax, %r11
jb 0x39071
movl %r10d, 0x10(%rbx)
movl %r10d, 0x14(%rbx)
movq %r9, 0x18(%rbx)
pushq $0x10
popq %rax
movl %esi, %ecx
shlq %cl, %rax
movq %r8, 0x20(%rbx)
pushq $-0x1
popq %r8
pushq $0x7
popq %r9
cmpq $0x3800, %rax           # imm = 0x3800
ja 0x390f0
leal 0x3f(%rax), %r11d
andl $0x7fc0, %r11d          # imm = 0x7FC0
cmpl $0x1000, %r11d          # imm = 0x1000
ja 0x39278
leaq -0x1(%r11), %rcx
shrq $0x3, %rcx
leaq 0x9a2c(%rip), %rdx      # 0x42b00
movzbl (%rdx,%rcx), %ecx
leaq 0x92a1(%rip), %rdx      # 0x42380
movq (%rdx,%rcx,8), %rdx
cmpq $0x4000, %rdx           # imm = 0x4000
jb 0x391dc
addl $0x2, %r10d
leaq 0x1e445(%rip), %rdx     # 0x57540
leaq 0x1e5a6(%rip), %rcx     # 0x576a8
movq (%rcx), %r11
pushq $0x40
popq %rcx
pushq $0x20
popq %r14
cmpq %rax, (%rdx)
jb 0x39174
cmpq $0x41, %r11
jb 0x39174
movl $0x4000, %edx           # imm = 0x4000
cmpq $0x4001, %rax           # imm = 0x4001
jb 0x3915b
testq %rax, %rax
js 0x392dd
movq %r14, %rdx
movl %esi, %ecx
shlq %cl, %rdx
decq %rdx
bsrq %rdx, %r15
leal -0x3(%r15), %ecx
movq %r8, %rdx
shlq %cl, %rdx
cmpq $0x6, %r15
notq %rdx
cmovbq %r9, %rdx
leaq (%rdx,%rax), %rcx
notq %rdx
andq %rcx, %rdx
leaq 0x1000(%rdx), %r15
leaq 0x1e3ff(%rip), %r12     # 0x57568
movl $0x1000, %ecx           # imm = 0x1000
cmpq (%r12), %r15
jbe 0x391dc
leaq 0x1e535(%rip), %rdx     # 0x576b0
movq (%rdx), %rdx
addq %rdx, %rcx
notq %rdx
movb $0x1, %bpl
andq %rcx, %rdx
je 0x3926d
cmpq %rax, %r11
jae 0x391c8
cmpq $0x1000, %rax           # imm = 0x1000
ja 0x392ed
leaq -0x1(%rax), %rcx
shrq $0x3, %rcx
leaq 0x9950(%rip), %rsi      # 0x42b00
movzbl (%rsi,%rcx), %ecx
leaq 0x91c5(%rip), %rsi      # 0x42380
movq (%rsi,%rcx,8), %r11
cmpq %rax, %r11
jb 0x3926d
movl $0xfff, %eax            # imm = 0xFFF
subq %rdx, %rax
movq %r11, %rdx
cmpq %r11, %rax
jb 0x3926d
testq %rdx, %rdx
je 0x3926a
pushq $0x40
popq %rcx
pushq $0x1
popq %r8
xorl %esi, %esi
xorl %r9d, %r9d
callq 0x23953
movq %rax, %r14
testq %rax, %rax
sete %bpl
je 0x39264
leaq 0x1e4a7(%rip), %r12     # 0x576b0
movq (%r12), %rax
notq %rax
andq %r14, %rax
cmpq %rax, %r14
je 0x392a8
movq (%rax), %r15
cmpq %rax, %r14
je 0x392c2
movq %r14, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
leaq 0x1e31f(%rip), %rdx     # 0x57558
subq (%rdx), %rcx
movq 0x68(%rax,%rcx,8), %rax
movl %eax, %ecx
shrl $0x5, %ecx
movl $0xff, %edx
andl %edx, %ecx
cmpl %edx, %ecx
je 0x392cc
movl %ecx, %eax
leaq 0x9126(%rip), %rcx      # 0x42380
movq (%rcx,%rax,8), %rax
lock
xaddq %rax, 0x58(%r15)
movq %r14, 0x28(%rbx)
jmp 0x3926d
movb $0x1, %bpl
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq -0x1(,%r11,2), %rcx
bsrq %rcx, %r14
leal -0x3(%r14), %ecx
movq %r8, %rdx
shlq %cl, %rdx
cmpq $0x6, %r14
notq %rdx
cmovbq %r9, %rdx
leaq (%rdx,%r11), %rcx
notq %rdx
andq %rcx, %rdx
jmp 0x390e3
movq %r14, %rdi
callq 0x311b6
movq %rax, %r15
movq (%r12), %rax
notq %rax
andq %r14, %rax
jmp 0x3921f
movq %r14, %rdi
callq 0x311c1
jmp 0x3925e
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
addq $-0x1000, %rax          # imm = 0xF000
jmp 0x3925e
xorl %r15d, %r15d
cmpl $0x3b, %r10d
adcq $0x3f, %r15
jmp 0x3913c
testq %rax, %rax
js 0x39321
movl %esi, %ecx
shlq %cl, %r14
decq %r14
bsrq %r14, %rsi
leal -0x3(%rsi), %ecx
shlq %cl, %r8
cmpq $0x6, %rsi
notq %r8
cmovbq %r9, %r8
leaq (%r8,%rax), %rcx
notq %r8
andq %rcx, %r8
movq %r8, %r11
jmp 0x391bf
xorl %esi, %esi
cmpl $0x3b, %r10d
adcq $0x3f, %rsi
jmp 0x392fe