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

	if (malloc_init()) {
		ret = NULL;
		goto label_oom;
	}

	if (size == 0)
		size = 1;

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

label_oom:
	if (ret == NULL) {
		if (config_xmalloc && opt_xmalloc) {
			malloc_write("<jemalloc>: Error in malloc(): "
			    "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, size, ret);
	JEMALLOC_VALGRIND_MALLOC(ret != NULL, ret, usize, false);
	return (ret);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
callq 0x7c7b5
testb %al, %al
jne 0x7c71f
cmpq $0x1, %rbx
movq %rbx, %rsi
adcq $0x0, %rsi
cmpq $0xe00, %rbx            # imm = 0xE00
ja 0x7c659
leaq -0x1(%rsi), %rax
shrq $0x3, %rax
leaq 0x26b86(%rip), %rcx     # 0xa31c0
movzbl (%rcx,%rax), %eax
imulq $0x68, %rax, %rax
leaq 0x625b7(%rip), %rcx     # 0xdec00
movq (%rcx,%rax), %r14
leaq 0x632dc(%rip), %rax     # 0xdf930
movq (%rax), %rax
jmp 0x7c68c
leaq 0x632d0(%rip), %rax     # 0xdf930
movq (%rax), %rax
cmpq %rsi, %rax
jae 0x7c67e
leaq 0x63211(%rip), %rcx     # 0xdf880
movq (%rcx), %r14
leaq (%r14,%rsi), %rcx
notq %r14
andq %rcx, %r14
jmp 0x7c68c
leaq 0xfff(%rsi), %r14
andq $-0x1000, %r14          # imm = 0xF000
cmpq %rsi, %rax
jae 0x7c69d
movq %rsi, %rdi
xorl %esi, %esi
callq 0x8b91c
jmp 0x7c6ab
xorl %edi, %edi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x7fb8c
movq %rax, %rbx
testq %rax, %rax
je 0x7c71f
addq %r14, %fs:-0x28
cmpb $0x1, 0x624a7(%rip)     # 0xdeb6a
jne 0x7c72c
movq $0x1301, 0x10(%rsp)     # imm = 0x1301
movq %rbx, 0x18(%rsp)
movq %r14, 0x20(%rsp)
leaq 0x631a1(%rip), %rax     # 0xdf880
movq (%rax), %rax
notq %rax
andq %rbx, %rax
movq %rbx, %rcx
subq %rax, %rcx
je 0x7c737
shrq $0xc, %rcx
leaq 0x6322d(%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 0x7c741
andq $-0x1000, %rax          # imm = 0xF000
jmp 0x7c750
callq 0x1f810
movl $0xc, (%rax)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x8be94
jmp 0x7c750
imulq $0x68, %rcx, %rax
leaq 0x624b4(%rip), %rcx     # 0xdec00
movq (%rcx,%rax), %rax
cmpq $0xe00, %rax            # imm = 0xE00
ja 0x7c77c
decq %rax
shrq $0x3, %rax
leaq 0x26a5a(%rip), %rcx     # 0xa31c0
movzbl (%rcx,%rax), %eax
imulq $0x68, %rax, %rax
leaq 0x6248b(%rip), %rcx     # 0xdec00
movq 0x8(%rcx,%rax), %rcx
jmp 0x7c77e
xorl %ecx, %ecx
leaq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
movq %rcx, 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 0x7c72c