// File: /workspace/github_c_makefile_star2_O3/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 $0x38, %rsp
movq %rsi, %r14
movl %edx, %ebx
imulq $0xe0, %rbx, %rax
movq %rdi, 0x28(%rsp)
addq %rax, %rdi
addq $0x450, %rdi            # imm = 0x450
movq %rdi, 0x18(%rsp)
callq 0x106d0
leaq 0x33ee4(%rip), %rax     # 0x5bdb0
movq (%rax), %rax
movl (%rax,%rbx,4), %edx
movb 0xc(%r14), %cl
shrl %cl, %edx
testl %edx, %edx
je 0x280df
leaq (%rbx,%rbx,2), %rax
shlq $0x5, %rax
leaq 0x327b1(%rip), %rcx     # 0x5a6a0
leaq (%rcx,%rax), %r15
movq %rdx, 0x10(%rsp)
movl %edx, %edx
movq %rdx, 0x30(%rsp)
leaq (%rax,%rcx), %rbx
addq $0x40, %rbx
xorl %ebp, %ebp
movq $-0x1, %r13
movq %r14, 0x20(%rsp)
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rdi
testq %rdi, %rdi
je 0x2804b
movl 0x4(%rdi), %eax
testl %eax, %eax
je 0x2804b
movl %eax, 0x8(%rsp)
leaq 0x8(%rdi), %rax
movl 0x30(%r15), %edx
leal -0x1(%rdx), %ecx
movq 0x38(%r15,%rcx,8), %rsi
movq 0x8(%rdi,%rsi,8), %rsi
bsfq %rsi, %rsi
cmoveq %r13, %rsi
testl %ecx, %ecx
je 0x27f78
movq 0x30(%r15,%rcx,8), %r9
leaq (%rax,%r9,8), %r9
movq (%r9,%rsi,8), %r9
shlq $0x6, %rsi
bsfq %r9, %r9
cmoveq %r13, %r9
addq %r9, %rsi
decq %rcx
jne 0x27f57
movq %rsi, %r9
shrq $0x6, %r9
movq (%rax,%r9,8), %r10
movl $0x1, %r11d
movl %esi, %ecx
shlq %cl, %r11
movq %r10, %rcx
btcq %rsi, %rcx
movq %rcx, (%rax,%r9,8)
cmpl $0x2, %edx
jb 0x27fe2
cmpq %r11, %r10
jne 0x27fe2
addq $-0x2, %rdx
xorl %r10d, %r10d
movq %r9, %rcx
shrq $0x6, %r9
movq (%rbx,%r10,8), %r11
leaq (%rax,%r11,8), %r11
movq (%r11,%r9,8), %r8
movl $0x1, %r14d
shlq %cl, %r14
movq %r8, %r12
btcq %rcx, %r12
movq %r12, (%r11,%r9,8)
cmpq %r14, %r8
jne 0x27fe2
leaq 0x1(%r10), %rcx
cmpq %r10, %rdx
movq %rcx, %r10
jne 0x27faa
leaq -0x10(%rdi), %rax
leaq 0x336c3(%rip), %rcx     # 0x5b6b0
movq (%rcx), %rcx
notq %rcx
andq %rax, %rcx
movq 0x33563(%rip), %rax     # 0x5b560
addq %rcx, %rax
negq %rax
addq %rdi, %rax
addq $-0x10, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq $0x6, %rdx
addq 0x33536(%rip), %rdx     # 0x5b558
shlq $0xc, %rdx
movl 0x58(%r15), %eax
movl %esi, %r12d
imulq 0x10(%r15), %r12
addq %rax, %r12
addq %rcx, %r12
addq %rdx, %r12
movl 0x8(%rsp), %eax
decl %eax
movl %eax, 0x4(%rdi)
movq 0x20(%rsp), %r14
jmp 0x2805d
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x28141
movq %rax, %r12
testq %r12, %r12
je 0x280be
leaq 0x325b8(%rip), %rax     # 0x5a621
cmpb $0x1, (%rax)
je 0x2808e
movq 0x18(%r14), %rax
movl %ebp, %ecx
notl %ecx
addl 0x10(%rsp), %ecx
movq %r12, (%rax,%rcx,8)
incq %rbp
cmpq 0x30(%rsp), %rbp
jne 0x27f15
jmp 0x280e3
movq 0x8(%r15), %rdx
movq %rdx, 0x8(%rsp)
movq %r12, %rdi
subq %rdx, %rdi
movl $0xa5, %esi
callq 0x10270
movq (%r15), %rdi
addq %r12, %rdi
movl $0xa5, %esi
movq 0x8(%rsp), %rdx
callq 0x10270
jmp 0x2806e
testq %rbp, %rbp
je 0x280df
movq 0x18(%r14), %rdi
movq 0x10(%rsp), %rax
subl %ebp, %eax
leaq (%rdi,%rax,8), %rsi
movl %ebp, %edx
shlq $0x3, %rdx
callq 0x10540
jmp 0x280e8
xorl %ebp, %ebp
jmp 0x280e8
movq 0x10(%rsp), %rbp
movl %ebp, %eax
movq 0x18(%rsp), %rdi
addq %rax, 0x98(%rdi)
movq (%r14), %rcx
addq %rcx, 0xa8(%rdi)
movq %rax, %xmm0
shufpd $0x2, 0x1df02(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
movdqu 0xb0(%rdi), %xmm1
paddq %xmm1, %xmm0
movdqu %xmm0, 0xb0(%rdi)
movq $0x0, (%r14)
callq 0x10440
movl %ebp, 0x10(%r14)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq