// File: /workspace/github_c_makefile_star2_O2/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 $0x28, %rsp
movq %r9, %r15
movq %rcx, %r12
pushq $-0x1
popq %r13
pushq $0x7
popq %r9
pushq $0x40
popq %r10
cmpq $0x1000, %r8            # imm = 0x1000
ja 0x25152
decq %r8
shrq $0x3, %r8
leaq 0x1dd63(%rip), %rax     # 0x42b00
movzbl (%rax,%r8), %eax
leaq 0x1d5d7(%rip), %rcx     # 0x42380
movq (%rcx,%rax,8), %r13
testq %r13, %r13
je 0x24f70
cmpq 0x32783(%rip), %r13     # 0x57540
ja 0x25186
movq %r10, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movb 0x60(%rsp), %r14b
movzbl %r14b, %ebx
movq %rdx, %rdi
movq %r12, %rsi
movq %rdx, %rbp
movq %r13, %rdx
xorl %ecx, %ecx
movl %ebx, %r8d
callq 0x24648
testb %al, %al
je 0x25140
movq %rbp, 0x8(%rsp)
testq %r15, %r15
je 0x24f77
cmpq $0xfff, %r15            # imm = 0xFFF
ja 0x24e68
cmpq $0x3800, %r13           # imm = 0x3800
ja 0x24e68
leaq (%r15,%r13), %rax
decq %rax
movq %r15, %rdx
negq %rdx
andq %rax, %rdx
cmpq $0x1000, %rdx           # imm = 0x1000
ja 0x254b4
decq %rdx
shrq $0x3, %rdx
leaq 0x1dcb3(%rip), %rax     # 0x42b00
movzbl (%rax,%rdx), %eax
leaq 0x1d528(%rip), %rcx     # 0x42380
movq (%rcx,%rax,8), %rax
cmpq $0x4000, %rax           # imm = 0x4000
jb 0x24f3e
leaq 0x32839(%rip), %rax     # 0x576a8
movq (%rax), %rdx
movq %r15, %rsi
cmpq %r13, 0x326c4(%rip)     # 0x57540
jb 0x24ee5
movq %r15, %rsi
cmpq %r15, %rdx
jbe 0x24ee5
leaq 0xfff(%r15), %rsi
andq $-0x1000, %rsi          # imm = 0xF000
movl $0x4000, %eax           # imm = 0x4000
cmpq $0x4001, %r13           # imm = 0x4001
jb 0x24ed8
testq %r13, %r13
js 0x254f7
leaq -0x1(,%r13,2), %rax
bsrq %rax, %rdi
leal -0x3(%rdi), %ecx
pushq $-0x1
popq %rax
shlq %cl, %rax
cmpq $0x6, %rdi
notq %rax
pushq $0x7
popq %rcx
cmovbq %rcx, %rax
leaq (%rax,%r13), %rcx
notq %rax
andq %rcx, %rax
leaq (%rax,%rsi), %rcx
cmpq 0x32685(%rip), %rcx     # 0x57568
jbe 0x24f3e
leaq 0x327c4(%rip), %rax     # 0x576b0
movq (%rax), %rax
addq %rax, %rsi
notq %rax
andq %rsi, %rax
je 0x24f70
cmpq %r13, %rdx
jae 0x24f2f
cmpq $0x1000, %r13           # imm = 0x1000
ja 0x25523
leaq -0x1(%r13), %rcx
shrq $0x3, %rcx
leaq 0x1dbe5(%rip), %rdx     # 0x42b00
movzbl (%rdx,%rcx), %ecx
leaq 0x1d45a(%rip), %rdx     # 0x42380
movq (%rdx,%rcx,8), %rdx
cmpq %r13, %rdx
jb 0x24f70
movl $0xfff, %ecx            # imm = 0xFFF
subq %rax, %rcx
cmpq %rdx, %rcx
jae 0x24f46
jmp 0x24f70
movq %rax, %rdx
testq %rax, %rax
je 0x24f70
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %r15, %rcx
movl %ebx, %r8d
movq (%rsp), %r9
callq 0x23953
movq %rax, %rbp
testq %rax, %rax
movq 0x8(%rsp), %rsi
jne 0x25056
xorl %ebp, %ebp
jmp 0x25140
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x285b4
testq %rax, %rax
je 0x24f70
movq %rax, %r8
cmpq $0x3800, %r13           # imm = 0x3800
movq 0x8(%rsp), %rsi
movq (%rsp), %rdx
ja 0x25302
testq %rdx, %rdx
je 0x253e3
cmpq $0x1000, %r13           # imm = 0x1000
ja 0x253f5
leaq -0x1(%r13), %rax
shrq $0x3, %rax
leaq 0x1db37(%rip), %rcx     # 0x42b00
movzbl (%rcx,%rax), %eax
movl %eax, %r15d
movq %r15, %rax
shlq $0x5, %rax
leaq (%rdx,%rax), %rbx
addq $0x20, %rbx
leaq 0x1d39a(%rip), %rax     # 0x42380
movq (%rax,%r15,8), %r9
movl 0x10(%rbx), %eax
testl %eax, %eax
je 0x25411
decl %eax
movl %eax, 0x10(%rbx)
cmpl 0x8(%rbx), %eax
jl 0x25472
movq 0x18(%rbx), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rbp
testq %rbp, %rbp
je 0x25415
leaq 0x31604(%rip), %rax     # 0x56621
movb (%rax), %al
testb %r14b, %r14b
jne 0x2544c
testb %al, %al
jne 0x2547a
leaq 0x315fc(%rip), %rax     # 0x56633
cmpb $0x1, (%rax)
je 0x25499
incq (%rbx)
movl 0x18(%rdx), %eax
incl %eax
movl %eax, 0x18(%rdx)
cmpl $0xd3, %eax
je 0x253cb
cmpq %r12, %r13
cmovaeq %r12, %r13
leaq 0x31620(%rip), %rax     # 0x56684
cmpb $0x1, (%rax)
je 0x251a2
movq %rbp, %rdi
movq %rsi, %rbx
movq %r13, %rdx
callq 0x10400
leaq 0x315a6(%rip), %rax     # 0x56628
cmpq $0x0, (%rax)
jne 0x251b7
leaq 0x3261d(%rip), %rax     # 0x576b0
movq (%rax), %rsi
notq %rsi
andq %rbx, %rsi
cmpq %rbx, %rsi
movq %rbx, %r9
movq (%rsp), %rdx
je 0x251c9
cmpq $0x3800, %r12           # imm = 0x3800
ja 0x251db
testq %rdx, %rdx
je 0x25274
cmpq $0x1000, %r12           # imm = 0x1000
ja 0x2528e
decq %r12
shrq $0x3, %r12
leaq 0x1da23(%rip), %rax     # 0x42b00
movzbl (%rax,%r12), %eax
leaq 0x31539(%rip), %rcx     # 0x56622
movl %eax, %ebx
cmpb $0x1, (%rcx)
je 0x252a4
movq %rbx, %rax
shlq $0x5, %rax
leaq (%rdx,%rax), %r15
addq $0x20, %r15
leaq 0x32ca6(%rip), %rax     # 0x57db0
movq (%rax), %rax
movl 0x10(%r15), %r8d
cmpl (%rax,%rbx,4), %r8d
je 0x252c8
movq 0x18(%r15), %rax
movl %r8d, %ecx
movq %r9, (%rax,%rcx,8)
incl %r8d
movl %r8d, 0x10(%r15)
movl 0x18(%rdx), %eax
incl %eax
movl %eax, 0x18(%rdx)
cmpl $0xd3, %eax
je 0x252f0
movq %rbp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r8, %r8
js 0x25568
leaq -0x1(,%r8,2), %rax
bsrq %rax, %rax
leal -0x3(%rax), %ecx
shlq %cl, %r13
cmpq $0x6, %rax
notq %r13
cmovbq %r9, %r13
addq %r13, %r8
notq %r13
andq %r8, %r13
jmp 0x24dad
movq %r12, %rcx
movq %r13, %r8
movq %r15, %r9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30ad9
movq %rbp, %rdi
movq %r13, %rsi
callq 0x38f6a
movq 0x8(%rsp), %rsi
jmp 0x2506d
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x3366e
jmp 0x25140
movq 0x10(%rsp), %rdi
movq %r9, %rsi
callq 0x30dbc
jmp 0x25140
testq %rdx, %rdx
je 0x254e5
leaq 0x32bf5(%rip), %rax     # 0x57de0
cmpq %r12, (%rax)
jb 0x254e5
movq %r12, %rdi
callq 0x284a4
movl %eax, %r15d
leaq 0x3141c(%rip), %rax     # 0x56622
cmpb $0x1, (%rax)
je 0x255f1
movl %r15d, %eax
movq %rax, %rcx
shlq $0x5, %rcx
movq (%rsp), %rdx
leaq (%rdx,%rcx), %rbx
addq $0x20, %rbx
leaq 0x32b84(%rip), %rcx     # 0x57db0
movq (%rcx), %rdx
movl 0x10(%rbx), %ecx
cmpl (%rdx,%rax,4), %ecx
je 0x25606
movq 0x18(%rbx), %rax
movl %ecx, %edx
movq 0x8(%rsp), %rsi
movq %rsi, (%rax,%rdx,8)
incl %ecx
movl %ecx, 0x10(%rbx)
movq (%rsp), %rcx
movl 0x18(%rcx), %eax
incl %eax
movl %eax, 0x18(%rcx)
cmpl $0xd3, %eax
jne 0x25140
movq 0x10(%rsp), %rdi
movq (%rsp), %rsi
jmp 0x252f8
movq %r9, %rcx
subq %rsi, %rcx
shrq $0xc, %rcx
movq (%rsi), %rdi
movq %r9, %rdx
callq 0x244f0
jmp 0x25140
movq %r12, %rdi
callq 0x284a4
movq (%rsp), %rdx
movq 0x8(%rsp), %r9
jmp 0x250e2
imulq $0x60, %rbx, %rax
leaq 0x313f1(%rip), %rsi     # 0x566a0
addq %rax, %rsi
movq %r9, %rdi
callq 0x233ee
movq (%rsp), %rdx
movq 0x8(%rsp), %r9
jmp 0x250f4
shrl %r8d
movq 0x10(%rsp), %rdi
movq (%rsp), %rsi
movq %r15, %rdx
movl %ebx, %ecx
callq 0x37034
movq (%rsp), %rdx
movq 0x8(%rsp), %r9
movl 0x10(%r15), %r8d
jmp 0x2511b
movq %rdx, %rsi
movq 0x10(%rsp), %rdi
callq 0x36f85
jmp 0x25140
movq %r8, 0x18(%rsp)
cmpq %r13, 0x32232(%rip)     # 0x57540
jb 0x25580
cmpq $0x0, (%rsp)
je 0x2550f
leaq 0x32aba(%rip), %rax     # 0x57de0
cmpq %r13, (%rax)
jb 0x2550f
movq %r13, %rdi
callq 0x284a4
movl %eax, %eax
leaq 0x1d040(%rip), %rcx     # 0x42380
movq (%rcx,%rax,8), %rdx
shlq $0x5, %rax
movq (%rsp), %rcx
leaq (%rcx,%rax), %r15
addq $0x20, %r15
movl 0x10(%r15), %eax
testl %eax, %eax
je 0x25624
decl %eax
movl %eax, 0x10(%r15)
cmpl 0x8(%r15), %eax
jl 0x25649
movq 0x18(%r15), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rbp
testq %rbp, %rbp
je 0x25629
testb %r14b, %r14b
jne 0x255ea
leaq 0x3128e(%rip), %rax     # 0x56621
cmpb $0x1, (%rax)
je 0x25652
leaq 0x31290(%rip), %rax     # 0x56633
cmpb $0x1, (%rax)
je 0x255ea
incq (%r15)
movq (%rsp), %rcx
movl 0x18(%rcx), %eax
incl %eax
movl %eax, 0x18(%rcx)
cmpl $0xd3, %eax
movq 0x8(%rsp), %rsi
jne 0x25056
movq 0x10(%rsp), %rdi
movq (%rsp), %rsi
callq 0x36f85
movq 0x8(%rsp), %rsi
jmp 0x25056
movq %r8, %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x2351e
jmp 0x24f5f
movq %r13, %rdi
movq %r8, %rbx
callq 0x284a4
movq %rbx, %r8
movq (%rsp), %rdx
movq 0x8(%rsp), %rsi
jmp 0x24fcd
orl $-0x1, 0x8(%rbx)
movq 0x10(%rsp), %rdi
movq %r8, %rsi
movq (%rsp), %rdx
movq %rbx, %rcx
movl %r15d, %r8d
movq %r9, %rbp
callq 0x37313
movq %rbp, %r9
movq (%rsp), %rdx
movq 0x8(%rsp), %rsi
movq %rax, %rbp
testq %rax, %rax
jne 0x25016
jmp 0x24f70
movq %r9, %r14
testb %al, %al
jne 0x2559d
movq %rbp, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x10270
movq 0x8(%rsp), %rsi
movq (%rsp), %rdx
jmp 0x25040
movl %eax, 0x8(%rbx)
jmp 0x25003
imulq $0x60, %r15, %rax
leaq 0x3121b(%rip), %rcx     # 0x566a0
movq %rbp, %rdi
subq 0x8(%rax,%rcx), %rdi
movq 0x10(%rax,%rcx), %rdx
movl $0xa5, %esi
jmp 0x254a1
movq %rbp, %rdi
xorl %esi, %esi
movq %r9, %rdx
callq 0x10270
movq (%rsp), %rdx
movq 0x8(%rsp), %rsi
jmp 0x25040
leaq -0x1(,%rdx,2), %rax
bsrq %rax, %rsi
leal -0x3(%rsi), %ecx
pushq $-0x1
popq %rax
shlq %cl, %rax
cmpq $0x6, %rsi
notq %rax
pushq $0x7
popq %rcx
cmovbq %rcx, %rax
addq %rax, %rdx
notq %rax
andq %rdx, %rax
jmp 0x24e5c
movq (%rsi), %rdi
movq 0x8(%rsp), %rdx
callq 0x24608
jmp 0x25140
movq %r13, %rax
btrq $0x3f, %rax
cmpq $0x1, %rax
pushq $0x40
popq %rdi
sbbq $0x0, %rdi
jmp 0x24eb7
movq 0x18(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x236e4
jmp 0x24f5f
testq %r13, %r13
js 0x25664
leaq -0x1(,%r13,2), %rcx
bsrq %rcx, %rcx
movq %rcx, 0x20(%rsp)
movq 0x20(%rsp), %rsi
leal -0x3(%rsi), %ecx
pushq $-0x1
popq %rdx
shlq %cl, %rdx
cmpq $0x6, %rsi
notq %rdx
pushq $0x7
popq %rcx
cmovbq %rcx, %rdx
leaq (%rdx,%r13), %rcx
notq %rdx
andq %rcx, %rdx
jmp 0x24f2a
movq %r8, %rax
btrq $0x3f, %rax
cmpq $0x1, %rax
movq %r10, %rax
sbbq $0x0, %rax
jmp 0x25167
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %r13, %rdx
movl %ebx, %ecx
movq (%rsp), %r8
callq 0x2fd7c
jmp 0x24f5f
imulq $0x60, %r15, %rax
movq %rax, 0x18(%rsp)
leaq 0x310f3(%rip), %rcx     # 0x566a0
movq 0x8(%rax,%rcx), %r15
movq %rbp, %rdi
subq %r15, %rdi
movl $0xa5, %esi
movq %r15, %rdx
callq 0x10270
leaq 0x310d4(%rip), %rax     # 0x566a0
movq 0x18(%rsp), %rcx
movq (%rcx,%rax), %rdi
addq %rbp, %rdi
movl $0xa5, %esi
movq %r15, %rdx
callq 0x10270
jmp 0x25457
movq %rbp, %rdi
xorl %esi, %esi
jmp 0x2565a
pushq $0x5a
popq %rsi
movq 0x8(%rsp), %rdi
movq %r12, %rdx
callq 0x10270
jmp 0x2520f
shrl %ecx
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movl %r15d, %edx
movq (%rsp), %r8
callq 0x371b7
movl 0x10(%rbx), %ecx
jmp 0x2523b
orl $-0x1, 0x8(%r15)
movq 0x18(%rsp), %rdi
movq %rdx, %rsi
movl %ebx, %edx
callq 0x236e4
movq %rax, %rbp
testq %rax, %rax
jne 0x253af
jmp 0x24f70
movl %eax, 0x8(%r15)
jmp 0x25370
movq %rbp, %rdi
movl $0xa5, %esi
callq 0x10270
jmp 0x253ac
movq %r13, %rcx
btrq $0x3f, %rcx
cmpq $0x1, %rcx
sbbq $0x0, 0x20(%rsp)
jmp 0x2553d