// File: /workspace/github_c_makefile_star2_O3/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
subq $0x18, %rsp
movl %edx, %ebp
movq %rdi, %r12
cmpq $0x1000, %rsi           # imm = 0x1000
ja 0x28988
decq %rsi
shrq $0x3, %rsi
leaq 0x1f863(%rip), %rax     # 0x47fc0
movzbl (%rax,%rsi), %eax
movl %eax, %r14d
imulq $0xe0, %r14, %rax
leaq (%r12,%rax), %r15
addq $0x450, %r15            # imm = 0x450
leaq 0x1f0c3(%rip), %rax     # 0x47840
movq (%rax,%r14,8), %rbx
movq %r15, %rdi
callq 0x106d0
movq 0x28(%r15), %rdi
testq %rdi, %rdi
je 0x288e7
movl 0x4(%rdi), %eax
testl %eax, %eax
je 0x288e7
movl %eax, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
leaq (%r14,%r14,2), %r10
shlq $0x5, %r10
leaq 0x31ee7(%rip), %r11     # 0x5a6a0
leaq (%r11,%r10), %r9
leaq 0x8(%rdi), %rax
movl 0x30(%r10,%r11), %edx
leal -0x1(%rdx), %ecx
movq 0x38(%r9,%rcx,8), %rsi
movq 0x8(%rdi,%rsi,8), %rsi
bsfq %rsi, %rsi
movq $-0x1, %r12
cmoveq %r12, %rsi
testl %ecx, %ecx
movl %ebp, 0xc(%rsp)
je 0x2880b
movq 0x30(%r9,%rcx,8), %rbx
leaq (%rax,%rbx,8), %rbx
movq (%rbx,%rsi,8), %rbx
shlq $0x6, %rsi
bsfq %rbx, %rbx
cmoveq %r12, %rbx
addq %rbx, %rsi
decq %rcx
jne 0x287ea
movq %rsi, %r12
shrq $0x6, %r12
movq (%rax,%r12,8), %r13
movl $0x1, %ebx
movl %esi, %ecx
shlq %cl, %rbx
movq %r13, %rcx
btcq %rsi, %rcx
movq %rcx, (%rax,%r12,8)
cmpl $0x2, %edx
jb 0x2887a
cmpq %rbx, %r13
jne 0x2887a
addq $-0x2, %rdx
addq %r11, %r10
addq $0x40, %r10
xorl %r11d, %r11d
movq %r12, %rcx
shrq $0x6, %r12
movq (%r10,%r11,8), %rbx
leaq (%rax,%rbx,8), %rbx
movq (%rbx,%r12,8), %r8
movl $0x1, %ebp
shlq %cl, %rbp
movq %r8, %r13
btcq %rcx, %r13
movq %r13, (%rbx,%r12,8)
cmpq %rbp, %r8
jne 0x2887a
leaq 0x1(%r11), %rcx
cmpq %r11, %rdx
movq %rcx, %r11
jne 0x28843
leaq -0x10(%rdi), %rax
leaq 0x32e2b(%rip), %rcx     # 0x5b6b0
movq (%rcx), %rcx
notq %rcx
andq %rax, %rcx
movq 0x32ccb(%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 0x32c9e(%rip), %rdx     # 0x5b558
shlq $0xc, %rdx
movl 0x58(%r9), %eax
movl %esi, %r12d
imulq 0x10(%r9), %r12
addq %rax, %r12
addq %rcx, %r12
addq %rdx, %r12
movl 0x8(%rsp), %eax
decl %eax
movl %eax, 0x4(%rdi)
movq 0x10(%rsp), %rbx
movl 0xc(%rsp), %ebp
jmp 0x288f5
movq %r12, %rdi
movq %r15, %rsi
callq 0x28141
movq %rax, %r12
testq %r12, %r12
je 0x28950
incq 0x98(%r15)
movdqu 0xa8(%r15), %xmm0
pcmpeqd %xmm1, %xmm1
psubq %xmm1, %xmm0
movdqu %xmm0, 0xa8(%r15)
movq %r15, %rdi
callq 0x10440
leaq 0x31cf7(%rip), %rax     # 0x5a621
movb (%rax), %al
testb %bpl, %bpl
je 0x2895a
testb %al, %al
jne 0x28995
leaq 0x31d48(%rip), %rax     # 0x5a684
cmpb $0x1, (%rax)
je 0x289a2
movq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10270
jmp 0x28976
movq %r15, %rdi
callq 0x10440
jmp 0x28976
testb %al, %al
jne 0x289af
leaq 0x31cce(%rip), %rax     # 0x5a633
cmpb $0x1, (%rax)
je 0x289df
leaq 0x31d13(%rip), %rax     # 0x5a684
cmpb $0x1, (%rax)
je 0x289d2
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rdi
callq 0x2da8d
jmp 0x28761
movq %r14, %rdi
movq %r12, %rsi
callq 0x11e80
jmp 0x28935
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3e7a6
jmp 0x28941
leaq (%r14,%r14,2), %rax
shlq $0x5, %rax
leaq 0x31ce2(%rip), %rcx     # 0x5a6a0
movq %r12, %rdi
subq 0x8(%rax,%rcx), %rdi
movq 0x10(%rax,%rcx), %rdx
movl $0xa5, %esi
jmp 0x289e7
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3e7a6
jmp 0x28976
movq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10270
jmp 0x2896a