// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/tcache.c
// Function: je_tcache_boot
bool
tcache_boot(tsdn_t *tsdn)
{
	unsigned i;

	/*
	 * If necessary, clamp opt_lg_tcache_max, now that large_maxclass is
	 * known.
	 */
	if (opt_lg_tcache_max < 0 || (ZU(1) << opt_lg_tcache_max) < SMALL_MAXCLASS)
		tcache_maxclass = SMALL_MAXCLASS;
	else if ((ZU(1) << opt_lg_tcache_max) > large_maxclass)
		tcache_maxclass = large_maxclass;
	else
		tcache_maxclass = (ZU(1) << opt_lg_tcache_max);

	nhbins = size2index(tcache_maxclass) + 1;

	/* Initialize tcache_bin_info. */
	tcache_bin_info = (tcache_bin_info_t *)base_alloc(tsdn, nhbins *
	    sizeof(tcache_bin_info_t));
	if (tcache_bin_info == NULL)
		return (true);
	stack_nelms = 0;
	for (i = 0; i < NBINS; i++) {
		if ((arena_bin_info[i].nregs << 1) <= TCACHE_NSLOTS_SMALL_MIN) {
			tcache_bin_info[i].ncached_max =
			    TCACHE_NSLOTS_SMALL_MIN;
		} else if ((arena_bin_info[i].nregs << 1) <=
		    TCACHE_NSLOTS_SMALL_MAX) {
			tcache_bin_info[i].ncached_max =
			    (arena_bin_info[i].nregs << 1);
		} else {
			tcache_bin_info[i].ncached_max =
			    TCACHE_NSLOTS_SMALL_MAX;
		}
		stack_nelms += tcache_bin_info[i].ncached_max;
	}
	for (; i < nhbins; i++) {
		tcache_bin_info[i].ncached_max = TCACHE_NSLOTS_LARGE;
		stack_nelms += tcache_bin_info[i].ncached_max;
	}

	return (false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x28(%rbp)
cmpq $0x0, 0x21834(%rip)     # 0xa3408
jl 0x81bed
movq 0x2182b(%rip), %rcx     # 0xa3408
movl $0x1, %eax
shlq %cl, %rax
cmpq $0x3800, %rax           # imm = 0x3800
jae 0x81bfa
movq $0x3800, 0x22908(%rip) # imm = 0x3800
jmp 0x81c40
movq 0x21807(%rip), %rcx     # 0xa3408
movl $0x1, %eax
shlq %cl, %rax
leaq 0x22370(%rip), %rcx     # 0xa3f80
cmpq (%rcx), %rax
jbe 0x81c28
leaq 0x22364(%rip), %rax     # 0xa3f80
movq (%rax), %rax
movq %rax, 0x228da(%rip)     # 0xa4500
jmp 0x81c3e
movq 0x217d9(%rip), %rcx     # 0xa3408
movl $0x1, %eax
shlq %cl, %rax
movq %rax, 0x228c2(%rip)     # 0xa4500
jmp 0x81c40
movq 0x228b9(%rip), %rax     # 0xa4500
movq %rax, -0x18(%rbp)
cmpq $0x1000, -0x18(%rbp)    # imm = 0x1000
setbe %al
testb $0x1, %al
jne 0x81c5c
jmp 0x81c86
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rcx
subq $0x1, %rcx
shrq $0x3, %rcx
leaq 0xee09(%rip), %rax      # 0x90a80
movzbl (%rax,%rcx), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x81c92
movq -0x18(%rbp), %rdi
callq 0x82230
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, 0x22842(%rip)     # 0xa44e0
movq -0x28(%rbp), %rdi
movl 0x22838(%rip), %eax     # 0xa44e0
movl %eax, %esi
shlq $0x2, %rsi
callq 0x50230
movq %rax, 0x2281e(%rip)     # 0xa44d8
cmpq $0x0, 0x22816(%rip)     # 0xa44d8
jne 0x81ccd
movb $0x1, -0x19(%rbp)
jmp 0x81dde
movl $0x0, 0x2280d(%rip)     # 0xa44e4
movl $0x0, -0x2c(%rbp)
cmpl $0x27, -0x2c(%rbp)
jae 0x81d98
movl -0x2c(%rbp), %eax
movl %eax, %ecx
leaq 0x218cc(%rip), %rax     # 0xa35c0
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
shll %eax
cmpl $0x14, %eax
ja 0x81d18
movq 0x227cc(%rip), %rax     # 0xa44d8
movl -0x2c(%rbp), %ecx
movl $0x14, (%rax,%rcx,4)
jmp 0x81d71
movl -0x2c(%rbp), %eax
movl %eax, %ecx
leaq 0x2189c(%rip), %rax     # 0xa35c0
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
shll %eax
cmpl $0xc8, %eax
ja 0x81d5e
movl -0x2c(%rbp), %eax
movl %eax, %ecx
leaq 0x2187d(%rip), %rax     # 0xa35c0
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x20(%rax), %edx
shll %edx
movq 0x22782(%rip), %rax     # 0xa44d8
movl -0x2c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x81d6f
movq 0x22773(%rip), %rax     # 0xa44d8
movl -0x2c(%rbp), %ecx
movl $0xc8, (%rax,%rcx,4)
jmp 0x81d71
movq 0x22760(%rip), %rax     # 0xa44d8
movl -0x2c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
addl 0x22760(%rip), %eax     # 0xa44e4
movl %eax, 0x2275a(%rip)     # 0xa44e4
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x81cde
jmp 0x81d9a
movl -0x2c(%rbp), %eax
cmpl 0x2273d(%rip), %eax     # 0xa44e0
jae 0x81dda
movq 0x2272c(%rip), %rax     # 0xa44d8
movl -0x2c(%rbp), %ecx
movl $0x14, (%rax,%rcx,4)
movq 0x2271b(%rip), %rax     # 0xa44d8
movl -0x2c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
addl 0x2271b(%rip), %eax     # 0xa44e4
movl %eax, 0x22715(%rip)     # 0xa44e4
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x81d9a
movb $0x0, -0x19(%rbp)
movb -0x19(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)