// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: arena_run_dalloc
static void
arena_run_dalloc(tsdn_t *tsdn, arena_t *arena, arena_run_t *run, bool dirty,
    bool cleaned, bool decommitted)
{
	arena_chunk_t *chunk;
	arena_chunk_map_misc_t *miscelm;
	size_t size, run_ind, run_pages, flag_dirty, flag_decommitted;

	chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(run);
	miscelm = arena_run_to_miscelm(run);
	run_ind = arena_miscelm_to_pageind(miscelm);
	assert(run_ind >= map_bias);
	assert(run_ind < chunk_npages);
	size = arena_run_size_get(arena, chunk, run, run_ind);
	run_pages = (size >> LG_PAGE);
	arena_nactive_sub(arena, run_pages);

	/*
	 * The run is dirty if the caller claims to have dirtied it, as well as
	 * if it was already dirty before being allocated and the caller
	 * doesn't claim to have cleaned it.
	 */
	assert(arena_mapbits_dirty_get(chunk, run_ind) ==
	    arena_mapbits_dirty_get(chunk, run_ind+run_pages-1));
	if (!cleaned && !decommitted && arena_mapbits_dirty_get(chunk, run_ind)
	    != 0)
		dirty = true;
	flag_dirty = dirty ? CHUNK_MAP_DIRTY : 0;
	flag_decommitted = decommitted ? CHUNK_MAP_DECOMMITTED : 0;

	/* Mark pages as unallocated in the chunk map. */
	if (dirty || decommitted) {
		size_t flags = flag_dirty | flag_decommitted;
		arena_mapbits_unallocated_set(chunk, run_ind, size, flags);
		arena_mapbits_unallocated_set(chunk, run_ind+run_pages-1, size,
		    flags);
	} else {
		arena_mapbits_unallocated_set(chunk, run_ind, size,
		    arena_mapbits_unzeroed_get(chunk, run_ind));
		arena_mapbits_unallocated_set(chunk, run_ind+run_pages-1, size,
		    arena_mapbits_unzeroed_get(chunk, run_ind+run_pages-1));
	}

	arena_run_coalesce(arena, chunk, &size, &run_ind, &run_pages,
	    flag_dirty, flag_decommitted);

	/* Insert into runs_avail, now that coalescing is complete. */
	assert(arena_mapbits_unallocated_size_get(chunk, run_ind) ==
	    arena_mapbits_unallocated_size_get(chunk, run_ind+run_pages-1));
	assert(arena_mapbits_dirty_get(chunk, run_ind) ==
	    arena_mapbits_dirty_get(chunk, run_ind+run_pages-1));
	assert(arena_mapbits_decommitted_get(chunk, run_ind) ==
	    arena_mapbits_decommitted_get(chunk, run_ind+run_pages-1));
	arena_avail_insert(arena, chunk, run_ind, run_pages);

	if (dirty)
		arena_run_dirty_insert(arena, chunk, run_ind, run_pages);

	/* Deallocate chunk if it is now completely unused. */
	if (size == arena_maxrun) {
		assert(run_ind == map_bias);
		assert(run_pages == (arena_maxrun >> LG_PAGE));
		arena_chunk_dalloc(tsdn, arena, chunk);
	}

	/*
	 * It is okay to do dirty page processing here even if the chunk was
	 * deallocated above, since in that case it is the spare.  Waiting
	 * until after possible chunk deallocation to do dirty processing
	 * allows for an old spare to be fully deallocated, thus decreasing the
	 * chances of spuriously crossing the dirty page purging threshold.
	 */
	if (dirty)
		arena_maybe_purge(tsdn, arena);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movl %r8d, -0x360(%rbp)
movl %ecx, %eax
movl -0x360(%rbp), %ecx
movl %eax, -0x35c(%rbp)
movq %rdx, %rax
movl -0x35c(%rbp), %edx
movq %rax, -0x358(%rbp)
movq %rsi, %rax
movq -0x358(%rbp), %rsi
movq %rax, -0x350(%rbp)
movq %rdi, %r8
movq -0x350(%rbp), %rdi
movb %r9b, %al
movq %r8, -0x2f0(%rbp)
movq %rdi, -0x2f8(%rbp)
movq %rsi, -0x300(%rbp)
andb $0x1, %dl
movb %dl, -0x301(%rbp)
andb $0x1, %cl
movb %cl, -0x302(%rbp)
andb $0x1, %al
movb %al, -0x303(%rbp)
movq -0x300(%rbp), %rax
leaq 0x5a5d5(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x310(%rbp)
movq -0x300(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movq -0x2e0(%rbp), %rax
subq $0x18, %rax
movq %rax, -0x2e8(%rbp)
movq -0x2e8(%rbp), %rax
movq %rax, -0x318(%rbp)
movq -0x318(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq -0x2c8(%rbp), %rax
leaq 0x5a57a(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x2d0(%rbp)
movq -0x2c8(%rbp), %rax
movq -0x2d0(%rbp), %rcx
addq 0x5a44c(%rip), %rcx     # 0xa3fa8
subq %rcx, %rax
movl $0x60, %ecx
xorl %edx, %edx
divq %rcx
addq 0x5a430(%rip), %rax     # 0xa3fa0
movq %rax, -0x2d8(%rbp)
movq -0x2d8(%rbp), %rax
movq %rax, -0x328(%rbp)
jmp 0x49b87
jmp 0x49b89
jmp 0x49b8b
movq -0x2f8(%rbp), %rdi
movq -0x310(%rbp), %rsi
movq -0x300(%rbp), %rdx
movq -0x328(%rbp), %rcx
callq 0x4a330
movq %rax, -0x320(%rbp)
movq -0x320(%rbp), %rax
shrq $0xc, %rax
movq %rax, -0x330(%rbp)
movq -0x2f8(%rbp), %rdi
movq -0x330(%rbp), %rsi
callq 0x3ad10
jmp 0x49bda
testb $0x1, -0x302(%rbp)
jne 0x49cd0
testb $0x1, -0x303(%rbp)
jne 0x49cd0
movq -0x310(%rbp), %rcx
movq -0x328(%rbp), %rax
movq %rcx, -0x110(%rbp)
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rcx
movq -0x118(%rbp), %rax
movq %rcx, -0x100(%rbp)
movq %rax, -0x108(%rbp)
movq -0x100(%rbp), %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0xe8(%rbp)
movq %rax, -0xf0(%rbp)
movq -0xe8(%rbp), %rcx
movq -0xf0(%rbp), %rax
movq %rcx, -0xd8(%rbp)
movq %rax, -0xe0(%rbp)
movq -0xd8(%rbp), %rcx
movq -0xe0(%rbp), %rax
movq %rcx, -0xc8(%rbp)
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rax
addq $0x78, %rax
movq -0xd0(%rbp), %rcx
subq 0x5a307(%rip), %rcx     # 0xa3fa0
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rax
andq $0x10, %rax
cmpq $0x0, %rax
je 0x49cd0
movb $0x1, -0x301(%rbp)
movb -0x301(%rbp), %dl
xorl %eax, %eax
movl $0x10, %ecx
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, -0x338(%rbp)
movb -0x303(%rbp), %dl
xorl %eax, %eax
movl $0x4, %ecx
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, -0x340(%rbp)
testb $0x1, -0x301(%rbp)
jne 0x49d1c
testb $0x1, -0x303(%rbp)
je 0x49f21
movq -0x338(%rbp), %rax
orq -0x340(%rbp), %rax
movq %rax, -0x348(%rbp)
movq -0x310(%rbp), %rsi
movq -0x328(%rbp), %rdx
movq -0x320(%rbp), %rcx
movq -0x348(%rbp), %rax
movq %rsi, -0x1c8(%rbp)
movq %rdx, -0x1d0(%rbp)
movq %rcx, -0x1d8(%rbp)
movq %rax, -0x1e0(%rbp)
movq -0x1c8(%rbp), %rcx
movq -0x1d0(%rbp), %rax
movq %rcx, -0x1b8(%rbp)
movq %rax, -0x1c0(%rbp)
movq -0x1b8(%rbp), %rcx
movq -0x1c0(%rbp), %rax
movq %rcx, -0x1a8(%rbp)
movq %rax, -0x1b0(%rbp)
movq -0x1a8(%rbp), %rax
addq $0x78, %rax
movq -0x1b0(%rbp), %rcx
subq 0x5a1e6(%rip), %rcx     # 0xa3fa0
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x1e8(%rbp)
movq -0x1e8(%rbp), %rcx
movq -0x1d8(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
shlq %rax
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rax
orq $0x1fe0, %rax           # imm = 0x1FE0
orq -0x1e0(%rbp), %rax
movq %rcx, -0x198(%rbp)
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rcx
movq -0x198(%rbp), %rax
movq %rcx, (%rax)
movq -0x310(%rbp), %rsi
movq -0x328(%rbp), %rdx
addq -0x330(%rbp), %rdx
subq $0x1, %rdx
movq -0x320(%rbp), %rcx
movq -0x348(%rbp), %rax
movq %rsi, -0x210(%rbp)
movq %rdx, -0x218(%rbp)
movq %rcx, -0x220(%rbp)
movq %rax, -0x228(%rbp)
movq -0x210(%rbp), %rcx
movq -0x218(%rbp), %rax
movq %rcx, -0x200(%rbp)
movq %rax, -0x208(%rbp)
movq -0x200(%rbp), %rcx
movq -0x208(%rbp), %rax
movq %rcx, -0x1f0(%rbp)
movq %rax, -0x1f8(%rbp)
movq -0x1f0(%rbp), %rax
addq $0x78, %rax
movq -0x1f8(%rbp), %rcx
subq 0x5a0eb(%rip), %rcx     # 0xa3fa0
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x230(%rbp)
movq -0x230(%rbp), %rcx
movq -0x220(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rax
shlq %rax
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rax
orq $0x1fe0, %rax           # imm = 0x1FE0
orq -0x228(%rbp), %rax
movq %rcx, -0x188(%rbp)
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rcx
movq -0x188(%rbp), %rax
movq %rcx, (%rax)
jmp 0x4a247
movq -0x310(%rbp), %rsi
movq -0x328(%rbp), %rdx
movq -0x320(%rbp), %rcx
movq -0x310(%rbp), %rdi
movq -0x328(%rbp), %rax
movq %rdi, -0x50(%rbp)
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rax
movq %rdi, -0x40(%rbp)
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rax
movq %rdi, -0x28(%rbp)
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rax
movq %rdi, -0x18(%rbp)
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x78, %rax
movq -0x10(%rbp), %rdi
subq 0x5a001(%rip), %rdi     # 0xa3fa0
shlq $0x3, %rdi
addq %rdi, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
andq $0x8, %rax
movq %rsi, -0x258(%rbp)
movq %rdx, -0x260(%rbp)
movq %rcx, -0x268(%rbp)
movq %rax, -0x270(%rbp)
movq -0x258(%rbp), %rcx
movq -0x260(%rbp), %rax
movq %rcx, -0x248(%rbp)
movq %rax, -0x250(%rbp)
movq -0x248(%rbp), %rcx
movq -0x250(%rbp), %rax
movq %rcx, -0x238(%rbp)
movq %rax, -0x240(%rbp)
movq -0x238(%rbp), %rax
addq $0x78, %rax
movq -0x240(%rbp), %rcx
subq 0x59f76(%rip), %rcx     # 0xa3fa0
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rcx
movq -0x268(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rax
shlq %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
orq $0x1fe0, %rax           # imm = 0x1FE0
orq -0x270(%rbp), %rax
movq %rcx, -0x178(%rbp)
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rcx
movq -0x178(%rbp), %rax
movq %rcx, (%rax)
movq -0x310(%rbp), %rsi
movq -0x328(%rbp), %rdx
addq -0x330(%rbp), %rdx
subq $0x1, %rdx
movq -0x320(%rbp), %rcx
movq -0x310(%rbp), %rdi
movq -0x328(%rbp), %rax
addq -0x330(%rbp), %rax
subq $0x1, %rax
movq %rdi, -0xb0(%rbp)
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rax
movq %rdi, -0xa0(%rbp)
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rdi
movq -0xa8(%rbp), %rax
movq %rdi, -0x88(%rbp)
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %rax
movq %rdi, -0x78(%rbp)
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rax
movq %rdi, -0x68(%rbp)
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rax
addq $0x78, %rax
movq -0x70(%rbp), %rdi
subq 0x59e57(%rip), %rdi     # 0xa3fa0
shlq $0x3, %rdi
addq %rdi, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
andq $0x8, %rax
movq %rsi, -0x2a0(%rbp)
movq %rdx, -0x2a8(%rbp)
movq %rcx, -0x2b0(%rbp)
movq %rax, -0x2b8(%rbp)
movq -0x2a0(%rbp), %rcx
movq -0x2a8(%rbp), %rax
movq %rcx, -0x290(%rbp)
movq %rax, -0x298(%rbp)
movq -0x290(%rbp), %rcx
movq -0x298(%rbp), %rax
movq %rcx, -0x280(%rbp)
movq %rax, -0x288(%rbp)
movq -0x280(%rbp), %rax
addq $0x78, %rax
movq -0x288(%rbp), %rcx
subq 0x59dc0(%rip), %rcx     # 0xa3fa0
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x2c0(%rbp)
movq -0x2c0(%rbp), %rcx
movq -0x2b0(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
shlq %rax
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rax
orq $0x1fe0, %rax           # imm = 0x1FE0
orq -0x2b8(%rbp), %rax
movq %rcx, -0x168(%rbp)
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rcx
movq -0x168(%rbp), %rax
movq %rcx, (%rax)
movq -0x2f8(%rbp), %rdi
movq -0x310(%rbp), %rsi
movq -0x338(%rbp), %r9
movq -0x340(%rbp), %rax
leaq -0x320(%rbp), %rdx
leaq -0x328(%rbp), %rcx
leaq -0x330(%rbp), %r8
movq %rax, (%rsp)
callq 0x4a520
jmp 0x4a283
jmp 0x4a285
jmp 0x4a287
jmp 0x4a289
jmp 0x4a28b
movq -0x2f8(%rbp), %rdi
movq -0x310(%rbp), %rsi
movq -0x328(%rbp), %rdx
movq -0x330(%rbp), %rcx
callq 0x466a0
testb $0x1, -0x301(%rbp)
je 0x4a2d6
movq -0x2f8(%rbp), %rdi
movq -0x310(%rbp), %rsi
movq -0x328(%rbp), %rdx
movq -0x330(%rbp), %rcx
callq 0x48130
movq -0x320(%rbp), %rax
cmpq 0x59ccc(%rip), %rax     # 0xa3fb0
jne 0x4a308
jmp 0x4a2e8
jmp 0x4a2ea
jmp 0x4a2ec
jmp 0x4a2ee
movq -0x2f0(%rbp), %rdi
movq -0x2f8(%rbp), %rsi
movq -0x310(%rbp), %rdx
callq 0x4b250
testb $0x1, -0x301(%rbp)
je 0x4a324
movq -0x2f0(%rbp), %rdi
movq -0x2f8(%rbp), %rsi
callq 0x3b4d0
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
nopl (%rax)