// File: /workspace/github_c_makefile_star2_O1/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 0x3c730(%rip), %rax     # 0x4d0c8
movq (%rax), %rax
cmpq %rdx, %rax
seta %cl
cmpq %r8, %rax
seta %al
orb %cl, %al
movb $0x1, %r13b
jne 0x10ea6
movq %r8, %r12
movq %rdx, %r15
movq %rsi, %r10
leaq 0x3c70e(%rip), %rsi     # 0x4d0d0
movq (%rsi), %rax
leaq (%rax,%r8), %rcx
movq %rax, %rdx
notq %rdx
andq %rdx, %rcx
addq %r15, %rax
andq %rdx, %rax
cmpq %rax, %rcx
jbe 0x10aca
movl %r9d, 0x20(%rsp)
movzbl %r9b, %r8d
movq %rdi, %r14
movq %r10, %rsi
movq %r15, %rdx
movq %r12, %rcx
movl %r8d, 0x18(%rsp)
movq %r10, %rbp
callq 0x2e22e
testb %al, %al
je 0x10c64
cmpq %r12, %rbx
movq %r14, %rdi
movq %rbp, %r10
movl 0x20(%rsp), %r9d
leaq 0x3c6b0(%rip), %rsi     # 0x4d0d0
jae 0x10aca
movq (%rsi), %rax
leaq (%rax,%rbx), %rcx
movq %rax, %rdx
notq %rdx
andq %rdx, %rcx
addq %r15, %rax
andq %rdx, %rax
cmpq %rax, %rcx
jbe 0x10aca
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %r10, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl 0x18(%rsp), %r8d
movq %r10, %r14
callq 0x2e22e
movl 0x20(%rsp), %r9d
movq %r14, %r10
leaq 0x3c65c(%rip), %rsi     # 0x4d0d0
movq 0x10(%rsp), %rdi
testb %al, %al
je 0x10aca
movq %r10, %rdi
callq 0x2e3aa
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x10ea3
movq (%rax), %rbx
movl (%rbx), %esi
callq 0x2e5bc
testq %rax, %rax
je 0x10ea3
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x10f1a
leal -0x1(%rcx), %edx
movl %edx, (%rax)
testl %ecx, %ecx
jg 0x10ea3
xorl %r13d, %r13d
movq 0x10(%rsp), %rdi
jmp 0x10ee6
movq (%rsi), %rax
leaq (%rax,%r15), %rbp
movq %rax, %rcx
notq %rcx
andq %rcx, %rbp
leaq (%rax,%rbx), %rdx
andq %rcx, %rdx
cmpq %rdx, %rbp
jb 0x10af6
leaq (%rax,%r12), %rdx
andq %rcx, %rdx
cmpq %rdx, %rbp
jbe 0x10cc0
addq %r12, %rax
andq %rcx, %rax
cmpq %rax, %rbp
jbe 0x10ea6
movq %rsi, %rbx
movq %rdi, %r14
movq %r10, %rdi
movq %r10, 0x20(%rsp)
callq 0x2e3aa
movq %rax, %rbp
movq (%rax), %rax
movb 0x20(%rbp), %cl
movl %ecx, 0x18(%rsp)
leaq 0x30(%rsp), %rdi
movq %r14, 0x10(%rsp)
movq %r14, %rsi
movq %rbx, %r14
movq %rax, %rbx
movq %rax, %rdx
callq 0x265ab
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 0x10b76
movl (%rbx), %r9d
pushq $0x1
popq %r8
movq 0x20(%rsp), %rdi
callq *0x58(%rsp)
testb %al, %al
jne 0x10ea6
movq %rbx, %r13
movq 0x20(%rsp), %rbx
movq %r15, %rdx
subq %r12, %rdx
jbe 0x10bcf
leaq 0x3b995(%rip), %rax     # 0x4c522
leaq (%rbx,%r12), %rdi
cmpb $0x1, (%rax)
je 0x10ef2
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 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x274d6
xorb $0x1, %al
movl %eax, 0x18(%rsp)
movq %r13, 0x28(%rsp)
addq $0x830, %r13            # imm = 0x830
movq %r13, %rdi
callq 0xb5a0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x26812
movq %r12, 0x10(%rbp)
movq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x266bc
movl 0x18(%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 0x21f33
movq %rbx, %rdi
callq 0x2e3aa
testq %r14, %r14
je 0x10ea3
movq (%rax), %rbx
movl (%rbx), %esi
movq 0x38(%r14), %rax
testq %rax, %rax
je 0x10c53
cmpl %esi, 0x40(%r14)
ja 0x10c91
movq 0x10(%rsp), %rdi
callq 0x1afa2
movq 0x10(%rsp), %r14
jmp 0x10c95
movq %rbp, %rdi
callq 0x2e3aa
testq %r14, %r14
je 0x10ea3
movq (%rax), %rbx
movl (%rbx), %esi
movq 0x38(%r14), %rax
testq %rax, %rax
je 0x10eb8
cmpl %esi, 0x40(%r14)
jbe 0x10eb8
leaq (%rax,%rsi,8), %rax
testq %rax, %rax
je 0x10ea3
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x10ec5
leal -0x1(%rcx), %edx
movl %edx, (%rax)
testl %ecx, %ecx
jg 0x10ea3
xorl %r13d, %r13d
movq %r14, %rdi
jmp 0x10ee6
movq %rdi, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x60(%rsp)
leaq 0x2b0dc(%rip), %rax     # 0x3bdc0
leaq 0x2a955(%rip), %rdx     # 0x3b640
pushq $-0x1
popq %rsi
pushq $0x7
popq %rdi
movq %rbx, %r13
cmpq %r12, %rbx
jae 0x10d57
movq %r13, %rcx
cmpq $0xfff, %r13            # imm = 0xFFF
ja 0x10d18
shrq $0x3, %rcx
movzbl (%rax,%rcx), %ecx
movq (%rdx,%rcx,8), %rbx
cmpq %r15, %rbx
jbe 0x10cf1
jmp 0x10d57
shrq $0x3c, %rcx
cmpl $0x6, %ecx
ja 0x10d53
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 0x10d11
xorl %ebx, %ebx
jmp 0x10d11
cmpq %r15, %r13
je 0x10e66
movl %r9d, 0x20(%rsp)
movq %r10, %rdi
movq %r10, %rbx
callq 0x2e3aa
movq %rax, %r12
movq (%rax), %r14
movb 0x20(%rax), %al
movb %al, 0x1f(%rsp)
cmpq %r15, %r13
jae 0x10db9
movq %r15, %rdx
subq %r13, %rdx
leaq 0x3b793(%rip), %rax     # 0x4c522
cmpb $0x1, (%rax)
je 0x10f07
movq %rdx, (%rsp)
leaq 0x30(%rsp), %rdx
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rcx
movq %rbp, %r8
movq %r13, %r9
callq 0x274d6
xorb $0x1, %al
movl %eax, 0x18(%rsp)
leaq 0x830(%r14), %rbp
movq %rbp, %rdi
callq 0xb5a0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x26812
movq %r13, 0x10(%r12)
movq %r14, 0x28(%rsp)
movq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x266bc
movl 0x18(%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 0x21ec5
subq %r15, %r13
movq %rbx, %r10
movl 0x20(%rsp), %eax
jbe 0x10e66
testb %al, %al
je 0x10e4a
cmpb $0x0, 0x1f(%rsp)
jne 0x10e66
addq %r10, %r15
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r10, %rbx
callq 0xb230
movq %rbx, %r10
jmp 0x10e66
leaq 0x3b6e2(%rip), %rax     # 0x4c533
cmpb $0x1, (%rax)
je 0x10e2b
leaq 0x3b6c4(%rip), %rax     # 0x4c521
cmpb $0x1, (%rax)
je 0x10f22
movq %r10, %rdi
callq 0x2e3aa
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x10ea3
movq (%rax), %rbx
movl (%rbx), %esi
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x10ecd
cmpl %esi, 0x40(%rdi)
jbe 0x10ecd
leaq (%rax,%rsi,8), %rax
testq %rax, %rax
je 0x10ea3
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x10ede
leal -0x1(%rcx), %edx
movl %edx, (%rax)
testl %ecx, %ecx
jle 0x10ee3
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x1afa2
jmp 0x10c95
movl 0x4(%rax), %edx
jmp 0x10cab
movq 0x10(%rsp), %rdi
callq 0x1afa2
movq 0x10(%rsp), %rdi
jmp 0x10e8f
movl 0x4(%rax), %edx
jmp 0x10e9d
xorl %r13d, %r13d
movq %rbx, %rsi
xorl %edx, %edx
callq 0x226c8
jmp 0x10ea6
pushq $0x5a
popq %rsi
callq 0xb230
movl $0x0, 0x18(%rsp)
jmp 0x10bcf
leaq (%rbx,%r13), %rdi
pushq $0x5a
popq %rsi
callq 0xb230
xorl %eax, %eax
jmp 0x10db9
movl 0x4(%rax), %edx
jmp 0x10ab3
addq %r10, %r15
movq %r15, %rdi
movl $0xa5, %esi
jmp 0x10e3a