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

	usize = s2u(size);
	if (usize == 0)
		return (NULL);

	if (likely(usize <= large_maxclass)) {
		size_t copysize;

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

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

		/*
		 * Junk/zero-filling were already done by
		 * ipalloc()/arena_malloc().
		 */

		copysize = (usize < oldsize) ? usize : oldsize;
		JEMALLOC_VALGRIND_MAKE_MEM_UNDEFINED(ret, copysize);
		memcpy(ret, ptr, copysize);
		isqalloc(tsd, ptr, oldsize, tcache);
	} else {
		ret = huge_ralloc(tsd, arena, ptr, oldsize, usize, alignment,
		    zero, tcache);
	}
	return (ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r14
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %r10
movq 0x78(%rsp), %rdx
movb 0x70(%rsp), %r15b
cmpq $0x1000, %r8            # imm = 0x1000
ja 0x2a3b2
decq %r8
shrq $0x3, %r8
leaq 0x1dfcc(%rip), %rax     # 0x47fc0
movzbl (%rax,%r8), %eax
leaq 0x1d840(%rip), %rcx     # 0x47840
movq (%rcx,%rax,8), %r13
testq %r13, %r13
je 0x2a1c3
cmpq 0x3152c(%rip), %r13     # 0x5b540
ja 0x2a3e8
movq %r10, %rbx
movq %rdi, 0x18(%rsp)
movq %rdx, 0x8(%rsp)
movzbl %r15b, %r8d
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
movl %r8d, 0x24(%rsp)
callq 0x29a1b
testb %al, %al
je 0x2a3a0
movq %rbp, 0x10(%rsp)
testq %r14, %r14
je 0x2a1ca
cmpq $0xfff, %r14            # imm = 0xFFF
movq %rbx, %rsi
ja 0x2a0b2
cmpq $0x3800, %r13           # imm = 0x3800
ja 0x2a0b2
leaq (%r14,%r13), %rax
decq %rax
movq %r14, %rdi
negq %rdi
andq %rax, %rdi
cmpq $0x1000, %rdi           # imm = 0x1000
ja 0x2a740
decq %rdi
shrq $0x3, %rdi
leaq 0x1df2a(%rip), %rax     # 0x47fc0
movzbl (%rax,%rdi), %eax
leaq 0x1d79f(%rip), %rcx     # 0x47840
movq (%rcx,%rax,8), %rcx
cmpq $0x4000, %rcx           # imm = 0x4000
jb 0x2a18e
leaq 0x315ef(%rip), %rax     # 0x5b6a8
movq (%rax), %rdx
movq %r14, %rax
cmpq %r13, 0x3147a(%rip)     # 0x5b540
jb 0x2a135
movq %r14, %rax
cmpq %r14, %rdx
jbe 0x2a135
leaq 0xfff(%r14), %rax
andq $-0x1000, %rax          # imm = 0xF000
movl $0x4000, %ecx           # imm = 0x4000
cmpq $0x4001, %r13           # imm = 0x4001
jb 0x2a128
testq %r13, %r13
js 0x2a76b
leaq -0x1(,%r13,2), %rcx
bsrq %rcx, %r8
leal -0x3(%r8), %ecx
movq $-0x1, %rdi
shlq %cl, %rdi
cmpq $0x6, %r8
notq %rdi
movl $0x7, %ecx
cmovaeq %rdi, %rcx
leaq (%rcx,%r13), %rdi
notq %rcx
andq %rdi, %rcx
leaq (%rcx,%rax), %rdi
cmpq 0x31435(%rip), %rdi     # 0x5b568
jbe 0x2a18e
leaq 0x31574(%rip), %rcx     # 0x5b6b0
movq (%rcx), %r15
addq %r15, %rax
notq %r15
andq %rax, %r15
je 0x2a1c3
cmpq %r13, %rdx
jae 0x2a17f
cmpq $0x1000, %r13           # imm = 0x1000
ja 0x2a7c1
leaq -0x1(%r13), %rax
shrq $0x3, %rax
leaq 0x1de55(%rip), %rcx     # 0x47fc0
movzbl (%rcx,%rax), %eax
leaq 0x1d6ca(%rip), %rcx     # 0x47840
movq (%rcx,%rax,8), %rdx
cmpq %r13, %rdx
jb 0x2a1c3
movl $0xfff, %eax            # imm = 0xFFF
subq %r15, %rax
cmpq %rdx, %rax
jae 0x2a196
jmp 0x2a1c3
movq %rcx, %rdx
testq %rcx, %rcx
je 0x2a1c3
movq 0x18(%rsp), %rdi
movq %r14, %rcx
movl 0x24(%rsp), %r8d
movq 0x8(%rsp), %r9
callq 0x28c3d
movq %rax, %rbp
testq %rax, %rax
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %r15
jne 0x2a2b4
xorl %ebp, %ebp
jmp 0x2a3a0
movq %rbx, %r8
testq %rbx, %rbx
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
jne 0x2a1ee
movq 0x18(%rsp), %rax
movq 0x28(%rax), %r8
testq %r8, %r8
je 0x2a79c
cmpq $0x3800, %r13           # imm = 0x3800
ja 0x2a55b
testq %rdx, %rdx
je 0x2a643
cmpq $0x1000, %r13           # imm = 0x1000
ja 0x2a657
leaq -0x1(%r13), %rax
shrq $0x3, %rax
leaq 0x1dda0(%rip), %rcx     # 0x47fc0
movzbl (%rcx,%rax), %eax
movl %eax, %ebx
movq %rbx, %rax
shlq $0x5, %rax
leaq (%rdx,%rax), %r14
addq $0x20, %r14
leaq 0x1d604(%rip), %rax     # 0x47840
movq (%rax,%rbx,8), %r9
movl 0x10(%r14), %eax
testl %eax, %eax
je 0x2a674
decl %eax
movl %eax, 0x10(%r14)
cmpl 0x8(%r14), %eax
jl 0x2a6e1
movq 0x18(%r14), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rbp
testq %rbp, %rbp
je 0x2a67c
leaq 0x303ab(%rip), %rax     # 0x5a621
movb (%rax), %al
testb %r15b, %r15b
jne 0x2a6b5
testb %al, %al
jne 0x2a6ea
leaq 0x303a3(%rip), %rax     # 0x5a633
cmpb $0x1, (%rax)
movq 0x18(%rsp), %r15
je 0x2a724
incq (%r14)
movl 0x18(%rdx), %eax
incl %eax
movl %eax, 0x18(%rdx)
cmpl $0xd3, %eax
je 0x2a62c
cmpq %r12, %r13
cmovaeq %r12, %r13
leaq 0x303c2(%rip), %rax     # 0x5a684
cmpb $0x1, (%rax)
je 0x2a40a
movq %rbp, %rdi
movq %r13, %rdx
movq %rsi, %r14
callq 0x10400
leaq 0x30348(%rip), %rax     # 0x5a628
cmpq $0x0, (%rax)
jne 0x2a41f
leaq 0x313bf(%rip), %rax     # 0x5b6b0
movq (%rax), %rsi
notq %rsi
andq %r14, %rsi
cmpq %r14, %rsi
movq 0x8(%rsp), %rdx
movq %r14, %r9
je 0x2a42f
cmpq $0x3800, %r12           # imm = 0x3800
ja 0x2a43f
testq %rdx, %rdx
je 0x2a4d6
cmpq $0x1000, %r12           # imm = 0x1000
ja 0x2a4f0
decq %r12
shrq $0x3, %r12
leaq 0x1dc84(%rip), %rax     # 0x47fc0
movzbl (%rax,%r12), %eax
leaq 0x302da(%rip), %rcx     # 0x5a622
movl %eax, %r14d
cmpb $0x1, (%rcx)
je 0x2a507
movq %r14, %rax
shlq $0x5, %rax
leaq (%rdx,%rax), %rbx
addq $0x20, %rbx
leaq 0x31a46(%rip), %rax     # 0x5bdb0
movq (%rax), %rax
movl 0x10(%rbx), %r8d
cmpl (%rax,%r14,4), %r8d
je 0x2a524
movq 0x18(%rbx), %rax
movl %r8d, %ecx
movq %r9, (%rax,%rcx,8)
incl %r8d
movl %r8d, 0x10(%rbx)
movl 0x18(%rdx), %eax
incl %eax
movl %eax, 0x18(%rdx)
cmpl $0xd3, %eax
je 0x2a54b
movq %rbp, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, 0x18(%rsp)
leaq 0x30(%rsp), %rsi
movq %r8, %rdi
movq %rdx, %r13
movq %rbp, %rbx
movq %r10, %rbp
callq 0x12150
movq %rbp, %r10
movq %rbx, %rbp
movq %r13, %rdx
leaq 0x30(%rsp), %rax
movq (%rax), %r13
movq 0x18(%rsp), %rdi
jmp 0x2a004
movq %r10, %rsi
movq %rbp, %rdx
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3662f
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3e7a6
movq 0x10(%rsp), %rsi
jmp 0x2a2cb
movq %r15, %rdi
movq %r14, %rsi
callq 0x38e87
jmp 0x2a3a0
movq %r15, %rdi
movq %r9, %rsi
callq 0x36925
jmp 0x2a3a0
testq %rdx, %rdx
je 0x2a759
leaq 0x31991(%rip), %rax     # 0x5bde0
cmpq %r12, (%rax)
jb 0x2a759
movq %r12, %rdi
callq 0x2da8d
movl %eax, %r14d
leaq 0x301b8(%rip), %rax     # 0x5a622
cmpb $0x1, (%rax)
je 0x2a814
movl %r14d, %eax
movq %rax, %rcx
shlq $0x5, %rcx
movq 0x8(%rsp), %rdx
leaq (%rdx,%rcx), %rbx
addq $0x20, %rbx
leaq 0x3191f(%rip), %rcx     # 0x5bdb0
movq (%rcx), %rdx
movl 0x10(%rbx), %ecx
cmpl (%rdx,%rax,4), %ecx
je 0x2a82b
movq 0x18(%rbx), %rax
movl %ecx, %edx
movq 0x10(%rsp), %rsi
movq %rsi, (%rax,%rdx,8)
incl %ecx
movl %ecx, 0x10(%rbx)
movq 0x8(%rsp), %rcx
movl 0x18(%rcx), %eax
incl %eax
movl %eax, 0x18(%rcx)
cmpl $0xd3, %eax
jne 0x2a3a0
movq %r15, %rdi
movq 0x8(%rsp), %rsi
jmp 0x2a551
movq %r9, %rcx
subq %rsi, %rcx
shrq $0xc, %rcx
movq (%rsi), %rdi
movq %r9, %rdx
callq 0x29824
jmp 0x2a3a0
movq %r12, %rdi
callq 0x2da8d
movq 0x10(%rsp), %r9
movq 0x8(%rsp), %rdx
jmp 0x2a341
movq %r14, %rdi
movq %r9, %rsi
movq %r9, %rdx
callq 0x12261
movq 0x10(%rsp), %r9
movq 0x8(%rsp), %rdx
jmp 0x2a354
shrl %r8d
movq %r15, %rdi
movq %rdx, %rsi
movq %rbx, %rdx
movl %r14d, %ecx
callq 0x3c88f
movq 0x10(%rsp), %r9
movq 0x8(%rsp), %rdx
movl 0x10(%rbx), %r8d
jmp 0x2a37b
movq %r15, %rdi
movq %rdx, %rsi
callq 0x3c7e1
jmp 0x2a3a0
movq %r8, 0x28(%rsp)
cmpq %r13, 0x30fd9(%rip)     # 0x5b540
jb 0x2a7dd
cmpq $0x0, 0x8(%rsp)
je 0x2a786
leaq 0x31860(%rip), %rax     # 0x5bde0
cmpq %r13, (%rax)
jb 0x2a786
movq %r13, %rdi
callq 0x2da8d
movl %eax, %eax
leaq 0x1d2a6(%rip), %rcx     # 0x47840
movq (%rcx,%rax,8), %rdx
shlq $0x5, %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax), %r14
addq $0x20, %r14
movl 0x10(%r14), %eax
testl %eax, %eax
je 0x2a848
decl %eax
movl %eax, 0x10(%r14)
cmpl 0x8(%r14), %eax
jl 0x2a872
movq 0x18(%r14), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rbp
testq %rbp, %rbp
je 0x2a850
testb %r15b, %r15b
jne 0x2a80d
leaq 0x30033(%rip), %rax     # 0x5a621
cmpb $0x1, (%rax)
je 0x2a87b
leaq 0x30035(%rip), %rax     # 0x5a633
cmpb $0x1, (%rax)
je 0x2a80d
incq (%r14)
movq 0x8(%rsp), %rcx
movl 0x18(%rcx), %eax
incl %eax
movl %eax, 0x18(%rcx)
cmpl $0xd3, %eax
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %rsi
jne 0x2a2b4
movq %r15, %rdi
movq 0x8(%rsp), %rsi
callq 0x3c7e1
movq 0x10(%rsp), %rsi
jmp 0x2a2b4
movq %r8, %rdi
movq %r13, %rsi
movl 0x24(%rsp), %edx
callq 0x2872f
jmp 0x2a1ad
movq %r13, %rdi
movq %r8, %rbx
callq 0x2da8d
movq %rbx, %r8
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
jmp 0x2a224
movl $0xffffffff, 0x8(%r14)  # imm = 0xFFFFFFFF
movq 0x18(%rsp), %rdi
movq %r8, %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rcx
movl %ebx, %r8d
movq %r9, %rbp
callq 0x3cbd1
movq %rbp, %r9
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rax, %rbp
testq %rax, %rax
jne 0x2a26f
jmp 0x2a1c3
movq %r9, %r15
testb %al, %al
jne 0x2a7fd
movq %rbp, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x10270
movq 0x18(%rsp), %r15
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
jmp 0x2a29e
movl %eax, 0x8(%r14)
jmp 0x2a25c
leaq (%rbx,%rbx,2), %rax
shlq $0x5, %rax
leaq 0x2ffa7(%rip), %rcx     # 0x5a6a0
movq %rbp, %rdi
subq 0x8(%rax,%rcx), %rdi
movq 0x10(%rax,%rcx), %rdx
movl $0xa5, %esi
callq 0x10270
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %r15
jmp 0x2a29e
movq %rbp, %rdi
xorl %esi, %esi
movq %r9, %rdx
callq 0x10270
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
jmp 0x2a29e
leaq 0x30(%rsp), %rbp
movq %rbp, %rsi
callq 0x1219a
movq %rbx, %rsi
movq (%rbp), %rcx
jmp 0x2a0a5
movq (%rsi), %rdi
movq 0x10(%rsp), %rdx
callq 0x299db
jmp 0x2a3a0
movq %r13, %rcx
btrq $0x3f, %rcx
cmpq $0x1, %rcx
movl $0x40, %r8d
sbbq $0x0, %r8
jmp 0x2a100
movq 0x28(%rsp), %rdi
movq %r13, %rsi
movl 0x24(%rsp), %edx
callq 0x289f1
jmp 0x2a1ad
movq 0x18(%rsp), %rdi
callq 0x22135
testq %rax, %rax
je 0x2a1c3
movq %rax, %r8
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
jmp 0x2a1ee
leaq 0x30(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x121ca
movq %rbx, %rsi
movq (%rbp), %rdx
jmp 0x2a17a
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %r13, %rdx
movl 0x24(%rsp), %ecx
movq 0x8(%rsp), %r8
callq 0x360a4
jmp 0x2a1ad
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x12214
jmp 0x2a6c0
movq %rbp, %rdi
xorl %esi, %esi
jmp 0x2a883
movq 0x10(%rsp), %rdi
movl $0x5a, %esi
movq %r12, %rdx
callq 0x10270
jmp 0x2a473
shrl %ecx
movq %r15, %rdi
movq %rbx, %rsi
movl %r14d, %edx
movq 0x8(%rsp), %r8
callq 0x3ca47
movl 0x10(%rbx), %ecx
jmp 0x2a4a0
movl $0xffffffff, 0x8(%r14)  # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rdi
movq %rdx, %rsi
movl 0x24(%rsp), %edx
callq 0x289f1
movq %rax, %rbp
testq %rax, %rax
jne 0x2a60a
jmp 0x2a1c3
movl %eax, 0x8(%r14)
jmp 0x2a5cb
movq %rbp, %rdi
movl $0xa5, %esi
callq 0x10270
jmp 0x2a607