// File: /workspace/github_c_makefile_star2_O3/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: arena_dalloc_bin_locked_impl
static void
arena_dalloc_bin_locked_impl(tsdn_t *tsdn, arena_t *arena, arena_chunk_t *chunk,
    void *ptr, arena_chunk_map_bits_t *bitselm, bool junked)
{
	size_t pageind, rpages_ind;
	arena_run_t *run;
	arena_bin_t *bin;
	arena_bin_info_t *bin_info;
	szind_t binind;

	pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> LG_PAGE;
	rpages_ind = pageind - arena_mapbits_small_runind_get(chunk, pageind);
	run = &arena_miscelm_get_mutable(chunk, rpages_ind)->run;
	binind = run->binind;
	bin = &arena->bins[binind];
	bin_info = &arena_bin_info[binind];

	if (!junked && config_fill && unlikely(opt_junk_free))
		arena_dalloc_junk_small(ptr, bin_info);

	arena_run_reg_dalloc(run, ptr);
	if (run->nfree == bin_info->nregs) {
		arena_dissociate_bin_run(chunk, run, bin);
		arena_dalloc_bin_run(tsdn, arena, chunk, run, bin);
	} else if (run->nfree == 1 && run != bin->runcur)
		arena_bin_lower_run(arena, run, bin);

	if (config_stats) {
		bin->stats.ndalloc++;
		bin->stats.curregs--;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r13
movq %rsi, %r11
movq %rdi, 0x20(%rsp)
movq %rcx, %rdi
subq %rdx, %rdi
shrq $0xc, %rdi
movq 0x29a3c(%rip), %rcx     # 0x4cfc0
movq %rdi, %rax
subq %rcx, %rax
movq 0x78(%rdx,%rax,8), %rax
shrq $0xd, %rax
subq %rax, %rdi
movq 0x29a2b(%rip), %rax     # 0x4cfc8
movq %rdx, 0x18(%rsp)
leaq (%rdi,%rdi,2), %rbx
shlq $0x5, %rbx
addq %rax, %rbx
addq %rdx, %rbx
movq %rcx, %rdx
negq %rdx
leaq (%rdx,%rdx,2), %r14
shlq $0x5, %r14
leaq (%r14,%rbx), %r15
addq $0x18, %r15
movl (%r15), %ebp
movq %rbp, %r12
shlq $0x6, %r12
leaq 0x29009(%rip), %rdx     # 0x4c5e0
addq %rdx, %r12
testl %r8d, %r8d
jne 0x235ef
leaq 0x28f3c(%rip), %rdx     # 0x4c522
cmpb $0x1, (%rdx)
je 0x23757
imulq $0xa8, %rbp, %rdi
addq %r14, %rbx
leaq 0x29ad0(%rip), %rdx     # 0x4d0d0
movq (%rdx), %r9
notq %r9
movq %r9, %rdx
andq %r15, %rdx
movq %r13, %rsi
subq %rdx, %rsi
shrq $0xc, %rsi
subq %rcx, %rsi
movl $0x1fe0, %r10d          # imm = 0x1FE0
andl 0x78(%rdx,%rsi,8), %r10d
leaq 0x28fb5(%rip), %rbp     # 0x4c5e0
movq 0x10(%rbp,%r10,2), %r8
movl 0x38(%rbp,%r10,2), %r10d
leaq -0x18(%r15), %rsi
andq %rsi, %r9
addq %r9, %rax
negq %rax
addq %r15, %rax
addq $-0x18, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq $0x6, %rdx
addq %rcx, %rdx
shlq $0xc, %rdx
addq %r9, %rdx
addq %r10, %rdx
subq %rdx, %r13
bsfq %r8, %rax
xorl %ecx, %ecx
cmpq $0x1, %r8
sbbl %ecx, %ecx
orb %al, %cl
shrq %cl, %r13
shrq %cl, %r8
cmpq $0x1, %r8
je 0x2369f
cmpq $0x1f, %r8
ja 0x237a2
leaq 0x1930b(%rip), %rax     # 0x3c9a0
imulq -0x18(%rax,%r8,8), %r13
shrq $0x37, %r13
leaq (%r11,%rdi), %r14
addq $0x980, %r14            # imm = 0x980
movq %r13, %rax
shrq $0x6, %rax
movl $0x1, %edx
movl %r13d, %ecx
shlq %cl, %rdx
xorq %rdx, 0x20(%rbx,%rax,8)
movl 0x1c(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x1c(%rbx)
cmpl 0x20(%r12), %ecx
je 0x236e8
testl %eax, %eax
jne 0x23740
cmpq 0x50(%r14), %r15
je 0x23740
movq %r15, %rdi
movq %r14, %rsi
callq 0x25ad1
jmp 0x23740
cmpq %r15, 0x50(%r14)
jne 0x236f8
movq $0x0, 0x50(%r14)
jmp 0x2372d
movq %r14, %rax
movq 0x18(%rsp), %rcx
subq (%rcx), %rax
addq $-0x980, %rax           # imm = 0xF680
shrq $0x3, %rax
imull $0x3cf3cf3d, %eax, %eax # imm = 0x3CF3CF3D
shlq $0x6, %rax
cmpl $0x1, 0x20(%rax,%rbp)
je 0x2372d
leaq 0x58(%r14), %rdi
movq %r11, %rbx
callq 0x25391
movq %rbx, %r11
movq 0x20(%rsp), %rdi
movq %r11, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xf2d8
incq 0x68(%r14)
decq 0x78(%r14)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rax
subq 0x8(%r12), %rax
movq %rax, 0x8(%rsp)
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
movq %r11, 0x10(%rsp)
callq 0x2336b
movq 0x10(%r12), %rdx
movq 0x8(%rsp), %rdi
movl $0x5a, %esi
callq 0xb230
movq 0x10(%rsp), %r11
movq 0x2982a(%rip), %rcx     # 0x4cfc0
movq 0x2982b(%rip), %rax     # 0x4cfc8
jmp 0x235ef
movq %r13, %rax
xorl %edx, %edx
divq %r8
movq %rax, %r13
jmp 0x2369f