// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/jemalloc/src/arena.c
// Function: je_arena_chunk_ralloc_huge_expand
bool
arena_chunk_ralloc_huge_expand(arena_t *arena, void *chunk, size_t oldsize,
    size_t usize, bool *zero)
{
	bool err;
	chunk_hooks_t chunk_hooks = chunk_hooks_get(arena);
	void *nchunk = (void *)((uintptr_t)chunk + CHUNK_CEILING(oldsize));
	size_t udiff = usize - oldsize;
	size_t cdiff = CHUNK_CEILING(usize) - CHUNK_CEILING(oldsize);

	malloc_mutex_lock(&arena->lock);

	/* Optimistically update stats. */
	if (config_stats) {
		arena_huge_ralloc_stats_update(arena, oldsize, usize);
		arena->stats.mapped += cdiff;
	}
	arena->nactive += (udiff >> LG_PAGE);

	err = (chunk_alloc_cache(arena, &arena->chunk_hooks, nchunk, cdiff,
	    chunksize, zero, true) == NULL);
	malloc_mutex_unlock(&arena->lock);
	if (err) {
		err = arena_chunk_ralloc_huge_expand_hard(arena, &chunk_hooks,
		    chunk, oldsize, usize, zero, nchunk, udiff,
		    cdiff);
	} else if (chunk_hooks.merge(chunk, CHUNK_CEILING(oldsize), nchunk,
	    cdiff, true, arena->ind)) {
		chunk_dalloc_arena(arena, &chunk_hooks, nchunk, cdiff, *zero,
		    true);
		err = true;
	}

	if (config_stats && !err)
		stats_cactive_add(udiff);
	return (err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x50010
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
leaq 0x65b25(%rip), %rdx     # 0xa2730
addq (%rdx), %rcx
leaq 0x65b1b(%rip), %rdx     # 0xa2730
movq (%rdx), %rdx
xorq $-0x1, %rdx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rax
leaq 0x65af3(%rip), %rcx     # 0xa2730
addq (%rcx), %rax
leaq 0x65ae9(%rip), %rcx     # 0xa2730
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq -0x18(%rbp), %rcx
leaq 0x65ad4(%rip), %rdx     # 0xa2730
addq (%rdx), %rcx
leaq 0x65aca(%rip), %rdx     # 0xa2730
movq (%rdx), %rdx
xorq $-0x1, %rdx
andq %rdx, %rcx
subq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x3c3a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x3ca50
movq -0x80(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x30(%rax), %rcx
movq %rcx, 0x30(%rax)
movq -0x78(%rbp), %rcx
shrq $0xc, %rcx
movq -0x8(%rbp), %rax
addq 0xe0(%rax), %rcx
movq %rcx, 0xe0(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x418, %rsi            # imm = 0x418
movq -0x70(%rbp), %rdx
movq -0x80(%rbp), %rcx
leaq 0x65a4b(%rip), %rax     # 0xa2728
movq (%rax), %r8
movq -0x28(%rbp), %r9
movl $0x1, (%rsp)
callq 0x50480
cmpq $0x0, %rax
sete %al
andb $0x1, %al
movb %al, -0x29(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x3c3c0
testb $0x1, -0x29(%rbp)
je 0x3cd4d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %r9
movq -0x70(%rbp), %r11
movq -0x78(%rbp), %r10
movq -0x80(%rbp), %rax
leaq -0x68(%rbp), %rsi
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x3cde0
andb $0x1, %al
movb %al, -0x29(%rbp)
jmp 0x3cdbe
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq 0x659d0(%rip), %rcx     # 0xa2730
addq (%rcx), %rsi
leaq 0x659c6(%rip), %rcx     # 0xa2730
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rsi
movq -0x70(%rbp), %rdx
movq -0x80(%rbp), %rcx
movq -0x8(%rbp), %r8
movl (%r8), %r9d
movl $0x1, %r8d
callq *%rax
testb $0x1, %al
jne 0x3cd91
jmp 0x3cdbc
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rdx
movq -0x80(%rbp), %rcx
movq -0x28(%rbp), %rax
movb (%rax), %al
leaq -0x68(%rbp), %rsi
movl $0x1, %r9d
andb $0x1, %al
movzbl %al, %r8d
callq 0x51470
movb $0x1, -0x29(%rbp)
jmp 0x3cdbe
testb $0x1, -0x29(%rbp)
jne 0x3cdcd
movq -0x78(%rbp), %rdi
callq 0x3c770
movb -0x29(%rbp), %al
andb $0x1, %al
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)