// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
jmp 0x3d1e9
movq -0x8(%rbp), %rax
addq $0x450, %rax            # imm = 0x450
movl -0x14(%rbp), %ecx
imulq $0xe0, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x3c3a0
movl $0x0, -0x24(%rbp)
leaq 0x65c8d(%rip), %rax     # 0xa2ea8
movq (%rax), %rax
movl -0x14(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
shrl %cl, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jae 0x3d327
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x3d278
movq -0x38(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jbe 0x3d278
movq -0x38(%rbp), %rdi
movl -0x14(%rbp), %eax
leaq 0x644ba(%rip), %rsi     # 0xa1720
imulq $0x60, %rax, %rax
addq %rax, %rsi
callq 0x3d3b0
movq %rax, -0x40(%rbp)
jmp 0x3d289
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x3d4c0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x3d2c5
cmpl $0x0, -0x24(%rbp)
jbe 0x3d2c3
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x28(%rbp), %eax
subl -0x24(%rbp), %eax
movl %eax, %eax
shlq $0x3, %rax
addq %rax, %rsi
movl -0x24(%rbp), %eax
movl %eax, %edx
shlq $0x3, %rdx
callq 0x10500
jmp 0x3d327
leaq 0x643d5(%rip), %rax     # 0xa16a1
movb (%rax), %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x3d2fe
movq -0x40(%rbp), %rdi
movl -0x14(%rbp), %eax
leaq 0x64433(%rip), %rsi     # 0xa1720
imulq $0x60, %rax, %rax
addq %rax, %rsi
movl $0x1, %edx
callq 0x3d600
movq -0x40(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x28(%rbp), %ecx
subl $0x1, %ecx
subl -0x24(%rbp), %ecx
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3d230
movl -0x24(%rbp), %eax
movl %eax, %ecx
movq -0x30(%rbp), %rax
addq 0x98(%rax), %rcx
movq %rcx, 0x98(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
addq 0xa8(%rax), %rcx
movq %rcx, 0xa8(%rax)
movl -0x24(%rbp), %eax
movl %eax, %ecx
movq -0x30(%rbp), %rax
addq 0xb0(%rax), %rcx
movq %rcx, 0xb0(%rax)
movq -0x30(%rbp), %rax
movq 0xb8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xb8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x30(%rbp), %rdi
callq 0x3c3c0
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)