// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rcx
subq $0x1, %rcx
shrq $0x3, %rcx
leaq 0x371f3(%rip), %rax     # 0xed680
movzbl (%rax,%rcx), %eax
movq %rax, -0x40(%rbp)
jmp 0xb6497
movq -0x10(%rbp), %rax
addq $0x120, %rax            # imm = 0x120
imulq $0x98, -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
leaq 0x72099(%rip), %rax     # 0x128550
imulq $0x68, -0x40(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rdi
callq 0xb5d20
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0xb6509
movq -0x38(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jbe 0xb6509
movq -0x38(%rbp), %rdi
leaq 0x7205a(%rip), %rsi     # 0x128550
imulq $0x68, -0x40(%rbp), %rax
addq %rax, %rsi
callq 0xb60b0
movq %rax, -0x28(%rbp)
jmp 0xb651a
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xb6150
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xb6537
movq -0x30(%rbp), %rdi
callq 0xb5ee0
movq $0x0, -0x8(%rbp)
jmp 0xb665e
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
addq 0x50(%rax), %rcx
movq %rcx, 0x50(%rax)
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x58(%rax)
movq -0x30(%rbp), %rax
movq 0x68(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x68(%rax)
movq -0x30(%rbp), %rdi
callq 0xb5ee0
movb -0x19(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xb65c7
leaq 0x71f27(%rip), %rax     # 0x1284ab
testb $0x1, (%rax)
je 0xb65a5
movq -0x28(%rbp), %rdi
leaq 0x71fbc(%rip), %rsi     # 0x128550
imulq $0x68, -0x40(%rbp), %rax
addq %rax, %rsi
xorl %edx, %edx
callq 0xb6290
jmp 0xb65c2
leaq 0x71f10(%rip), %rax     # 0x1284bc
testb $0x1, (%rax)
je 0xb65c0
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x1f110
jmp 0xb65c2
jmp 0xb6656
leaq 0x71edd(%rip), %rax     # 0x1284ab
testb $0x1, (%rax)
je 0xb65f0
movq -0x28(%rbp), %rdi
leaq 0x71f72(%rip), %rsi     # 0x128550
imulq $0x68, -0x40(%rbp), %rax
addq %rax, %rsi
movl $0x1, %edx
callq 0xb6290
movq $0x4d430001, -0x70(%rbp) # imm = 0x4D430001
movq -0x28(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
leaq -0x70(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
rolq $0x3, %rdi
rolq $0xd, %rdi
rolq $0x3d, %rdi
rolq $0x33, %rdi
xchgq %rbx, %rbx
movq %rdx, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x1f110
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)