// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rdx, %rbx
movq %rdi, %rbp
movq %rdx, %rax
movq %rsi, 0x10(%rsp)
subq %rsi, %rax
addq $-0x980, %rax           # imm = 0xF680
sarq $0x3, %rax
movabsq $-0x30c30c30c30c30c3, %r13 # imm = 0xCF3CF3CF3CF3CF3D
imulq %rax, %r13
movl %r13d, %r12d
shlq $0x6, %r12
leaq 0x294c4(%rip), %r15     # 0x4c5e0
movq $0x0, 0x50(%rdx)
movq %rdx, %rdi
callq 0x25c34
movq %rax, %r14
testq %rax, %rax
jne 0x2324f
movq %rbp, 0x8(%rsp)
movl %r13d, %ebp
shlq $0x6, %rbp
movq %rbx, %rdi
callq 0xb380
movq 0x10(%rsp), %r14
leaq 0x10(%r14), %rdi
movq %rdi, 0x20(%rsp)
callq 0xb5a0
movq 0x18(%rbp,%r15), %r15
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0x260ce
movq %rax, %r14
testq %rax, %rax
jne 0x231d6
movq %r15, 0x18(%rsp)
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x24c04
testq %rax, %rax
je 0x231c3
movq 0x29e2b(%rip), %rcx     # 0x4cfc8
leaq (%rcx,%rax), %r15
addq $0x18, %r15
movq %r14, %rdi
movq %r15, %rsi
movq 0x18(%rsp), %rdx
movl %r13d, %ecx
callq 0x26115
xorl %r14d, %r14d
testb %al, %al
cmoveq %r15, %r14
jmp 0x231d6
movq %r14, %rdi
movq 0x18(%rsp), %rsi
movl %r13d, %edx
callq 0x260ce
movq %rax, %r14
testq %r14, %r14
je 0x23226
leaq 0x293fe(%rip), %r15     # 0x4c5e0
addq %r15, %rbp
movl %r13d, (%r14)
movl 0x20(%rbp), %eax
movl %eax, 0x4(%r14)
leaq 0x8(%r14), %rdi
addq $0x28, %rbp
movq %rbp, %rsi
callq 0x2641c
movq 0x20(%rsp), %rdi
callq 0xb380
movq %rbx, %rdi
callq 0xb5a0
incq 0x90(%rbx)
incq 0xa0(%rbx)
movq 0x8(%rsp), %rbp
jmp 0x2324f
movq 0x20(%rsp), %rdi
callq 0xb380
movq %rbx, %rdi
callq 0xb5a0
movq %rbx, %rdi
callq 0x25c34
movq %rax, %r14
movq 0x8(%rsp), %rbp
leaq 0x29391(%rip), %r15     # 0x4c5e0
addq %r12, %r15
movq 0x50(%rbx), %rsi
testq %rsi, %rsi
je 0x23327
movl 0x4(%rsi), %edi
testl %edi, %edi
je 0x23327
movq 0x8(%rsi), %rcx
xorl %eax, %eax
testq %rcx, %rcx
jne 0x2328d
movl $0x1, %edx
movl %edx, %ecx
movq 0x8(%rsi,%rcx,8), %rcx
addl $0x40, %eax
incl %edx
testq %rcx, %rcx
je 0x2327a
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 0x29e20(%rip), %rcx     # 0x4d0d0
movq (%rcx), %rcx
notq %rcx
andq %rax, %rcx
movq 0x29d08(%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 0x29cdb(%rip), %rdx     # 0x4cfc0
shlq $0xc, %rdx
movl 0x38(%r15), %r12d
imulq 0x10(%r15), %r8
addq %rcx, %r12
addq %r8, %r12
addq %rdx, %r12
decl %edi
movl %edi, 0x4(%rsi)
testq %r14, %r14
je 0x233ce
movl 0x4(%r14), %eax
cmpl 0x20(%r15), %eax
je 0x233e0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x25b57
jmp 0x233ce
testq %r14, %r14
je 0x233cb
movq %r14, 0x50(%rbx)
movq 0x8(%r14), %rcx
xorl %eax, %eax
testq %rcx, %rcx
jne 0x23357
movl $0x1, %edx
movl %edx, %ecx
movq 0x8(%r14,%rcx,8), %rcx
addl $0x40, %eax
incl %edx
testq %rcx, %rcx
je 0x23344
movl %eax, %eax
bsfq %rcx, %rcx
leaq (%rcx,%rax), %rsi
movl $0x1, %edx
shlq %cl, %rdx
shrl $0x3, %eax
xorq %rdx, 0x8(%r14,%rax)
leaq -0x18(%r14), %rax
leaq 0x29d56(%rip), %rcx     # 0x4d0d0
movq (%rcx), %rcx
notq %rcx
andq %rax, %rcx
movq 0x29c3e(%rip), %rax     # 0x4cfc8
addq %rcx, %rax
negq %rax
addq %r14, %rax
addq $-0x18, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq $0x6, %rdx
addq 0x29c11(%rip), %rdx     # 0x4cfc0
shlq $0xc, %rdx
movl 0x38(%r15), %r12d
imulq 0x10(%r15), %rsi
addq %rcx, %r12
addq %rsi, %r12
addq %rdx, %r12
decl 0x4(%r14)
jmp 0x233ce
xorl %r12d, %r12d
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xf997
jmp 0x233ce