// File: /workspace/github_c_makefile_star2_O2/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
pushq %rax
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
movq 0x30783(%rip), %rbp     # 0x47ff0
movq %fs:0x0, %r14
addq %rbp, %r14
movl %fs:(%rbp), %eax
testl %eax, %eax
je 0x17a8f
cmpl $0x2, %eax
je 0x17af9
movl %r15d, %ecx
andl $0x3f, %ecx
jne 0x178f7
cmpq $0x1000, %r12           # imm = 0x1000
ja 0x17a4d
decq %r12
shrq $0x3, %r12
leaq 0x1f10f(%rip), %rax     # 0x369c0
movzbl (%r12,%rax), %eax
leaq 0x1e983(%rip), %rcx     # 0x36240
movq (%rcx,%rax,8), %r13
andl $0xfff00, %r15d         # imm = 0xFFF00
jne 0x17a3d
movq %fs:0x8(%rbp), %rcx
movzbl 0x30a7d(%rip), %r8d     # 0x48358
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17bad
pushq $0x1
popq %rax
shlq %cl, %rax
cmpq $0x3801, %r12           # imm = 0x3801
setae %dl
cmpl $0xc, %ecx
setae %cl
orb %dl, %cl
pushq $-0x1
popq %rdx
pushq $0x7
popq %rsi
jne 0x1795e
leaq (%r12,%rax), %rcx
decq %rcx
movq %rax, %rdi
negq %rdi
andq %rcx, %rdi
cmpq $0x1000, %rdi           # imm = 0x1000
ja 0x17b38
decq %rdi
shrq $0x3, %rdi
leaq 0x1f07e(%rip), %rcx     # 0x369c0
movzbl (%rdi,%rcx), %ecx
leaq 0x1e8f3(%rip), %rdi     # 0x36240
movq (%rdi,%rcx,8), %r13
cmpq $0x4000, %r13           # imm = 0x4000
jb 0x178c1
leaq 0x3163b(%rip), %rcx     # 0x48fa0
leaq 0x3175c(%rip), %rdi     # 0x490c8
movq (%rdi), %rdi
movabsq $0x7000000000000000, %r8 # imm = 0x7000000000000000
cmpq %r12, (%rcx)
jb 0x179e8
cmpq %rax, %rdi
jbe 0x179e8
addq $0xfff, %rax            # imm = 0xFFF
andq $-0x1000, %rax          # imm = 0xF000
movl $0x4000, %r13d          # imm = 0x4000
cmpq $0x4001, %r12           # imm = 0x4001
jb 0x179d4
cmpq %r8, %r12
ja 0x17b69
leaq -0x1(,%r12,2), %rcx
bsrq %rcx, %r9
movl %r9d, %ecx
addb $-0x3, %cl
movq %rdx, %r13
shlq %cl, %r13
cmpl $0x6, %r9d
notq %r13
cmovbq %rsi, %r13
leaq (%r12,%r13), %rcx
notq %r13
andq %rcx, %r13
leaq (%rax,%r13), %rcx
leaq 0x315f1(%rip), %r9      # 0x48fd0
cmpq (%r9), %rcx
jbe 0x178c1
cmpq %r8, %rax
ja 0x17a35
leaq 0x316dc(%rip), %rcx     # 0x490d0
movq (%rcx), %r9
cmpq %r12, %rdi
jae 0x17ad9
cmpq $0x1000, %r12           # imm = 0x1000
ja 0x17b71
leaq -0x1(%r12), %rcx
shrq $0x3, %rcx
leaq 0x1efa3(%rip), %rdx     # 0x369c0
movzbl (%rcx,%rdx), %ecx
leaq 0x1e818(%rip), %rdx     # 0x36240
movq (%rdx,%rcx,8), %rdi
cmpq %r12, %rdi
jae 0x17ad9
xorl %r13d, %r13d
jmp 0x178c1
cmpl $0x100, %r15d           # imm = 0x100
jne 0x17a99
xorl %ecx, %ecx
jmp 0x178d3
movabsq $0x7000000000000000, %rax # imm = 0x7000000000000000
cmpq %rax, %r12
ja 0x17a35
leaq -0x1(,%r12,2), %rax
bsrq %rax, %rax
movl %eax, %ecx
addb $-0x3, %cl
pushq $-0x1
popq %rdx
shlq %cl, %rdx
cmpl $0x6, %eax
notq %rdx
pushq $0x7
popq %r13
cmovaeq %rdx, %r13
addq %r13, %r12
notq %r13
andq %r12, %r13
jmp 0x178c1
movl $0x1, %fs:(%rbp)
jmp 0x17b01
shrl $0x8, %r15d
addl $-0x2, %r15d
leaq 0x319e0(%rip), %rax     # 0x49488
movq (%rax), %r12
movq (%r12,%r15,8), %rcx
testq %rcx, %rcx
jne 0x178d3
movq %r14, %rdi
xorl %esi, %esi
callq 0x19a6b
movq %r14, %rdi
movq %rax, %rsi
callq 0x307e8
movq %rax, %rcx
movq %rax, (%r12,%r15,8)
jmp 0x178d3
addq %r9, %rax
notq %r9
andq %rax, %r9
movl $0xfff, %eax            # imm = 0xFFF
subq %r9, %rax
xorl %r13d, %r13d
cmpq %rdi, %rax
cmovaeq %rdi, %r13
jmp 0x178c1
movl $0x3, %fs:(%rbp)
leaq 0x319cc(%rip), %rax     # 0x494d4
movl (%rax), %edi
movq %r14, %rsi
callq 0xb5b0
testl %eax, %eax
je 0x1788e
leaq 0x1f260(%rip), %rdi     # 0x36d81
callq 0x3126c
cmpb $0x1, 0x309f3(%rip)     # 0x48520
jne 0x1788e
callq 0xb070
leaq -0x1(,%rdi,2), %rcx
bsrq %rcx, %r8
movl %r8d, %ecx
addb $-0x3, %cl
movq %rdx, %r13
shlq %cl, %r13
cmpl $0x6, %r8d
notq %r13
cmovbq %rsi, %r13
addq %r13, %rdi
notq %r13
andq %rdi, %r13
jmp 0x17951
xorl %r13d, %r13d
jmp 0x179d4
cmpq %r8, %r12
ja 0x17ba6
leaq -0x1(,%r12,2), %rcx
bsrq %rcx, %rdi
movl %edi, %ecx
addb $-0x3, %cl
shlq %cl, %rdx
cmpl $0x6, %edi
notq %rdx
cmovbq %rsi, %rdx
leaq (%rdx,%r12), %rcx
notq %rdx
andq %rcx, %rdx
movq %rdx, %rdi
jmp 0x17a2c
xorl %edi, %edi
jmp 0x17a2c