// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %rsi
movq %rdi, 0x18(%rsp)
leaq 0x50(%rsp), %rdi
movq %rbp, %rdx
callq 0x211f1
leaq 0x2ec5d(%rip), %rax     # 0x490d0
movq (%rax), %r14
leaq (%r14,%r15), %rcx
movq %r14, %rax
notq %rax
andq %rax, %rcx
movq %rbx, %r13
subq %r15, %r13
addq %rbx, %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(%rbp), %r12
movq %r12, %rdi
callq 0xb5a0
movq %rbp, %rdi
movq %r15, 0x38(%rsp)
movq %r15, %rsi
movq %rbx, 0x28(%rsp)
movq %rbx, %rdx
callq 0x1a321
addq %r14, 0x60(%rbp)
shrq $0xc, %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x1a0f3
leaq 0x2ebe3(%rip), %rax     # 0x490c8
movq (%rax), %r9
leaq 0x40(%rsp), %rbx
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
leaq 0x50(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq %r14, %r8
pushq $0x1
leaq 0xe(%rsp), %rax
pushq %rax
pushq 0x20(%rsp)
pushq %rbx
callq 0x2146e
addq $0x20, %rsp
movq %rax, %r15
movq %r12, %rdi
callq 0xb380
testq %r15, %r15
je 0x1a585
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r15
leaq 0x2eb97(%rip), %rax     # 0x490d0
movq (%rax), %rsi
movq 0x38(%rsp), %rax
addq %rsi, %rax
notq %rsi
andq %rax, %rsi
movl (%rbp), %r9d
pushq $0x1
popq %r8
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rdx
movq %r14, %rcx
callq *0x80(%rsp)
testb %al, %al
je 0x1a638
movq 0x40(%rsp), %r9
movzbl (%r12), %eax
leaq 0x50(%rsp), %rdx
movq %r15, %rdi
jmp 0x1a61e
movq %r12, 0x48(%rsp)
movq 0x38(%rsp), %r15
movq %r13, 0x20(%rsp)
leaq 0x7(%rsp), %rax
movb $0x1, (%rax)
leaq 0x2eb25(%rip), %rcx     # 0x490c8
movq (%rcx), %r9
subq $0x8, %rsp
leaq 0x58(%rsp), %rdx
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
movq 0x10(%rsp), %rcx
movq %r14, %r8
pushq %rax
pushq 0x20(%rsp)
pushq %rbx
callq 0x21943
addq $0x20, %rsp
testq %rax, %rax
je 0x1a63f
leaq 0x2eaf3(%rip), %rax     # 0x490d0
movq (%rax), %rsi
addq %rsi, %r15
notq %rsi
andq %r15, %rsi
movl (%rbp), %r9d
pushq $0x1
popq %r8
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rdx
movq %r14, %rcx
callq *0x80(%rsp)
testb %al, %al
je 0x1a638
movq 0x40(%rsp), %r9
movq 0x10(%rsp), %rax
movzbl (%rax), %eax
leaq 0x50(%rsp), %rdx
movq %r12, %rdi
movq %rbp, %rsi
movq 0x8(%rsp), %rcx
movq %r14, %r8
pushq $0x1
pushq %rax
callq 0x21eb3
popq %rax
popq %rcx
jmp 0x1a6d1
xorl %eax, %eax
jmp 0x1a6d3
movq %r14, %rbx
movq 0x48(%rsp), %r13
movq %r13, %rdi
callq 0xb5a0
movq %r15, %r14
cmpq $0x1000, %r15           # imm = 0x1000
ja 0x1a6e5
leaq -0x1(%r14), %rax
shrq $0x3, %rax
leaq 0x1c352(%rip), %rcx     # 0x369c0
movzbl (%rcx,%rax), %eax
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %r15
subl 0x2df52(%rip), %eax     # 0x485d4
decq 0xc8(%rbp)
addq %r14, 0xb8(%rbp)
addl $-0x27, %eax
movq 0xd8(%rbp), %rcx
imulq $0x18, %rax, %rax
movdqu 0x8(%rcx,%rax), %xmm0
paddq 0x1c774(%rip), %xmm0    # 0x36e20
movdqu %xmm0, 0x8(%rcx,%rax)
movq %rbp, %rdi
callq 0x1ecbe
subq %rbx, 0x60(%rbp)
movq %rbp, %rdi
movq %r15, %rsi
callq 0x1a267
movq %r13, %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 0x20acc
jmp 0x1a672