// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 (unlikely(usize == 0 || usize > HUGE_MAXCLASS)) {
		ret = true;
		goto label_return;
	}
	ckh->tab = (ckhc_t *)ipallocztm(tsd_tsdn(tsd), usize, CACHELINE, true,
	    NULL, true, arena_ichoose(tsd, 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 %rsi, %rbx
movq $0x2a, (%rsi)
andq $0x0, 0x8(%rsi)
movq %rdx, %rcx
movq %rdi, %r14
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 %rsi
pushq $0x1
popq %rdi
leal 0x3(%rsi), %edx
movq %rdi, %r10
movl %edx, %ecx
shlq %cl, %r10
incl %esi
cmpq %rax, %r10
jb 0x11b83
movl %esi, 0x10(%rbx)
movl %esi, 0x14(%rbx)
movq %r9, 0x18(%rbx)
pushq $0x10
popq %rax
movl %edx, %ecx
shlq %cl, %rax
movq %r8, 0x20(%rbx)
pushq $-0x1
popq %rsi
pushq $0x7
popq %rdi
cmpq $0x3800, %rax           # imm = 0x3800
ja 0x11bfd
leal 0x3f(%rax), %r8d
andl $0x7fc0, %r8d           # imm = 0x7FC0
cmpl $0x1000, %r8d           # imm = 0x1000
ja 0x11def
leaq -0x1(%r8), %rcx
shrq $0x3, %rcx
leaq 0x2a1e0(%rip), %r8      # 0x3bdc0
movzbl (%r8,%rcx), %ecx
leaq 0x29a54(%rip), %r8      # 0x3b640
movq (%r8,%rcx,8), %r15
cmpq $0x4000, %r15           # imm = 0x4000
jb 0x11ce7
leaq 0x3b39c(%rip), %rcx     # 0x4cfa0
leaq 0x3b4bd(%rip), %r8      # 0x4d0c8
movq (%r8), %r8
pushq $-0x41
popq %r9
movabsq $0x7000000000000000, %r11 # imm = 0x7000000000000000
pushq $0x20
popq %r10
cmpq %rax, (%rcx)
jb 0x11c8d
cmpq $0x41, %r8
jb 0x11c8d
movl $0x4000, %r15d          # imm = 0x4000
cmpq $0x4001, %rax           # imm = 0x4001
jb 0x11c72
cmpq %r11, %rax
ja 0x11e21
movq %r10, %r9
movl %edx, %ecx
shlq %cl, %r9
decq %r9
bsrq %r9, %r9
movl %r9d, %ecx
addb $-0x3, %cl
movq %rsi, %r15
shlq %cl, %r15
cmpl $0x6, %r9d
notq %r15
cmovbq %rdi, %r15
leaq (%r15,%rax), %rcx
notq %r15
andq %rcx, %r15
leaq 0x1000(%r15), %rcx
leaq 0x3b350(%rip), %r12     # 0x4cfd0
movq $-0x1001, %r9           # imm = 0xEFFF
cmpq (%r12), %rcx
jbe 0x11ce7
leaq 0x3b43c(%rip), %rcx     # 0x4d0d0
movq (%rcx), %r15
cmpq %rax, %r8
jae 0x11cd0
cmpq $0x1000, %rax           # imm = 0x1000
ja 0x11e29
leaq -0x1(%rax), %rcx
shrq $0x3, %rcx
leaq 0x2a109(%rip), %rdx     # 0x3bdc0
movzbl (%rdx,%rcx), %ecx
leaq 0x2997e(%rip), %rdx     # 0x3b640
movq (%rdx,%rcx,8), %r8
cmpq %rax, %r8
jae 0x11cd0
xorl %r15d, %r15d
jmp 0x11ce7
subq %r15, %r9
orq %r15, %r9
addq $0x1000, %r9            # imm = 0x1000
xorl %r15d, %r15d
cmpq %r8, %r9
cmovaeq %r8, %r15
movabsq $-0x7000000000000001, %rax # imm = 0x8FFFFFFFFFFFFFFF
leaq (%r15,%rax), %rcx
incq %rax
cmpq %rax, %rcx
jb 0x11da9
movq 0x28(%r14), %rsi
testq %rsi, %rsi
je 0x11dae
pushq $0x40
popq %rcx
pushq $0x1
popq %r8
movq %r14, %rdi
movq %r15, %rdx
xorl %r9d, %r9d
callq 0xd4f0
movq %rax, %r15
testq %rax, %rax
sete %bpl
je 0x11d94
leaq 0x3b39a(%rip), %r13     # 0x4d0d0
movq (%r13), %rax
notq %rax
andq %r15, %rax
cmpq %rax, %r15
je 0x11dc1
movq (%rax), %r12
movq (%r13), %rax
notq %rax
andq %r15, %rax
movq %r15, %rcx
subq %rax, %rcx
je 0x11dd1
shrq $0xc, %rcx
leaq 0x3b25b(%rip), %rdx     # 0x4cfc0
subq (%rdx), %rcx
movq 0x78(%rax,%rcx,8), %rax
movl %eax, %ecx
shrl $0x5, %ecx
movl $0xff, %edx
andl %edx, %ecx
cmpl %edx, %ecx
je 0x11dde
movl %ecx, %eax
leaq 0x298ba(%rip), %rcx     # 0x3b640
movq (%rcx,%rax,8), %rax
lock
xaddq %rax, 0x90(%r12)
movq %r15, 0x28(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %bpl
jmp 0x11d98
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x1b0d1
movq %rax, %rsi
jmp 0x11d0e
movq %r15, %rdi
callq 0x2e39f
movq %rax, %r12
jmp 0x11d48
movq %r14, %rdi
movq %r15, %rsi
callq 0x2e4e2
jmp 0x11d8a
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
addq $-0x1000, %rax          # imm = 0xF000
jmp 0x11d8a
leaq -0x1(,%r8,2), %rcx
bsrq %rcx, %r9
movl %r9d, %ecx
addb $-0x3, %cl
movq %rsi, %r15
shlq %cl, %r15
cmpl $0x6, %r9d
notq %r15
cmovbq %rdi, %r15
leaq (%r15,%r8), %rcx
notq %r15
andq %rcx, %r15
jmp 0x11bf0
xorl %r15d, %r15d
jmp 0x11c72
cmpq %r11, %rax
ja 0x11e5e
movl %edx, %ecx
shlq %cl, %r10
decq %r10
bsrq %r10, %rdx
movl %edx, %ecx
addb $-0x3, %cl
shlq %cl, %rsi
cmpl $0x6, %edx
notq %rsi
cmovbq %rdi, %rsi
leaq (%rsi,%rax), %rcx
notq %rsi
andq %rcx, %rsi
movq %rsi, %r8
jmp 0x11cc6
xorl %r8d, %r8d
jmp 0x11cc6