// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/arena.c
// Function: arena_bin_malloc_hard
static void *
arena_bin_malloc_hard(arena_t *arena, arena_bin_t *bin)
{
	void *ret;
	size_t binind;
	arena_bin_info_t *bin_info;
	arena_run_t *run;

	binind = arena_bin_index(arena, bin);
	bin_info = &arena_bin_info[binind];
	bin->runcur = NULL;
	run = arena_bin_nonfull_run_get(arena, bin);
	if (bin->runcur != NULL && bin->runcur->nfree > 0) {
		/*
		 * Another thread updated runcur while this one ran without the
		 * bin lock in arena_bin_nonfull_run_get().
		 */
		assert(bin->runcur->nfree > 0);
		ret = arena_run_reg_alloc(bin->runcur, bin_info);
		if (run != NULL) {
			arena_chunk_t *chunk;

			/*
			 * arena_run_alloc() may have allocated run, or it may
			 * have pulled run from the bin's run tree.  Therefore
			 * it is unsafe to make any assumptions about how run
			 * has previously been used, and arena_bin_lower_run()
			 * must be called, as if a region were just deallocated
			 * from the run.
			 */
			chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run);
			if (run->nfree == bin_info->nregs)
				arena_dalloc_bin_run(arena, chunk, run, bin);
			else
				arena_bin_lower_run(arena, chunk, run, bin);
		}
		return (ret);
	}

	if (run == NULL)
		return (NULL);

	bin->runcur = run;

	assert(bin->runcur->nfree > 0);

	return (arena_run_reg_alloc(bin->runcur, bin_info));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rax
subq %rdi, %rax
addq $-0x120, %rax           # imm = 0xFEE0
movl $0x98, %ecx
cqto
idivq %rcx
movq %rax, %rbp
imulq $0x68, %rax, %rax
leaq 0x63a8f(%rip), %r15     # 0xdbc00
addq %rax, %r15
andq $0x0, 0x28(%rsi)
movq %rsi, %rdi
callq 0x7bc47
movq %rax, %r12
testq %rax, %rax
jne 0x78268
movq %rbx, %rdi
callq 0x1fbb0
leaq 0x8(%r14), %r13
movq %r13, %rdi
callq 0x1faa0
movq 0x18(%r15), %rsi
movq %r14, %rdi
xorl %edx, %edx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x786a2
testq %rax, %rax
je 0x7824d
movq %rax, %r12
movl 0x24(%r15), %edi
leaq 0x10(%rsp), %rax
movq $0x4d430001, (%rax)     # imm = 0x4D430001
movq %r12, 0x8(%rax)
movl 0x64(%r15), %ecx
subq 0x8(%r15), %rcx
movq %rcx, 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 %rbx, (%r12)
andl $0x0, 0x8(%r12)
addq %r12, %rdi
movl 0x20(%r15), %eax
movl %eax, 0xc(%r12)
leaq 0x28(%r15), %rsi
callq 0x7c923
movq %r13, %rdi
callq 0x1fbb0
movq %rbx, %rdi
callq 0x1faa0
incq 0x80(%rbx)
incq 0x90(%rbx)
jmp 0x78268
movq %r13, %rdi
callq 0x1fbb0
movq %rbx, %rdi
callq 0x1faa0
movq %rbx, %rdi
callq 0x7bc47
movq %rax, %r12
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x782b2
cmpl $0x0, 0xc(%rdi)
je 0x782b2
movq %r15, %rsi
callq 0x78047
movq %rax, %r13
testq %r12, %r12
je 0x782db
movl 0xc(%r12), %eax
cmpl 0x20(%r15), %eax
jne 0x782d0
leaq 0x645e7(%rip), %rax     # 0xdc880
movq (%rax), %rsi
notq %rsi
andq %r12, %rsi
movq %r14, %rdi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x78c21
jmp 0x782db
testq %r12, %r12
je 0x782cb
movq %r12, 0x28(%rbx)
movq %r12, %rdi
movq %r15, %rsi
callq 0x78047
movq %rax, %r13
jmp 0x782db
xorl %r13d, %r13d
jmp 0x782db
movq %r12, %rdi
movq %rbx, %rsi
callq 0x78db3
movq %r13, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq