// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/arena.c
// Function: arena_ralloc_large
static bool
arena_ralloc_large(void *ptr, size_t oldsize, size_t size, size_t extra,
    bool zero)
{
	size_t psize;

	psize = PAGE_CEILING(size + extra);
	if (psize == oldsize) {
		/* Same size class. */
		if (config_fill && opt_junk && size < oldsize) {
			memset((void *)((uintptr_t)ptr + size), 0x5a, oldsize -
			    size);
		}
		return (false);
	} else {
		arena_chunk_t *chunk;
		arena_t *arena;

		chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
		arena = chunk->arena;

		if (psize < oldsize) {
			/* Fill before shrinking in order avoid a race. */
			if (config_fill && opt_junk) {
				memset((void *)((uintptr_t)ptr + size), 0x5a,
				    oldsize - size);
			}
			arena_ralloc_large_shrink(arena, chunk, ptr, oldsize,
			    psize);
			return (false);
		} else {
			bool ret = arena_ralloc_large_grow(arena, chunk, ptr,
			    oldsize, PAGE_CEILING(size),
			    psize - PAGE_CEILING(size), zero);
			if (config_fill && ret == false && zero == false &&
			    opt_zero) {
				memset((void *)((uintptr_t)ptr + oldsize), 0,
				    size - oldsize);
			}
			return (ret);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %r8b, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
addq $0xfff, %rax            # imm = 0xFFF
andq $-0x1000, %rax          # imm = 0xF000
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0xb7bcb
leaq 0x70912(%rip), %rax     # 0x1284ab
testb $0x1, (%rax)
je 0xb7bc2
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0xb7bc2
movq -0x10(%rbp), %rdi
addq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
subq -0x20(%rbp), %rdx
movl $0x5a, %esi
callq 0x1f110
movb $0x0, -0x1(%rbp)
jmp 0xb7cd4
movq -0x10(%rbp), %rax
leaq 0x715fa(%rip), %rcx     # 0x1291d0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0xb7c41
leaq 0x708ab(%rip), %rax     # 0x1284ab
testb $0x1, (%rax)
je 0xb7c1f
movq -0x10(%rbp), %rdi
addq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
subq -0x20(%rbp), %rdx
movl $0x5a, %esi
callq 0x1f110
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %r8
callq 0xbead0
movb $0x0, -0x1(%rbp)
jmp 0xb7cd4
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
addq $0xfff, %r8             # imm = 0xFFF
andq $-0x1000, %r8           # imm = 0xF000
movq -0x38(%rbp), %r9
movq -0x20(%rbp), %rax
addq $0xfff, %rax            # imm = 0xFFF
andq $-0x1000, %rax          # imm = 0xF000
subq %rax, %r9
movb -0x29(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, (%rsp)
callq 0xbec50
andb $0x1, %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xb7ccc
movb -0x29(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xb7ccc
leaq 0x7080c(%rip), %rax     # 0x1284bc
testb $0x1, (%rax)
je 0xb7ccc
movq -0x10(%rbp), %rdi
addq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
subq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x1f110
movb -0x49(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nop