// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/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 0x12960
leaq 0x4a468(%rip), %rax     # 0x84da0
movq (%rax), %rax
movl (%rax,%rbx,4), %edx
movb 0xc(%r14), %cl
shrl %cl, %edx
testl %edx, %edx
je 0x3ab54
leaq (%rbx,%rbx,2), %rax
shlq $0x5, %rax
leaq 0x48e55(%rip), %rcx     # 0x837b0
leaq (%rcx,%rax), %r13
movl %edx, 0xc(%rsp)
movl %edx, %edx
movq %rdx, 0x30(%rsp)
leaq (%rax,%rcx), %rbx
addq $0x40, %rbx
xorl %r15d, %r15d
movq $-0x1, %rbp
movq %r14, 0x20(%rsp)
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rdi
testq %rdi, %rdi
je 0x3aab7
movl 0x4(%rdi), %eax
testl %eax, %eax
je 0x3aab7
movl %eax, 0x10(%rsp)
leaq 0x8(%rdi), %rax
movl 0x30(%r13), %edx
leal -0x1(%rdx), %ecx
movq 0x38(%r13,%rcx,8), %rsi
movq 0x8(%rdi,%rsi,8), %rsi
bsfq %rsi, %rsi
cmoveq %rbp, %rsi
testl %ecx, %ecx
je 0x3a9e4
movq 0x30(%r13,%rcx,8), %r9
leaq (%rax,%r9,8), %r9
movq (%r9,%rsi,8), %r9
shlq $0x6, %rsi
bsfq %r9, %r9
cmoveq %rbp, %r9
addq %r9, %rsi
decq %rcx
jne 0x3a9c3
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 0x3aa4e
cmpq %r11, %r10
jne 0x3aa4e
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 0x3aa4e
leaq 0x1(%r10), %rcx
cmpq %r10, %rdx
movq %rcx, %r10
jne 0x3aa16
leaq -0x10(%rdi), %rax
leaq 0x49c47(%rip), %rcx     # 0x846a0
movq (%rcx), %rcx
notq %rcx
andq %rax, %rcx
movq 0x49ae7(%rip), %rax     # 0x84550
addq %rcx, %rax
negq %rax
addq %rdi, %rax
addq $-0x10, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq $0x6, %rdx
addq 0x49aba(%rip), %rdx     # 0x84548
shlq $0xc, %rdx
movl 0x58(%r13), %eax
movl %esi, %r12d
imulq 0x10(%r13), %r12
addq %rax, %r12
addq %rcx, %r12
addq %rdx, %r12
movl 0x10(%rsp), %eax
decl %eax
movl %eax, 0x4(%rdi)
movq 0x20(%rsp), %r14
jmp 0x3aac9
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x3aba6
movq %rax, %r12
testq %r12, %r12
je 0x3aaed
leaq 0x48c5c(%rip), %rax     # 0x83731
cmpb $0x1, (%rax)
je 0x3ab23
movq 0x18(%r14), %rax
movl %r15d, %ecx
notl %ecx
addl 0xc(%rsp), %ecx
movq %r12, (%rax,%rcx,8)
jmp 0x3ab0e
testq %r15, %r15
je 0x3ab0e
movq 0x18(%r14), %rdi
movl 0xc(%rsp), %eax
subl %r15d, %eax
leaq (%rdi,%rax,8), %rsi
leaq (,%r15,8), %rdx
callq 0x12720
testq %r12, %r12
je 0x3ab58
incq %r15
cmpq 0x30(%rsp), %r15
jne 0x3a981
jmp 0x3ab5d
movq 0x8(%r13), %rdx
movq %rdx, 0x10(%rsp)
movq %r12, %rdi
subq %rdx, %rdi
movl $0xa5, %esi
callq 0x12380
movq (%r13), %rdi
addq %r12, %rdi
movl $0xa5, %esi
movq 0x10(%rsp), %rdx
callq 0x12380
jmp 0x3aada
xorl %ebx, %ebx
jmp 0x3ab61
movl %r15d, %ebx
jmp 0x3ab61
movl 0xc(%rsp), %ebx
movl %ebx, %eax
movq 0x18(%rsp), %rdi
addq %rax, 0x98(%rdi)
movq (%r14), %rcx
addq %rcx, 0xa8(%rdi)
addq %rax, 0xb0(%rdi)
incq 0xb8(%rdi)
movq $0x0, (%r14)
callq 0x125c0
movl %ebx, 0x10(%r14)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq