// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: je_arena_tcache_fill_small
void
arena_tcache_fill_small(tsdn_t *tsdn, arena_t *arena, tcache_bin_t *tbin,
    szind_t binind, uint64_t prof_accumbytes)
{
	unsigned i, nfill;
	arena_bin_t *bin;

	assert(tbin->ncached == 0);

	if (config_prof && arena_prof_accum(tsdn, arena, prof_accumbytes))
		prof_idump(tsdn);
	bin = &arena->bins[binind];
	malloc_mutex_lock(tsdn, &bin->lock);
	for (i = 0, nfill = (tcache_bin_info[binind].ncached_max >>
	    tbin->lg_fill_div); i < nfill; i++) {
		arena_run_t *run;
		void *ptr;
		if ((run = bin->runcur) != NULL && run->nfree > 0)
			ptr = arena_run_reg_alloc(run, &arena_bin_info[binind]);
		else
			ptr = arena_bin_malloc_hard(tsdn, arena, bin);
		if (ptr == NULL) {
			/*
			 * OOM.  tbin->avail isn't yet filled down to its first
			 * element, so the successful allocations (if any) must
			 * be moved just before tbin->avail before bailing out.
			 */
			if (i > 0) {
				memmove(tbin->avail - i, tbin->avail - nfill,
				    i * sizeof(void *));
			}
			break;
		}
		if (config_fill && unlikely(opt_junk_alloc)) {
			arena_alloc_junk_small(ptr, &arena_bin_info[binind],
			    true);
		}
		/* Insert such that low regions get used first. */
		*(tbin->avail - nfill + i) = ptr;
	}
	if (config_stats) {
		bin->stats.nmalloc += i;
		bin->stats.nrequests += tbin->tstats.nrequests;
		bin->stats.curregs += i;
		bin->stats.nfills++;
		tbin->tstats.nrequests = 0;
	}
	malloc_mutex_unlock(tsdn, &bin->lock);
	tbin->ncached = i;
	arena_decay_tick(tsdn, arena);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x50(%rbp)
movq %rsi, -0x58(%rbp)
movq %rdx, -0x60(%rbp)
movl %ecx, -0x64(%rbp)
movq %r8, -0x70(%rbp)
jmp 0x3c670
movq -0x58(%rbp), %rax
addq $0x980, %rax            # imm = 0x980
movl -0x64(%rbp), %ecx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x50(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x3a660
movl $0x0, -0x74(%rbp)
leaq 0x67e32(%rip), %rax     # 0xa44d8
movq (%rax), %rax
movl -0x64(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq -0x60(%rbp), %rcx
movl 0xc(%rcx), %ecx
shrl %cl, %eax
movl %eax, -0x78(%rbp)
movl -0x74(%rbp), %eax
cmpl -0x78(%rbp), %eax
jae 0x3c7ea
movq -0x80(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, %rax
je 0x3c70f
movq -0x88(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jbe 0x3c70f
movq -0x88(%rbp), %rdi
movl -0x64(%rbp), %eax
leaq 0x66ec6(%rip), %rsi     # 0xa35c0
shlq $0x6, %rax
addq %rax, %rsi
callq 0x3c900
movq %rax, -0x90(%rbp)
jmp 0x3c727
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x80(%rbp), %rdx
callq 0x3ca10
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0x3c779
cmpl $0x0, -0x74(%rbp)
jbe 0x3c777
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x74(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x78(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x3, %rax
addq %rax, %rsi
movl -0x74(%rbp), %eax
movl %eax, %edx
shlq $0x3, %rdx
callq 0xb430
jmp 0x3c7ea
leaq 0x66d81(%rip), %rax     # 0xa3501
movb (%rax), %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3c7b5
movq -0x90(%rbp), %rdi
movl -0x64(%rbp), %eax
leaq 0x66e1c(%rip), %rsi     # 0xa35c0
shlq $0x6, %rax
addq %rax, %rsi
movl $0x1, %edx
callq 0x3cb50
movq -0x90(%rbp), %rdx
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x78(%rbp), %ecx
movl %ecx, %esi
xorl %ecx, %ecx
subq %rsi, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movl -0x74(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x3c6bb
movl -0x74(%rbp), %eax
movl %eax, %ecx
movq -0x80(%rbp), %rax
addq 0x60(%rax), %rcx
movq %rcx, 0x60(%rax)
movq -0x60(%rbp), %rax
movq (%rax), %rcx
movq -0x80(%rbp), %rax
addq 0x70(%rax), %rcx
movq %rcx, 0x70(%rax)
movl -0x74(%rbp), %eax
movl %eax, %ecx
movq -0x80(%rbp), %rax
addq 0x78(%rax), %rcx
movq %rcx, 0x78(%rax)
movq -0x80(%rbp), %rax
movq 0x80(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x80(%rax)
movq -0x60(%rbp), %rax
movq $0x0, (%rax)
movq -0x50(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x3a6b0
movl -0x74(%rbp), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq %rax, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
sete %al
testb $0x1, %al
jne 0x3c894
jmp 0x3c896
jmp 0x3c8ea
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %esi
callq 0x4d580
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
sete %al
testb $0x1, %al
jne 0x3c8c7
jmp 0x3c8c9
jmp 0x3c8ea
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x4d5e0
testb $0x1, %al
jne 0x3c8db
jmp 0x3c8ea
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
xorl %edx, %edx
callq 0x3b8a0
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)