// File: /workspace/github_c_makefile_star2_O2/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, %r14
movq %rdi, 0x18(%rsp)
movl %ecx, %ebx
imulq $0xa8, %rbx, %rax
movq %rsi, 0x8(%rsp)
leaq (%rsi,%rax), %r12
addq $0x980, %r12            # imm = 0x980
movq %r12, %rdi
callq 0xb5a0
leaq 0x2e014(%rip), %rax     # 0x49478
movq (%rax), %rax
movl (%rax,%rbx,4), %eax
movq %r14, 0x10(%rsp)
movb 0xc(%r14), %cl
shrl %cl, %eax
shlq $0x6, %rbx
leaq 0x2d160(%rip), %rcx     # 0x485e0
addq %rbx, %rcx
movq %rcx, (%rsp)
movq %rax, %rcx
negq %rcx
movq %rcx, 0x28(%rsp)
movq %rax, 0x30(%rsp)
leaq (,%rax,8), %r15
movq %r15, %r13
negq %r13
xorl %r14d, %r14d
xorl %ebp, %ebp
movq %r15, %rax
addq %rbp, %rax
je 0x1b549
movq 0x50(%r12), %rdi
testq %rdi, %rdi
je 0x1b4d1
cmpl $0x0, 0x4(%rdi)
je 0x1b4d1
movq (%rsp), %rsi
callq 0x1b618
jmp 0x1b4e3
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
callq 0x1b6a3
movq %rax, %rbx
testq %rax, %rax
je 0x1b550
leaq 0x2d02f(%rip), %rax     # 0x48521
cmpb $0x1, (%rax)
je 0x1b511
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rbx, (%rax,%r13)
addq $-0x8, %rbp
incl %r14d
addq $0x8, %r13
jmp 0x1b4aa
movq (%rsp), %rax
movq 0x8(%rax), %rdx
movq %rdx, 0x20(%rsp)
movq %rbx, %rdi
subq %rdx, %rdi
movl $0xa5, %esi
callq 0xb230
movq (%rsp), %rax
movq (%rax), %rdi
addq %rbx, %rdi
movl $0xa5, %esi
movq 0x20(%rsp), %rdx
callq 0xb230
jmp 0x1b4f7
movq 0x30(%rsp), %r14
jmp 0x1b57a
testq %rbp, %rbp
je 0x1b577
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x28(%rsp), %rax
leaq (%rdi,%rax,8), %rsi
addq %rbp, %rdi
negq %rbp
movq %rbp, %rdx
callq 0xb450
jmp 0x1b57a
xorl %r14d, %r14d
movl %r14d, %eax
movq %rax, %xmm0
addq %rax, 0x60(%r12)
movq 0x10(%rsp), %rbx
movq (%rbx), %rax
addq %rax, 0x70(%r12)
movdqu 0x78(%r12), %xmm1
shufpd $0x2, 0x1b85c(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
paddq %xmm1, %xmm0
movdqu %xmm0, 0x78(%r12)
andq $0x0, (%rbx)
movq %r12, %rdi
callq 0xb380
movl %r14d, 0x10(%rbx)
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
je 0x1b5e7
movq 0x8(%rsp), %rax
movl (%rax), %esi
movq %rbx, %rdi
callq 0x20a5e
testq %rax, %rax
je 0x1b5e7
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x1b5f6
decl %ecx
movl %ecx, (%rax)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rax), %ecx
movl %ecx, (%rax)
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
xorl %edx, %edx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1aac4