// File: /workspace/github_c_makefile_star2_O1/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 0x2c792(%rip), %rax     # 0x4bfe8
movq %fs:0x0, %r14
addq %rax, %r14
movl %fs:(%rax), %ecx
testl %ecx, %ecx
je 0x1f9eb
cmpl $0x2, %ecx
je 0x1fa24
movl %r15d, %ecx
andl $0x3f, %ecx
jne 0x1f8e1
cmpq $0x1000, %r12           # imm = 0x1000
ja 0x1f99f
decq %r12
shrq $0x3, %r12
leaq 0x1c527(%rip), %rax     # 0x3bdc0
movzbl (%r12,%rax), %eax
leaq 0x1bd9b(%rip), %rcx     # 0x3b640
movq (%rcx,%rax,8), %r13
andl $0xfff00, %r15d         # imm = 0xFFF00
jne 0x1f98f
leaq 0x8(%r14), %r15
movq (%r15), %rcx
movzbl 0x2ca93(%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 0x1faaf
movl $0x1, %r13d
shlq %cl, %r13
cmpq $0x3801, %r12           # imm = 0x3801
setae %al
cmpl $0xc, %ecx
setae %cl
orb %al, %cl
je 0x1fa62
leaq 0x2d697(%rip), %rax     # 0x4cfa0
leaq 0x2d7b8(%rip), %rcx     # 0x4d0c8
movq (%rcx), %rcx
cmpq %r12, (%rax)
jb 0x1faa7
movq %rcx, %rbp
cmpq %r13, %rcx
jbe 0x1f946
leaq 0x10(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r13, %rdi
movq %r12, %rsi
callq 0xc79d
testb $0x1, %al
je 0x1fa7a
movq 0x10(%rsp), %r13
movabsq $0x7000000000000000, %rax # imm = 0x7000000000000000
cmpq %rax, %r13
ja 0x1fa95
movq %rbp, %rcx
leaq 0x2d76d(%rip), %rax     # 0x4d0d0
movq (%rax), %rbp
cmpq %r12, %rcx
jb 0x1fa84
addq %rbp, %r13
notq %rbp
andq %r13, %rbp
movl $0xfff, %eax            # imm = 0xFFF
subq %rbp, %rax
xorl %r13d, %r13d
cmpq %rcx, %rax
cmovaeq %rcx, %r13
jmp 0x1f8a9
cmpl $0x100, %r15d           # imm = 0x100
jne 0x1f9f4
xorl %ecx, %ecx
jmp 0x1f8bd
movabsq $0x7000000000000000, %rax # imm = 0x7000000000000000
cmpq %rax, %r12
ja 0x1fa95
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 0x1f8a9
movl $0x1, %fs:(%rax)
jmp 0x1fa2b
shrl $0x8, %r15d
addl $-0x2, %r15d
leaq 0x2da85(%rip), %rax     # 0x4d488
movq (%rax), %rax
leaq (%rax,%r15,8), %r15
cmpq $0x0, (%r15)
jne 0x1f8ba
movq %r14, %rdi
movq %r15, %rsi
callq 0xc890
jmp 0x1f8ba
movl $0x3, %fs:(%rax)
leaq 0x2daa2(%rip), %rax     # 0x4d4d4
movl (%rax), %edi
movq %r14, %rsi
callq 0xb5b0
testl %eax, %eax
je 0x1f876
leaq 0x1c736(%rip), %rdi     # 0x3c181
callq 0x35efc
cmpb $0x1, 0x2cac9(%rip)     # 0x4c520
jne 0x1f876
callq 0xb070
leaq 0x8(%rsp), %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0xc717
testb $0x1, %al
je 0x1f902
movq 0x8(%rsp), %r13
jmp 0x1f8a9
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0xc818
testb $0x1, %al
je 0x1fa9d
xorl %r13d, %r13d
jmp 0x1f8a9
movq 0x8(%rsp), %rcx
jmp 0x1f96f
movq %rcx, %rbp
jmp 0x1f946