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

	node = huge_node_get(ptr);
	arena = extent_node_arena_get(node);
	pre_zeroed = extent_node_zeroed_get(node);
	chunk_hooks = chunk_hooks_get(tsdn, arena);

	assert(oldsize > usize);

	/* Split excess chunks. */
	cdiff = CHUNK_CEILING(oldsize) - CHUNK_CEILING(usize);
	if (cdiff != 0 && chunk_hooks.split(ptr, CHUNK_CEILING(oldsize),
	    CHUNK_CEILING(usize), cdiff, true, arena->ind))
		return (true);

	if (oldsize > usize) {
		size_t sdiff = oldsize - usize;
		if (config_fill && unlikely(opt_junk_free)) {
			huge_dalloc_junk((void *)((uintptr_t)ptr + usize),
			    sdiff);
			post_zeroed = false;
		} else {
			post_zeroed = !chunk_purge_wrapper(tsdn, arena,
			    &chunk_hooks, CHUNK_ADDR2BASE((uintptr_t)ptr +
			    usize), CHUNK_CEILING(oldsize),
			    CHUNK_ADDR2OFFSET((uintptr_t)ptr + 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);
	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);

	/* Zap the excess chunks. */
	arena_chunk_ralloc_huge_shrink(tsdn, arena, ptr, oldsize, usize,
	    extent_node_sn_get(node));

	return (false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x65ae0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x65b10
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x66390
andb $0x1, %al
movb %al, -0x79(%rbp)
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0xb8(%rbp), %rdi
callq 0x51160
leaq -0x70(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movl $0x38, %edx
callq 0xb310
jmp 0x643ae
movq -0x20(%rbp), %rax
leaq 0x3fcf7(%rip), %rcx     # 0xa40b0
addq (%rcx), %rax
leaq 0x3fced(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq -0x28(%rbp), %rcx
leaq 0x3fcd8(%rip), %rdx     # 0xa40b0
addq (%rdx), %rcx
leaq 0x3fcce(%rip), %rdx     # 0xa40b0
movq (%rdx), %rdx
xorq $-0x1, %rdx
andq %rdx, %rcx
subq %rcx, %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x64462
movq -0x48(%rbp), %rax
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x3fca3(%rip), %rcx     # 0xa40b0
addq (%rcx), %rsi
leaq 0x3fc99(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rsi
movq -0x28(%rbp), %rdx
leaq 0x3fc84(%rip), %rcx     # 0xa40b0
addq (%rcx), %rdx
leaq 0x3fc7a(%rip), %rcx     # 0xa40b0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rdx
movq -0x78(%rbp), %rcx
movq -0x38(%rbp), %r8
movl (%r8), %r9d
movl $0x1, %r8d
callq *%rax
testb $0x1, %al
jne 0x64459
jmp 0x64462
movb $0x1, -0x1(%rbp)
jmp 0x645fd
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jbe 0x64522
movq -0x20(%rbp), %rax
subq -0x28(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq 0x3f07c(%rip), %rax     # 0xa3502
movb (%rax), %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x644b3
movq -0x18(%rbp), %rdi
addq -0x28(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x65b60
movb $0x0, -0x7a(%rbp)
jmp 0x64520
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rcx
addq -0x28(%rbp), %rcx
leaq 0x3fbe6(%rip), %rax     # 0xa40b0
movq (%rax), %rax
xorq $-0x1, %rax
andq %rax, %rcx
movq -0x20(%rbp), %r8
leaq 0x3fbd1(%rip), %rax     # 0xa40b0
addq (%rax), %r8
leaq 0x3fbc7(%rip), %rax     # 0xa40b0
movq (%rax), %rax
xorq $-0x1, %rax
andq %rax, %r8
movq -0x18(%rbp), %r9
addq -0x28(%rbp), %r9
leaq 0x3fbae(%rip), %rax     # 0xa40b0
andq (%rax), %r9
movq -0xc0(%rbp), %rax
leaq -0x70(%rbp), %rdx
movq %rax, (%rsp)
callq 0x52c40
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x7a(%rbp)
jmp 0x6452a
movb -0x79(%rbp), %al
andb $0x1, %al
movb %al, -0x7a(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x830, %rsi            # imm = 0x830
callq 0x635b0
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x65b30
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x66150
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x663b0
movq -0x30(%rbp), %rdi
movb -0x7a(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x66190
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x830, %rsi            # imm = 0x830
callq 0x63600
movq -0x10(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x30(%rbp), %rdi
callq 0x65bf0
movq -0xe8(%rbp), %rdi
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq -0xd0(%rbp), %rcx
movq -0xc8(%rbp), %r8
movq %rax, %r9
callq 0x3ae90
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax,%rax)