// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/jemalloc/src/arena.c
// Function: arena_chunk_dalloc
static void
arena_chunk_dalloc(arena_t *arena, arena_chunk_t *chunk)
{

	assert(arena_mapbits_allocated_get(chunk, map_bias) == 0);
	assert(arena_mapbits_allocated_get(chunk, chunk_npages-1) == 0);
	assert(arena_mapbits_unallocated_size_get(chunk, map_bias) ==
	    arena_maxrun);
	assert(arena_mapbits_unallocated_size_get(chunk, chunk_npages-1) ==
	    arena_maxrun);
	assert(arena_mapbits_dirty_get(chunk, map_bias) ==
	    arena_mapbits_dirty_get(chunk, chunk_npages-1));
	assert(arena_mapbits_decommitted_get(chunk, map_bias) ==
	    arena_mapbits_decommitted_get(chunk, chunk_npages-1));

	/*
	 * Remove run from the runs_avail tree, so that the arena does not use
	 * it.
	 */
	arena_avail_remove(arena, chunk, map_bias, chunk_npages-map_bias);

	if (arena->spare != NULL) {
		arena_chunk_t *spare = arena->spare;
		chunk_hooks_t chunk_hooks = CHUNK_HOOKS_INITIALIZER;
		bool committed;

		arena->spare = chunk;
		if (arena_mapbits_dirty_get(spare, map_bias) != 0) {
			arena_run_dirty_remove(arena, spare, map_bias,
			    chunk_npages-map_bias);
		}

		chunk_deregister(spare, &spare->node);

		committed = (arena_mapbits_decommitted_get(spare, 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(arena);
			chunk_hooks.decommit(spare, chunksize, 0, map_bias <<
			    LG_PAGE, arena->ind);
		}

		chunk_dalloc_cache(arena, &chunk_hooks, (void *)spare,
		    chunksize, committed);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0xa8(%rbp)
movq %rsi, -0xb0(%rbp)
jmp 0x4a41b
jmp 0x4a41d
jmp 0x4a41f
jmp 0x4a421
jmp 0x4a423
jmp 0x4a425
jmp 0x4a427
jmp 0x4a429
jmp 0x4a42b
jmp 0x4a42d
jmp 0x4a42f
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movq 0x58194(%rip), %rdx     # 0xa25d8
leaq 0x582ed(%rip), %rax     # 0xa2738
movq (%rax), %rcx
subq 0x58183(%rip), %rcx     # 0xa25d8
callq 0x47d00
movq -0xa8(%rbp), %rax
cmpq $0x0, 0xc8(%rax)
je 0x4a6d5
movq -0xa8(%rbp), %rax
movq 0xc8(%rax), %rax
movq %rax, -0xb8(%rbp)
leaq -0xf0(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x10250
movq -0xb0(%rbp), %rcx
movq -0xa8(%rbp), %rax
movq %rcx, 0xc8(%rax)
movq -0xb8(%rbp), %rcx
movq 0x5811e(%rip), %rax     # 0xa25d8
movq %rcx, -0x90(%rbp)
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x80(%rbp)
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x68(%rbp)
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rcx
movq -0x70(%rbp), %rax
movq %rcx, -0x58(%rbp)
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
addq $0x68, %rax
movq -0x60(%rbp), %rcx
subq 0x580c1(%rip), %rcx     # 0xa25d8
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
andq $0x10, %rax
cmpq $0x0, %rax
je 0x4a56c
movq -0xa8(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movq 0x58082(%rip), %rdx     # 0xa25d8
leaq 0x581db(%rip), %rax     # 0xa2738
movq (%rax), %rcx
subq 0x58071(%rip), %rcx     # 0xa25d8
callq 0x47d70
movq -0xb8(%rbp), %rdi
movq -0xb8(%rbp), %rsi
callq 0x503c0
movq -0xb8(%rbp), %rcx
movq 0x5804b(%rip), %rax     # 0xa25d8
movq %rcx, -0x40(%rbp)
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rcx
movq -0x38(%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 $0x68, %rax
movq -0x10(%rbp), %rcx
subq 0x58000(%rip), %rcx     # 0xa25d8
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
andq $0x4, %rax
cmpq $0x0, %rax
sete %al
andb $0x1, %al
movb %al, -0xf1(%rbp)
testb $0x1, -0xf1(%rbp)
jne 0x4a66a
movq -0xa8(%rbp), %rsi
leaq -0x130(%rbp), %rdi
callq 0x50010
leaq -0xf0(%rbp), %rdi
leaq -0x130(%rbp), %rsi
movl $0x38, %edx
callq 0x103b0
movq -0xd8(%rbp), %rax
movq -0xb8(%rbp), %rdi
leaq 0x580da(%rip), %rcx     # 0xa2728
movq (%rcx), %rsi
movq 0x57f80(%rip), %rcx     # 0xa25d8
shlq $0xc, %rcx
movq -0xa8(%rbp), %rdx
movl (%rdx), %r8d
xorl %edx, %edx
callq *%rax
movq -0xa8(%rbp), %rdi
movq -0xb8(%rbp), %rdx
leaq 0x580a9(%rip), %rax     # 0xa2728
movq (%rax), %rcx
movb -0xf1(%rbp), %al
leaq -0xf0(%rbp), %rsi
andb $0x1, %al
movzbl %al, %r8d
callq 0x50ea0
leaq 0x58087(%rip), %rax     # 0xa2728
movq (%rax), %rdx
movq -0xa8(%rbp), %rax
movq 0x30(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x30(%rax)
movq 0x57f1b(%rip), %rdx     # 0xa25d8
shlq $0xc, %rdx
movq -0xa8(%rbp), %rax
movq 0x50(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x50(%rax)
jmp 0x4a6ea
movq -0xb0(%rbp), %rcx
movq -0xa8(%rbp), %rax
movq %rcx, 0xc8(%rax)
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw %cs:(%rax,%rax)