// File: /workspace/github_c_makefile_star2_O2/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/huge.c
// Function: je_huge_ralloc_no_move
bool
huge_ralloc_no_move(tsdn_t *tsdn, void *ptr, size_t oldsize, size_t usize_min,
    size_t usize_max, bool zero)
{

	assert(s2u(oldsize) == oldsize);
	/* The following should have been caught by callers. */
	assert(usize_min > 0 && usize_max <= HUGE_MAXCLASS);

	/* Both allocations must be huge to avoid a move. */
	if (oldsize < chunksize || usize_max < chunksize)
		return (true);

	if (CHUNK_CEILING(usize_max) > CHUNK_CEILING(oldsize)) {
		/* Attempt to expand the allocation in-place. */
		if (!huge_ralloc_no_move_expand(tsdn, ptr, oldsize, usize_max,
		    zero)) {
			arena_decay_tick(tsdn, huge_aalloc(ptr));
			return (false);
		}
		/* Try again, this time with usize_min. */
		if (usize_min < usize_max && CHUNK_CEILING(usize_min) >
		    CHUNK_CEILING(oldsize) && huge_ralloc_no_move_expand(tsdn,
		    ptr, oldsize, usize_min, zero)) {
			arena_decay_tick(tsdn, huge_aalloc(ptr));
			return (false);
		}
	}

	/*
	 * Avoid moving the allocation if the existing chunk size accommodates
	 * the new size.
	 */
	if (CHUNK_CEILING(oldsize) >= CHUNK_CEILING(usize_min)
	    && CHUNK_CEILING(oldsize) <= CHUNK_CEILING(usize_max)) {
		huge_ralloc_no_move_similar(tsdn, ptr, oldsize, usize_min,
		    usize_max, zero);
		arena_decay_tick(tsdn, huge_aalloc(ptr));
		return (false);
	}

	/* Attempt to shrink the allocation in-place. */
	if (CHUNK_CEILING(oldsize) > CHUNK_CEILING(usize_max)) {
		if (!huge_ralloc_no_move_shrink(tsdn, ptr, oldsize,
		    usize_max)) {
			arena_decay_tick(tsdn, huge_aalloc(ptr));
			return (false);
		}
	}
	return (true);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, %rbx
leaq 0x20a14(%rip), %rax     # 0x490c8
movq (%rax), %rax
cmpq %rdx, %rax
seta %cl
cmpq %r8, %rax
seta %al
orb %cl, %al
movb $0x1, %r13b
jne 0x28afa
movq %r8, %r12
movq %rdx, %r15
movq %rsi, %r10
leaq 0x209f2(%rip), %r8      # 0x490d0
movq (%r8), %rax
leaq (%rax,%r12), %rcx
movq %rax, %rdx
notq %rdx
andq %rdx, %rcx
leaq (%rax,%r15), %rsi
andq %rdx, %rsi
cmpq %rsi, %rcx
movq %rdi, 0x18(%rsp)
jbe 0x287b2
movl %r9d, 0x20(%rsp)
movzbl %r9b, %r8d
movq %rdi, %r14
movq %r10, %rsi
movq %r15, %rdx
movq %r12, %rcx
movl %r8d, 0x10(%rsp)
movq %r10, %rbp
callq 0x28b72
testb %al, %al
je 0x2879d
leaq 0x209a0(%rip), %r8      # 0x490d0
movq (%r8), %rax
cmpq %r12, %rbx
jae 0x287a5
leaq (%rax,%rbx), %rcx
movq %rax, %rdx
notq %rdx
andq %rdx, %rcx
leaq (%rax,%r15), %rsi
andq %rdx, %rsi
cmpq %rsi, %rcx
movq 0x18(%rsp), %rdi
movq %rbp, %r10
movl 0x20(%rsp), %r9d
jbe 0x287b2
movq %rdi, %rbp
movq %r10, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl 0x10(%rsp), %r8d
movq %r10, %r14
callq 0x28b72
testb %al, %al
je 0x28b0c
movq %r14, %rdi
callq 0x28ce3
testq %rbp, %rbp
je 0x28af7
movq %rax, %rbx
movl (%rax), %esi
movq %rbp, %rdi
jmp 0x28ae3
movq %rbp, %rdi
jmp 0x28910
movq 0x18(%rsp), %rdi
movq %rbp, %r10
movl 0x20(%rsp), %r9d
leaq (%rax,%r15), %rbp
movq %rax, %rcx
notq %rcx
andq %rcx, %rbp
leaq (%rax,%rbx), %rdx
andq %rcx, %rdx
cmpq %rdx, %rbp
setb %dl
addq %r12, %rax
andq %rcx, %rax
cmpq %rax, %rbp
seta %cl
orb %dl, %cl
je 0x2892b
cmpq %rax, %rbp
jbe 0x28afa
movq %r8, %rbx
movq %rdi, %r14
movq %r10, %rdi
movq %r10, 0x20(%rsp)
callq 0x291b0
movq %rax, %rbp
movq (%rax), %rax
movb 0x20(%rbp), %cl
movl %ecx, 0x10(%rsp)
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %r14
movq %rax, %rbx
movq %rax, %rdx
callq 0x211f1
movq (%r14), %rdx
leaq (%rdx,%r15), %rsi
movq %rdx, %rax
notq %rax
andq %rax, %rsi
addq %r12, %rdx
andq %rax, %rdx
movq %rsi, %rcx
subq %rdx, %rcx
je 0x28855
movl (%rbx), %r9d
pushq $0x1
popq %r8
movq 0x20(%rsp), %rdi
callq *0x58(%rsp)
testb %al, %al
jne 0x28afa
movq %rbx, %r13
movq 0x20(%rsp), %rbx
movq %r15, %rdx
subq %r12, %rdx
jbe 0x288ae
leaq 0x1fcb6(%rip), %rax     # 0x48522
leaq (%rbx,%r12), %rdi
cmpb $0x1, (%rax)
je 0x28b4d
movq (%r14), %r9
movq %r9, %rax
notq %rax
movq %rdi, %rcx
andq %rax, %rcx
leaq (%r9,%r15), %r8
andq %rax, %r8
andq %rdi, %r9
movq %rdx, (%rsp)
leaq 0x30(%rsp), %rdx
movq 0x18(%rsp), %rdi
movq %r13, %rsi
callq 0x21fcc
xorb $0x1, %al
movl %eax, 0x10(%rsp)
movq %r13, 0x28(%rsp)
addq $0x830, %r13            # imm = 0x830
movq %r13, %rdi
callq 0xb5a0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x21412
movq %r12, 0x10(%rbp)
movq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x21302
movl 0x10(%rsp), %eax
movb %al, 0x20(%rbp)
movq %r13, %rdi
callq 0xb380
movq 0x18(%rbp), %r9
movq %r14, %rdi
movq 0x28(%rsp), %rsi
movq %rbx, %rdx
movq %r15, %rcx
movq %r12, %r8
callq 0x1a342
movq %rbx, %rdi
callq 0x28ce3
testq %r14, %r14
je 0x28af7
movq %rax, %rbx
movl (%rax), %esi
movq %r14, %rdi
jmp 0x28ae3
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x60(%rsp)
leaq 0xe076(%rip), %rax      # 0x369c0
leaq 0xd8ef(%rip), %rdx      # 0x36240
pushq $-0x1
popq %rsi
pushq $0x7
popq %rdi
movq %rbx, %r13
cmpq %r12, %rbx
jae 0x289bd
movq %r13, %rcx
cmpq $0xfff, %r13            # imm = 0xFFF
ja 0x2897e
shrq $0x3, %rcx
movzbl (%rax,%rcx), %ecx
movq (%rdx,%rcx,8), %rbx
cmpq %r15, %rbx
jbe 0x28957
jmp 0x289bd
shrq $0x3c, %rcx
cmpl $0x6, %ecx
ja 0x289b9
leaq 0x1(%r13), %r8
leaq -0x1(,%r8,2), %rcx
bsrq %rcx, %r11
movl %r11d, %ecx
addb $-0x3, %cl
movq %rsi, %rbx
shlq %cl, %rbx
cmpl $0x6, %r11d
notq %rbx
cmovbq %rdi, %rbx
addq %rbx, %r8
notq %rbx
andq %r8, %rbx
jmp 0x28977
xorl %ebx, %ebx
jmp 0x28977
cmpq %r15, %r13
je 0x28acc
movl %r9d, 0x20(%rsp)
movq %r10, %rdi
movq %r10, %rbx
callq 0x291b0
movq %rax, %r12
movq (%rax), %r14
movb 0x20(%rax), %al
movb %al, 0x17(%rsp)
cmpq %r15, %r13
jae 0x28a1f
movq %r15, %rdx
subq %r13, %rdx
leaq 0x1fb2d(%rip), %rax     # 0x48522
cmpb $0x1, (%rax)
je 0x28b3a
movq %rdx, (%rsp)
leaq 0x30(%rsp), %rdx
movq 0x18(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rcx
movq %rbp, %r8
movq %r13, %r9
callq 0x21fcc
xorb $0x1, %al
movl %eax, 0x10(%rsp)
leaq 0x830(%r14), %rbp
movq %rbp, %rdi
callq 0xb5a0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x21412
movq %r13, 0x10(%r12)
movq %r14, 0x28(%rsp)
movq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x21302
movl 0x10(%rsp), %eax
movb %al, 0x20(%r12)
movq %rbp, %rdi
callq 0xb380
movq %r14, %rdi
movq 0x28(%rsp), %rsi
movq %rbx, %rdx
movq %r15, %rcx
movq %r13, %r8
callq 0x1a2bb
subq %r15, %r13
movq %rbx, %r10
movl 0x20(%rsp), %eax
jbe 0x28acc
testb %al, %al
je 0x28ab0
cmpb $0x0, 0x17(%rsp)
jne 0x28acc
addq %r10, %r15
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r10, %rbx
callq 0xb230
movq %rbx, %r10
jmp 0x28acc
leaq 0x1fa7c(%rip), %rax     # 0x48533
cmpb $0x1, (%rax)
je 0x28a91
leaq 0x1fa5e(%rip), %rax     # 0x48521
cmpb $0x1, (%rax)
je 0x28b62
movq %r10, %rdi
callq 0x28ce3
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x28af7
movq %rax, %rbx
movl (%rax), %esi
callq 0x293fd
testq %rax, %rax
je 0x28af7
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x28b21
decl %ecx
movl %ecx, (%rax)
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x205bd(%rip), %r8      # 0x490d0
movq (%r8), %rax
movq %rbp, %rdi
movq %r14, %r10
jmp 0x287ad
movl 0x4(%rax), %ecx
movl %ecx, (%rax)
xorl %r13d, %r13d
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x1aac4
jmp 0x28afa
leaq (%rbx,%r13), %rdi
pushq $0x5a
popq %rsi
callq 0xb230
xorl %eax, %eax
jmp 0x28a1f
pushq $0x5a
popq %rsi
callq 0xb230
movl $0x0, 0x10(%rsp)
jmp 0x288ae
addq %r10, %r15
movq %r15, %rdi
movl $0xa5, %esi
jmp 0x28aa0