// File: /workspace/github_c_makefile_star2_O3/zhou-yuxin[P]redis-aof-no-cow/deps/jemalloc/src/prof.c
// Function: prof_tdata_destroy_locked
static void
prof_tdata_destroy_locked(tsd_t *tsd, prof_tdata_t *tdata,
    bool even_if_attached)
{

	malloc_mutex_assert_owner(tsd_tsdn(tsd), &tdatas_mtx);

	tdata_tree_remove(&tdatas, tdata);

	assert(prof_tdata_should_destroy_unlocked(tdata, even_if_attached));

	if (tdata->thread_name != NULL)
		idalloctm(tsd_tsdn(tsd), tdata->thread_name, NULL, true, true);
	ckh_delete(tsd, &tdata->bt2tctx);
	idalloctm(tsd_tsdn(tsd), tdata, NULL, true, true);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x800, %rsp            # imm = 0x800
movq %rsi, %rbx
movq %rdi, %r14
movq 0x1e085(%rip), %rdx     # 0x4d2b0
movq %rdx, (%rsp)
testq %rdx, %rdx
je 0x2f28e
movq 0x8(%rbx), %rcx
leaq 0x10(%rsp), %rax
xorl %esi, %esi
cmpq 0x8(%rdx), %rcx
seta %sil
sbbl $0x0, %esi
jne 0x2f25d
movq 0x10(%rbx), %rdi
xorl %esi, %esi
cmpq 0x10(%rdx), %rdi
seta %sil
sbbl $0x0, %esi
movl %esi, -0x8(%rax)
testl %esi, %esi
js 0x2f278
movq 0x30(%rdx), %rdx
andq $-0x2, %rdx
movq %rdx, (%rax)
testl %esi, %esi
jne 0x2f27f
jmp 0x2f33f
movq 0x28(%rdx), %rdx
movq %rdx, (%rax)
addq $0x10, %rax
testq %rdx, %rdx
jne 0x2f23d
addq $-0x10, %rax
jmp 0x2f291
movq %rsp, %rax
xorl %ecx, %ecx
leaq -0x10(%rax), %rsi
movq -0x10(%rax), %rdx
cmpq %rbx, %rdx
je 0x2f30f
movq 0x30(%rdx), %rdi
movl %edi, %r8d
andl $0x1, %r8d
andq $-0x2, %rdi
movq 0x30(%rbx), %r9
andl $0x1, %r9d
orq %r9, %rdi
movq %rdi, 0x30(%rdx)
movq 0x28(%rbx), %rdi
movq %rdi, 0x28(%rdx)
movq 0x30(%rbx), %rdi
andq $-0x2, %rdi
orq %r9, %rdi
movq %rdi, 0x30(%rdx)
movq 0x30(%rbx), %rdi
andq $-0x2, %rdi
orq %r8, %rdi
movq %rdi, 0x30(%rbx)
movq %rdx, (%rcx)
movq %rbx, (%rsi)
movq %rsp, %rdx
cmpq %rdx, %rcx
je 0x2f368
cmpl $0x0, -0x8(%rcx)
movq (%rcx), %rdx
js 0x2f374
movq -0x10(%rcx), %rcx
movq 0x30(%rcx), %rsi
andl $0x1, %esi
orq %rdx, %rsi
movq %rsi, 0x30(%rcx)
jmp 0x2f37c
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
je 0x2f46d
andb $-0x2, 0x30(%rcx)
movq %rsp, %rdx
cmpq %rdx, %rsi
je 0x2f5ea
cmpl $0x0, -0x18(%rax)
js 0x2f489
movq -0x20(%rax), %rax
jmp 0x2f628
movl $0x1, -0x8(%rax)
leaq -0x10(%rax), %rcx
testq %rdx, %rdx
je 0x2f293
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq 0x28(%rdx), %rdx
movq %rdx, 0x10(%rax)
addq $0x10, %rax
jmp 0x2f34a
movq (%rcx), %rcx
movq %rcx, 0x1df3e(%rip)     # 0x4d2b0
jmp 0x2f37c
movq -0x10(%rcx), %rcx
movq %rdx, 0x28(%rcx)
movq %rbx, %rdx
testb $0x1, 0x30(%rdx)
jne 0x2f45c
movq $0x0, -0x10(%rax)
leaq -0x20(%rax), %rcx
movq %rsp, %rdx
cmpq %rdx, %rcx
jb 0x2f44c
addq $-0x30, %rax
cmpl $0x0, 0x18(%rax)
movq 0x20(%rax), %rdi
js 0x2f3ff
movq 0x10(%rax), %rsi
movq 0x28(%rsi), %rcx
movq 0x30(%rsi), %r9
andl $0x1, %r9d
orq %rdi, %r9
movq %r9, 0x30(%rsi)
movq 0x30(%rcx), %r8
testb $0x1, %r8b
jne 0x2f492
testb $0x1, %r9b
jne 0x2f4cf
movq 0x28(%rcx), %rdi
testq %rdi, %rdi
je 0x2f3f5
movq 0x30(%rdi), %r9
testb $0x1, %r9b
jne 0x2f517
orq $0x1, %r8
movq %r8, 0x30(%rcx)
jmp 0x2f43c
movq 0x10(%rax), %rcx
movq %rdi, 0x28(%rcx)
movq 0x30(%rcx), %rsi
testb $0x1, %sil
jne 0x2f4f3
movq 0x28(%rsi), %rdi
testq %rdi, %rdi
je 0x2f42c
movq 0x30(%rdi), %r8
testb $0x1, %r8b
jne 0x2f54a
orq $0x1, %rdi
movq %rdi, 0x30(%rcx)
movq %rcx, 0x28(%rsi)
movq %rsi, 0x10(%rax)
leaq -0x10(%rax), %rcx
cmpq %rdx, %rax
movq %rcx, %rax
jae 0x2f3a5
movq (%rsp), %rax
movq %rax, 0x1de59(%rip)     # 0x4d2b0
jmp 0x2f6b1
movq -0x20(%rax), %rax
movq $0x0, 0x28(%rax)
jmp 0x2f6b1
movq %rsp, %rcx
cmpq %rcx, %rsi
jne 0x2f37f
movq $0x0, 0x1de2c(%rip) # 0x4d2b0
jmp 0x2f6b1
movq -0x20(%rax), %rax
jmp 0x2f63b
andq $-0x2, %r8
movq 0x28(%r8), %r9
leaq 0x10(%rax), %rdi
testq %r9, %r9
je 0x2f4b1
movq 0x30(%r9), %r10
testb $0x1, %r10b
jne 0x2f597
orb $0x1, 0x30(%r8)
movq 0x30(%rcx), %r8
andq $-0x2, %r8
movq %r8, 0x28(%rsi)
andq $-0x2, %rsi
movq %rsi, 0x30(%rcx)
jmp 0x2f5e5
movq 0x28(%rcx), %rdx
testq %rdx, %rdx
je 0x2f4e2
testb $0x1, 0x30(%rdx)
jne 0x2f5f6
orq $0x1, %r8
movq %r8, 0x30(%rcx)
andb $-0x2, 0x30(%rsi)
jmp 0x2f6b1
andq $-0x2, %rsi
movq 0x28(%rsi), %rdx
testq %rdx, %rdx
je 0x2f50a
testb $0x1, 0x30(%rdx)
jne 0x2f641
leaq 0x28(%rsi), %rdi
orq $0x1, %rdx
jmp 0x2f67b
andq $-0x2, %r9
movq %r9, 0x30(%rdi)
movq 0x30(%rcx), %rdi
movq %rdi, %r8
andq $-0x2, %r8
movq %r8, 0x28(%rsi)
andl $0x1, %edi
orq %rsi, %rdi
movq %rdi, 0x30(%rcx)
leaq 0x10(%rax), %rsi
cmpq %rdx, %rsi
jne 0x2f61f
jmp 0x2f5ea
andq $-0x2, %r8
movq %r8, 0x28(%rsi)
movq %rsi, 0x30(%rdi)
movl 0x30(%rcx), %esi
orl %edi, %esi
andq $-0x2, %rdi
andl $0x1, %esi
orq 0x28(%rdi), %rsi
movq %rsi, 0x30(%rcx)
movq %rcx, 0x28(%rdi)
leaq 0x10(%rax), %rcx
cmpq %rdx, %rcx
je 0x2f6a4
cmpl $0x0, 0x8(%rax)
movq (%rax), %rax
js 0x2f6ad
movq 0x30(%rax), %rcx
andl $0x1, %ecx
orq %rdi, %rcx
jmp 0x2f695
andq $-0x2, %r10
movq %r10, 0x30(%r9)
movq 0x30(%rcx), %r8
movq %r8, %r9
andq $-0x2, %r9
andl $0x1, %r8d
orq %rsi, %r8
movq %r8, 0x30(%rcx)
movq 0x30(%r9), %r8
movq %r8, %r10
andq $-0x2, %r10
movq %r10, 0x28(%rsi)
andl $0x1, %r8d
orq %rsi, %r8
movq %r8, 0x30(%r9)
movq 0x30(%rcx), %rsi
andl $0x1, %esi
orq 0x28(%r9), %rsi
movq %rsi, 0x30(%rcx)
movq %rcx, 0x28(%r9)
movq %r9, %rcx
cmpq %rdx, %rdi
jne 0x2f61f
movq %rcx, 0x1dcbf(%rip)     # 0x4d2b0
jmp 0x2f6b1
andq $-0x2, %rdi
movq %rdi, 0x30(%rsi)
orb $0x1, 0x30(%rcx)
andb $-0x2, 0x30(%rdx)
movq 0x30(%rcx), %rdx
movq %rdx, %rdi
andq $-0x2, %rdi
movq %rdi, 0x28(%rsi)
andl $0x1, %edx
orq %rsi, %rdx
movq %rdx, 0x30(%rcx)
cmpl $0x0, 0x8(%rax)
js 0x2f638
movq (%rax), %rax
movq 0x30(%rax), %rdx
andl $0x1, %edx
orq %rcx, %rdx
movq %rdx, 0x30(%rax)
jmp 0x2f6b1
movq (%rax), %rax
movq %rcx, 0x28(%rax)
jmp 0x2f6b1
movq %rsi, 0x30(%rcx)
movq 0x30(%rdx), %rdi
movq %rdi, %r8
andq $-0x2, %r8
movq %r8, 0x28(%rsi)
andl $0x1, %edi
orq %rsi, %rdi
movq %rdi, 0x30(%rdx)
movl 0x30(%rcx), %r8d
orl %edx, %r8d
movq %rdx, %rsi
andq $-0x2, %rsi
leaq 0x28(%rsi), %rdi
andl $0x1, %r8d
orq 0x28(%rsi), %r8
movq %r8, %rdx
movq %rdx, 0x30(%rcx)
movq %rcx, (%rdi)
cmpl $0x0, 0x8(%rax)
js 0x2f69b
movq (%rax), %rax
movq 0x30(%rax), %rcx
andl $0x1, %ecx
orq %rsi, %rcx
movq %rcx, 0x30(%rax)
jmp 0x2f6b1
movq (%rax), %rax
movq %rsi, 0x28(%rax)
jmp 0x2f6b1
movq %rdi, 0x1dc05(%rip)     # 0x4d2b0
jmp 0x2f6b1
movq %rdi, 0x28(%rax)
movq 0x18(%rbx), %r15
testq %r15, %r15
je 0x2f76b
leaq 0x1da0b(%rip), %r13     # 0x4d0d0
movq (%r13), %rax
notq %rax
andq %r15, %rax
cmpq %rax, %r15
je 0x2f87e
movq (%rax), %r12
cmpq %rax, %r15
je 0x2f898
movq %r15, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
leaq 0x1d8cb(%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 0x2f8b8
movl %ecx, %eax
leaq 0xbfa6(%rip), %rcx      # 0x3b6c0
movq (%rcx,%rax,8), %rax
negq %rax
lock
xaddq %rax, 0x90(%r12)
movq (%r13), %rdx
notq %rdx
andq %r15, %rdx
movq %r15, %r8
subq %rdx, %r8
je 0x2f8a8
shrq $0xc, %r8
leaq 0x1d874(%rip), %rax     # 0x4cfc0
movq %r8, %rcx
subq (%rax), %rcx
testb $0x2, 0x78(%rdx,%rcx,8)
movq (%rdx), %rsi
movq %r14, %rdi
movq %r15, %rcx
jne 0x2f8cc
callq 0xd9f4
leaq 0x40(%rbx), %rsi
movq %r14, %rdi
callq 0x37788
leaq 0x1d952(%rip), %r12     # 0x4d0d0
movq (%r12), %rax
notq %rax
andq %rbx, %rax
cmpq %rbx, %rax
je 0x2f82f
movq (%rax), %r15
cmpq %rbx, %rax
je 0x2f849
movq %rbx, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
leaq 0x1d812(%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 0x2f863
movl %ecx, %eax
leaq 0xbeed(%rip), %rcx      # 0x3b6c0
movq (%rcx,%rax,8), %rax
negq %rax
lock
xaddq %rax, 0x90(%r15)
movq (%r12), %rdx
notq %rdx
andq %rbx, %rdx
cmpq %rbx, %rdx
je 0x2f856
movq %rbx, %r8
subq %rdx, %r8
shrq $0xc, %r8
leaq 0x1d7bd(%rip), %rax     # 0x4cfc0
movq %r8, %rcx
subq (%rax), %rcx
testb $0x2, 0x78(%rdx,%rcx,8)
movq (%rdx), %rsi
movq %r14, %rdi
movq %rbx, %rcx
jne 0x2f877
callq 0xd9f4
addq $0x800, %rsp            # imm = 0x800
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x2e203
movq %rax, %r15
movq (%r12), %rax
notq %rax
andq %rbx, %rax
jmp 0x2f794
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2e344
jmp 0x2f7d7
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10a30
jmp 0x2f81e
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
addq $-0x1000, %rax          # imm = 0xF000
jmp 0x2f7d7
callq 0xda57
jmp 0x2f81e
movq %r15, %rdi
callq 0x2e203
movq %rax, %r12
movq (%r13), %rax
notq %rax
andq %r15, %rax
jmp 0x2f6db
movq %r14, %rdi
movq %r15, %rsi
callq 0x2e344
jmp 0x2f71e
movq %r14, %rdi
movq %r15, %rsi
callq 0x10a30
jmp 0x2f76b
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
addq $-0x1000, %rax          # imm = 0xF000
jmp 0x2f71e
callq 0xda57
jmp 0x2f76b