// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/arena.c
// Function: arena_dalloc_bin_locked
void
arena_dalloc_bin_locked(arena_t *arena, arena_chunk_t *chunk, void *ptr,
    arena_chunk_map_t *mapelm)
{
	size_t pageind;
	arena_run_t *run;
	arena_bin_t *bin;
	arena_bin_info_t *bin_info;
	size_t size, binind;

	pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> LG_PAGE;
	run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind -
	    arena_mapbits_small_runind_get(chunk, pageind)) << LG_PAGE));
	bin = run->bin;
	binind = arena_ptr_small_binind_get(ptr, mapelm->bits);
	bin_info = &arena_bin_info[binind];
	if (config_fill || config_stats)
		size = bin_info->reg_size;

	if (config_fill && opt_junk)
		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(arena, chunk, run, bin);
	} else if (run->nfree == 1 && run != bin->runcur)
		arena_bin_lower_run(arena, chunk, run, bin);

	if (config_stats) {
		bin->stats.allocated -= size;
		bin->stats.ndalloc++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, 0x10(%rsp)
movq %rdx, %rbx
subq %rsi, %rbx
shrq $0xc, %rbx
leaq 0x5e8d0(%rip), %r13     # 0xdf928
movq %rbx, %rax
subq (%r13), %rax
leaq (%rax,%rax,2), %rax
movq 0x40(%rsi,%rax,8), %rax
shrq $0xc, %rax
subq %rax, %rbx
shlq $0xc, %rbx
movq (%rbx,%rsi), %r14
addq %rsi, %rbx
movl 0x10(%rcx), %eax
shrl $0x4, %eax
movzbl %al, %eax
imulq $0x68, %rax, %rax
leaq 0x5db72(%rip), %r12     # 0xdec00
leaq (%r12,%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax,%r12), %rax
movq %rax, (%rsp)
leaq 0x5dab5(%rip), %rax     # 0xdeb5b
cmpb $0x1, (%rax)
jne 0x810b8
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
callq 0x8085a
leaq 0x5e7c1(%rip), %rax     # 0xdf880
movq (%rax), %rax
notq %rax
andq %rbx, %rax
movq %rbp, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
subq (%r13), %rcx
leaq (%rcx,%rcx,2), %rcx
movl 0x40(%rax,%rcx,8), %eax
shrl $0x4, %eax
movzbl %al, %eax
imulq $0x68, %rax, %rsi
leaq (%r12,%rsi), %rdi
movl 0x64(%rsi,%r12), %eax
addl %ebx, %eax
subl %eax, %ebp
movq 0x10(%rsi,%r12), %r8
bsfl %r8d, %eax
xorl %ecx, %ecx
cmpl $0x1, %r8d
sbbl %ecx, %ecx
orb %al, %cl
shrl %cl, %ebp
shrq %cl, %r8
cmpq $0x1, %r8
je 0x81135
cmpq $0x1f, %r8
ja 0x8112b
leaq 0x22160(%rip), %rax     # 0xa3280
imull -0xc(%rax,%r8,4), %ebp
shrl $0x15, %ebp
jmp 0x81135
movl %ebp, %eax
xorl %edx, %edx
divq %r8
movq %rax, %rbp
movl 0x24(%rdi), %eax
addq %rbx, %rax
movl %ebp, %ecx
shrl $0x6, %ecx
movq (%rax,%rcx,8), %rdx
movq %rdx, %r8
btcq %rbp, %r8
movq %r8, (%rax,%rcx,8)
testq %rdx, %rdx
jne 0x81199
movl 0x30(%rdi), %edx
cmpq $0x2, %rdx
jb 0x81199
addq $-0x2, %rdx
addq %r12, %rsi
addq $0x40, %rsi
xorl %edi, %edi
movq %rcx, %r8
shrq $0x6, %rcx
movq (%rsi,%rdi,8), %r9
leaq (%rax,%r9,8), %r9
movq (%r9,%rcx,8), %r10
movq %r10, %r11
btcq %r8, %r11
movq %r11, (%r9,%rcx,8)
testq %r10, %r10
jne 0x81199
leaq 0x1(%rdi), %r8
cmpq %rdi, %rdx
movq %r8, %rdi
jne 0x8116a
movl 0xc(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xc(%rbx)
movq 0x8(%rsp), %rdx
cmpl 0x20(%rdx), %ecx
jne 0x811e9
cmpq %rbx, 0x28(%r14)
je 0x81204
movq %r14, %rax
subq (%r15), %rax
addq $-0x120, %rax           # imm = 0xFEE0
shrq $0x3, %rax
movabsq $-0x435e50d79435e508, %rcx # imm = 0xBCA1AF286BCA1AF8
imulq %rax, %rcx
cmpl $0x1, 0x20(%rcx,%r12)
movq (%rsp), %r12
je 0x81210
movq %r14, %rdi
movq %rbx, %rsi
callq 0x846ec
jmp 0x81210
testl %eax, %eax
movq (%rsp), %r12
jne 0x81223
cmpq %rbx, 0x28(%r14)
je 0x81223
movq %rbx, %rdi
movq %r14, %rsi
callq 0x813d5
jmp 0x81223
movq $0x0, 0x28(%r14)
movq (%rsp), %r12
movq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x8123a
subq %r12, 0x50(%r14)
incq 0x60(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq