// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/arena.c
// Function: arena_tcache_fill_small
void
arena_tcache_fill_small(arena_t *arena, tcache_bin_t *tbin, size_t binind,
    uint64_t prof_accumbytes)
{
	unsigned i, nfill;
	arena_bin_t *bin;
	arena_run_t *run;
	void *ptr;

	assert(tbin->ncached == 0);

	if (config_prof) {
		malloc_mutex_lock(&arena->lock);
		arena_prof_accum(arena, prof_accumbytes);
		malloc_mutex_unlock(&arena->lock);
	}
	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++) {
		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)
			break;
		if (config_fill && opt_junk) {
			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.allocated += i * arena_bin_info[binind].reg_size;
		bin->stats.nmalloc += i;
		bin->stats.nrequests += tbin->tstats.nrequests;
		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)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
jmp 0xb5f3a
movq -0x8(%rbp), %rax
addq $0x120, %rax            # imm = 0x120
imulq $0x98, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0xb5d20
movl $0x0, -0x24(%rbp)
leaq 0x8457e(%rip), %rax     # 0x13a4e8
movq (%rax), %rax
movq -0x18(%rbp), %rcx
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 0xb6032
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0xb5fc6
movq -0x38(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jbe 0xb5fc6
movq -0x38(%rbp), %rdi
leaq 0x7259d(%rip), %rsi     # 0x128550
imulq $0x68, -0x18(%rbp), %rax
addq %rax, %rsi
callq 0xb60b0
movq %rax, -0x40(%rbp)
jmp 0xb5fd7
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xb6150
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xb5fe0
jmp 0xb6032
leaq 0x724c4(%rip), %rax     # 0x1284ab
testb $0x1, (%rax)
je 0xb6009
movq -0x40(%rbp), %rdi
leaq 0x72559(%rip), %rsi     # 0x128550
imulq $0x68, -0x18(%rbp), %rax
addq %rax, %rsi
movl $0x1, %edx
callq 0xb6290
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 0xb5f80
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0x72512(%rip), %rax     # 0x128550
imulq $0x68, -0x18(%rbp), %rdx
addq %rdx, %rax
imulq (%rax), %rcx
movq -0x30(%rbp), %rax
addq 0x50(%rax), %rcx
movq %rcx, 0x50(%rax)
movl -0x24(%rbp), %eax
movl %eax, %ecx
movq -0x30(%rbp), %rax
addq 0x58(%rax), %rcx
movq %rcx, 0x58(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
addq 0x68(%rax), %rcx
movq %rcx, 0x68(%rax)
movq -0x30(%rbp), %rax
movq 0x70(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x30(%rbp), %rdi
callq 0xb5ee0
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
addq $0x40, %rsp
popq %rbp
retq
nop