// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r12
movq %rsi, %rbp
imulq $0x98, %rdx, %rax
movq %rdi, 0x30(%rsp)
leaq (%rdi,%rax), %r14
addq $0x120, %r14            # imm = 0x120
movq %r14, %rdi
callq 0x1faa0
leaq 0x75c8a(%rip), %rax     # 0xedb90
movq (%rax), %rax
movl (%rax,%r12,4), %edx
movb 0xc(%rbp), %cl
shrl %cl, %edx
imulq $0x68, %r12, %rax
leaq 0x63ce3(%rip), %rcx     # 0xdbc00
addq %rax, %rcx
movq %rcx, 0x8(%rsp)
movl %edx, %eax
movq %rax, 0x10(%rsp)
movq %rax, %rbx
negq %rbx
movq %rdx, 0x18(%rsp)
leal -0x1(%rdx), %r12d
xorl %r15d, %r15d
movq %rbx, 0x28(%rsp)
movq %rbp, 0x20(%rsp)
cmpq %r15, %rbx
je 0x77fe6
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x77f6c
cmpl $0x0, 0xc(%rdi)
je 0x77f6c
movq 0x8(%rsp), %rsi
callq 0x78047
jmp 0x77f79
movq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x78139
movq %rax, %r13
testq %rax, %rax
je 0x77ff2
leaq 0x63bd3(%rip), %rax     # 0xdbb5b
cmpb $0x1, (%rax)
jne 0x77fd2
movq %r12, %rbx
movq %r14, %r12
movq 0x8(%rsp), %r14
movq 0x8(%r14), %rbp
movq %r13, %rdi
subq %rbp, %rdi
movl $0xa5, %esi
movq %rbp, %rdx
callq 0x1f110
movq (%r14), %rdi
movq %r12, %r14
movq %rbx, %r12
addq %r13, %rdi
movl $0xa5, %esi
movq %rbp, %rdx
movq 0x20(%rsp), %rbp
movq 0x28(%rsp), %rbx
callq 0x1f110
movq 0x18(%rbp), %rax
leal (%r12,%r15), %ecx
movq %r13, (%rax,%rcx,8)
decq %r15
jmp 0x77f48
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %rcx
jmp 0x77ff8
negq %r15
movq %r15, %rcx
movq 0x8(%rsp), %rax
movq (%rax), %rax
imulq %rcx, %rax
addq %rax, 0x50(%r14)
addq %rcx, 0x58(%r14)
movdqu 0x68(%r14), %xmm0
movaps 0x121c7(%rip), %xmm1    # 0x8a1e0
movlps (%rbp), %xmm1           # xmm1 = mem[0,1],xmm1[2,3]
paddq %xmm0, %xmm1
movdqu %xmm1, 0x68(%r14)
andq $0x0, (%rbp)
movq %r14, %rdi
callq 0x1fbb0
movl %r15d, 0x10(%rbp)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq