// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/arena.c
// Function: arena_dalloc_bin_run
static void
arena_dalloc_bin_run(arena_t *arena, arena_chunk_t *chunk, arena_run_t *run,
    arena_bin_t *bin)
{
	size_t binind;
	arena_bin_info_t *bin_info;
	size_t npages, run_ind, past;

	assert(run != bin->runcur);
	assert(arena_run_tree_search(&bin->runs,
	    arena_mapp_get(chunk, ((uintptr_t)run-(uintptr_t)chunk)>>LG_PAGE))
	    == NULL);

	binind = arena_bin_index(chunk->arena, run->bin);
	bin_info = &arena_bin_info[binind];

	malloc_mutex_unlock(&bin->lock);
	/******************************/
	npages = bin_info->run_size >> LG_PAGE;
	run_ind = (size_t)(((uintptr_t)run - (uintptr_t)chunk) >> LG_PAGE);
	past = (size_t)(PAGE_CEILING((uintptr_t)run +
	    (uintptr_t)bin_info->reg0_offset + (uintptr_t)(run->nextind *
	    bin_info->reg_interval - bin_info->redzone_size) -
	    (uintptr_t)chunk) >> LG_PAGE);
	malloc_mutex_lock(&arena->lock);

	/*
	 * If the run was originally clean, and some pages were never touched,
	 * trim the clean pages before deallocating the dirty portion of the
	 * run.
	 */
	assert(arena_mapbits_dirty_get(chunk, run_ind) ==
	    arena_mapbits_dirty_get(chunk, run_ind+npages-1));
	if (arena_mapbits_dirty_get(chunk, run_ind) == 0 && past - run_ind <
	    npages) {
		/* Trim clean pages.  Convert to large run beforehand. */
		assert(npages > 0);
		arena_mapbits_large_set(chunk, run_ind, bin_info->run_size, 0);
		arena_mapbits_large_set(chunk, run_ind+npages-1, 0, 0);
		arena_run_trim_tail(arena, chunk, run, (npages << LG_PAGE),
		    ((past - run_ind) << LG_PAGE), false);
		/* npages = past - run_ind; */
	}
	arena_run_dalloc(arena, run, true, false);
	malloc_mutex_unlock(&arena->lock);
	/****************************/
	malloc_mutex_lock(&bin->lock);
	if (config_stats)
		bin->stats.curruns--;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
jmp 0xb70fa
jmp 0xb70fc
jmp 0xb70fe
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0xba070
movq %rax, -0x28(%rbp)
leaq 0x71434(%rip), %rax     # 0x128550
imulq $0x68, -0x28(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0xb5ee0
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0xc, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
shrq $0xc, %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x64(%rcx), %ecx
addq %rcx, %rax
movq -0x18(%rbp), %rcx
movl 0x8(%rcx), %ecx
movq -0x30(%rbp), %rdx
imulq 0x10(%rdx), %rcx
movq -0x30(%rbp), %rdx
subq 0x8(%rdx), %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
addq $0xfff, %rax            # imm = 0xFFF
andq $-0x1000, %rax          # imm = 0xF000
shrq $0xc, %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0xb5d20
jmp 0xb71a7
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xb9ad0
cmpq $0x0, %rax
jne 0xb7229
movq -0x48(%rbp), %rax
subq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0xb7229
jmp 0xb71ca
jmp 0xb71cc
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0xbbdd0
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq -0x38(%rbp), %rsi
subq $0x1, %rsi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0xbbdd0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rcx
shlq $0xc, %rcx
movq -0x48(%rbp), %r8
subq -0x40(%rbp), %r8
shlq $0xc, %r8
xorl %r9d, %r9d
callq 0xb6c10
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xb7540
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0xb5ee0
movq -0x20(%rbp), %rdi
callq 0xb5d20
movq -0x20(%rbp), %rax
movq 0x90(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x90(%rax)
addq $0x50, %rsp
popq %rbp
retq
nop