// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/huge.c
// Function: huge_palloc
void *
huge_palloc(size_t size, size_t alignment, bool zero)
{
	void *ret;
	size_t csize;
	extent_node_t *node;
	bool is_zeroed;

	/* Allocate one or more contiguous chunks for this request. */

	csize = CHUNK_CEILING(size);
	if (csize == 0) {
		/* size is large enough to cause size_t wrap-around. */
		return (NULL);
	}

	/* Allocate an extent node with which to track the chunk. */
	node = base_node_alloc();
	if (node == NULL)
		return (NULL);

	/*
	 * Copy zero into is_zeroed and pass the copy to chunk_alloc(), so that
	 * it is possible to make correct junk/zero fill decisions below.
	 */
	is_zeroed = zero;
	ret = chunk_alloc(csize, alignment, false, &is_zeroed,
	    chunk_dss_prec_get());
	if (ret == NULL) {
		base_node_dealloc(node);
		return (NULL);
	}

	/* Insert node into huge. */
	node->addr = ret;
	node->size = csize;

	malloc_mutex_lock(&huge_mtx);
	extent_tree_ad_insert(&huge, node);
	if (config_stats) {
		stats_cactive_add(csize);
		huge_nmalloc++;
		huge_allocated += csize;
	}
	malloc_mutex_unlock(&huge_mtx);

	if (config_fill && zero == false) {
		if (opt_junk)
			memset(ret, 0xa5, csize);
		else if (opt_zero && is_zeroed == false)
			memset(ret, 0, csize);
	}

	return (ret);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x10(%rbp), %rax
leaq 0x5c3be(%rip), %rcx     # 0x1291d0
addq (%rcx), %rax
leaq 0x5c3b4(%rip), %rcx     # 0x1291d0
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xcce3e
movq $0x0, -0x8(%rbp)
jmp 0xccf7d
callq 0xbfe80
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0xcce5b
movq $0x0, -0x8(%rbp)
jmp 0xccf7d
movb -0x19(%rbp), %al
andb $0x1, %al
movb %al, -0x39(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
callq 0xc0ae0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl %eax, %r8d
xorl %edx, %edx
leaq -0x39(%rbp), %rcx
callq 0xc0250
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xcceaf
movq -0x38(%rbp), %rdi
callq 0xbfef0
movq $0x0, -0x8(%rbp)
jmp 0xccf7d
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x30(%rax)
leaq 0x5c48a(%rip), %rdi     # 0x129358
callq 0xccf90
movq -0x38(%rbp), %rsi
leaq 0x5c4a2(%rip), %rdi     # 0x129380
callq 0xcb690
movq -0x30(%rbp), %rdi
callq 0xccfb0
movq 0x5c4d5(%rip), %rax     # 0x1293c8
addq $0x1, %rax
movq %rax, 0x5c4ca(%rip)     # 0x1293c8
movq -0x30(%rbp), %rax
addq 0x5c4c7(%rip), %rax     # 0x1293d0
movq %rax, 0x5c4c0(%rip)     # 0x1293d0
leaq 0x5c441(%rip), %rdi     # 0x129358
callq 0xccfe0
movb -0x19(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xccf75
leaq 0x5b57b(%rip), %rax     # 0x1284ab
testb $0x1, (%rax)
je 0xccf49
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rdx
movl $0xa5, %esi
callq 0x1f110
jmp 0xccf73
leaq 0x5b56c(%rip), %rax     # 0x1284bc
testb $0x1, (%rax)
je 0xccf71
movb -0x39(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xccf71
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rdx
xorl %esi, %esi
callq 0x1f110
jmp 0xccf73
jmp 0xccf75
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)