// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/jemalloc/src/arena.c
// Function: je_arena_malloc_small
void *
arena_malloc_small(arena_t *arena, size_t size, bool zero)
{
	void *ret;
	arena_bin_t *bin;
	arena_run_t *run;
	szind_t binind;

	binind = size2index(size);
	assert(binind < NBINS);
	bin = &arena->bins[binind];
	size = index2size(binind);

	malloc_mutex_lock(&bin->lock);
	if ((run = bin->runcur) != NULL && run->nfree > 0)
		ret = arena_run_reg_alloc(run, &arena_bin_info[binind]);
	else
		ret = arena_bin_malloc_hard(arena, bin);

	if (ret == NULL) {
		malloc_mutex_unlock(&bin->lock);
		return (NULL);
	}

	if (config_stats) {
		bin->stats.nmalloc++;
		bin->stats.nrequests++;
		bin->stats.curregs++;
	}
	malloc_mutex_unlock(&bin->lock);
	if (config_prof && !isthreaded && arena_prof_accum(arena, size))
		prof_idump();

	if (!zero) {
		if (config_fill) {
			if (unlikely(opt_junk_alloc)) {
				arena_alloc_junk_small(ret,
				    &arena_bin_info[binind], false);
			} else if (unlikely(opt_zero))
				memset(ret, 0, size);
		}
		JEMALLOC_VALGRIND_MAKE_MEM_UNDEFINED(ret, size);
	} else {
		if (config_fill && unlikely(opt_junk_alloc)) {
			arena_alloc_junk_small(ret, &arena_bin_info[binind],
			    true);
		}
		JEMALLOC_VALGRIND_MAKE_MEM_UNDEFINED(ret, size);
		memset(ret, 0, size);
	}

	return (ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %r14
cmpq $0x1000, %rsi           # imm = 0x1000
ja 0x2364a
decq %rsi
shrq $0x3, %rsi
leaq 0x1f5b7(%rip), %rax     # 0x42b00
movzbl (%rax,%rsi), %eax
movl %eax, %r12d
imulq $0xe0, %r12, %rax
leaq (%r14,%rax), %r15
addq $0x450, %r15            # imm = 0x450
leaq 0x1ee17(%rip), %rax     # 0x42380
movq (%rax,%r12,8), %rbx
movq %r15, %rdi
callq 0x106d0
movq 0x28(%r15), %rdi
testq %rdi, %rdi
je 0x23599
cmpl $0x0, 0x4(%rdi)
je 0x23599
imulq $0x60, %r12, %rax
leaq 0x33111(%rip), %rsi     # 0x566a0
addq %rax, %rsi
callq 0x230ba
jmp 0x235a4
movq %r14, %rdi
movq %r15, %rsi
callq 0x231e0
movq %rax, %r14
testq %rax, %rax
je 0x23606
incq 0x98(%r15)
movdqu 0xa8(%r15), %xmm0
pcmpeqd %xmm1, %xmm1
psubq %xmm1, %xmm0
movdqu %xmm0, 0xa8(%r15)
movq %r15, %rdi
callq 0x10440
leaq 0x33045(%rip), %rax     # 0x56621
movb (%rax), %al
testb %bpl, %bpl
je 0x23610
testb %al, %al
jne 0x23657
leaq 0x33096(%rip), %rax     # 0x56684
cmpb $0x1, (%rax)
je 0x23693
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10270
jmp 0x23638
movq %r15, %rdi
callq 0x10440
jmp 0x23638
testb %al, %al
jne 0x236a3
leaq 0x33014(%rip), %rax     # 0x56633
cmpb $0x1, (%rax)
je 0x236d2
leaq 0x33055(%rip), %rax     # 0x56684
cmpb $0x1, (%rax)
je 0x236c2
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rdi
callq 0x284a4
jmp 0x2354d
imulq $0x60, %r12, %r12
leaq 0x3303e(%rip), %r13     # 0x566a0
movq 0x8(%r12,%r13), %r15
movq %r14, %rdi
subq %r15, %rdi
movl $0xa5, %esi
movq %r15, %rdx
callq 0x10270
movq (%r12,%r13), %rdi
addq %r14, %rdi
movl $0xa5, %esi
movq %r15, %rdx
callq 0x10270
jmp 0x235e7
movq %r14, %rdi
movq %rbx, %rsi
callq 0x38f6a
jmp 0x235f7
imulq $0x60, %r12, %rax
leaq 0x32ff2(%rip), %rcx     # 0x566a0
movq %r14, %rdi
subq 0x8(%rax,%rcx), %rdi
movq 0x10(%rax,%rcx), %rdx
movl $0xa5, %esi
jmp 0x236da
movq %r14, %rdi
movq %rbx, %rsi
callq 0x38f6a
jmp 0x23638
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10270
jmp 0x23628