// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/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, %r14
movq %rcx, %r12
movq %rdx, %r9
movq 0x68(%rsp), %rdx
movb 0x60(%rsp), %r15b
cmpq $0x1000, %r8            # imm = 0x1000
ja 0x3c539
decq %r8
shrq $0x3, %r8
leaq 0x1d6c0(%rip), %rax     # 0x59800
movzbl (%rax,%r8), %eax
leaq 0x1cf34(%rip), %rcx     # 0x59080
movq (%rcx,%rax,8), %r13
testq %r13, %r13
je 0x3c4ff
cmpq 0x483d0(%rip), %r13     # 0x84530
ja 0x3c572
movq %rdi, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x8(%rsp)
movzbl %r15b, %ebx
movq %r9, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
movl %ebx, %r8d
movq %r9, %rbp
callq 0x3bb54
testb %al, %al
je 0x3c501
movq %rbp, (%rsp)
testq %r14, %r14
je 0x3c2e1
cmpq $0xfff, %r14            # imm = 0xFFF
movq (%rsp), %r8
ja 0x3c201
cmpq $0x3800, %r13           # imm = 0x3800
ja 0x3c201
leaq (%r14,%r13), %rax
decq %rax
movq %r14, %rdi
negq %rdi
andq %rax, %rdi
cmpq $0x1000, %rdi           # imm = 0x1000
ja 0x3c87a
decq %rdi
shrq $0x3, %rdi
leaq 0x1d61b(%rip), %rax     # 0x59800
movzbl (%rax,%rdi), %eax
leaq 0x1ce90(%rip), %rcx     # 0x59080
movq (%rcx,%rax,8), %rdx
cmpq $0x4000, %rdx           # imm = 0x4000
jb 0x3c3f1
leaq 0x48490(%rip), %rax     # 0x84698
movq (%rax), %rax
movq %r14, %rsi
cmpq %r13, 0x4831b(%rip)     # 0x84530
jb 0x3c288
movq %r14, %rsi
cmpq %r14, %rax
jbe 0x3c288
leaq 0xfff(%r14), %rsi
andq $-0x1000, %rsi          # imm = 0xF000
movl $0x4000, %edx           # imm = 0x4000
cmpq $0x4001, %r13           # imm = 0x4001
jb 0x3c277
testq %r13, %r13
js 0x3c8a5
leaq -0x1(,%r13,2), %rcx
bsrq %rcx, %rdx
leal -0x3(%rdx), %ecx
movq $-0x1, %rdi
shlq %cl, %rdi
cmpq $0x7, %rdx
notq %rdi
movl $0xf, %edx
cmovaeq %rdi, %rdx
leaq (%rdx,%r13), %rcx
notq %rdx
andq %rcx, %rdx
leaq (%rdx,%rsi), %rcx
cmpq 0x482d6(%rip), %rcx     # 0x84558
jbe 0x3c3f1
leaq 0x48411(%rip), %rcx     # 0x846a0
movq (%rcx), %r15
addq %r15, %rsi
notq %r15
andq %rsi, %r15
je 0x3c2da
cmpq %r13, %rax
jae 0x3c3e0
cmpq $0x1000, %r13           # imm = 0x1000
ja 0x3c8ed
leaq -0x1(%r13), %rax
shrq $0x3, %rax
leaq 0x1d53e(%rip), %rcx     # 0x59800
movzbl (%rcx,%rax), %eax
leaq 0x1cdb3(%rip), %rcx     # 0x59080
movq (%rcx,%rax,8), %rax
cmpq %r13, %rax
jae 0x3c3e0
xorl %edx, %edx
jmp 0x3c3f1
movq 0x18(%rsp), %rax
testq %rax, %rax
movq (%rsp), %r8
jne 0x3c301
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x3c8da
movq %rax, 0x18(%rsp)
testq %rax, %rax
movq 0x8(%rsp), %rsi
je 0x3c3fa
cmpq $0x3800, %r13           # imm = 0x3800
ja 0x3c6cc
testq %rsi, %rsi
je 0x3c79d
cmpq $0x1000, %r13           # imm = 0x1000
ja 0x3c7b1
leaq -0x1(%r13), %rax
shrq $0x3, %rax
leaq 0x1d4ba(%rip), %rcx     # 0x59800
movzbl (%rcx,%rax), %eax
movl %eax, %ebx
movq %rbx, %rax
shlq $0x5, %rax
leaq (%rsi,%rax), %r14
addq $0x20, %r14
leaq 0x1cd1e(%rip), %rax     # 0x59080
movq (%rax,%rbx,8), %rdx
movl 0x10(%r14), %eax
testl %eax, %eax
je 0x3c7c7
decl %eax
movl %eax, 0x10(%r14)
cmpl 0x8(%r14), %eax
jl 0x3c836
movq 0x18(%r14), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rbp
testq %rbp, %rbp
je 0x3c7d6
leaq 0x47395(%rip), %rax     # 0x83731
movb (%rax), %al
testb %r15b, %r15b
jne 0x3c810
testb %al, %al
jne 0x3c83f
leaq 0x4738d(%rip), %rax     # 0x83743
cmpb $0x1, (%rax)
je 0x3c862
incq (%r14)
movl 0x18(%rsi), %eax
incl %eax
movl %eax, 0x18(%rsi)
cmpl $0xe4, %eax
jne 0x3c3fc
movq 0x10(%rsp), %rdi
callq 0x4e7cd
jmp 0x3c8d1
movl $0xfff, %ecx            # imm = 0xFFF
subq %r15, %rcx
xorl %edx, %edx
cmpq %rax, %rcx
cmovaeq %rax, %rdx
testq %rdx, %rdx
jne 0x3c513
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x3c4ff
cmpq %r12, %r13
cmovaeq %r12, %r13
leaq 0x47381(%rip), %rax     # 0x83794
cmpb $0x1, (%rax)
je 0x3c591
movq %rbp, %rdi
movq %r8, %rsi
movq %r13, %rdx
movq %r8, %r14
callq 0x12520
leaq 0x47304(%rip), %rax     # 0x83738
cmpq $0x0, (%rax)
movq 0x10(%rsp), %r15
jne 0x3c5a5
leaq 0x48256(%rip), %rax     # 0x846a0
movq (%rax), %rsi
notq %rsi
andq %r14, %rsi
cmpq %r14, %rsi
movq 0x8(%rsp), %rdx
movq %r14, %r9
je 0x3c5b5
cmpq $0x3800, %r12           # imm = 0x3800
ja 0x3c5c5
testq %rdx, %rdx
je 0x3c65e
cmpq $0x1000, %r12           # imm = 0x1000
ja 0x3c678
decq %r12
shrq $0x3, %r12
leaq 0x1d36b(%rip), %rax     # 0x59800
movzbl (%rax,%r12), %ebx
leaq 0x47291(%rip), %rax     # 0x83732
cmpb $0x1, (%rax)
je 0x3c690
movl %ebx, %eax
leaq 0x488ed(%rip), %rcx     # 0x84da0
movq (%rcx), %rcx
movl (%rcx,%rax,4), %r8d
shlq $0x5, %rax
leaq (%rdx,%rax), %r14
addq $0x20, %r14
cmpl %r8d, 0x10(%r14)
je 0x3c6ab
movq 0x18(%r14), %rax
movl 0x10(%r14), %ecx
movq %r9, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x10(%r14)
movl 0x18(%rdx), %eax
incl %eax
movl %eax, 0x18(%rdx)
cmpl $0xe4, %eax
jne 0x3c501
movq %r15, %rdi
movq %rdx, %rsi
callq 0x4e7cd
jmp 0x3c501
xorl %ebp, %ebp
movq %rbp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %r14, %rcx
movl %ebx, %r8d
movq 0x8(%rsp), %r9
callq 0x13e13
movq (%rsp), %r8
movq %rax, %rbp
jmp 0x3c3fc
movq %rdi, 0x10(%rsp)
leaq 0x20(%rsp), %rax
movq %r8, %rdi
movq %rsi, %rbp
movq %rax, %rsi
movq %rdx, %r13
movq %r9, %rbx
callq 0x14997
movq %rbp, %rsi
movq %rbx, %r9
movq %r13, %rdx
leaq 0x20(%rsp), %rax
movq (%rax), %r13
movq 0x10(%rsp), %rdi
jmp 0x3c150
movq %r9, %rdx
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x485df
movq %rbp, %rdi
movq %r13, %rsi
callq 0x507e2
movq (%rsp), %r8
jmp 0x3c41c
movq %r15, %rdi
movq %r14, %rsi
callq 0x4aed0
jmp 0x3c501
movq %r15, %rdi
movq %r9, %rsi
callq 0x488cb
jmp 0x3c501
testq %rdx, %rdx
je 0x3c894
leaq 0x487fb(%rip), %rax     # 0x84dd0
cmpq %r12, (%rax)
jb 0x3c894
movq %r12, %rdi
callq 0x3fb29
movl %eax, %ebx
leaq 0x47143(%rip), %rax     # 0x83732
cmpb $0x1, (%rax)
je 0x3c93c
movl %ebx, %eax
leaq 0x4879f(%rip), %rcx     # 0x84da0
movq (%rcx), %rcx
movl (%rcx,%rax,4), %ecx
shlq $0x5, %rax
movq 0x8(%rsp), %rdx
leaq (%rdx,%rax), %r14
addq $0x20, %r14
cmpl %ecx, 0x10(%r14)
je 0x3c952
movq 0x18(%r14), %rax
movl 0x10(%r14), %ecx
movq (%rsp), %rdx
movq %rdx, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x10(%r14)
movq 0x8(%rsp), %rcx
movl 0x18(%rcx), %eax
incl %eax
movl %eax, 0x18(%rcx)
cmpl $0xe4, %eax
jne 0x3c501
movq %r15, %rdi
movq 0x8(%rsp), %rsi
jmp 0x3c4f8
movq %r9, %rcx
subq %rsi, %rcx
shrq $0xc, %rcx
movq (%rsi), %rdi
movq %r9, %rdx
callq 0x3b95d
jmp 0x3c501
movq %r12, %rdi
callq 0x3fb29
movq (%rsp), %r9
movq 0x8(%rsp), %rdx
movl %eax, %ebx
jmp 0x3c49a
movl %ebx, %edi
movq %r9, %rsi
movq %r9, %rdx
callq 0x14ac2
movq (%rsp), %r9
movq 0x8(%rsp), %rdx
jmp 0x3c4aa
shrl %r8d
movq %r15, %rdi
movq %rdx, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x4e87e
movq (%rsp), %r9
movq 0x8(%rsp), %rdx
jmp 0x3c4d0
cmpq %r13, 0x47e5d(%rip)     # 0x84530
jb 0x3c90a
cmpq $0x0, 0x8(%rsp)
je 0x3c8bf
leaq 0x486e4(%rip), %rax     # 0x84dd0
cmpq %r13, (%rax)
jb 0x3c8bf
movq %r13, %rdi
callq 0x3fb29
movl %eax, %eax
leaq 0x1c97a(%rip), %rcx     # 0x59080
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 0x3c96b
decl %eax
movl %eax, 0x10(%r14)
cmpl 0x8(%r14), %eax
jl 0x3c99c
movq 0x18(%r14), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rbp
testq %rbp, %rbp
je 0x3c97a
testb %r15b, %r15b
jne 0x3c935
leaq 0x46fd7(%rip), %rax     # 0x83731
cmpb $0x1, (%rax)
je 0x3c9a5
leaq 0x46fd9(%rip), %rax     # 0x83743
cmpb $0x1, (%rax)
je 0x3c935
incq (%r14)
movq 0x8(%rsp), %rcx
movl 0x18(%rcx), %eax
incl %eax
movl %eax, 0x18(%rcx)
cmpl $0xe4, %eax
jne 0x3c8d1
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
jmp 0x3c3d6
movq 0x18(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x3b19e
jmp 0x3c52d
movq %r13, %rdi
callq 0x3fb29
movq (%rsp), %r8
movq 0x8(%rsp), %rsi
jmp 0x3c34a
movl $0xffffffff, 0x8(%r14)  # imm = 0xFFFFFFFF
xorl %ebp, %ebp
jmp 0x3c38c
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %rdx, %rbp
movq 0x8(%rsp), %rdx
movq %r14, %rcx
movl %ebx, %r8d
callq 0x4ebc2
movq %rbp, %rdx
movq (%rsp), %r8
movq 0x8(%rsp), %rsi
movq %rax, %rbp
testq %rax, %rax
jne 0x3c395
jmp 0x3c3fa
movq %rdx, %r15
testb %al, %al
jne 0x3c925
movq %rbp, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x12380
movq 0x8(%rsp), %rsi
movq (%rsp), %r8
jmp 0x3c3bf
movl %eax, 0x8(%r14)
jmp 0x3c382
leaq (%rbx,%rbx,2), %rax
shlq $0x5, %rax
leaq 0x46f62(%rip), %rcx     # 0x837b0
movq %rbp, %rdi
subq 0x8(%rax,%rcx), %rdi
movq 0x10(%rax,%rcx), %rdx
movl $0xa5, %esi
jmp 0x3c867
movq %rbp, %rdi
xorl %esi, %esi
callq 0x12380
movq (%rsp), %r8
movq 0x8(%rsp), %rsi
jmp 0x3c3bf
leaq 0x20(%rsp), %rbp
movq %rbp, %rsi
callq 0x149e1
movq (%rsp), %r8
movq (%rbp), %rdx
jmp 0x3c1f4
movq (%rsi), %rdi
movq (%rsp), %rdx
callq 0x3bb14
jmp 0x3c501
movq %r13, %rcx
btrq $0x3f, %rcx
cmpq $0x1, %rcx
movl $0x40, %edx
sbbq $0x0, %rdx
jmp 0x3c250
movq 0x18(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x3b463
movq %rax, %rbp
movq (%rsp), %r8
jmp 0x3c3fc
movq 0x10(%rsp), %rdi
callq 0x34a5f
movq (%rsp), %r8
jmp 0x3c301
leaq 0x20(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x14a2b
movq (%rsp), %r8
movq (%rbp), %rax
jmp 0x3c2d1
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %r13, %rdx
movl %ebx, %ecx
movq 0x8(%rsp), %r8
callq 0x48064
jmp 0x3c8ce
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x14a75
jmp 0x3c81b
movq %rbp, %rdi
xorl %esi, %esi
jmp 0x3c9ad
movq (%rsp), %rdi
movl $0x5a, %esi
movq %r12, %rdx
callq 0x12380
jmp 0x3c5f8
shrl %ecx
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
movq 0x8(%rsp), %r8
callq 0x4ea32
jmp 0x3c622
movl $0xffffffff, 0x8(%r14)  # imm = 0xFFFFFFFF
xorl %ebp, %ebp
jmp 0x3c741
movq 0x18(%rsp), %rdi
movq %rdx, %rsi
movl %ebx, %edx
callq 0x3b463
movq %rax, %rbp
testq %rax, %rax
jne 0x3c776
xorl %ebp, %ebp
jmp 0x3c8d1
movl %eax, 0x8(%r14)
jmp 0x3c737
movq %rbp, %rdi
movl $0xa5, %esi
callq 0x12380
jmp 0x3c773