// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r15
movq %rdi, %rbx
movl %ecx, %r14d
imulq $0xa8, %r14, %rax
movq %rsi, 0x10(%rsp)
leaq (%rsi,%rax), %r12
addq $0x980, %r12            # imm = 0x980
movq %r12, %rdi
callq 0xb5a0
leaq 0x4068e(%rip), %rax     # 0x4d478
movq (%rax), %rax
movl (%rax,%r14,4), %eax
movb 0xc(%r15), %cl
shrl %cl, %eax
testl %eax, %eax
je 0xcf71
movq %rbx, 0x8(%rsp)
shlq $0x6, %r14
leaq 0x3f7d1(%rip), %rbx     # 0x4c5e0
addq %r14, %rbx
movl %eax, 0x1c(%rsp)
movl %eax, %ebp
movq %rbp, %rax
negq %rax
xorl %r14d, %r14d
movq %rax, 0x28(%rsp)
leaq (,%rax,8), %rax
movq %rax, 0x30(%rsp)
movq 0x50(%r12), %rsi
testq %rsi, %rsi
je 0xce51
movl 0x4(%rsi), %edi
testl %edi, %edi
je 0xce51
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0xce6b
xorl %edx, %edx
jmp 0xce83
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x230d7
movq %rax, %r13
jmp 0xceec
xorl %ecx, %ecx
pushq $0x1
popq %rdx
movl %edx, %eax
movq 0x8(%rsi,%rax,8), %rax
addl $0x40, %ecx
incl %edx
testq %rax, %rax
je 0xce70
movl %ecx, %edx
bsfq %rax, %rcx
leaq (%rcx,%rdx), %r8
pushq $0x1
popq %rax
shlq %cl, %rax
shrl $0x3, %edx
xorq %rax, 0x8(%rsi,%rdx)
leaq -0x18(%rsi), %rax
leaq 0x4022c(%rip), %rcx     # 0x4d0d0
movq (%rcx), %rcx
notq %rcx
andq %rax, %rcx
movq 0x40114(%rip), %rax     # 0x4cfc8
addq %rcx, %rax
negq %rax
addq %rsi, %rax
addq $-0x18, %rax
xorl %edx, %edx
pushq $0x60
popq %r9
divq %r9
addq 0x400ef(%rip), %rax     # 0x4cfc0
shlq $0xc, %rax
movl 0x38(%rbx), %r13d
imulq 0x10(%rbx), %r8
addq %rcx, %r13
addq %r8, %r13
addq %rax, %r13
decl %edi
movl %edi, 0x4(%rsi)
testq %r13, %r13
je 0xcf0c
leaq 0x3f629(%rip), %rax     # 0x4c521
cmpb $0x1, (%rax)
je 0xcf41
movq 0x18(%r15), %rax
addq 0x30(%rsp), %rax
movq %r13, (%rax,%r14,8)
jmp 0xcf2e
testq %r14, %r14
je 0xcf2e
movq 0x18(%r15), %rdi
leaq (,%r14,8), %rdx
movq 0x28(%rsp), %rax
leaq (%rdi,%rax,8), %rsi
subq %rdx, %rdi
callq 0xb450
testq %r13, %r13
je 0xcf75
incq %r14
cmpq %rbp, %r14
jne 0xce33
jmp 0xcf7f
movq 0x8(%rbx), %rdx
movq %rdx, 0x20(%rsp)
movq %r13, %rdi
subq %rdx, %rdi
movl $0xa5, %esi
callq 0xb230
movq (%rbx), %rdi
addq %r13, %rdi
movl $0xa5, %esi
movq 0x20(%rsp), %rdx
callq 0xb230
jmp 0xcefd
xorl %ebp, %ebp
jmp 0xcf88
movl %r14d, %ebp
movq 0x8(%rsp), %rbx
jmp 0xcf88
movq 0x8(%rsp), %rbx
movl 0x1c(%rsp), %ebp
movl %ebp, %eax
addq %rax, 0x60(%r12)
movq (%r15), %rcx
addq %rcx, 0x70(%r12)
addq %rax, 0x78(%r12)
incq 0x80(%r12)
andq $0x0, (%r15)
movq %r12, %rdi
callq 0xb380
movl %ebp, 0x10(%r15)
testq %rbx, %rbx
je 0xcfe6
movq 0x10(%rsp), %rax
movl (%rax), %esi
movq 0x38(%rbx), %rax
testq %rax, %rax
je 0xcff5
cmpl %esi, 0x40(%rbx)
jbe 0xcff5
leaq (%rax,%rsi,8), %rax
testq %rax, %rax
je 0xcfe6
movl (%rax), %ecx
testl %ecx, %ecx
jle 0xcfff
leal -0x1(%rcx), %edx
movl %edx, (%rax)
testl %ecx, %ecx
jle 0xd004
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x1afa2
jmp 0xcfd2
movl 0x4(%rax), %edx
jmp 0xcfe0
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
xorl %edx, %edx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x226c8