// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x7c7b5
testb %al, %al
jne 0x7dad5
movq %rbx, %rax
mulq %r14
seto %cl
testq %rax, %rax
je 0x7d9f4
orq %r14, %rbx
shrq $0x20, %rbx
setne %dl
testb %cl, %dl
jne 0x7dad5
cmpq $0xe00, %rax            # imm = 0xE00
jbe 0x7da0d
leaq 0x61f60(%rip), %rcx     # 0xdf930
movq (%rcx), %rcx
cmpq %rax, %rcx
jae 0x7daed
leaq 0x61e9d(%rip), %rdx     # 0xdf880
movq (%rdx), %r14
movq %rax, %rdx
addq %r14, %rdx
notq %r14
andq %rdx, %r14
jmp 0x7da39
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
movl $0x1, %eax
je 0x7dad5
leaq -0x1(%rax), %rcx
shrq $0x3, %rcx
leaq 0x257a4(%rip), %rdx     # 0xa31c0
movzbl (%rdx,%rcx), %ecx
imulq $0x68, %rcx, %rcx
leaq 0x611d5(%rip), %rdx     # 0xdec00
movq (%rdx,%rcx), %r14
leaq 0x61efa(%rip), %rcx     # 0xdf930
movq (%rcx), %rcx
cmpq %rax, %rcx
jae 0x7da4d
movq %rax, %rdi
movl $0x1, %esi
callq 0x8b91c
jmp 0x7da61
xorl %edi, %edi
movq %rax, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x7fb8c
movq %rax, %rbx
testq %rax, %rax
je 0x7dad5
addq %r14, %fs:-0x28
cmpb $0x1, 0x610f1(%rip)     # 0xdeb6a
jne 0x7dae2
movq $0x1301, 0x10(%rsp)     # imm = 0x1301
movq %rbx, 0x18(%rsp)
movq %r14, 0x20(%rsp)
leaq 0x61deb(%rip), %rax     # 0xdf880
movq (%rax), %rax
notq %rax
andq %rbx, %rax
movq %rbx, %rcx
subq %rax, %rcx
je 0x7db03
shrq $0xc, %rcx
leaq 0x61e77(%rip), %rdx     # 0xdf928
subq (%rdx), %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x40(%rax,%rcx,8), %rax
movl %eax, %ecx
shrl $0x4, %ecx
movl $0xff, %edx
andl %edx, %ecx
cmpl %edx, %ecx
jne 0x7db0d
andq $-0x1000, %rax          # imm = 0xF000
jmp 0x7db1c
callq 0x1f810
movl $0xc, (%rax)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
addq $0xfff, %r14            # imm = 0xFFF
andq $-0x1000, %r14          # imm = 0xF000
jmp 0x7da39
movq %rbx, %rdi
callq 0x8be94
jmp 0x7db1c
imulq $0x68, %rcx, %rax
leaq 0x610e8(%rip), %rcx     # 0xdec00
movq (%rcx,%rax), %rax
cmpq $0xe00, %rax            # imm = 0xE00
ja 0x7db48
decq %rax
shrq $0x3, %rax
leaq 0x2568e(%rip), %rcx     # 0xa31c0
movzbl (%rcx,%rax), %eax
imulq $0x68, %rax, %rax
leaq 0x610bf(%rip), %rcx     # 0xdec00
movq 0x8(%rcx,%rax), %rcx
jmp 0x7db4a
xorl %ecx, %ecx
leaq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq $0x1, 0x20(%rax)
movq $0x0, 0x28(%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
jmp 0x7dae2