// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: arena_chunk_discard
static void
arena_chunk_discard(tsdn_t *tsdn, arena_t *arena, arena_chunk_t *chunk)
{
	size_t sn, hugepage;
	bool committed;
	chunk_hooks_t chunk_hooks = CHUNK_HOOKS_INITIALIZER;

	chunk_deregister(chunk, &chunk->node);

	sn = extent_node_sn_get(&chunk->node);
	hugepage = chunk->hugepage;
	committed = (arena_mapbits_decommitted_get(chunk, map_bias) == 0);
	if (!committed) {
		/*
		 * Decommit the header.  Mark the chunk as decommitted even if
		 * header decommit fails, since treating a partially committed
		 * chunk as committed has a high potential for causing later
		 * access of decommitted memory.
		 */
		chunk_hooks = chunk_hooks_get(tsdn, arena);
		chunk_hooks.decommit(chunk, chunksize, 0, map_bias << LG_PAGE,
		    arena->ind);
	}
	if (!hugepage) {
		/*
		 * Convert chunk back to the default state, so that all
		 * subsequent chunk allocations start out with chunks that can
		 * be backed by transparent huge pages.
		 */
		pages_huge(chunk, chunksize);
	}

	chunk_dalloc_cache(tsdn, arena, &chunk_hooks, (void *)chunk, chunksize,
	    sn, committed);

	if (config_stats) {
		arena->stats.mapped -= chunksize;
		arena->stats.metadata_mapped -= (map_bias << LG_PAGE);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x68(%rbp)
movq %rsi, -0x70(%rbp)
movq %rdx, -0x78(%rbp)
leaq -0xc8(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0xb210
movq -0x78(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x51810
movq -0x78(%rbp), %rdi
callq 0x499c0
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rax
movb 0x70(%rax), %al
andb $0x1, %al
movzbl %al, %eax
movq %rax, -0x88(%rbp)
movq -0x78(%rbp), %rcx
movq 0x67ace(%rip), %rax     # 0xa3fa0
movq %rcx, -0x50(%rbp)
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, -0x8(%rbp)
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x78, %rax
movq -0x10(%rbp), %rcx
subq 0x67a73(%rip), %rcx     # 0xa3fa0
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
andq $0x4, %rax
cmpq $0x0, %rax
sete %al
andb $0x1, %al
movb %al, -0x89(%rbp)
testb $0x1, -0x89(%rbp)
jne 0x3c5ba
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq -0x100(%rbp), %rdi
callq 0x51160
leaq -0xc8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
movl $0x38, %edx
callq 0xb310
movq -0xb0(%rbp), %rax
movq -0x78(%rbp), %rdi
leaq 0x67b07(%rip), %rcx     # 0xa40a8
movq (%rcx), %rsi
movq 0x679f5(%rip), %rcx     # 0xa3fa0
shlq $0xc, %rcx
movq -0x70(%rbp), %rdx
movl (%rdx), %r8d
xorl %edx, %edx
callq *%rax
cmpq $0x0, -0x88(%rbp)
jne 0x3c5d7
movq -0x78(%rbp), %rdi
leaq 0x67ad9(%rip), %rax     # 0xa40a8
movq (%rax), %rsi
callq 0x67240
movq -0x68(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x78(%rbp), %rcx
leaq 0x67abe(%rip), %rax     # 0xa40a8
movq (%rax), %r8
movq -0x80(%rbp), %r9
movb -0x89(%rbp), %al
leaq -0xc8(%rbp), %rdx
andb $0x1, %al
movzbl %al, %eax
movl %eax, (%rsp)
callq 0x523b0
leaq 0x67a96(%rip), %rax     # 0xa40a8
movq (%rax), %rdx
movq -0x70(%rbp), %rax
movq 0x60(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x60(%rax)
movq 0x67975(%rip), %rdx     # 0xa3fa0
shlq $0xc, %rdx
movq -0x70(%rbp), %rax
movq 0x88(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x88(%rax)
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopl (%rax)