// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r8, 0x20(%rsp)
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, 0x18(%rsp)
movq %rdi, %rbp
leaq 0x50(%rsp), %rdi
movq %rbp, %rsi
callq 0x28d7d
leaq 0x34f97(%rip), %rax     # 0x576b0
movq (%rax), %r12
leaq (%r12,%r14), %r13
movq %r12, %rax
notq %rax
andq %rax, %r13
movq %rbx, %r15
subq %r14, %r15
addq %rbx, %r12
andq %rax, %r12
subq %r13, %r12
addq 0x18(%rsp), %r13
leaq 0x8(%rbp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x106d0
movq %rbp, %rdi
movq %r14, 0x38(%rsp)
movq %r14, %rsi
movq %rbx, 0x30(%rsp)
movq %rbx, %rdx
callq 0x225dc
addq %r12, 0x30(%rbp)
movq %r15, 0x40(%rsp)
shrq $0xc, %r15
addq %r15, 0xe0(%rbp)
leaq 0x418(%rbp), %rsi
leaq 0x34f23(%rip), %r14     # 0x576a8
movq (%r14), %r8
movl $0x1, (%rsp)
movq %rbp, %rdi
movq %r13, 0x10(%rsp)
movq %r13, %rdx
movq %r12, %rcx
movq 0x20(%rsp), %r9
callq 0x28fe6
movq %rax, %rbx
movq 0x48(%rsp), %rdi
movq %rdi, %r13
callq 0x10440
testq %rbx, %rbx
je 0x2281a
movq 0x20(%rsp), %r15
leaq 0x34ee8(%rip), %rax     # 0x576b0
movq (%rax), %rsi
movq 0x38(%rsp), %rax
addq %rsi, %rax
notq %rsi
andq %rax, %rsi
movl (%rbp), %r9d
pushq $0x1
popq %r8
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
movq %r12, %rcx
callq *0x80(%rsp)
testb %al, %al
je 0x228b7
movzbl (%r15), %r8d
leaq 0x50(%rsp), %rsi
pushq $0x1
popq %r9
movq %rbp, %rdi
movq 0x10(%rsp), %rdx
movq %r12, %rcx
jmp 0x228ad
movq %r15, 0x28(%rsp)
movq %r14, %rcx
movq 0x38(%rsp), %r14
movq %r13, %r15
leaq 0xf(%rsp), %rax
movb $0x1, (%rax)
movq (%rcx), %r8
movq %rax, (%rsp)
leaq 0x50(%rsp), %rsi
movq %rbp, %rdi
movq 0x10(%rsp), %rdx
movq %r12, %rcx
movq 0x20(%rsp), %rbx
movq %rbx, %r9
callq 0x294b0
testq %rax, %rax
movq %rbx, %r13
movq %r12, %rbx
je 0x228cf
leaq 0x34e48(%rip), %rax     # 0x576b0
movq (%rax), %rsi
addq %rsi, %r14
notq %rsi
andq %r14, %rsi
movl (%rbp), %r9d
pushq $0x1
popq %r8
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
movq %rbx, %rcx
callq *0x80(%rsp)
testb %al, %al
je 0x228b7
movzbl (%r13), %r8d
leaq 0x50(%rsp), %rsi
pushq $0x1
popq %r9
movq %rbp, %rdi
movq 0x10(%rsp), %rdx
movq %rbx, %rcx
callq 0x2983a
jmp 0x22956
leaq 0x354ea(%rip), %rax     # 0x57da8
movq 0x40(%rsp), %rcx
lock
xaddq %rcx, (%rax)
xorl %eax, %eax
jmp 0x22958
movq %r15, %rdi
callq 0x106d0
movq %r14, %r12
cmpq $0x1000, %r14           # imm = 0x1000
ja 0x2296a
leaq -0x1(%r12), %rax
shrq $0x3, %rax
leaq 0x20209(%rip), %rcx     # 0x42b00
movzbl (%rcx,%rax), %eax
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %r14
subl 0x34c45(%rip), %eax     # 0x57550
decq 0x90(%rbp)
addq %r12, 0x80(%rbp)
addl $-0x27, %eax
movq 0xa0(%rbp), %rcx
imulq $0x18, %rax, %rax
movdqu 0x8(%rcx,%rax), %xmm0
paddq 0x205cb(%rip), %xmm0    # 0x42f00
movdqu %xmm0, 0x8(%rcx,%rax)
movq %rbp, %rdi
callq 0x266c6
subq %rbx, 0x30(%rbp)
subq %r14, 0xe0(%rbp)
movq %r15, %rdi
callq 0x10440
movb $0x1, %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x284a4
jmp 0x228fb