// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 (unlikely(usize == 0 || size > HUGE_MAXCLASS))
		return (NULL);

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

		/* Try to avoid moving the allocation. */
		if (!arena_ralloc_no_move(tsd_tsdn(tsd), 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_tsdn(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, true);
	} 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, %r15
movq %rcx, %r10
movq %rdx, %r9
movabsq $0x7000000000000000, %r12 # imm = 0x7000000000000000
cmpq $0x1000, %r8            # imm = 0x1000
ja 0xec5a
leaq -0x1(%r8), %rax
shrq $0x3, %rax
leaq 0x2d581(%rip), %rcx     # 0x3bdc0
movzbl (%rcx,%rax), %eax
leaq 0x2cdf6(%rip), %rcx     # 0x3b640
movq (%rcx,%rax,8), %r13
xorl %ebp, %ebp
cmpq %r12, %r8
ja 0xec48
testq %r13, %r13
je 0xec48
cmpq 0x3e737(%rip), %r13     # 0x4cfa0
ja 0xec97
movq %rsi, 0x20(%rsp)
movq 0x78(%rsp), %rax
movq %rax, (%rsp)
movb 0x70(%rsp), %r14b
movzbl %r14b, %ebx
movq %rdi, 0x10(%rsp)
movq %r9, %rsi
movq %r10, 0x18(%rsp)
movq %r10, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
movq %r9, %rbp
movl %ebx, %r9d
callq 0xe06d
testb %al, %al
je 0xec48
movq %rbp, 0x8(%rsp)
testq %r15, %r15
je 0xe9ed
cmpq $0xfff, %r15            # imm = 0xFFF
movq (%rsp), %r9
ja 0xe919
cmpq $0x3800, %r13           # imm = 0x3800
ja 0xe919
leaq (%r15,%r13), %rcx
decq %rcx
movq %r15, %rax
negq %rax
andq %rcx, %rax
cmpq $0x1000, %rax           # imm = 0x1000
ja 0xf032
decq %rax
shrq $0x3, %rax
leaq 0x2d4c3(%rip), %rcx     # 0x3bdc0
movzbl (%rcx,%rax), %eax
leaq 0x2cd38(%rip), %rcx     # 0x3b640
movq (%rcx,%rax,8), %rdx
cmpq $0x4000, %rdx           # imm = 0x4000
jb 0xeafd
leaq 0x3e7a8(%rip), %rax     # 0x4d0c8
movq (%rax), %rsi
movq %r15, %rax
cmpq %r13, 0x3e673(%rip)     # 0x4cfa0
jb 0xe99a
movq %r15, %rax
cmpq %r15, %rsi
jbe 0xe99a
leaq 0xfff(%r15), %rax
andq $-0x1000, %rax          # imm = 0xF000
movl $0x4000, %edx           # imm = 0x4000
cmpq $0x4001, %r13           # imm = 0x4001
jb 0xe989
cmpq %r12, %r13
ja 0xf07f
leaq -0x1(,%r13,2), %rcx
bsrq %rcx, %rdi
movl %edi, %ecx
addb $-0x3, %cl
pushq $-0x1
popq %rdx
shlq %cl, %rdx
cmpl $0x6, %edi
notq %rdx
pushq $0x7
popq %rcx
cmovbq %rcx, %rdx
leaq (%rdx,%r13), %rcx
notq %rdx
andq %rcx, %rdx
leaq (%rdx,%rax), %rcx
cmpq 0x3e63c(%rip), %rcx     # 0x4cfd0
jbe 0xeafd
cmpq %r12, %rax
ja 0xe9e6
leaq 0x3e72a(%rip), %rcx     # 0x4d0d0
movq (%rcx), %rdx
cmpq %r13, %rsi
jae 0xeae3
cmpq $0x1000, %r13           # imm = 0x1000
ja 0xf086
leaq -0x1(%r13), %rcx
shrq $0x3, %rcx
leaq 0x2d3f2(%rip), %rsi     # 0x3bdc0
movzbl (%rsi,%rcx), %ecx
leaq 0x2cc67(%rip), %rsi     # 0x3b640
movq (%rsi,%rcx,8), %rsi
cmpq %r13, %rsi
jae 0xeae3
xorl %edx, %edx
jmp 0xeafd
cmpq $0x1000, %r13           # imm = 0x1000
movq 0x8(%rsp), %rsi
movq (%rsp), %r8
movq 0x18(%rsp), %rdi
ja 0xee34
leaq -0x1(%r13), %rax
shrq $0x3, %rax
leaq 0x2d3a9(%rip), %rcx     # 0x3bdc0
movzbl (%rcx,%rax), %r12d
testq %r8, %r8
je 0xef1d
movl %r12d, %r15d
cmpq $0x3800, %r13           # imm = 0x3800
ja 0xee52
movq %r15, %rax
shlq $0x5, %rax
leaq (%r8,%rax), %rbx
addq $0x28, %rbx
movl 0x10(%rbx), %eax
testq %rax, %rax
je 0xef47
movq 0x18(%rbx), %rcx
leaq (,%rax,8), %rdx
negq %rdx
movq (%rcx,%rdx), %rbp
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rbx)
cmpl 0x8(%rbx), %ecx
jl 0xefeb
testq %rax, %rax
je 0xef52
leaq 0x2cbbe(%rip), %rax     # 0x3b640
movq (%rax,%r15,8), %r12
leaq 0x3da94(%rip), %rax     # 0x4c521
movb (%rax), %al
testb %r14b, %r14b
jne 0xefba
testb %al, %al
jne 0xeff3
leaq 0x3da8c(%rip), %rax     # 0x4c533
cmpb $0x1, (%rax)
je 0xf012
incq (%rbx)
movl 0x18(%r8), %eax
testl %eax, %eax
jle 0xefe2
leal -0x1(%rax), %ecx
movl %ecx, 0x18(%r8)
testl %eax, %eax
jg 0xeb39
movq 0x10(%rsp), %rdi
movq %r8, %rsi
callq 0x350b5
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
jmp 0xeb39
addq %rdx, %rax
notq %rdx
andq %rax, %rdx
movl $0xfff, %eax            # imm = 0xFFF
subq %rdx, %rax
xorl %edx, %edx
cmpq %rsi, %rax
cmovaeq %rsi, %rdx
movabsq $-0x7000000000000001, %rax # imm = 0x8FFFFFFFFFFFFFFF
leaq (%rdx,%rax), %rcx
incq %rax
cmpq %rax, %rcx
jb 0xf12d
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %r15, %rcx
movl %ebx, %r8d
callq 0xd4f0
movq %rax, %rbp
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdi
testq %rbp, %rbp
je 0xec46
cmpq %rdi, %r13
cmovaeq %rdi, %r13
leaq 0x3da4c(%rip), %rax     # 0x4c59c
cmpb $0x1, (%rax)
je 0xecb6
movq %rbp, %rdi
movq %r13, %rdx
movq %rsi, %rbx
callq 0xb340
leaq 0x3d9ba(%rip), %rax     # 0x4c528
cmpq $0x0, (%rax)
jne 0xeccb
leaq 0x3e551(%rip), %rax     # 0x4d0d0
movq (%rax), %rdx
notq %rdx
andq %rbx, %rdx
cmpq %rbx, %rdx
movq %rbx, %rcx
je 0xecdd
movq 0x18(%rsp), %rdi
cmpq $0x3800, %rdi           # imm = 0x3800
ja 0xecef
movq (%rsp), %rsi
testq %rsi, %rsi
je 0xed94
cmpq $0x1000, %rdi           # imm = 0x1000
ja 0xedb0
decq %rdi
shrq $0x3, %rdi
leaq 0x2d1f2(%rip), %rax     # 0x3bdc0
movzbl (%rax,%rdi), %ebx
leaq 0x3d949(%rip), %rax     # 0x4c522
cmpb $0x1, (%rax)
movl %ebx, %r14d
movq 0x10(%rsp), %rdi
je 0xedc5
movq %r14, %rax
shlq $0x5, %rax
leaq (%rsi,%rax), %r15
addq $0x28, %r15
leaq 0x3e878(%rip), %rax     # 0x4d478
movq (%rax), %rax
movl (%rax,%r14,4), %r8d
cmpl %r8d, 0x10(%r15)
je 0xee0c
movl 0x10(%r15), %eax
incl %eax
movl %eax, 0x10(%r15)
movq 0x18(%r15), %rdx
shlq $0x3, %rax
negq %rax
movq %rcx, (%rdx,%rax)
movl 0x18(%rsi), %eax
testl %eax, %eax
jle 0xee2c
leal -0x1(%rax), %ecx
movl %ecx, 0x18(%rsi)
testl %eax, %eax
jg 0xec48
callq 0x350b5
jmp 0xec48
xorl %ebp, %ebp
movq %rbp, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq %r12, %r8
ja 0xf0c9
leaq -0x1(,%r8,2), %rax
bsrq %rax, %rax
movl %eax, %ecx
addb $-0x3, %cl
pushq $-0x1
popq %r13
shlq %cl, %r13
cmpl $0x6, %eax
notq %r13
pushq $0x7
popq %rax
cmovbq %rax, %r13
leaq (%r8,%r13), %rax
notq %r13
andq %rax, %r13
jmp 0xe84e
movq %r9, %rdx
movq %r10, %rcx
movq %r13, %r8
movq %r15, %r9
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10f32
movq %rbp, %rdi
movq %r13, %rsi
callq 0x37116
movq 0x8(%rsp), %rsi
jmp 0xeb59
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x30003
jmp 0xec48
movq 0x10(%rsp), %rdi
movq %rcx, %rsi
callq 0x11227
jmp 0xec48
cmpq $0x0, (%rsp)
je 0xf06d
leaq 0x3e79f(%rip), %rax     # 0x4d4a0
cmpq %rdi, (%rax)
jb 0xf06d
callq 0xfdc2
movl %eax, %ebx
leaq 0x3d80a(%rip), %rax     # 0x4c522
cmpb $0x1, (%rax)
je 0xf1b0
movl %ebx, %eax
leaq 0x3e74e(%rip), %rcx     # 0x4d478
movq (%rcx), %rcx
movl (%rcx,%rax,4), %ecx
shlq $0x5, %rax
movq (%rsp), %r8
leaq (%r8,%rax), %r15
addq $0x28, %r15
cmpl %ecx, 0x10(%r15)
je 0xf1c7
movl 0x10(%r15), %eax
incl %eax
movl %eax, 0x10(%r15)
movq 0x18(%r15), %rcx
shlq $0x3, %rax
negq %rax
movq 0x8(%rsp), %rdx
movq %rdx, (%rcx,%rax)
movl 0x18(%r8), %eax
testl %eax, %eax
jle 0xf1e1
leal -0x1(%rax), %ecx
movq (%rsp), %rdx
movl %ecx, 0x18(%rdx)
testl %eax, %eax
jg 0xec48
movq 0x10(%rsp), %rdi
movq (%rsp), %rsi
jmp 0xec3f
movq %rcx, %r8
subq %rdx, %r8
shrq $0xc, %r8
movq (%rdx), %rsi
movq 0x10(%rsp), %rdi
callq 0xdf6b
jmp 0xec48
callq 0xfdc2
movq (%rsp), %rsi
movq 0x8(%rsp), %rcx
movl %eax, %ebx
jmp 0xebd2
movq %r14, %r12
shlq $0x6, %r12
leaq 0x3d80d(%rip), %r13     # 0x4c5e0
leaq (%r12,%r13), %rsi
movq %rcx, %r15
subq 0x8(%r12,%r13), %r15
movq %rcx, %rdi
xorl %edx, %edx
callq 0x23468
movq 0x10(%r12,%r13), %rdx
pushq $0x5a
popq %rsi
movq %r15, %rdi
callq 0xb230
movq (%rsp), %rsi
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
jmp 0xebea
shrl %r8d
movq %r15, %rdx
movl %ebx, %ecx
callq 0x35162
movq (%rsp), %rsi
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
jmp 0xec11
movl 0x1c(%rsi), %ecx
jmp 0xec38
movq %r13, %rdi
callq 0xfdc2
movq 0x18(%rsp), %rdi
movq (%rsp), %r8
movq 0x8(%rsp), %rsi
movl %eax, %r12d
jmp 0xea1c
leaq 0x3e647(%rip), %rax     # 0x4d4a0
cmpq %r13, (%rax)
jb 0xef1d
movq %r15, %rax
shlq $0x5, %rax
leaq (%r8,%rax), %rsi
addq $0x28, %rsi
movl 0x10(%rsi), %eax
testq %rax, %rax
movq %rsi, 0x30(%rsp)
je 0xf0db
movq 0x18(%rsi), %rcx
leaq (,%rax,8), %rdx
negq %rdx
movq (%rcx,%rdx), %rbp
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl 0x8(%rsi), %ecx
jl 0xf18a
testq %rax, %rax
je 0xf0e6
leaq 0x2c78c(%rip), %rax     # 0x3b640
movq (%rax,%r15,8), %rdx
testb %r14b, %r14b
jne 0xf0d1
leaq 0x3d659(%rip), %rax     # 0x4c521
cmpb $0x1, (%rax)
je 0xf197
leaq 0x3d65b(%rip), %rax     # 0x4c533
cmpb $0x1, (%rax)
je 0xf0d1
movq 0x30(%rsp), %rax
incq (%rax)
movq (%rsp), %rax
movl 0x18(%rax), %eax
testl %eax, %eax
jle 0xf13b
leal -0x1(%rax), %ecx
movq (%rsp), %rdx
movl %ecx, 0x18(%rdx)
testl %eax, %eax
jg 0xeb2f
movq 0x10(%rsp), %rdi
movq (%rsp), %rsi
callq 0x350b5
jmp 0xeb2f
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %r13, %rdx
movl %r12d, %ecx
movl %ebx, %r8d
callq 0xd1d4
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rax, %rbp
jmp 0xeb39
orl $-0x1, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xea72
movq 0x20(%rsp), %rsi
testq %rsi, %rsi
jne 0xef6e
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rsi
testq %rsi, %rsi
je 0xf1ed
testq %rsi, %rsi
je 0xf134
leaq 0x2f(%rsp), %rax
movq 0x10(%rsp), %rdi
movq (%rsp), %rdx
movq %rbx, %rcx
movl %r12d, %r8d
movq %rax, %r12
movq %rax, %r9
callq 0x355ce
movq %rax, %rbp
movb (%r12), %al
testb %al, %al
movq 0x8(%rsp), %rsi
movq (%rsp), %r8
movq 0x18(%rsp), %rdi
jne 0xea7b
xorl %ebp, %ebp
jmp 0xeb39
testb %al, %al
jne 0xf147
movq %rbp, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0xb230
movq 0x8(%rsp), %rsi
movq (%rsp), %r8
movq 0x18(%rsp), %rdi
jmp 0xeab0
movl 0x1c(%r8), %ecx
jmp 0xeac2
movl %ecx, 0x8(%rbx)
jmp 0xea72
shlq $0x6, %r15
leaq 0x3d5e2(%rip), %rax     # 0x4c5e0
movq %rbp, %rdi
subq 0x8(%r15,%rax), %rdi
movq 0x10(%r15,%rax), %rdx
movl $0xa5, %esi
jmp 0xf01a
movq %rbp, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0xb230
movq 0x18(%rsp), %rdi
movq (%rsp), %r8
movq 0x8(%rsp), %rsi
jmp 0xeab0
cmpq %r12, %rax
ja 0xf1a9
leaq -0x1(,%rax,2), %rcx
bsrq %rcx, %rsi
movl %esi, %ecx
addb $-0x3, %cl
pushq $-0x1
popq %rdx
shlq %cl, %rdx
cmpl $0x6, %esi
notq %rdx
pushq $0x7
popq %rcx
cmovbq %rcx, %rdx
addq %rdx, %rax
notq %rdx
andq %rax, %rdx
jmp 0xe90c
movq (%rdx), %rsi
movq 0x10(%rsp), %rdi
callq 0xdfd3
jmp 0xec48
xorl %edx, %edx
jmp 0xe989
cmpq %r12, %r13
ja 0xf201
leaq -0x1(,%r13,2), %rcx
bsrq %rcx, %rsi
movl %esi, %ecx
addb $-0x3, %cl
pushq $-0x1
popq %rdi
shlq %cl, %rdi
cmpl $0x6, %esi
notq %rdi
pushq $0x7
popq %rcx
cmovbq %rcx, %rdi
leaq (%rdi,%r13), %rcx
notq %rdi
andq %rcx, %rdi
movq %rdi, %rsi
movq (%rsp), %r9
jmp 0xe9dd
xorl %r13d, %r13d
jmp 0xe84e
movq %rbp, %rdi
xorl %esi, %esi
jmp 0xf19f
orl $-0x1, 0x8(%rsi)
xorl %ebp, %ebp
jmp 0xeea4
cmpq $0x0, 0x20(%rsp)
jne 0xf105
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0xf208
cmpq $0x0, 0x20(%rsp)
je 0xf12d
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %r12d, %edx
movl %ebx, %ecx
callq 0xd021
movq %rax, %rbp
testq %rax, %rax
jne 0xeee9
xorl %ebp, %ebp
jmp 0xeb2f
xorl %eax, %eax
jmp 0xef9d
movq (%rsp), %rcx
movl 0x1c(%rcx), %ecx
jmp 0xeefb
shlq $0x6, %r15
leaq 0x3d48e(%rip), %rax     # 0x4c5e0
movq 0x8(%r15,%rax), %r14
movq %rbp, %rdi
subq %r14, %rdi
movl $0xa5, %esi
movq %r14, %rdx
callq 0xb230
leaq 0x3d46f(%rip), %rax     # 0x4c5e0
movq (%r15,%rax), %rdi
addq %rbp, %rdi
movl $0xa5, %esi
movq %r14, %rdx
callq 0xb230
jmp 0xefc2
movq 0x30(%rsp), %rdx
movl %ecx, 0x8(%rdx)
jmp 0xeea4
movq %rbp, %rdi
movl $0xa5, %esi
callq 0xb230
jmp 0xeee1
xorl %edx, %edx
jmp 0xe90c
pushq $0x5a
popq %rsi
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rdx
callq 0xb230
jmp 0xed21
shrl %ecx
movq 0x10(%rsp), %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x353a2
movq (%rsp), %r8
jmp 0xed4a
movq (%rsp), %rcx
movl 0x1c(%rcx), %ecx
jmp 0xed77
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x1b0d1
movq %rax, %rsi
jmp 0xef6e
xorl %esi, %esi
jmp 0xf0c0
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x1b0d1
movq %rax, 0x20(%rsp)
jmp 0xf105