// File: /workspace/github_c_makefile_star2_O3/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/jemalloc.c
// Function: je_sdallocx
JEMALLOC_NOTHROW
je_sdallocx(void *ptr, size_t size, int flags)
{
	tsd_t *tsd;
	tcache_t *tcache;
	size_t usize;

	assert(ptr != NULL);
	assert(malloc_initialized() || IS_INITIALIZER);
	tsd = tsd_fetch();
	usize = inallocx(tsd_tsdn(tsd), size, flags);
	assert(usize == isalloc(tsd_tsdn(tsd), ptr, config_prof));

	witness_assert_lockless(tsd_tsdn(tsd));
	if (unlikely((flags & MALLOCX_TCACHE_MASK) != 0)) {
		if ((flags & MALLOCX_TCACHE_MASK) == MALLOCX_TCACHE_NONE)
			tcache = NULL;
		else
			tcache = tcaches_get(tsd, MALLOCX_TCACHE_GET(flags));
	} else
		tcache = tcache_get(tsd, false);

	UTRACE(ptr, 0, 0);
	if (likely(!malloc_slow))
		isfree(tsd, ptr, usize, tcache, false);
	else
		isfree(tsd, ptr, usize, tcache, true);
	witness_assert_lockless(tsd_tsdn(tsd));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
movq 0x2cafc(%rip), %rbp     # 0x4bfe8
movq %fs:0x0, %r14
addq %rbp, %r14
movl %fs:(%rbp), %eax
testl %eax, %eax
je 0x1f6c1
cmpl $0x2, %eax
je 0x1f715
movl %r15d, %ecx
andl $0x3f, %ecx
jne 0x1f576
cmpq $0x1000, %r12           # imm = 0x1000
ja 0x1f675
decq %r12
shrq $0x3, %r12
leaq 0x1c910(%rip), %rax     # 0x3be40
movzbl (%r12,%rax), %eax
leaq 0x1c184(%rip), %rcx     # 0x3b6c0
movq (%rcx,%rax,8), %r13
andl $0xfff00, %r15d         # imm = 0xFFF00
jne 0x1f665
movq %fs:0x8(%rbp), %rcx
movzbl 0x2cdfe(%rip), %r8d     # 0x4c358
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f7b1
movl $0x1, %r8d
shlq %cl, %r8
cmpq $0x3801, %r12           # imm = 0x3801
setae %al
cmpl $0xc, %ecx
setae %cl
orb %al, %cl
jne 0x1f5da
leaq (%r12,%r8), %rax
decq %rax
movq %r8, %rdi
negq %rdi
andq %rax, %rdi
cmpq $0x1000, %rdi           # imm = 0x1000
ja 0x1f786
decq %rdi
shrq $0x3, %rdi
leaq 0x1c882(%rip), %rax     # 0x3be40
movzbl (%rdi,%rax), %eax
leaq 0x1c0f7(%rip), %rcx     # 0x3b6c0
movq (%rcx,%rax,8), %r13
cmpq $0x4000, %r13           # imm = 0x4000
jb 0x1f540
leaq 0x2d9bf(%rip), %rax     # 0x4cfa0
leaq 0x2dae0(%rip), %rcx     # 0x4d0c8
movq (%rcx), %rcx
cmpq %r12, (%rax)
jb 0x1f77e
movq %rcx, %r13
cmpq %r8, %rcx
jbe 0x1f61c
leaq 0x10(%rsp), %rdx
movq %rsp, %rcx
movq %r8, %rdi
movq %r12, %rsi
callq 0xc2e5
testb $0x1, %al
je 0x1f70c
movq 0x10(%rsp), %r8
movabsq $0x7000000000000000, %rax # imm = 0x7000000000000000
cmpq %rax, %r8
ja 0x1f768
movq %r13, %rcx
leaq 0x2da97(%rip), %rax     # 0x4d0d0
movq (%rax), %r13
cmpq %r12, %rcx
jb 0x1f754
addq %r13, %r8
notq %r13
andq %r8, %r13
movl $0xfff, %eax            # imm = 0xFFF
subq %r13, %rax
xorl %r13d, %r13d
cmpq %rcx, %rax
cmovaeq %rcx, %r13
jmp 0x1f540
cmpl $0x100, %r15d           # imm = 0x100
jne 0x1f6cb
xorl %ecx, %ecx
jmp 0x1f552
movabsq $0x7000000000000000, %rax # imm = 0x7000000000000000
cmpq %rax, %r12
ja 0x1f768
leaq -0x1(,%r12,2), %rax
bsrq %rax, %rax
movl %eax, %ecx
addb $-0x3, %cl
movq $-0x1, %rdx
shlq %cl, %rdx
cmpl $0x6, %eax
notq %rdx
movl $0x7, %r13d
cmovaeq %rdx, %r13
addq %r13, %r12
notq %r13
andq %r12, %r13
jmp 0x1f540
movl $0x1, %fs:(%rbp)
jmp 0x1f71d
shrl $0x8, %r15d
addl $-0x2, %r15d
leaq 0x2ddae(%rip), %rax     # 0x4d488
movq (%rax), %r12
movq (%r12,%r15,8), %rcx
testq %rcx, %rcx
jne 0x1f552
movq %fs:0x30(%rbp), %rsi
testq %rsi, %rsi
je 0x1f79f
movq %r14, %rdi
callq 0x10eca
movq %rax, %rcx
movq %rax, (%r12,%r15,8)
jmp 0x1f552
movq (%rsp), %r13
jmp 0x1f540
movl $0x3, %fs:(%rbp)
leaq 0x2ddb0(%rip), %rax     # 0x4d4d4
movl (%rax), %edi
movq %r14, %rsi
callq 0xb5b0
testl %eax, %eax
je 0x1f50d
leaq 0x1cac4(%rip), %rdi     # 0x3c201
callq 0x3645c
cmpb $0x1, 0x2cdd7(%rip)     # 0x4c520
jne 0x1f50d
callq 0xb070
movq %r8, 0x8(%rsp)
movq %rsp, %rsi
movq %r12, %rdi
callq 0xc360
testb $0x1, %al
je 0x1f770
xorl %r13d, %r13d
jmp 0x1f540
movq (%rsp), %rcx
movq 0x8(%rsp), %r8
jmp 0x1f645
movq %rcx, %r13
jmp 0x1f61c
movq %rsp, %rsi
movq %r8, %r13
callq 0xc2b4
movq %r13, %r8
movq %rsp, %rax
movq (%rax), %r13
jmp 0x1f5cd
movq %r14, %rdi
xorl %esi, %esi
callq 0x1af15
movq %rax, %rsi
jmp 0x1f6f8