// File: /workspace/github_c_makefile_star2_O3/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 0x3ceda(%rip), %rax     # 0x4d0c8
movq (%rax), %rax
cmpq %rdx, %rax
seta %cl
cmpq %r8, %rax
seta %al
orb %cl, %al
movb $0x1, %r13b
jne 0x106a4
movq %r8, %r12
movq %rdx, %r15
movq %rsi, %r10
leaq 0x3ceb8(%rip), %r8      # 0x4d0d0
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, 0x10(%rsp)
jbe 0x10319
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 0x2e092
testb %al, %al
je 0x10304
leaq 0x3ce62(%rip), %r8      # 0x4d0d0
movq (%r8), %rax
cmpq %r12, %rbx
jae 0x1030c
leaq (%rax,%rbx), %rcx
movq %rax, %rdx
notq %rdx
andq %rdx, %rcx
leaq (%rax,%r15), %rsi
andq %rdx, %rsi
cmpq %rsi, %rcx
movq 0x10(%rsp), %rdi
movq %rbp, %r10
movl 0x20(%rsp), %r9d
jbe 0x10319
movq %rdi, %rbp
movq %r10, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl 0x18(%rsp), %r8d
movq %r10, %r14
callq 0x2e092
testb %al, %al
je 0x106b6
movq %r14, %rdi
callq 0x2e20e
testq %rbp, %rbp
je 0x106a1
movq (%rax), %rbx
movl (%rbx), %esi
movq %rbp, %rdi
callq 0x2e41e
testq %rax, %rax
je 0x106a1
movl (%rax), %ecx
testl %ecx, %ecx
jg 0x1069d
movl 0x4(%rax), %ecx
movl %ecx, (%rax)
xorl %r13d, %r13d
movq 0x10(%rsp), %rdi
jmp 0x106f8
movq %rbp, %rdi
jmp 0x10477
movq 0x10(%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 0x104c8
cmpq %rax, %rbp
jbe 0x106a4
movq %r8, %rbx
movq %rdi, %r14
movq %r10, %rdi
movq %r10, 0x20(%rsp)
callq 0x2e20e
movq %rax, %rbp
movq (%rax), %rax
movb 0x20(%rbp), %cl
movl %ecx, 0x18(%rsp)
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %r14
movq %rax, %rbx
movq %rax, %rdx
callq 0x26557
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 0x103bc
movl (%rbx), %r9d
pushq $0x1
popq %r8
movq 0x20(%rsp), %rdi
callq *0x58(%rsp)
testb %al, %al
jne 0x106a4
movq %rbx, %r13
movq 0x20(%rsp), %rbx
movq %r15, %rdx
subq %r12, %rdx
jbe 0x10415
leaq 0x3c14f(%rip), %rax     # 0x4c522
leaq (%rbx,%r12), %rdi
cmpb $0x1, (%rax)
je 0x10717
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 0x2747b
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 0x267b6
movq %r12, 0x10(%rbp)
movq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x26668
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 0x21dd5
movq %rbx, %rdi
callq 0x2e20e
testq %r14, %r14
je 0x106a1
movq (%rax), %rbx
movl (%rbx), %esi
movq 0x38(%r14), %rax
testq %rax, %rax
je 0x106cb
cmpl %esi, 0x40(%r14)
jbe 0x106cb
leaq (%rax,%rsi,8), %rax
testq %rax, %rax
je 0x106a1
movl (%rax), %ecx
testl %ecx, %ecx
jg 0x1069d
movl 0x4(%rax), %ecx
movl %ecx, (%rax)
xorl %r13d, %r13d
movq %r14, %rdi
jmp 0x106f8
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x60(%rsp)
leaq 0x2b959(%rip), %rax     # 0x3be40
leaq 0x2b1d2(%rip), %rdx     # 0x3b6c0
pushq $-0x1
popq %rsi
pushq $0x7
popq %rdi
movq %rbx, %r13
cmpq %r12, %rbx
jae 0x1055a
movq %r13, %rcx
cmpq $0xfff, %r13            # imm = 0xFFF
ja 0x1051b
shrq $0x3, %rcx
movzbl (%rax,%rcx), %ecx
movq (%rdx,%rcx,8), %rbx
cmpq %r15, %rbx
jbe 0x104f4
jmp 0x1055a
shrq $0x3c, %rcx
cmpl $0x6, %ecx
ja 0x10556
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 0x10514
xorl %ebx, %ebx
jmp 0x10514
cmpq %r15, %r13
je 0x10669
movl %r9d, 0x20(%rsp)
movq %r10, %rdi
movq %r10, %rbx
callq 0x2e20e
movq %rax, %r12
movq (%rax), %r14
movb 0x20(%rax), %al
movb %al, 0x1f(%rsp)
cmpq %r15, %r13
jae 0x105bc
movq %r15, %rdx
subq %r13, %rdx
leaq 0x3bf90(%rip), %rax     # 0x4c522
cmpb $0x1, (%rax)
je 0x10704
movq %rdx, (%rsp)
leaq 0x30(%rsp), %rdx
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rcx
movq %rbp, %r8
movq %r13, %r9
callq 0x2747b
xorb $0x1, %al
movl %eax, 0x18(%rsp)
leaq 0x830(%r14), %rbp
movq %rbp, %rdi
callq 0xb5a0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x267b6
movq %r13, 0x10(%r12)
movq %r14, 0x28(%rsp)
movq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x26668
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 0x21d67
subq %r15, %r13
movq %rbx, %r10
movl 0x20(%rsp), %eax
jbe 0x10669
testb %al, %al
je 0x1064d
cmpb $0x0, 0x1f(%rsp)
jne 0x10669
addq %r10, %r15
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r10, %rbx
callq 0xb230
movq %rbx, %r10
jmp 0x10669
leaq 0x3bedf(%rip), %rax     # 0x4c533
cmpb $0x1, (%rax)
je 0x1062e
leaq 0x3bec1(%rip), %rax     # 0x4c521
cmpb $0x1, (%rax)
je 0x1072c
movq %r10, %rdi
callq 0x2e20e
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x106a1
movq (%rax), %rbx
movl (%rbx), %esi
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x106df
cmpl %esi, 0x40(%rdi)
jbe 0x106df
leaq (%rax,%rsi,8), %rax
testq %rax, %rax
je 0x106a1
movl (%rax), %ecx
testl %ecx, %ecx
jle 0x106f0
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 0x3ca13(%rip), %r8      # 0x4d0d0
movq (%r8), %rax
movq %rbp, %rdi
movq %r14, %r10
jmp 0x10314
movq 0x10(%rsp), %rdi
callq 0x1ade7
movq 0x10(%rsp), %r14
jmp 0x104a5
movq 0x10(%rsp), %rdi
callq 0x1ade7
movq 0x10(%rsp), %rdi
jmp 0x10692
movl 0x4(%rax), %ecx
movl %ecx, (%rax)
xorl %r13d, %r13d
movq %rbx, %rsi
xorl %edx, %edx
callq 0x225b4
jmp 0x106a4
leaq (%rbx,%r13), %rdi
pushq $0x5a
popq %rsi
callq 0xb230
xorl %eax, %eax
jmp 0x105bc
pushq $0x5a
popq %rsi
callq 0xb230
movl $0x0, 0x18(%rsp)
jmp 0x10415
addq %r10, %r15
movq %r15, %rdi
movl $0xa5, %esi
jmp 0x1063d