// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/jemalloc/src/huge.c
// Function: je_huge_ralloc_no_move
bool
huge_ralloc_no_move(void *ptr, size_t oldsize, size_t usize_min,
    size_t usize_max, bool zero)
{

	assert(s2u(oldsize) == oldsize);

	/* 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(ptr, oldsize, usize_max, zero))
			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(ptr,
		    oldsize, usize_min, zero))
			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(ptr, oldsize, usize_min, usize_max,
		    zero);
		return (false);
	}

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r15
leaq 0x270be(%rip), %rax     # 0x576a8
movq (%rax), %rax
cmpq %rsi, %rax
seta %cl
cmpq %r15, %rax
seta %al
orb %cl, %al
movb $0x1, %r12b
jne 0x30946
movq %rdx, %r13
movq %rsi, %r14
leaq 0x2709f(%rip), %rax     # 0x576b0
movq (%rax), %rax
leaq (%rax,%r15), %rcx
movq %rax, %rdx
notq %rdx
andq %rdx, %rcx
addq %rax, %rsi
andq %rdx, %rsi
cmpq %rsi, %rcx
jbe 0x306a1
movl %r8d, (%rsp)
movzbl %r8b, %ebx
movq %rdi, %rbp
movq %r14, %rsi
movq %r15, %rdx
movl %ebx, %ecx
callq 0x30992
testb %al, %al
je 0x30943
leaq 0x2705d(%rip), %rax     # 0x576b0
movq (%rax), %rax
cmpq %r15, %r13
jae 0x3069a
leaq (%rax,%r13), %rcx
movq %rax, %rdx
notq %rdx
andq %rdx, %rcx
leaq (%rax,%r14), %rsi
andq %rdx, %rsi
cmpq %rsi, %rcx
movq %rbp, %rdi
movl (%rsp), %r8d
jbe 0x306a1
movq %r14, %rsi
movq %r13, %rdx
movl %ebx, %ecx
callq 0x30992
testb %al, %al
jne 0x30943
leaq 0x27019(%rip), %rax     # 0x576b0
movq (%rax), %rax
movq %rbp, %rdi
movl (%rsp), %r8d
leaq (%rax,%r14), %rcx
movq %rax, %rdx
notq %rdx
andq %rdx, %rcx
leaq (%rax,%r13), %rsi
andq %rdx, %rsi
cmpq %rsi, %rcx
setb %sil
addq %r15, %rax
andq %rdx, %rax
cmpq %rax, %rcx
seta %dl
orb %sil, %dl
je 0x307c2
cmpq %rax, %rcx
jbe 0x30946
movq %rdi, %rbx
callq 0x3110a
movq %rax, %rbp
movq (%rax), %r13
movb 0x18(%rax), %al
movl %eax, (%rsp)
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x28d7d
leaq 0x26fae(%rip), %rax     # 0x576b0
movq (%rax), %rdx
leaq (%rdx,%r14), %rsi
movq %rdx, %rax
notq %rax
andq %rax, %rsi
addq %r15, %rdx
andq %rax, %rdx
movq %rsi, %rcx
subq %rdx, %rcx
je 0x3073a
movl (%r13), %r9d
pushq $0x1
popq %r8
movq %rbx, %rdi
callq *0x38(%rsp)
movb $0x1, %r12b
testb %al, %al
jne 0x30946
movq %rbx, %r12
movq %r14, %r9
subq %r15, %r9
jbe 0x3078b
leaq 0x25ed6(%rip), %rax     # 0x56622
leaq (%r12,%r15), %rdi
cmpb $0x1, (%rax)
je 0x3096e
leaq 0x26f50(%rip), %rax     # 0x576b0
movq (%rax), %r8
movq %r8, %rax
notq %rax
movq %rdi, %rdx
andq %rax, %rdx
leaq (%r8,%r14), %rcx
andq %rax, %rcx
andq %rdi, %r8
leaq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0x29964
xorb $0x1, %al
movl %eax, (%rsp)
leaq 0x1d8(%r13), %rbx
movq %rbx, %rdi
callq 0x106d0
movq %r15, 0x10(%rbp)
movl (%rsp), %eax
movb %al, 0x18(%rbp)
movq %rbx, %rdi
callq 0x10440
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x225fd
jmp 0x30943
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x40(%rsp)
leaq 0x1231f(%rip), %rax     # 0x42b00
leaq 0x11b98(%rip), %rdx     # 0x42380
pushq $0x40
popq %rsi
pushq $-0x1
popq %r11
pushq $0x7
popq %rbx
movq %r13, %r12
cmpq %r15, %r13
jae 0x30862
cmpq $0xfff, %r12            # imm = 0xFFF
ja 0x30819
movq %r12, %rcx
shrq $0x3, %rcx
movzbl (%rax,%rcx), %ecx
movq (%rdx,%rcx,8), %r13
cmpq %r14, %r13
jbe 0x307f2
jmp 0x30862
movq %r12, %r9
incq %r9
js 0x3084d
leaq -0x1(,%r9,2), %rcx
bsrq %rcx, %r10
leal -0x3(%r10), %ecx
movq %r11, %r13
shlq %cl, %r13
cmpq $0x6, %r10
notq %r13
cmovbq %rbx, %r13
addq %r13, %r9
notq %r13
andq %r9, %r13
jmp 0x30812
movq %r9, %rcx
btrq $0x3f, %rcx
cmpq $0x1, %rcx
movq %rsi, %r10
sbbq $0x0, %r10
jmp 0x3082d
cmpq %r14, %r12
je 0x30943
movl %r8d, (%rsp)
movq %rdi, %r13
callq 0x3110a
movq (%rax), %r15
movq %rax, 0x8(%rsp)
movb 0x18(%rax), %al
movb %al, 0x7(%rsp)
movl %eax, %ebx
cmpq %r14, %r12
jae 0x308cf
movq %r14, %r9
subq %r12, %r9
leaq 0x25d88(%rip), %rax     # 0x56622
cmpb $0x1, (%rax)
je 0x30958
leaq 0x26e06(%rip), %rax     # 0x576b0
movq (%rax), %rcx
leaq (%rcx,%r14), %rax
notq %rcx
andq %rax, %rcx
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %r13, %rdx
movq %r12, %r8
callq 0x29964
movl %eax, %ebx
xorb $0x1, %bl
movq %r15, %rbp
addq $0x1d8, %r15            # imm = 0x1D8
movq %r15, %rdi
callq 0x106d0
movq 0x8(%rsp), %rax
movq %r12, 0x10(%rax)
movb %bl, 0x18(%rax)
movq %r15, %rdi
callq 0x10440
movq %rbp, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0x2254d
subq %r14, %r12
movl (%rsp), %eax
jbe 0x30943
testb %al, %al
je 0x3092b
cmpb $0x0, 0x7(%rsp)
jne 0x30943
addq %r14, %r13
movq %r13, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x10270
jmp 0x30943
leaq 0x25d01(%rip), %rax     # 0x56633
cmpb $0x1, (%rax)
je 0x30912
leaq 0x25ce3(%rip), %rax     # 0x56621
cmpb $0x1, (%rax)
je 0x30985
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%r12,%r13), %rdi
pushq $0x5a
popq %rsi
movq %r9, %rdx
callq 0x10270
xorl %ebx, %ebx
jmp 0x308cf
pushq $0x5a
popq %rsi
movq %r9, %rdx
callq 0x10270
movl $0x0, (%rsp)
jmp 0x3078b
addq %r14, %r13
movq %r13, %rdi
movl $0xa5, %esi
jmp 0x30921