// File: /workspace/github_c_makefile_star2_O3/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, %r12
movq %rsi, %r15
movq %rdi, %rbx
movl $0x1, %r13d
shlq %cl, %r13
movq %fs:0x0, %r14
addq 0x32dc6(%rip), %r14     # 0x57ff0
cmpq $0x0, 0x353f6(%rip)     # 0x5a628
jne 0x25385
movq 0x32db1(%rip), %rsi     # 0x57ff0
movl %fs:(%rsi), %eax
testl %eax, %eax
je 0x253f9
cmpl $0x2, %eax
je 0x254a0
leaq 0x36456(%rip), %rbp     # 0x5b6b0
movq (%rbp), %rax
notq %rax
andq %rbx, %rax
cmpq %rbx, %rax
je 0x25396
movq %rbx, %r8
subq %rax, %r8
shrq $0xc, %r8
leaq 0x362da(%rip), %rdx     # 0x5b558
subq (%rdx), %r8
movq 0x68(%rax,%r8,8), %r14
movl %r14d, %eax
shrl $0x5, %eax
movl $0xff, %edx
andl %edx, %eax
cmpl %edx, %eax
je 0x253e3
movl %eax, %eax
leaq 0x2259c(%rip), %rdx     # 0x47840
movq (%rdx,%rax,8), %r14
movabsq $-0x2000000000000000, %rax # imm = 0xE000000000000000
leaq (%r12,%r15), %rdx
cmpq %rax, %rdx
ja 0x253b3
andq $-0x2, %r13
cmpb $0x1, 0x353ba(%rip)     # 0x5a684
je 0x253c4
testq %r13, %r13
je 0x252dd
decq %r13
testq %rbx, %r13
jne 0x25304
movq %rsi, %r13
movl %ecx, 0x4(%rsp)
movl %ecx, %r8d
andl $0x40, %r8d
shrl $0x6, %r8d
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x29a1b
testb %al, %al
je 0x25309
movq %r14, %r15
jmp 0x25373
movq (%rbp), %rax
notq %rax
andq %rbx, %rax
cmpq %rbx, %rax
je 0x25405
movq %rbx, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
leaq 0x3622b(%rip), %rdx     # 0x5b558
subq (%rdx), %rcx
movq 0x68(%rax,%rcx,8), %r15
movl %r15d, %eax
shrl $0x5, %eax
movl $0xff, %ecx
andl %ecx, %eax
cmpl %ecx, %eax
je 0x2548a
movl %eax, %eax
leaq 0x224ed(%rip), %rcx     # 0x47840
movq (%rcx,%rax,8), %r15
cmpq %r14, %r15
je 0x25304
addq %r15, %fs:0x10(%r13)
addq %r14, %fs:0x18(%r13)
cmpb $0x1, 0x35317(%rip)     # 0x5a684
je 0x25415
movq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movl %ecx, %ebp
callq 0x118a7
movl %ebp, %ecx
jmp 0x25238
movq %rbx, %rdi
movl %ecx, %r14d
callq 0x36d46
movl %r14d, %ecx
movq 0x32c45(%rip), %rsi     # 0x57ff0
movq %rax, %r14
jmp 0x252a8
subq %r15, %rax
jb 0x25304
movq %rax, %r12
jmp 0x252bf
movq %r14, %rdi
movl %ecx, %ebp
callq 0x23a15
movl %ebp, %ecx
leaq 0x362d9(%rip), %rbp     # 0x5b6b0
movq 0x32c12(%rip), %rsi     # 0x57ff0
jmp 0x252d0
shrq %r14
andq $-0x1000, %r14          # imm = 0xF000
addq $-0x1000, %r14          # imm = 0xF000
jmp 0x252a8
movl $0x1, %fs:(%rsi)
jmp 0x254a7
movq %rbx, %rdi
callq 0x36d46
movq %rax, %r15
jmp 0x25357
movq %rbx, %rdi
callq 0x22712
leaq 0x10(%rsp), %rcx
movq $0x130b, (%rcx)         # imm = 0x130B
movq %rbx, 0x8(%rcx)
movq %r14, 0x10(%rcx)
movq %r15, 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 0x25373
movq %r15, %rsi
subq %r14, %rsi
jbe 0x25373
addq %rbx, %r14
movq %r14, %rdi
callq 0x3e7e8
jmp 0x25373
shrq %r15
andq $-0x1000, %r15          # imm = 0xF000
addq $-0x1000, %r15          # imm = 0xF000
jmp 0x25357
movl $0x3, %fs:(%rsi)
leaq 0x36966(%rip), %rax     # 0x5be14
movl (%rax), %edi
movq %r14, %rsi
movl %ecx, %ebp
callq 0x106f0
movl %ebp, %ecx
movq 0x32b2d(%rip), %rsi     # 0x57ff0
testl %eax, %eax
je 0x25253
leaq 0x22ea7(%rip), %rdi     # 0x48379
callq 0x3d37c
movl %ebp, %ecx
movq 0x32b10(%rip), %rsi     # 0x57ff0
cmpb $0x1, 0x35139(%rip)     # 0x5a620
jne 0x25253
callq 0x10090