// File: /workspace/github_c_makefile_star2_O3/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: arena_bin_malloc_hard
static void *
arena_bin_malloc_hard(tsdn_t *tsdn, arena_t *arena, arena_bin_t *bin)
{
	szind_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(tsdn, 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().
		 */
		void *ret;
		assert(bin->runcur->nfree > 0);
		ret = arena_run_reg_alloc(bin->runcur, bin_info);
		if (run != NULL) {
			arena_chunk_t *chunk;

			/*
			 * arena_run_alloc_small() 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(tsdn, arena, chunk, run,
				    bin);
			} else
				arena_bin_lower_run(arena, 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 $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbp
movq %rdx, %rax
subq %rsi, %rax
addq $-0x980, %rax           # imm = 0xF680
sarq $0x3, %rax
movabsq $-0x30c30c30c30c30c3, %r13 # imm = 0xCF3CF3CF3CF3CF3D
imulq %rax, %r13
movl %r13d, %eax
shlq $0x6, %rax
leaq 0x29597(%rip), %r15     # 0x4c5e0
addq %rax, %r15
movq $0x0, 0x50(%rdx)
movq %rdx, %rdi
callq 0x25bab
movq %rax, %rbx
testq %rax, %rax
jne 0x230e2
movq %rbp, (%rsp)
movq %r14, %rdi
callq 0xb380
leaq 0x10(%r12), %rdi
movq %rdi, 0x8(%rsp)
callq 0xb5a0
movq 0x18(%r15), %rbp
movq %r12, %rdi
movq %rbp, %rsi
movl %r13d, %edx
callq 0x2606b
testq %rax, %rax
movq %r12, 0x10(%rsp)
je 0x2326e
movq %rax, %rbx
movl %r13d, (%rbx)
movl 0x20(%r15), %eax
movl %eax, 0x4(%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x28(%r15), %rsi
callq 0x263c8
movq 0x8(%rsp), %rdi
callq 0xb380
movq %r14, %rdi
callq 0xb5a0
incq 0x90(%r14)
incq 0xa0(%r14)
movq 0x10(%rsp), %r12
movq (%rsp), %rbp
movq 0x50(%r14), %rsi
testq %rsi, %rsi
je 0x231b6
movl 0x4(%rsi), %edi
testl %edi, %edi
je 0x231b6
movq 0x8(%rsi), %rcx
xorl %eax, %eax
testq %rcx, %rcx
jne 0x2311d
movl $0x1, %edx
movl %edx, %ecx
movq 0x8(%rsi,%rcx,8), %rcx
addl $0x40, %eax
incl %edx
testq %rcx, %rcx
je 0x2310a
movl %eax, %eax
bsfq %rcx, %rcx
leaq (%rcx,%rax), %r8
movl $0x1, %edx
shlq %cl, %rdx
shrl $0x3, %eax
xorq %rdx, 0x8(%rsi,%rax)
leaq -0x18(%rsi), %rax
leaq 0x29f90(%rip), %rcx     # 0x4d0d0
movq (%rcx), %rcx
notq %rcx
andq %rax, %rcx
movq 0x29e78(%rip), %rax     # 0x4cfc8
addq %rcx, %rax
negq %rax
addq %rsi, %rax
addq $-0x18, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq $0x6, %rdx
addq 0x29e4b(%rip), %rdx     # 0x4cfc0
shlq $0xc, %rdx
movl 0x38(%r15), %r13d
imulq 0x10(%r15), %r8
addq %rcx, %r13
addq %r8, %r13
addq %rdx, %r13
decl %edi
movl %edi, 0x4(%rsi)
testq %rbx, %rbx
je 0x2325c
movl 0x4(%rbx), %eax
cmpl 0x20(%r15), %eax
je 0x232e2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x25ad1
jmp 0x2325c
testq %rbx, %rbx
je 0x23259
movq %rbx, 0x50(%r14)
movq 0x8(%rbx), %rcx
xorl %eax, %eax
testq %rcx, %rcx
jne 0x231e6
movl $0x1, %edx
movl %edx, %ecx
movq 0x8(%rbx,%rcx,8), %rcx
addl $0x40, %eax
incl %edx
testq %rcx, %rcx
je 0x231d3
movl %eax, %eax
bsfq %rcx, %rcx
leaq (%rcx,%rax), %rsi
movl $0x1, %edx
shlq %cl, %rdx
shrl $0x3, %eax
xorq %rdx, 0x8(%rbx,%rax)
leaq -0x18(%rbx), %rax
leaq 0x29ec7(%rip), %rcx     # 0x4d0d0
movq (%rcx), %rcx
notq %rcx
andq %rax, %rcx
movq 0x29daf(%rip), %rax     # 0x4cfc8
addq %rcx, %rax
negq %rax
addq %rbx, %rax
addq $-0x18, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq $0x6, %rdx
addq 0x29d82(%rip), %rdx     # 0x4cfc0
shlq $0xc, %rdx
movl 0x38(%r15), %r13d
imulq 0x10(%r15), %rsi
addq %rcx, %r13
addq %rsi, %r13
addq %rdx, %r13
decl 0x4(%rbx)
jmp 0x2325c
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x24b13
testq %rax, %rax
je 0x232a9
movq 0x29d42(%rip), %rcx     # 0x4cfc8
leaq (%rcx,%rax), %rbx
addq $0x18, %rbx
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
movl %r13d, %ecx
callq 0x260b2
testb %al, %al
je 0x230a2
jmp 0x232c0
movq %r12, %rdi
movq %rbp, %rsi
movl %r13d, %edx
callq 0x2606b
testq %rax, %rax
jne 0x2309f
movq 0x8(%rsp), %rdi
callq 0xb380
movq %r14, %rdi
callq 0xb5a0
movq %r14, %rdi
callq 0x25bab
movq %rax, %rbx
jmp 0x230d9
movq %rbp, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0xf2d8
jmp 0x2325c