// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movq %rcx, %r13
movq %rsi, (%rsp)
movq %rdi, 0x10(%rsp)
subq %rdx, %rcx
shrq $0xc, %rcx
movq 0x2c7a8(%rip), %r9      # 0x48fc0
movq %rcx, %rax
subq %r9, %rax
movq 0x78(%rdx,%rax,8), %rax
shrq $0xd, %rax
subq %rax, %rcx
movq 0x2c797(%rip), %rax     # 0x48fc8
movq %rdx, 0x8(%rsp)
addq %rax, %rdx
imulq $0x60, %rcx, %rbx
addq %rdx, %rbx
movq %r9, %rcx
negq %rcx
imulq $0x60, %rcx, %r14
leaq (%r14,%rbx), %r15
addq $0x18, %r15
movl (%r15), %ebp
movq %rbp, %r12
shlq $0x6, %r12
leaq 0x2bd7d(%rip), %rcx     # 0x485e0
addq %rcx, %r12
testl %r8d, %r8d
jne 0x1c87b
leaq 0x2bcb0(%rip), %rcx     # 0x48522
cmpb $0x1, (%rcx)
je 0x1c9dd
imulq $0xa8, %rbp, %rdi
addq %r14, %rbx
leaq 0x2c844(%rip), %rcx     # 0x490d0
movq (%rcx), %r8
notq %r8
movq %r8, %rcx
andq %r15, %rcx
movq %r13, %rdx
subq %rcx, %rdx
shrq $0xc, %rdx
subq %r9, %rdx
movl $0x1fe0, %r10d          # imm = 0x1FE0
andl 0x78(%rcx,%rdx,8), %r10d
leaq -0x18(%r15), %rsi
andq %rsi, %r8
addq %r8, %rax
negq %rax
addq %r15, %rax
addq $-0x18, %rax
xorl %ecx, %ecx
pushq $0x60
popq %r11
xorl %edx, %edx
divq %r11
addq %r9, %rax
leaq 0x2bd07(%rip), %r9      # 0x485e0
movl 0x38(%r9,%r10,2), %edx
addq %r8, %rdx
shlq $0xc, %rax
addq %rdx, %rax
subq %rax, %r13
movq 0x10(%r9,%r10,2), %r8
bsfq %r8, %rax
cmpq $0x1, %r8
sbbl %ecx, %ecx
orb %al, %cl
shrq %cl, %r13
shrq %cl, %r8
cmpq $0x1, %r8
jne 0x1c90e
movq (%rsp), %rbp
jmp 0x1c92d
cmpq $0x1f, %r8
movq (%rsp), %rbp
ja 0x1c9fb
leaq 0x1abfd(%rip), %rax     # 0x37520
imulq -0x18(%rax,%r8,8), %r13
shrq $0x37, %r13
leaq (%rdi,%rbp), %r14
addq $0x980, %r14            # imm = 0x980
movq %r13, %rax
shrq $0x6, %rax
pushq $0x1
popq %rdx
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
jne 0x1c997
cmpq %r15, 0x50(%r14)
je 0x1c9ae
movq %r14, %rax
movq 0x8(%rsp), %rcx
subq (%rcx), %rax
addq $-0x980, %rax           # imm = 0xF680
movl $0xa8, %ecx
cqto
idivq %rcx
movl %eax, %eax
shlq $0x6, %rax
cmpl $0x1, 0x20(%rax,%r9)
je 0x1c9b3
leaq 0x58(%r14), %rdi
callq 0x1f7a7
jmp 0x1c9b3
testl %eax, %eax
jne 0x1c9c6
cmpq 0x50(%r14), %r15
je 0x1c9c6
movq %r15, %rdi
movq %r14, %rsi
callq 0x20259
jmp 0x1c9c6
andq $0x0, 0x50(%r14)
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x201f8
incq 0x68(%r14)
decq 0x78(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
movq %r12, %rsi
callq 0x1b8a9
movq 0x2c5d1(%rip), %r9      # 0x48fc0
movq 0x2c5d2(%rip), %rax     # 0x48fc8
jmp 0x1c87b
movq %r13, %rax
xorl %edx, %edx
divq %r8
movq %rax, %r13
jmp 0x1c92d