// File: /workspace/github_c_makefile_star2_O3/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, %r12
movq %rdx, %rbp
movq %rsi, 0x18(%rsp)
movq %rdi, %rbx
leaq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0x2e354
leaq 0x3406d(%rip), %rax     # 0x5b6b0
movq (%rax), %r14
leaq (%r14,%rbp), %r13
movq %r14, %rax
notq %rax
andq %rax, %r13
movq %r12, %r15
subq %rbp, %r15
addq %r12, %r14
andq %rax, %r14
subq %r13, %r14
addq 0x18(%rsp), %r13
leaq 0x8(%rbx), %rdi
movq %rdi, 0x48(%rsp)
callq 0x106d0
movq %rbx, %rdi
movq %rbp, 0x38(%rsp)
movq %rbp, %rsi
callq 0x27415
movq %rbx, %rdi
movq %r12, 0x30(%rsp)
movq %r12, %rsi
callq 0x272ed
addq %r14, 0x30(%rbx)
movq %r15, 0x40(%rsp)
shrq $0xc, %r15
addq %r15, 0xe0(%rbx)
leaq 0x418(%rbx), %rsi
leaq 0x33ff1(%rip), %rbp     # 0x5b6a8
movq (%rbp), %r8
movl $0x1, (%rsp)
movq %rbx, %rdi
movq %r13, 0x10(%rsp)
movq %r13, %rdx
movq %r14, %rcx
movq 0x20(%rsp), %r9
callq 0x2e5fb
movq %rax, %r12
movq 0x48(%rsp), %rdi
movq %rdi, %r13
callq 0x10440
testq %r12, %r12
je 0x2770e
movq 0x20(%rsp), %r15
leaq 0x33fb5(%rip), %rax     # 0x5b6b0
movq (%rax), %rsi
movq 0x38(%rsp), %rax
addq %rsi, %rax
notq %rsi
andq %rax, %rsi
jmp 0x2775f
movq %r15, 0x28(%rsp)
movq %rbp, %rcx
movq 0x38(%rsp), %rbp
leaq 0xf(%rsp), %rax
movb $0x1, (%rax)
movq (%rcx), %r8
movq %rax, (%rsp)
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
movq 0x10(%rsp), %rdx
movq %r14, %rcx
movq 0x20(%rsp), %r15
movq %r15, %r9
callq 0x2ead2
testq %rax, %rax
je 0x277bc
leaq 0x33f5d(%rip), %rax     # 0x5b6b0
movq (%rax), %rsi
addq %rsi, %rbp
notq %rsi
andq %rbp, %rsi
movl (%rbx), %r9d
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rdx
movq %r14, %rcx
movl $0x1, %r8d
callq *0x80(%rsp)
testb %al, %al
je 0x277a4
movzbl (%r15), %r8d
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
movq 0x10(%rsp), %rdx
movq %r14, %rcx
movl $0x1, %r9d
callq 0x2ef44
jmp 0x27842
leaq 0x345fd(%rip), %rax     # 0x5bda8
movq 0x40(%rsp), %rcx
lock
xaddq %rcx, (%rax)
xorl %eax, %eax
jmp 0x27844
movq %r13, %r15
movq %r13, %rdi
callq 0x106d0
cmpq $0x1000, %rbp           # imm = 0x1000
ja 0x27856
leaq -0x1(%rbp), %rax
shrq $0x3, %rax
leaq 0x207dd(%rip), %rcx     # 0x47fc0
movzbl (%rcx,%rax), %eax
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %r13
subl 0x33d59(%rip), %eax     # 0x5b550
decq 0x90(%rbx)
addq %rbp, 0x80(%rbx)
addl $-0x27, %eax
movq 0xa0(%rbx), %rcx
leaq (%rax,%rax,2), %rax
movdqu 0x8(%rcx,%rax,8), %xmm0
paddq 0x20b8f(%rip), %xmm0    # 0x483b0
movdqu %xmm0, 0x8(%rcx,%rax,8)
movq %rbx, %rdi
callq 0x2b8f7
subq %r14, 0x30(%rbx)
subq %r13, 0xe0(%rbx)
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 %rbp, %rdi
callq 0x2da8d
jmp 0x277e7