// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %r14
xorl %r15d, %r15d
callq 0x7c61b
movl $0x0, %ebx
testb %al, %al
jne 0x7c507
cmpq $0x1, %r14
movq %r14, %rsi
adcq $0x0, %rsi
cmpq $0xe00, %r14            # imm = 0xE00
ja 0x7c4ae
leaq -0x1(%rsi), %rax
shrq $0x3, %rax
leaq 0x26c27(%rip), %rcx     # 0xa30c0
movzbl (%rcx,%rax), %eax
imulq $0x68, %rax, %rax
leaq 0x62758(%rip), %rcx     # 0xdec00
movq (%rcx,%rax), %r15
jmp 0x7c4de
leaq 0x6347b(%rip), %rax     # 0xdf930
cmpq %rsi, (%rax)
jae 0x7c4d0
leaq 0x633bf(%rip), %rax     # 0xdf880
movq (%rax), %r15
leaq (%r15,%rsi), %rax
notq %r15
andq %rax, %r15
jmp 0x7c4de
leaq 0xfff(%rsi), %r15
andq $-0x1000, %r15          # imm = 0xF000
leaq 0x6344b(%rip), %rax     # 0xdf930
cmpq %rsi, (%rax)
jae 0x7c4f6
movq %rsi, %rdi
xorl %esi, %esi
callq 0x8b6a4
jmp 0x7c504
xorl %edi, %edi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x7f908
movq %rax, %rbx
testq %rbx, %rbx
jne 0x7c517
callq 0x1f810
movl $0xc, (%rax)
testq %rbx, %rbx
je 0x7c525
addq %r15, %fs:-0x28
testq %rbx, %rbx
je 0x7c60e
cmpb $0x0, 0x62635(%rip)     # 0xdeb6a
je 0x7c60e
movq $0x1301, 0x10(%rsp)     # imm = 0x1301
movq %rbx, 0x18(%rsp)
movq %r15, 0x20(%rsp)
leaq 0x6332b(%rip), %rax     # 0xdf880
movq (%rax), %rax
notq %rax
andq %rbx, %rax
movq %rbx, %rcx
subq %rax, %rcx
je 0x7c595
shrq $0xc, %rcx
leaq 0x633b7(%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 0x7c59f
andq $-0x1000, %rax          # imm = 0xF000
jmp 0x7c5ae
movq %rbx, %rdi
callq 0x8bc15
jmp 0x7c5ae
imulq $0x68, %rcx, %rax
leaq 0x62656(%rip), %rcx     # 0xdec00
movq (%rcx,%rax), %rax
cmpq $0xe00, %rax            # imm = 0xE00
ja 0x7c5da
decq %rax
shrq $0x3, %rax
leaq 0x26afc(%rip), %rcx     # 0xa30c0
movzbl (%rcx,%rax), %eax
imulq $0x68, %rax, %rax
leaq 0x6262d(%rip), %rcx     # 0xdec00
movq 0x8(%rcx,%rax), %rcx
jmp 0x7c5dc
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
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq