// File: /workspace/github_c_makefile_star2_O2/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, 0x8(%rsp)
movq %rdx, %rbx
subq %rsi, %rbx
shrq $0xc, %rbx
leaq 0x63ecf(%rip), %r13     # 0xdc928
movq (%r13), %rax
movq %rbx, %rdx
subq %rax, %rdx
imulq $0x18, %rdx, %rdx
movq 0x40(%rsi,%rdx), %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 0x6316e(%rip), %r12     # 0xdbc00
leaq (%r12,%rcx), %rdx
movq %rdx, (%rsp)
movq (%rcx,%r12), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x630b1(%rip), %rcx     # 0xdbb5b
cmpb $0x1, (%rcx)
jne 0x78abf
movq %rbp, %rdi
movq (%rsp), %rsi
callq 0x7833d
movq (%r13), %rax
leaq 0x63dba(%rip), %rcx     # 0xdc880
movq (%rcx), %rcx
notq %rcx
andq %rbx, %rcx
movq %rbp, %rdx
subq %rcx, %rdx
shrq $0xc, %rdx
subq %rax, %rdx
imulq $0x18, %rdx, %rax
movl 0x40(%rcx,%rax), %eax
shrl $0x4, %eax
movzbl %al, %eax
imulq $0x68, %rax, %rax
leaq (%r12,%rax), %rsi
movl 0x64(%rax,%r12), %ecx
addl %ebx, %ecx
subl %ecx, %ebp
movq 0x10(%rax,%r12), %rdi
bsfl %edi, %eax
xorl %ecx, %ecx
cmpl $0x1, %edi
sbbl %ecx, %ecx
orb %al, %cl
shrl %cl, %ebp
shrq %cl, %rdi
cmpq $0x1, %rdi
je 0x78b38
cmpq $0x1f, %rdi
ja 0x78b2e
leaq 0x207dc(%rip), %rax     # 0x99300
imull -0xc(%rax,%rdi,4), %ebp
shrl $0x15, %ebp
jmp 0x78b38
movl %ebp, %eax
xorl %edx, %edx
divq %rdi
movq %rax, %rbp
movl 0x24(%rsi), %eax
addq %rbx, %rax
movl %ebp, %ecx
shrl $0x6, %ecx
movq (%rax,%rcx,8), %rdx
movq %rdx, %rdi
btcq %rbp, %rdi
movq %rdi, (%rax,%rcx,8)
testq %rdx, %rdx
jne 0x78b8f
movl 0x30(%rsi), %edx
pushq $0x8
popq %rdi
leaq -0x7(%rdi), %r8
cmpq %rdx, %r8
jae 0x78b8f
movq %rcx, %r8
shrq $0x6, %r8
movq (%rsi,%rdi,8), %r9
leaq (%rax,%r9,8), %r9
movq (%r9,%r8,8), %r10
movq %r10, %r11
btcq %rcx, %r11
incq %rdi
movq %r11, (%r9,%r8,8)
movq %r8, %rcx
testq %r10, %r10
je 0x78b5d
movl 0xc(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xc(%rbx)
movq (%rsp), %rdx
cmpl 0x20(%rdx), %ecx
jne 0x78bd6
cmpq %rbx, 0x28(%r14)
je 0x78bed
movq %r14, %rax
subq (%r15), %rax
addq $-0x120, %rax           # imm = 0xFEE0
movl $0x98, %ecx
cqto
idivq %rcx
imulq $0x68, %rax, %rax
cmpl $0x1, 0x20(%rax,%r12)
je 0x78bf2
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7bce6
jmp 0x78bf2
testl %eax, %eax
jne 0x78c05
cmpq %rbx, 0x28(%r14)
je 0x78c05
movq %rbx, %rdi
movq %r14, %rsi
callq 0x78db3
jmp 0x78c05
andq $0x0, 0x28(%r14)
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x78c21
movq 0x10(%rsp), %rax
subq %rax, 0x50(%r14)
incq 0x60(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq