// File: /workspace/github_c_makefile_star2_O3/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, %r13
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %rsi
movq %rdi, 0x18(%rsp)
leaq 0x50(%rsp), %rdi
movq %rbx, %rdx
callq 0x26557
leaq 0x2b1bf(%rip), %rax     # 0x4d0d0
movq (%rax), %r14
leaq (%r14,%r15), %rcx
movq %r14, %rax
notq %rax
andq %rax, %rcx
movq %r13, %rbp
subq %r15, %rbp
addq %r13, %r14
andq %rax, %r14
subq %rcx, %r14
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 0x21ca5
movq %rbx, %rdi
movq %r13, 0x28(%rsp)
movq %r13, %rsi
callq 0x21b25
addq %r14, 0x60(%rbx)
shrq $0xc, %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x21b9c
leaq 0x2b13d(%rip), %rax     # 0x4d0c8
movq (%rax), %r9
leaq 0x40(%rsp), %r13
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
leaq 0x50(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq %r14, %r8
pushq $0x1
leaq 0xe(%rsp), %rax
pushq %rax
pushq 0x20(%rsp)
pushq %r13
callq 0x26812
addq $0x20, %rsp
movq %rax, %r15
movq %r12, %rdi
callq 0xb380
testq %r15, %r15
je 0x2202d
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r15
leaq 0x2b0f0(%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 %r14, %rcx
movl $0x1, %r8d
callq *0x80(%rsp)
testb %al, %al
je 0x220e4
movq 0x40(%rsp), %r9
movzbl (%r12), %eax
leaq 0x50(%rsp), %rdx
movq %r15, %rdi
jmp 0x220c8
movq %r12, 0x48(%rsp)
movq 0x38(%rsp), %r15
movq %rbp, 0x20(%rsp)
leaq 0x7(%rsp), %rax
movb $0x1, (%rax)
leaq 0x2b07d(%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 %r14, %r8
pushq %rax
pushq 0x20(%rsp)
pushq %r13
callq 0x26d04
addq $0x20, %rsp
testq %rax, %rax
je 0x220eb
leaq 0x2b04a(%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 %r14, %rcx
movl $0x1, %r8d
callq *0x80(%rsp)
testb %al, %al
je 0x220e4
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 %r14, %r8
pushq $0x1
pushq %rax
callq 0x27376
addq $0x10, %rsp
jmp 0x2217d
xorl %eax, %eax
jmp 0x2217f
movq %r14, %r12
movq 0x48(%rsp), %rbp
movq %rbp, %rdi
callq 0xb5a0
movq %r15, %r14
cmpq $0x1000, %r15           # imm = 0x1000
ja 0x22191
leaq -0x1(%r14), %rax
shrq $0x3, %rax
leaq 0x19d26(%rip), %rcx     # 0x3be40
movzbl (%rcx,%rax), %eax
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %r15
subl 0x2a4a6(%rip), %eax     # 0x4c5d4
decq 0xc8(%rbx)
addq %r14, 0xb8(%rbx)
addl $-0x27, %eax
movq 0xd8(%rbx), %rcx
leaq (%rax,%rax,2), %rax
movdqu 0x8(%rcx,%rax,8), %xmm0
paddq 0x1a138(%rip), %xmm0    # 0x3c290
movdqu %xmm0, 0x8(%rcx,%rax,8)
movq %rbx, %rdi
callq 0x249b5
subq %r12, 0x60(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21d13
movq %rbp, %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 0xf6d1
jmp 0x2211e