// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/deps/jemalloc/src/huge.c
// Function: je_huge_ralloc
void *
huge_ralloc(tsd_t *tsd, arena_t *arena, void *ptr, size_t oldsize, size_t usize,
    size_t alignment, bool zero, tcache_t *tcache)
{
	void *ret;
	size_t copysize;

	/* Try to avoid moving the allocation. */
	if (!huge_ralloc_no_move(ptr, oldsize, usize, usize, zero))
		return (ptr);

	/*
	 * usize and oldsize are different enough that we need to use a
	 * different size class.  In that case, fall back to allocating new
	 * space and copying.
	 */
	ret = huge_ralloc_move_helper(tsd, arena, usize, alignment, zero,
	    tcache);
	if (ret == NULL)
		return (NULL);

	copysize = (usize < oldsize) ? usize : oldsize;
	memcpy(ret, ptr, copysize);
	isqalloc(tsd, ptr, oldsize, tcache);
	return (ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %rbp
movq %rcx, %r13
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, (%rsp)
movzbl 0x40(%rsp), %r12d
movq %rdx, %rdi
movq %rcx, %rsi
movq %r8, %rdx
movq %r8, %rcx
movl %r12d, %r8d
callq 0x36133
testb %al, %al
je 0x3678b
movq 0x48(%rsp), %r9
leaq 0x2502d(%rip), %rax     # 0x5b6a8
cmpq %rbx, (%rax)
jb 0x367a4
movq (%rsp), %rdi
movq %r14, %rsi
movq %rbp, %rdx
movl %r12d, %ecx
movq %r9, %r14
movq %r9, %r8
callq 0x360a4
movq %rax, %rbx
testq %rax, %rax
je 0x36790
cmpq %r13, %rbp
cmovaeq %r13, %rbp
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x10400
leaq 0x23f64(%rip), %rax     # 0x5a628
cmpq $0x0, (%rax)
jne 0x367c1
leaq 0x24fdb(%rip), %rax     # 0x5b6b0
movq (%rax), %rsi
notq %rsi
andq %r15, %rsi
cmpq %r15, %rsi
je 0x367cf
cmpq $0x3800, %r13           # imm = 0x3800
movq %r14, %r9
ja 0x367e0
testq %r9, %r9
je 0x3686f
cmpq $0x1000, %r13           # imm = 0x1000
ja 0x36889
decq %r13
shrq $0x3, %r13
leaq 0x118a5(%rip), %rax     # 0x47fc0
movzbl (%rax,%r13), %eax
leaq 0x23efb(%rip), %rcx     # 0x5a622
movl %eax, %r13d
cmpb $0x1, (%rcx)
je 0x3689c
movq %r13, %rax
shlq $0x5, %rax
leaq (%r9,%rax), %rbp
addq $0x20, %rbp
leaq 0x25667(%rip), %rax     # 0x5bdb0
movq (%rax), %rax
movl 0x10(%rbp), %r8d
cmpl (%rax,%r13,4), %r8d
je 0x368c5
movq 0x18(%rbp), %rax
movl %r8d, %ecx
movq %r15, (%rax,%rcx,8)
incl %r8d
movl %r8d, 0x10(%rbp)
movl 0x18(%r9), %eax
incl %eax
movl %eax, 0x18(%r9)
cmpl $0xd3, %eax
jne 0x36792
movq (%rsp), %rdi
movq %r9, %rsi
callq 0x3c7e1
jmp 0x36792
movq %r15, %rbx
jmp 0x36792
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
movl %r12d, %r8d
movq %r9, %r14
callq 0x12382
jmp 0x3669c
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x38e87
jmp 0x36792
movq (%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x36925
jmp 0x36792
testq %r9, %r9
je 0x368e9
leaq 0x255f0(%rip), %rax     # 0x5bde0
cmpq %r13, (%rax)
jb 0x368e9
movq %r9, %r14
movq %r13, %rdi
callq 0x36dea
movl %eax, %ebp
leaq 0x23e15(%rip), %rax     # 0x5a622
cmpb $0x1, (%rax)
je 0x368f9
movl %ebp, %eax
movq %rax, %rcx
shlq $0x5, %rcx
leaq (%r14,%rcx), %r13
addq $0x20, %r13
leaq 0x25582(%rip), %rcx     # 0x5bdb0
movq (%rcx), %rdx
movl 0x10(%r13), %ecx
cmpl (%rdx,%rax,4), %ecx
je 0x36909
movq 0x18(%r13), %rax
movl %ecx, %edx
movq %r15, (%rax,%rdx,8)
incl %ecx
movl %ecx, 0x10(%r13)
movl 0x18(%r14), %eax
incl %eax
movl %eax, 0x18(%r14)
cmpl $0xd3, %eax
jne 0x36792
movq (%rsp), %rdi
movq %r14, %rsi
jmp 0x36784
movq %r15, %rcx
subq %rsi, %rcx
shrq $0xc, %rcx
movq (%rsi), %rdi
movq %r15, %rdx
callq 0x298af
jmp 0x36792
movq %r13, %rdi
movq %r9, %r14
callq 0x36dea
movq %r14, %r9
jmp 0x36720
leaq (,%r13,2), %rsi
addq %r13, %rsi
shlq $0x5, %rsi
addq 0x21726(%rip), %rsi     # 0x57fd8
movq %r15, %rdi
movq %r9, %r14
callq 0x2859f
movq %r14, %r9
jmp 0x36733
shrl %r8d
movq (%rsp), %rdi
movq %r9, %rsi
movq %rbp, %rdx
movl %r13d, %ecx
movq %r9, %r14
callq 0x3c88f
movq %r14, %r9
movl 0x10(%rbp), %r8d
jmp 0x3675a
movq (%rsi), %rdi
movq %r15, %rdx
callq 0x299db
jmp 0x36792
movq %r15, %rdi
movq %r13, %rsi
callq 0x298b4
jmp 0x36816
shrl %ecx
movq (%rsp), %rdi
movq %r13, %rsi
movl %ebp, %edx
movq %r14, %r8
callq 0x3ca47
movl 0x10(%r13), %ecx
jmp 0x3683e