// File: /workspace/github_c_makefile_star2_O1/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, %r10
movq %rdi, %r11
movq %rcx, %rax
subq %rdx, %rax
shrq $0xc, %rax
movq 0x2993e(%rip), %rcx     # 0x4cfc0
movq %rax, %rsi
subq %rcx, %rsi
movq 0x78(%rdx,%rsi,8), %rsi
shrq $0xd, %rsi
subq %rsi, %rax
movq 0x2992d(%rip), %rsi     # 0x4cfc8
movq %rdx, 0x20(%rsp)
addq %rdx, %rsi
leaq (%rax,%rax,2), %rbx
shlq $0x5, %rbx
addq %rsi, %rbx
negq %rcx
leaq (%rcx,%rcx,2), %r14
shlq $0x5, %r14
leaq (%r14,%rbx), %r15
addq $0x18, %r15
movl (%r15), %ebp
movq %rbp, %r12
shlq $0x6, %r12
leaq 0x28f0e(%rip), %rax     # 0x4c5e0
addq %rax, %r12
testl %r8d, %r8d
jne 0x236ea
leaq 0x28e41(%rip), %rax     # 0x4c522
cmpb $0x1, (%rax)
je 0x23865
imulq $0xa8, %rbp, %rdi
addq %r14, %rbx
leaq 0x299d5(%rip), %rax     # 0x4d0d0
movq (%rax), %rcx
notq %rcx
movq %rcx, %rax
andq %r15, %rax
movq %r13, %rdx
subq %rax, %rdx
shrq $0xc, %rdx
movq 0x298a8(%rip), %r9      # 0x4cfc0
subq %r9, %rdx
movl $0x1fe0, %r8d           # imm = 0x1FE0
andl 0x78(%rax,%rdx,8), %r8d
leaq -0x18(%r15), %rsi
andq %rsi, %rcx
movq 0x29894(%rip), %rax     # 0x4cfc8
addq %rcx, %rax
negq %rax
addq %r15, %rax
addq $-0x18, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq $0x6, %rdx
addq %r9, %rdx
leaq 0x28e84(%rip), %r9      # 0x4c5e0
movl 0x38(%r9,%r8,2), %eax
shlq $0xc, %rdx
addq %rcx, %rdx
addq %rax, %rdx
subq %rdx, %r13
movq 0x10(%r9,%r8,2), %r8
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 0x237a8
cmpq $0x1f, %r8
ja 0x238ac
leaq 0x19142(%rip), %rax     # 0x3c8e0
imulq -0x18(%rax,%r8,8), %r13
shrq $0x37, %r13
leaq (%r10,%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 0x237f1
testl %eax, %eax
jne 0x2384e
cmpq 0x50(%r14), %r15
je 0x2384e
movq %r15, %rdi
movq %r14, %rsi
callq 0x25b57
jmp 0x2384e
cmpq %r15, 0x50(%r14)
jne 0x23801
movq $0x0, 0x50(%r14)
jmp 0x2383d
movq %r14, %rax
movq 0x20(%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,%r9)
je 0x2383d
leaq 0x58(%r14), %rdi
movq %r10, %rbx
movq %r11, %r12
callq 0x25432
movq %r12, %r11
movq %rbx, %r10
movq %r11, %rdi
movq %r10, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xf997
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 %r10, 0x18(%rsp)
movq %r11, 0x10(%rsp)
callq 0x23468
movq 0x10(%r12), %rdx
movq 0x8(%rsp), %rdi
movl $0x5a, %esi
callq 0xb230
movq 0x10(%rsp), %r11
movq 0x18(%rsp), %r10
jmp 0x236ea
movq %r13, %rax
xorl %edx, %edx
divq %r8
movq %rax, %r13
jmp 0x237a8