// File: /workspace/github_c_makefile_star2_O3/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 0x5e5b4(%rip), %r13     # 0xdf928
movq (%r13), %rax
movq %rbx, %rdx
subq %rax, %rdx
leaq (%rdx,%rdx,2), %rdx
movq 0x40(%rsi,%rdx,8), %rdx
shrq $0xc, %rdx
subq %rdx, %rbx
shlq $0xc, %rbx
movq (%rbx,%rsi), %r14
addq %rsi, %rbx
movl 0x10(%rcx), %ecx
shrl $0x4, %ecx
movzbl %cl, %ecx
imulq $0x68, %rcx, %rcx
leaq 0x5d853(%rip), %r12     # 0xdec00
leaq (%r12,%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq (%rcx,%r12), %rcx
movq %rcx, (%rsp)
leaq 0x5d796(%rip), %rcx     # 0xdeb5b
cmpb $0x1, (%rcx)
jne 0x813db
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
callq 0x80b41
movq (%r13), %rax
leaq 0x5e49e(%rip), %rcx     # 0xdf880
movq (%rcx), %rcx
notq %rcx
andq %rbx, %rcx
movq %rbp, %rdx
subq %rcx, %rdx
shrq $0xc, %rdx
subq %rax, %rdx
leaq (%rdx,%rdx,2), %rax
movl 0x40(%rcx,%rax,8), %eax
shrl $0x4, %eax
movzbl %al, %eax
imulq $0x68, %rax, %rsi
leaq (%r12,%rsi), %rdi
movq 0x10(%rsi,%r12), %r8
movl 0x64(%rsi,%r12), %eax
addl %ebx, %eax
subl %eax, %ebp
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 0x81457
cmpq $0x1f, %r8
ja 0x8144d
leaq 0x21f3e(%rip), %rax     # 0xa3380
imull -0xc(%rax,%r8,4), %ebp
shrl $0x15, %ebp
jmp 0x81457
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 0x814bb
movl 0x30(%rdi), %edx
cmpq $0x2, %rdx
jb 0x814bb
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 0x814bb
leaq 0x1(%rdi), %r8
cmpq %rdi, %rdx
movq %r8, %rdi
jne 0x8148c
movl 0xc(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xc(%rbx)
movq 0x8(%rsp), %rdx
cmpl 0x20(%rdx), %ecx
jne 0x8150b
cmpq %rbx, 0x28(%r14)
je 0x81526
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 0x81532
movq %r14, %rdi
movq %rbx, %rsi
callq 0x84a57
jmp 0x81532
testl %eax, %eax
movq (%rsp), %r12
jne 0x81545
cmpq %rbx, 0x28(%r14)
je 0x81545
movq %rbx, %rdi
movq %r14, %rsi
callq 0x816f7
jmp 0x81545
movq $0x0, 0x28(%r14)
movq (%rsp), %r12
movq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x8155c
subq %r12, 0x50(%r14)
incq 0x60(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq