// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/arena.c
// Function: je_arena_chunk_ralloc_huge_expand
bool
arena_chunk_ralloc_huge_expand(tsdn_t *tsdn, arena_t *arena, void *chunk,
    size_t oldsize, size_t usize, bool *zero)
{
	bool err;
	chunk_hooks_t chunk_hooks = chunk_hooks_get(tsdn, arena);
	void *nchunk = (void *)((uintptr_t)chunk + CHUNK_CEILING(oldsize));
	size_t udiff = usize - oldsize;
	size_t cdiff = CHUNK_CEILING(usize) - CHUNK_CEILING(oldsize);
	size_t sn;
	bool commit = true;

	malloc_mutex_lock(tsdn, &arena->lock);

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

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

	return (err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xc0, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq %r8, -0x38(%rbp)
movq %r9, -0x40(%rbp)
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0x51160
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
leaq 0x6909a(%rip), %rdx     # 0xa40b0
addq (%rdx), %rcx
leaq 0x69090(%rip), %rdx     # 0xa40b0
movq (%rdx), %rdx
xorq $-0x1, %rdx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x38(%rbp), %rax
subq -0x30(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x38(%rbp), %rax
leaq 0x69062(%rip), %rcx     # 0xa40b0
addq (%rcx), %rax
leaq 0x69058(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq -0x30(%rbp), %rcx
leaq 0x69043(%rip), %rdx     # 0xa40b0
addq (%rdx), %rcx
leaq 0x69039(%rip), %rdx     # 0xa40b0
movq (%rdx), %rdx
xorq $-0x1, %rdx
andq %rdx, %rcx
subq %rcx, %rax
movq %rax, -0x98(%rbp)
movb $0x1, -0xa1(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x10, %rsi
callq 0x3a660
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x3ae50
movq -0x98(%rbp), %rcx
movq -0x20(%rbp), %rax
addq 0x60(%rax), %rcx
movq %rcx, 0x60(%rax)
movq -0x20(%rbp), %rdi
movq -0x90(%rbp), %rsi
shrq $0xc, %rsi
callq 0x3a9e0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x88(%rbp), %rcx
movq -0x98(%rbp), %r8
leaq 0x68fb0(%rip), %rax     # 0xa40a8
movq (%rax), %r9
movq -0x40(%rbp), %r10
leaq -0x80(%rbp), %rdx
leaq -0xa0(%rbp), %r11
leaq -0xa1(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movl $0x1, 0x18(%rsp)
callq 0x518e0
cmpq $0x0, %rax
sete %al
andb $0x1, %al
movb %al, -0x41(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x10, %rsi
callq 0x3a6b0
testb $0x1, -0x41(%rbp)
je 0x3b1ae
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
movq -0x40(%rbp), %rbx
movq -0x88(%rbp), %r11
movq -0x90(%rbp), %r10
movq -0x98(%rbp), %rax
leaq -0x80(%rbp), %rdx
leaq -0xa0(%rbp), %r14
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x3b250
andb $0x1, %al
movb %al, -0x41(%rbp)
jmp 0x3b23a
movq -0x50(%rbp), %rax
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq 0x68eef(%rip), %rcx     # 0xa40b0
addq (%rcx), %rsi
leaq 0x68ee5(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rsi
movq -0x88(%rbp), %rdx
movq -0x98(%rbp), %rcx
movq -0x20(%rbp), %r8
movl (%r8), %r9d
movl $0x1, %r8d
callq *%rax
testb $0x1, %al
jne 0x3b1f8
jmp 0x3b238
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x88(%rbp), %rcx
movq -0x98(%rbp), %r8
movq -0xa0(%rbp), %r9
movq -0x40(%rbp), %rax
movb (%rax), %al
leaq -0x80(%rbp), %rdx
andb $0x1, %al
movzbl %al, %eax
movl %eax, (%rsp)
movl $0x1, 0x8(%rsp)
callq 0x52a50
movb $0x1, -0x41(%rbp)
jmp 0x3b23a
movb -0x41(%rbp), %al
andb $0x1, %al
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax,%rax)