// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %rsi
movq %rdi, 0x18(%rsp)
leaq 0x50(%rsp), %rdi
movq %rbx, %rdx
callq 0x265ab
leaq 0x2b061(%rip), %rax     # 0x4d0d0
movq (%rax), %rbp
leaq (%r15,%rbp), %rcx
movq %rbp, %rax
notq %rax
andq %rax, %rcx
movq %r14, %r13
subq %r15, %r13
addq %r14, %rbp
andq %rax, %rbp
subq %rcx, %rbp
movq %r12, 0x30(%rsp)
addq %r12, %rcx
movq %rcx, 0x8(%rsp)
leaq 0x6(%rsp), %rax
movb $0x1, (%rax)
leaq 0x10(%rbx), %r12
movq %r12, %rdi
callq 0xb5a0
movq %rbx, %rdi
movq %r15, 0x38(%rsp)
movq %r15, %rsi
callq 0x21e1a
movq %rbx, %rdi
movq %r14, 0x28(%rsp)
movq %r14, %rsi
callq 0x21cbb
addq %rbp, 0x60(%rbx)
shrq $0xc, %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x21d1e
leaq 0x2afdf(%rip), %rax     # 0x4d0c8
movq (%rax), %r9
leaq 0x40(%rsp), %r14
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
leaq 0x50(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq %rbp, %r8
pushq $0x1
leaq 0xe(%rsp), %rax
pushq %rax
pushq 0x20(%rsp)
pushq %r14
callq 0x2687b
addq $0x20, %rsp
movq %rax, %r15
movq %r12, %rdi
callq 0xb380
testq %r15, %r15
je 0x2218b
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r15
leaq 0x2af92(%rip), %rax     # 0x4d0d0
movq (%rax), %rsi
movq 0x38(%rsp), %rax
addq %rsi, %rax
notq %rsi
andq %rax, %rsi
movl (%rbx), %r9d
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rdx
movq %rbp, %rcx
movl $0x1, %r8d
callq *0x80(%rsp)
testb %al, %al
je 0x22242
movq 0x40(%rsp), %r9
movzbl (%r12), %eax
leaq 0x50(%rsp), %rdx
movq %r15, %rdi
jmp 0x22226
movq %r12, 0x48(%rsp)
movq 0x38(%rsp), %r15
movq %r13, 0x20(%rsp)
leaq 0x7(%rsp), %rax
movb $0x1, (%rax)
leaq 0x2af1f(%rip), %rcx     # 0x4d0c8
movq (%rcx), %r9
subq $0x8, %rsp
leaq 0x58(%rsp), %rdx
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq 0x10(%rsp), %rcx
movq %rbp, %r8
pushq %rax
pushq 0x20(%rsp)
pushq %r14
callq 0x26d69
addq $0x20, %rsp
testq %rax, %rax
je 0x22249
leaq 0x2aeec(%rip), %rax     # 0x4d0d0
movq (%rax), %rsi
addq %rsi, %r15
notq %rsi
andq %r15, %rsi
movl (%rbx), %r9d
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rdx
movq %rbp, %rcx
movl $0x1, %r8d
callq *0x80(%rsp)
testb %al, %al
je 0x22242
movq 0x40(%rsp), %r9
movq 0x10(%rsp), %rax
movzbl (%rax), %eax
leaq 0x50(%rsp), %rdx
movq %r12, %rdi
movq %rbx, %rsi
movq 0x8(%rsp), %rcx
movq %rbp, %r8
pushq $0x1
pushq %rax
callq 0x273ec
addq $0x10, %rsp
jmp 0x222ca
xorl %eax, %eax
jmp 0x222cc
movq 0x48(%rsp), %r12
movq %r12, %rdi
callq 0xb5a0
movq %r15, %r14
cmpq $0x1000, %r15           # imm = 0x1000
ja 0x222de
leaq -0x1(%r14), %rax
shrq $0x3, %rax
leaq 0x19b4f(%rip), %rcx     # 0x3bdc0
movzbl (%rcx,%rax), %eax
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %r15
subl 0x2a34f(%rip), %eax     # 0x4c5d4
addl $-0x27, %eax
decq 0xc8(%rbx)
addq %r14, 0xb8(%rbx)
movq 0xd8(%rbx), %rcx
leaq (%rax,%rax,2), %rax
decq 0x8(%rcx,%rax,8)
incq 0x10(%rcx,%rax,8)
movq %rbx, %rdi
callq 0x24aa6
subq %rbp, 0x60(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21e7e
movq %r12, %rdi
callq 0xb380
movb $0x1, %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0xfdc2
jmp 0x22275