// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/arena.c
// Function: 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;
	size_t binind;

	binind = SMALL_SIZE2BIN(size);
	assert(binind < NBINS);
	bin = &arena->bins[binind];
	size = arena_bin_info[binind].reg_size;

	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.allocated += size;
		bin->stats.nmalloc++;
		bin->stats.nrequests++;
	}
	malloc_mutex_unlock(&bin->lock);
	if (config_prof && isthreaded == false) {
		malloc_mutex_lock(&arena->lock);
		arena_prof_accum(arena, size);
		malloc_mutex_unlock(&arena->lock);
	}

	if (zero == false) {
		if (config_fill) {
			if (opt_junk) {
				arena_alloc_junk_small(ret,
				    &arena_bin_info[binind], false);
			} else if (opt_zero)
				memset(ret, 0, size);
		}
	} else {
		if (config_fill && opt_junk) {
			arena_alloc_junk_small(ret, &arena_bin_info[binind],
			    true);
		}
		VALGRIND_MAKE_MEM_UNDEFINED(ret, size);
		memset(ret, 0, size);
	}

	return (ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movl %edx, %ebp
movq %rdi, %r14
decq %rsi
shrq $0x3, %rsi
leaq 0x20cf4(%rip), %rax     # 0x99140
movzbl (%rsi,%rax), %eax
imulq $0x98, %rax, %rcx
leaq (%rdi,%rcx), %r12
addq $0x120, %r12            # imm = 0x120
imulq $0x68, %rax, %rax
leaq 0x63793(%rip), %rcx     # 0xdbc00
leaq (%rcx,%rax), %r15
movq (%rax,%rcx), %rbx
movq %r12, %rdi
callq 0x1faa0
movq 0x28(%r12), %rdi
testq %rdi, %rdi
je 0x78497
cmpl $0x0, 0xc(%rdi)
je 0x78497
movq %r15, %rsi
callq 0x78047
jmp 0x784a2
movq %r14, %rdi
movq %r12, %rsi
callq 0x78139
movq %rax, %r14
testq %rax, %rax
je 0x78566
movdqu 0x50(%r12), %xmm0
movq %rbx, %xmm1
shufpd $0x2, 0x11d1d(%rip), %xmm1 # xmm1 = xmm1[0],mem[1]
paddq %xmm0, %xmm1
movdqu %xmm1, 0x50(%r12)
incq 0x68(%r12)
movq %r12, %rdi
callq 0x1fbb0
leaq 0x63679(%rip), %rax     # 0xdbb5b
movb (%rax), %al
testb %bpl, %bpl
je 0x78570
testb %al, %al
je 0x7851b
movq 0x8(%r15), %r12
movq %r14, %rdi
subq %r12, %rdi
movl $0xa5, %esi
movq %r12, %rdx
callq 0x1f110
movq (%r15), %rdi
addq %r14, %rdi
movl $0xa5, %esi
movq %r12, %rdx
callq 0x1f110
leaq 0x10(%rsp), %rax
movq $0x4d430001, (%rax)     # imm = 0x4D430001
movq %r14, 0x8(%rax)
movq %rbx, 0x10(%rax)
xorl %ecx, %ecx
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rcx, 0x28(%rax)
xorl %edx, %edx
rolq $0x3, %rdi
rolq $0xd, %rdi
rolq $0x3d, %rdi
rolq $0x33, %rdi
xchgq %rbx, %rbx
movq %rdx, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
jmp 0x78584
movq %r12, %rdi
callq 0x1fbb0
jmp 0x78589
testb %al, %al
je 0x78599
movq %r14, %rdi
subq 0x8(%r15), %rdi
movq 0x10(%r15), %rdx
movl $0xa5, %esi
callq 0x1f110
movq %r14, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x635cc(%rip), %rax     # 0xdbb6c
cmpb $0x1, (%rax)
je 0x7855c
jmp 0x78589