// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/jemalloc/src/jemalloc.c
// Function: je_xallocx
JEMALLOC_NOTHROW
je_xallocx(void *ptr, size_t size, size_t extra, int flags)
{
	tsd_t *tsd;
	size_t usize, old_usize;
	UNUSED size_t old_rzsize JEMALLOC_CC_SILENCE_INIT(0);
	size_t alignment = MALLOCX_ALIGN_GET(flags);
	bool zero = flags & MALLOCX_ZERO;

	assert(ptr != NULL);
	assert(size != 0);
	assert(SIZE_T_MAX - size >= extra);
	assert(malloc_initialized() || IS_INITIALIZER);
	malloc_thread_init();
	tsd = tsd_fetch();

	old_usize = isalloc(ptr, config_prof);

	/* Clamp extra if necessary to avoid (size + extra) overflow. */
	if (unlikely(size + extra > HUGE_MAXCLASS)) {
		/* Check for size overflow. */
		if (unlikely(size > HUGE_MAXCLASS)) {
			usize = old_usize;
			goto label_not_resized;
		}
		extra = HUGE_MAXCLASS - size;
	}

	if (config_valgrind && unlikely(in_valgrind))
		old_rzsize = u2rz(old_usize);

	if (config_prof && opt_prof) {
		usize = ixallocx_prof(tsd, ptr, old_usize, size, extra,
		    alignment, zero);
	} else {
		usize = ixallocx_helper(ptr, old_usize, size, extra, alignment,
		    zero);
	}
	if (unlikely(usize == old_usize))
		goto label_not_resized;

	if (config_stats) {
		*tsd_thread_allocatedp_get(tsd) += usize;
		*tsd_thread_deallocatedp_get(tsd) += old_usize;
	}
	JEMALLOC_VALGRIND_REALLOC(false, ptr, usize, false, ptr, old_usize,
	    old_rzsize, false, zero);
label_not_resized:
	UTRACE(ptr, size, ptr);
	return (usize);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x1
popq %r13
shlq %cl, %r13
movq %fs:0x0, %r12
addq 0x34089(%rip), %r12     # 0x53ff0
cmpq $0x0, 0x366b9(%rip)     # 0x56628
jne 0x200c2
movq 0x34074(%rip), %rdi     # 0x53ff0
movl %fs:(%rdi), %eax
testl %eax, %eax
je 0x2015b
cmpl $0x2, %eax
je 0x20202
leaq 0x37719(%rip), %rbp     # 0x576b0
movq (%rbp), %rax
notq %rax
andq %rbx, %rax
cmpq %rbx, %rax
je 0x200fb
movq %rbx, %rsi
subq %rax, %rsi
shrq $0xc, %rsi
leaq 0x3759d(%rip), %rdx     # 0x57558
subq (%rdx), %rsi
movq 0x68(%rax,%rsi,8), %r12
movl %r12d, %eax
shrl $0x5, %eax
movl $0xff, %edx
andl %edx, %eax
cmpl %edx, %eax
je 0x20145
movl %eax, %eax
leaq 0x2239f(%rip), %rdx     # 0x42380
movq (%rdx,%rax,8), %r12
movabsq $-0x2000000000000000, %rax # imm = 0xE000000000000000
leaq (%r15,%r14), %rdx
cmpq %rax, %rdx
ja 0x20118
andq $-0x2, %r13
cmpb $0x1, 0x3667d(%rip)     # 0x56684
je 0x20129
testq %r13, %r13
je 0x2001a
decq %r13
testq %rbx, %r13
jne 0x20041
movq %rdi, %r13
movl %ecx, 0x4(%rsp)
movl %ecx, %r8d
andl $0x40, %r8d
shrl $0x6, %r8d
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x24648
testb %al, %al
je 0x20046
movq %r12, %r14
jmp 0x200b0
movq (%rbp), %rax
notq %rax
andq %rbx, %rax
cmpq %rbx, %rax
je 0x20167
movq %rbx, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
leaq 0x374ee(%rip), %rdx     # 0x57558
subq (%rdx), %rcx
movq 0x68(%rax,%rcx,8), %r14
movl %r14d, %eax
shrl $0x5, %eax
movl $0xff, %ecx
andl %ecx, %eax
cmpl %ecx, %eax
je 0x201ec
movl %eax, %eax
leaq 0x222f0(%rip), %rcx     # 0x42380
movq (%rcx,%rax,8), %r14
cmpq %r12, %r14
je 0x20041
addq %r14, %fs:0x10(%r13)
addq %r12, %fs:0x18(%r13)
cmpb $0x1, 0x365da(%rip)     # 0x56684
je 0x20177
movq %r14, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x33f27(%rip), %rbp     # 0x53ff0
movl %fs:(%rbp), %eax
testl %eax, %eax
je 0x20254
cmpl $0x2, %eax
je 0x2025e
cmpq $0x0, %fs:0x48(%rbp)
jne 0x1ff75
movq %r12, %rdi
movl %ecx, %ebp
callq 0x32f9c
movl %ebp, %ecx
jmp 0x1ff75
movq %rbx, %rdi
movl %ecx, %r12d
callq 0x311c1
movq 0x33ee3(%rip), %rdi     # 0x53ff0
movl %r12d, %ecx
movq %rax, %r12
jmp 0x1ffe5
subq %r14, %rax
jb 0x20041
movq %rax, %r15
jmp 0x1fffc
movq %r12, %rdi
movl %ecx, 0x4(%rsp)
callq 0x1e699
movq 0x33eb4(%rip), %rdi     # 0x53ff0
movl 0x4(%rsp), %ecx
jmp 0x2000d
shrq %r12
andq $-0x1000, %r12          # imm = 0xF000
addq $-0x1000, %r12          # imm = 0xF000
jmp 0x1ffe5
movl $0x1, %fs:(%rdi)
jmp 0x20209
movq %rbx, %rdi
callq 0x311c1
movq %rax, %r14
jmp 0x20094
movq %rbx, %rdi
callq 0x1ce55
leaq 0x10(%rsp), %rcx
movq $0x130b, (%rcx)         # imm = 0x130B
movq %rbx, 0x8(%rcx)
movq %r12, 0x10(%rcx)
movq %r14, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq $0x0, 0x28(%rcx)
movq %rcx, %rax
xorl %edx, %edx
rolq $0x3, %rdi
rolq $0xd, %rdi
rolq $0x3d, %rdi
rolq $0x33, %rdi
xchgq %rbx, %rbx
movq %rdx, 0x8(%rsp)
movq 0x8(%rsp), %rax
testb $0x40, 0x4(%rsp)
je 0x200b0
movq %r14, %rsi
subq %r12, %rsi
jbe 0x200b0
addq %rbx, %r12
movq %r12, %rdi
callq 0x38fac
jmp 0x200b0
shrq %r14
andq $-0x1000, %r14          # imm = 0xF000
addq $-0x1000, %r14          # imm = 0xF000
jmp 0x20094
movl $0x3, %fs:(%rdi)
leaq 0x37c04(%rip), %rax     # 0x57e14
movl (%rax), %edi
movq %r12, %rsi
movl %ecx, %ebp
callq 0x106f0
movq 0x33dcd(%rip), %rdi     # 0x53ff0
movl %ebp, %ecx
testl %eax, %eax
je 0x1ff90
leaq 0x22c85(%rip), %rdi     # 0x42eb9
callq 0x37d1c
movq 0x33db0(%rip), %rdi     # 0x53ff0
movl %ebp, %ecx
cmpb $0x1, 0x363d7(%rip)     # 0x56620
jne 0x1ff90
callq 0x10090
movl $0x1, %fs:(%rbp)
jmp 0x20266
movl $0x3, %fs:(%rbp)
leaq 0x37ba7(%rip), %rax     # 0x57e14
movl (%rax), %edi
movq %r12, %rsi
movl %ecx, 0x4(%rsp)
callq 0x106f0
movl 0x4(%rsp), %ecx
testl %eax, %eax
je 0x200de
leaq 0x22c2b(%rip), %rdi     # 0x42eb9
callq 0x37d1c
movl 0x4(%rsp), %ecx
cmpb $0x1, 0x36382(%rip)     # 0x56620
jne 0x200de
jmp 0x2024f