// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/deps/jemalloc/include/jemalloc/internal/jemalloc_internal.h
// Function: irallocx
JEMALLOC_INLINE void *
irallocx(void *ptr, size_t size, size_t extra, size_t alignment, bool zero,
    bool no_move, bool try_tcache_alloc, bool try_tcache_dalloc, arena_t *arena)
{
	void *ret;
	size_t oldsize;

	assert(ptr != NULL);
	assert(size != 0);

	oldsize = isalloc(ptr, config_prof);

	if (alignment != 0 && ((uintptr_t)ptr & ((uintptr_t)alignment-1))
	    != 0) {
		size_t usize, copysize;

		/*
		 * Existing object alignment is inadequate; allocate new space
		 * and copy.
		 */
		if (no_move)
			return (NULL);
		usize = sa2u(size + extra, alignment);
		if (usize == 0)
			return (NULL);
		ret = ipallocx(usize, alignment, zero, try_tcache_alloc, arena);
		if (ret == NULL) {
			if (extra == 0)
				return (NULL);
			/* Try again, without extra this time. */
			usize = sa2u(size, alignment);
			if (usize == 0)
				return (NULL);
			ret = ipallocx(usize, alignment, zero, try_tcache_alloc,
			    arena);
			if (ret == NULL)
				return (NULL);
		}
		/*
		 * Copy at most size bytes (not size+extra), since the caller
		 * has no expectation that the extra bytes will be reliably
		 * preserved.
		 */
		copysize = (size < oldsize) ? size : oldsize;
		memcpy(ret, ptr, copysize);
		iqallocx(ptr, try_tcache_dalloc);
		return (ret);
	}

	if (no_move) {
		if (size <= arena_maxclass) {
			return (arena_ralloc_no_move(ptr, oldsize, size,
			    extra, zero));
		} else {
			return (huge_ralloc_no_move(ptr, oldsize, size,
			    extra));
		}
	} else {
		if (size + extra <= arena_maxclass) {
			return (arena_ralloc(arena, ptr, oldsize, size, extra,
			    alignment, zero, try_tcache_alloc,
			    try_tcache_dalloc));
		} else {
			return (huge_ralloc(ptr, oldsize, size, extra,
			    alignment, zero, try_tcache_dalloc));
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl %r9d, -0x5c(%rbp)
movl %r8d, %eax
movq %rcx, %r8
movl -0x5c(%rbp), %ecx
movq %r8, -0x58(%rbp)
movq %rdx, %r8
movq %rsi, %r9
movq %rdi, %r10
movq -0x58(%rbp), %rdi
movb %cl, %dl
movb %al, %sil
movq 0x20(%rbp), %rax
movb 0x18(%rbp), %al
movb 0x10(%rbp), %cl
movq %r10, -0x10(%rbp)
movq %r9, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq %rdi, -0x28(%rbp)
andb $0x1, %sil
movb %sil, -0x29(%rbp)
andb $0x1, %dl
movb %dl, -0x2a(%rbp)
andb $0x1, %cl
movb %cl, -0x2b(%rbp)
andb $0x1, %al
movb %al, -0x2c(%rbp)
jmp 0xb2ec3
jmp 0xb2ec5
jmp 0xb2ec7
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0xb18e0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xb302b
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0xb302b
testb $0x1, -0x2a(%rbp)
je 0xb2f0d
movq $0x0, -0x8(%rbp)
jmp 0xb311e
movq -0x18(%rbp), %rdi
addq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xb2690
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xb2f36
movq $0x0, -0x8(%rbp)
jmp 0xb311e
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
movb -0x29(%rbp), %cl
movb -0x2b(%rbp), %al
movq 0x20(%rbp), %r8
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edx
movzbl %al, %ecx
callq 0xb5760
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0xb2fd8
cmpq $0x0, -0x20(%rbp)
jne 0xb2f77
movq $0x0, -0x8(%rbp)
jmp 0xb311e
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xb2690
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xb2f9c
movq $0x0, -0x8(%rbp)
jmp 0xb311e
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
movb -0x29(%rbp), %cl
movb -0x2b(%rbp), %al
movq 0x20(%rbp), %r8
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edx
movzbl %al, %ecx
callq 0xb5760
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0xb2fd6
movq $0x0, -0x8(%rbp)
jmp 0xb311e
jmp 0xb2fd8
movq -0x18(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0xb2fec
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0xb2ff4
movq -0x40(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x1fbf0
movq -0x10(%rbp), %rdi
movb -0x2c(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0xb32c0
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xb311e
testb $0x1, -0x2a(%rbp)
je 0xb3086
movq -0x18(%rbp), %rax
leaq 0x76244(%rip), %rcx     # 0x129280
cmpq (%rcx), %rax
ja 0xb3068
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movb -0x29(%rbp), %al
andb $0x1, %al
movzbl %al, %r8d
callq 0xb7a10
movq %rax, -0x8(%rbp)
jmp 0xb311e
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0xcd000
movq %rax, -0x8(%rbp)
jmp 0xb311e
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
leaq 0x761eb(%rip), %rcx     # 0x129280
cmpq (%rcx), %rax
ja 0xb30ea
movq 0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %r9
movb -0x29(%rbp), %r11b
movb -0x2b(%rbp), %r10b
movb -0x2c(%rbp), %al
andb $0x1, %r11b
andb $0x1, %r10b
andb $0x1, %al
movzbl %r11b, %r11d
movl %r11d, (%rsp)
movzbl %r10b, %r10d
movl %r10d, 0x8(%rsp)
movzbl %al, %eax
movl %eax, 0x10(%rsp)
callq 0xb7ce0
movq %rax, -0x8(%rbp)
jmp 0xb311e
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movb -0x29(%rbp), %r9b
movb -0x2c(%rbp), %al
andb $0x1, %r9b
andb $0x1, %al
movzbl %r9b, %r9d
movzbl %al, %eax
movl %eax, (%rsp)
callq 0xcd110
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)