// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/jemalloc.c
// Function: je_calloc
void *
je_calloc(size_t num, size_t size)
{
	void *ret;
	size_t num_size;
	size_t usize JEMALLOC_CC_SILENCE_INIT(0);
	prof_thr_cnt_t *cnt JEMALLOC_CC_SILENCE_INIT(NULL);

	if (malloc_init()) {
		num_size = 0;
		ret = NULL;
		goto label_return;
	}

	num_size = num * size;
	if (num_size == 0) {
		if (num == 0 || size == 0)
			num_size = 1;
		else {
			ret = NULL;
			goto label_return;
		}
	/*
	 * Try to avoid division here.  We know that it isn't possible to
	 * overflow during multiplication if neither operand uses any of the
	 * most significant half of the bits in a size_t.
	 */
	} else if (((num | size) & (SIZE_T_MAX << (sizeof(size_t) << 2)))
	    && (num_size / size != num)) {
		/* size_t overflow. */
		ret = NULL;
		goto label_return;
	}

	if (config_prof && opt_prof) {
		usize = s2u(num_size);
		PROF_ALLOC_PREP(1, usize, cnt);
		if (cnt == NULL) {
			ret = NULL;
			goto label_return;
		}
		if (prof_promote && (uintptr_t)cnt != (uintptr_t)1U && usize
		    <= SMALL_MAXCLASS) {
			ret = icalloc(SMALL_MAXCLASS+1);
			if (ret != NULL)
				arena_prof_promoted(ret, usize);
		} else
			ret = icalloc(num_size);
	} else {
		if (config_stats || (config_valgrind && opt_valgrind))
			usize = s2u(num_size);
		ret = icalloc(num_size);
	}

label_return:
	if (ret == NULL) {
		if (config_xmalloc && opt_xmalloc) {
			malloc_write("<jemalloc>: Error in calloc(): out of "
			    "memory\n");
			abort();
		}
		set_errno(ENOMEM);
	}

	if (config_prof && opt_prof && ret != NULL)
		prof_malloc(ret, usize, cnt);
	if (config_stats && ret != NULL) {
		assert(usize == isalloc(ret, config_prof));
		thread_allocated_tsd_get()->allocated += usize;
	}
	UTRACE(0, num_size, ret);
	JEMALLOC_VALGRIND_MALLOC(ret != NULL, ret, usize, true);
	return (ret);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
callq 0xb1590
testb $0x1, %al
jne 0xb1a4e
jmp 0xb1a63
movq $0x0, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
jmp 0xb1aee
movq -0x8(%rbp), %rax
imulq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xb1a9b
cmpq $0x0, -0x8(%rbp)
je 0xb1a85
cmpq $0x0, -0x10(%rbp)
jne 0xb1a8f
movq $0x1, -0x20(%rbp)
jmp 0xb1a99
movq $0x0, -0x18(%rbp)
jmp 0xb1aee
jmp 0xb1ad4
movq -0x8(%rbp), %rax
orq -0x10(%rbp), %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
andq %rcx, %rax
cmpq $0x0, %rax
je 0xb1ad2
movq -0x20(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x10(%rbp)
cmpq -0x8(%rbp), %rax
je 0xb1ad2
movq $0x0, -0x18(%rbp)
jmp 0xb1aee
jmp 0xb1ad4
movq -0x20(%rbp), %rdi
callq 0xb15d0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0xb1bb0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xb1aff
movl $0xc, %edi
callq 0xb16a0
cmpq $0x0, -0x18(%rbp)
je 0xb1b21
jmp 0xb1b08
jmp 0xb1b0a
movq -0x28(%rbp), %rax
movq %rax, -0x78(%rbp)
callq 0xb16d0
movq -0x78(%rbp), %rcx
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xb1b23
testb $0x1, 0x76990(%rip)     # 0x1284ba
je 0xb1b93
cmpq $0x0, -0x18(%rbp)
je 0xb1b93
jmp 0xb1b35
movq $0x1301, -0x60(%rbp)    # imm = 0x1301
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0xb16f0
movq %rax, -0x48(%rbp)
movq $0x1, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
leaq -0x60(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
rolq $0x3, %rdi
rolq $0xd, %rdi
rolq $0x3d, %rdi
rolq $0x33, %rdi
xchgq %rbx, %rbx
movq %rdx, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0xb1b93
jmp 0xb1b95
movq -0x18(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)