// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/huge.c
// Function: huge_ralloc_no_move_similar
static void
huge_ralloc_no_move_similar(tsdn_t *tsdn, void *ptr, size_t oldsize,
    size_t usize_min, size_t usize_max, bool zero)
{
	size_t usize, usize_next;
	extent_node_t *node;
	arena_t *arena;
	chunk_hooks_t chunk_hooks = CHUNK_HOOKS_INITIALIZER;
	bool pre_zeroed, post_zeroed;

	/* Increase usize to incorporate extra. */
	for (usize = usize_min; usize < usize_max && (usize_next = s2u(usize+1))
	    <= oldsize; usize = usize_next)
		; /* Do nothing. */

	if (oldsize == usize)
		return;

	node = huge_node_get(ptr);
	arena = extent_node_arena_get(node);
	pre_zeroed = extent_node_zeroed_get(node);

	/* Fill if necessary (shrinking). */
	if (oldsize > usize) {
		size_t sdiff = oldsize - usize;
		if (config_fill && unlikely(opt_junk_free)) {
			memset((void *)((uintptr_t)ptr + usize),
			    JEMALLOC_FREE_JUNK, sdiff);
			post_zeroed = false;
		} else {
			post_zeroed = !chunk_purge_wrapper(tsdn, arena,
			    &chunk_hooks, ptr, CHUNK_CEILING(oldsize), usize,
			    sdiff);
		}
	} else
		post_zeroed = pre_zeroed;

	malloc_mutex_lock(tsdn, &arena->huge_mtx);
	/* Update the size of the huge allocation. */
	huge_node_unset(ptr, node);
	assert(extent_node_size_get(node) != usize);
	extent_node_size_set(node, usize);
	huge_node_reset(tsdn, ptr, node);
	/* Update zeroed. */
	extent_node_zeroed_set(node, post_zeroed);
	malloc_mutex_unlock(tsdn, &arena->huge_mtx);

	arena_chunk_ralloc_huge_similar(tsdn, arena, ptr, oldsize, usize);

	/* Fill if necessary (growing). */
	if (oldsize < usize) {
		if (zero || (config_fill && unlikely(opt_zero))) {
			if (!pre_zeroed) {
				memset((void *)((uintptr_t)ptr + oldsize), 0,
				    usize - oldsize);
			}
		} else if (config_fill && unlikely(opt_junk_alloc)) {
			memset((void *)((uintptr_t)ptr + oldsize),
			    JEMALLOC_ALLOC_JUNK, usize - oldsize);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movb %r9b, %al
movq %rdi, -0x78(%rbp)
movq %rsi, -0x80(%rbp)
movq %rdx, -0x88(%rbp)
movq %rcx, -0x90(%rbp)
movq %r8, -0x98(%rbp)
andb $0x1, %al
movb %al, -0x99(%rbp)
leaq -0xf8(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0xb210
movq -0x90(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rcx
xorl %eax, %eax
cmpq -0x98(%rbp), %rcx
movb %al, -0x109(%rbp)
jae 0x640ac
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
cmpq $0x1000, -0x70(%rbp)    # imm = 0x1000
setbe %al
testb $0x1, %al
jne 0x63f80
jmp 0x63fd9
movq -0x70(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rcx
subq $0x1, %rcx
shrq $0x3, %rcx
leaq 0x2cadd(%rip), %rax     # 0x90a80
movzbl (%rax,%rcx), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, %ecx
leaq 0x2c344(%rip), %rax     # 0x90300
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x64091
movq -0x70(%rbp), %rax
movq %rax, -0x28(%rbp)
movabsq $0x7000000000000000, %rax # imm = 0x7000000000000000
cmpq %rax, -0x28(%rbp)
seta %al
testb $0x1, %al
jne 0x63ff8
jmp 0x64005
movq $0x0, -0x20(%rbp)
jmp 0x64089
movq -0x28(%rbp), %rdi
shlq %rdi
subq $0x1, %rdi
callq 0x65dd0
movl %eax, %eax
movq %rax, -0x30(%rbp)
cmpq $0x6, -0x30(%rbp)
jae 0x64030
movl $0x3, %eax
movq %rax, -0x118(%rbp)
jmp 0x64043
movq -0x30(%rbp), %rax
subq $0x2, %rax
subq $0x1, %rax
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
addq -0x48(%rbp), %rax
movq -0x48(%rbp), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0xb0(%rbp)
cmpq -0x88(%rbp), %rax
setbe %al
movb %al, -0x109(%rbp)
movb -0x109(%rbp), %al
testb $0x1, %al
jne 0x640b8
jmp 0x640cd
jmp 0x640ba
movq -0xb0(%rbp), %rax
movq %rax, -0xa8(%rbp)
jmp 0x63f44
movq -0x88(%rbp), %rax
cmpq -0xa8(%rbp), %rax
jne 0x640e2
jmp 0x6432d
movq -0x80(%rbp), %rdi
callq 0x65ae0
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x65b10
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x66390
andb $0x1, %al
movb %al, -0xf9(%rbp)
movq -0x88(%rbp), %rax
cmpq -0xa8(%rbp), %rax
jbe 0x641dc
movq -0x88(%rbp), %rax
subq -0xa8(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq 0x3f3b9(%rip), %rax     # 0xa3502
movb (%rax), %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x64181
movq -0x80(%rbp), %rdi
addq -0xa8(%rbp), %rdi
movq -0x108(%rbp), %rdx
movl $0x5a, %esi
callq 0xb210
movb $0x0, -0xfa(%rbp)
jmp 0x641da
movq -0x78(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq -0x80(%rbp), %rcx
movq -0x88(%rbp), %r8
leaq 0x3ff12(%rip), %rax     # 0xa40b0
addq (%rax), %r8
leaq 0x3ff08(%rip), %rax     # 0xa40b0
movq (%rax), %rax
xorq $-0x1, %rax
andq %rax, %r8
movq -0xa8(%rbp), %r9
movq -0x108(%rbp), %rax
leaq -0xf8(%rbp), %rdx
movq %rax, (%rsp)
callq 0x52c40
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0xfa(%rbp)
jmp 0x641ea
movb -0xf9(%rbp), %al
andb $0x1, %al
movb %al, -0xfa(%rbp)
movq -0x78(%rbp), %rdi
movq -0xc0(%rbp), %rsi
addq $0x830, %rsi            # imm = 0x830
callq 0x635b0
movq -0x80(%rbp), %rdi
movq -0xb8(%rbp), %rsi
callq 0x65b30
jmp 0x64213
movq -0xb8(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0x66150
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0xb8(%rbp), %rdx
callq 0x663b0
movq -0xb8(%rbp), %rdi
movb -0xfa(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x66190
movq -0x78(%rbp), %rdi
movq -0xc0(%rbp), %rsi
addq $0x830, %rsi            # imm = 0x830
callq 0x63600
movq -0x78(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x88(%rbp), %rcx
movq -0xa8(%rbp), %r8
callq 0x3adb0
movq -0x88(%rbp), %rax
cmpq -0xa8(%rbp), %rax
jae 0x6432d
testb $0x1, -0x99(%rbp)
jne 0x642c1
leaq 0x3f265(%rip), %rax     # 0xa3513
movb (%rax), %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x642ec
testb $0x1, -0xf9(%rbp)
jne 0x642ea
movq -0x80(%rbp), %rdi
addq -0x88(%rbp), %rdi
movq -0xa8(%rbp), %rdx
subq -0x88(%rbp), %rdx
xorl %esi, %esi
callq 0xb210
jmp 0x6432b
leaq 0x3f20e(%rip), %rax     # 0xa3501
movb (%rax), %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x64329
movq -0x80(%rbp), %rdi
addq -0x88(%rbp), %rdi
movq -0xa8(%rbp), %rdx
subq -0x88(%rbp), %rdx
movl $0xa5, %esi
callq 0xb210
jmp 0x6432b
jmp 0x6432d
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)