// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/jemalloc/src/arena.c
// Function: je_arena_tcache_fill_small
void
arena_tcache_fill_small(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(arena, prof_accumbytes))
		prof_idump();
	bin = &arena->bins[binind];
	malloc_mutex_lock(&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(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 to the base of tbin->avail before bailing
			 * out.
			 */
			if (i > 0) {
				memmove(tbin->avail, &tbin->avail[nfill - i],
				    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 - 1 - 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(&bin->lock);
	tbin->ncached = i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r12
movl %edx, %ebx
imulq $0xe0, %rbx, %rax
movq %rdi, 0x20(%rsp)
leaq (%rdi,%rax), %r14
addq $0x450, %r14            # imm = 0x450
movq %r14, %rdi
callq 0x106d0
leaq 0x34e47(%rip), %rax     # 0x57db0
movq (%rax), %rax
movl (%rax,%rbx,4), %r15d
movq %r12, 0x10(%rsp)
movb 0xc(%r12), %cl
shrl %cl, %r15d
imulq $0x60, %rbx, %rax
leaq 0x33718(%rip), %rcx     # 0x566a0
addq %rax, %rcx
movq %rcx, 0x8(%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x23037
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x22fbf
cmpl $0x0, 0x4(%rdi)
je 0x22fbf
movq 0x8(%rsp), %rsi
callq 0x230ba
jmp 0x22fcc
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x231e0
movq %rax, %rbp
testq %rax, %rax
je 0x2303c
leaq 0x33646(%rip), %rax     # 0x56621
cmpb $0x1, (%rax)
je 0x22ffd
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
leal (%r15,%rbx), %ecx
movq %rbp, (%rax,%rcx,8)
incq %r13
addq $0x8, %r12
decq %rbx
jmp 0x22f9b
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rbp, %rdi
subq %rdx, %rdi
movl $0xa5, %esi
callq 0x10270
movq 0x8(%rsp), %rax
movq (%rax), %rdi
addq %rbp, %rdi
movl $0xa5, %esi
movq 0x18(%rsp), %rdx
callq 0x10270
jmp 0x22fe0
movl %r15d, %r13d
jmp 0x2305e
testq %r12, %r12
je 0x2305b
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
subl %r13d, %r15d
leaq (%rdi,%r15,8), %rsi
movq %r12, %rdx
callq 0x10540
jmp 0x2305e
xorl %r13d, %r13d
movl %r13d, %eax
movq %rax, %xmm0
addq %rax, 0x98(%r14)
movq 0x10(%rsp), %rbx
movq (%rbx), %rax
addq %rax, 0xa8(%r14)
movdqu 0xb0(%r14), %xmm1
shufpd $0x2, 0x1fe52(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
paddq %xmm1, %xmm0
movdqu %xmm0, 0xb0(%r14)
andq $0x0, (%rbx)
movq %r14, %rdi
callq 0x10440
movl %r13d, 0x10(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq