// File: /workspace/github_c_makefile_star2_O3/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/jemalloc.c
// Function: ifree
JEMALLOC_INLINE_C void
ifree(tsd_t *tsd, void *ptr, tcache_t *tcache, bool slow_path)
{
	size_t usize;
	UNUSED size_t rzsize JEMALLOC_CC_SILENCE_INIT(0);

	witness_assert_lockless(tsd_tsdn(tsd));

	assert(ptr != NULL);
	assert(malloc_initialized() || IS_INITIALIZER);

	if (config_prof && opt_prof) {
		usize = isalloc(tsd_tsdn(tsd), ptr, config_prof);
		prof_free(tsd, ptr, usize);
	} else if (config_stats || config_valgrind)
		usize = isalloc(tsd_tsdn(tsd), ptr, config_prof);
	if (config_stats)
		*tsd_thread_deallocatedp_get(tsd) += usize;

	if (likely(!slow_path))
		iqalloc(tsd, ptr, tcache, false);
	else {
		if (config_valgrind && unlikely(in_valgrind))
			rzsize = p2rz(tsd_tsdn(tsd), ptr);
		iqalloc(tsd, ptr, tcache, true);
		JEMALLOC_VALGRIND_FREE(ptr, rzsize);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x300e3(%rip), %r12     # 0x4d0d0
movq (%r12), %rax
notq %rax
andq %rsi, %rax
cmpq %rsi, %rax
je 0x1d0e4
movq %r15, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
leaq 0x2ffaf(%rip), %rdx     # 0x4cfc0
subq (%rdx), %rcx
movq 0x78(%rax,%rcx,8), %rax
movl %eax, %ecx
shrl $0x5, %ecx
movl $0xff, %edx
andl %edx, %ecx
cmpl %edx, %ecx
je 0x1d107
movl %ecx, %eax
leaq 0x1e68a(%rip), %rcx     # 0x3b6c0
movq (%rcx,%rax,8), %rax
addq %rax, 0x18(%r14)
testb %bpl, %bpl
jne 0x1d0f4
movq (%r12), %rdx
notq %rdx
andq %r15, %rdx
cmpq %r15, %rdx
je 0x1d11b
movq %r15, %r8
subq %rdx, %r8
shrq $0xc, %r8
leaq 0x2ff55(%rip), %rax     # 0x4cfc0
movq %r8, %rcx
subq (%rax), %rcx
movq 0x78(%rdx,%rcx,8), %rax
testb $0x2, %al
jne 0x1d12e
testq %rbx, %rbx
je 0x1d165
shrl $0x5, %eax
movzbl %al, %ecx
movl %ecx, %eax
shll $0x5, %eax
leaq (%rbx,%rax), %r12
addq $0x28, %r12
leaq 0x303d7(%rip), %rax     # 0x4d478
movq (%rax), %rax
movl 0x10(%r12), %r8d
cmpl (%rax,%rcx,4), %r8d
je 0x1d194
incl %r8d
movl %r8d, 0x10(%r12)
movq 0x18(%r12), %rax
shlq $0x3, %r8
negq %r8
movq %r15, (%rax,%r8)
movl 0x18(%rbx), %eax
testl %eax, %eax
jle 0x1d17b
decl %eax
movl %eax, 0x18(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %r15, %rsi
callq 0x2e344
jmp 0x1d03a
movq %r14, %rdi
movq %r15, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0xbaa2
jmp 0x1d0db
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
addq $-0x1000, %rax          # imm = 0xF000
jmp 0x1d03a
movq %r14, %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x10a30
testq %rbx, %rbx
je 0x1d14f
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
leaq -0x1000(%rax), %rdi
leaq 0x30356(%rip), %rcx     # 0x4d4a0
cmpq (%rcx), %rdi
jbe 0x1d1af
movq (%rdx), %rsi
movq %r14, %rdi
movq %r15, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xda57
movq (%rdx), %rsi
movq %r14, %rdi
movq %r15, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xd9f4
movl 0x1c(%rbx), %eax
movl %eax, 0x18(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x35571
shrl %r8d
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x3561b
movl 0x10(%r12), %r8d
jmp 0x1d0b3
cmpq $0x1000, %rdi           # imm = 0x1000
ja 0x1d20e
addq $-0x1001, %rax          # imm = 0xEFFF
shrq $0x3, %rax
leaq 0x1ec77(%rip), %rcx     # 0x3be40
movzbl (%rax,%rcx), %eax
movl %eax, %edx
movq %rdx, %rcx
shlq $0x5, %rcx
leaq (%rbx,%rcx), %r12
addq $0x28, %r12
leaq 0x30293(%rip), %rcx     # 0x4d478
movq (%rcx), %rsi
movl 0x10(%r12), %ecx
cmpl (%rsi,%rdx,4), %ecx
je 0x1d215
incl %ecx
movl %ecx, 0x10(%r12)
movq 0x18(%r12), %rax
shlq $0x3, %rcx
negq %rcx
movq %r15, (%rax,%rcx)
jmp 0x1d0cb
callq 0xb765
jmp 0x1d1cd
shrl %ecx
movq %r14, %rdi
movq %r12, %rsi
movl %eax, %edx
movq %rbx, %r8
callq 0x35853
movl 0x10(%r12), %ecx
jmp 0x1d1f2