// File: /workspace/github_c_makefile_star2_O1/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 0x1ded8(%rip), %rsi     # 0x4d2b0
movq %rsi, (%rsp)
testq %rsi, %rsi
je 0x2f47b
movq 0x8(%rbx), %rdx
movq %rsp, %rax
xorl %ecx, %ecx
xorl %edi, %edi
cmpq 0x8(%rsi), %rdx
seta %dil
sbbl $0x0, %edi
jne 0x2f40e
movq 0x10(%rbx), %r8
xorl %edi, %edi
cmpq 0x10(%rsi), %r8
seta %dil
sbbl $0x0, %edi
movl %edi, 0x8(%rax)
testl %edi, %edi
js 0x2f44d
movq 0x30(%rsi), %r8
andq $-0x2, %r8
movq %r8, 0x10(%rax)
movb $0x1, %r9b
testl %edi, %edi
jne 0x2f463
leaq 0x10(%rax), %rsi
movl $0x1, 0x8(%rax)
testq %r8, %r8
je 0x2f45a
movl $0xffffffff, 0x8(%rsi)  # imm = 0xFFFFFFFF
movq 0x28(%r8), %r8
movq %r8, 0x10(%rsi)
addq $0x10, %rsi
jmp 0x2f433
movq 0x28(%rsi), %rsi
movq %rsi, 0x10(%rax)
movb $0x1, %r9b
jmp 0x2f463
xorl %r9d, %r9d
movq %rax, %rcx
movq %rsi, %rax
testb %r9b, %r9b
je 0x2f480
movq 0x10(%rax), %rsi
addq $0x10, %rax
testq %rsi, %rsi
jne 0x2f3ee
jmp 0x2f480
movq %rsp, %rax
xorl %ecx, %ecx
leaq -0x10(%rax), %rdx
movq -0x10(%rax), %rsi
cmpq %rbx, %rsi
je 0x2f4fc
movq 0x30(%rsi), %rdi
movl %edi, %r8d
andl $0x1, %r8d
andq $-0x2, %rdi
movq 0x30(%rbx), %r9
andl $0x1, %r9d
orq %r9, %rdi
movq %rdi, 0x30(%rsi)
movq 0x28(%rbx), %rdi
movq %rdi, 0x28(%rsi)
movq 0x30(%rbx), %rdi
andq $-0x2, %rdi
orq %r9, %rdi
movq %rdi, 0x30(%rsi)
movq 0x30(%rbx), %rdi
andq $-0x2, %rdi
orq %r8, %rdi
movq %rdi, 0x30(%rbx)
movq %rsi, (%rcx)
movq %rbx, (%rdx)
movq %rsp, %rsi
cmpq %rsi, %rcx
je 0x2f528
cmpl $0x0, -0x8(%rcx)
movq (%rcx), %rsi
js 0x2f534
movq -0x10(%rcx), %rcx
movq 0x30(%rcx), %rdi
andl $0x1, %edi
orq %rsi, %rdi
movq %rdi, 0x30(%rcx)
jmp 0x2f54a
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
je 0x2f53e
andb $-0x2, 0x30(%rcx)
movq %rsp, %rsi
cmpq %rsi, %rdx
je 0x2f7c5
cmpl $0x0, -0x18(%rax)
js 0x2f63b
movq -0x20(%rax), %rax
jmp 0x2f803
movq (%rcx), %rcx
movq %rcx, 0x1dd7e(%rip)     # 0x4d2b0
jmp 0x2f54a
movq -0x10(%rcx), %rcx
movq %rsi, 0x28(%rcx)
jmp 0x2f54a
movq %rsp, %rcx
cmpq %rcx, %rdx
je 0x2f644
movq (%rdx), %rcx
testb $0x1, 0x30(%rcx)
jne 0x2f62a
movq $0x0, -0x10(%rax)
leaq -0x20(%rax), %rcx
movq %rsp, %rdx
cmpq %rdx, %rcx
jb 0x2f61a
addq $-0x30, %rax
cmpl $0x0, 0x18(%rax)
movq 0x20(%rax), %rdi
js 0x2f5cd
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 0x2f654
testb $0x1, %r9b
jne 0x2f691
movq 0x28(%rcx), %rdi
testq %rdi, %rdi
je 0x2f5c3
movq 0x30(%rdi), %r9
testb $0x1, %r9b
jne 0x2f6d9
orq $0x1, %r8
movq %r8, 0x30(%rcx)
jmp 0x2f60a
movq 0x10(%rax), %rcx
movq %rdi, 0x28(%rcx)
movq 0x30(%rcx), %rsi
testb $0x1, %sil
jne 0x2f6b5
movq 0x28(%rsi), %rdi
testq %rdi, %rdi
je 0x2f5fa
movq 0x30(%rdi), %r8
testb $0x1, %r8b
jne 0x2f70c
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 0x2f573
movq (%rsp), %rax
movq %rax, 0x1dc8b(%rip)     # 0x4d2b0
jmp 0x2f897
movq -0x20(%rax), %rax
movq $0x0, 0x28(%rax)
jmp 0x2f897
movq -0x20(%rax), %rax
jmp 0x2f819
movq $0x0, 0x1dc61(%rip) # 0x4d2b0
jmp 0x2f897
andq $-0x2, %r8
movq 0x28(%r8), %r9
leaq 0x10(%rax), %rdi
testq %r9, %r9
je 0x2f673
movq 0x30(%r9), %r10
testb $0x1, %r10b
jne 0x2f766
orb $0x1, 0x30(%r8)
movq 0x30(%rcx), %r8
andq $-0x2, %r8
movq %r8, 0x28(%rsi)
andq $-0x2, %rsi
movq %rsi, 0x30(%rcx)
jmp 0x2f7c0
movq 0x28(%rcx), %rdx
testq %rdx, %rdx
je 0x2f6a4
testb $0x1, 0x30(%rdx)
jne 0x2f7d1
orq $0x1, %r8
movq %r8, 0x30(%rcx)
andb $-0x2, 0x30(%rsi)
jmp 0x2f897
andq $-0x2, %rsi
movq 0x28(%rsi), %rdx
testq %rdx, %rdx
je 0x2f6cc
testb $0x1, 0x30(%rdx)
jne 0x2f81f
leaq 0x28(%rsi), %rdi
orq $0x1, %rdx
jmp 0x2f861
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 0x2f7fa
jmp 0x2f7c5
andq $-0x2, %r8
movq %r8, 0x30(%rdi)
movq %r8, 0x28(%rsi)
movq %rsi, 0x30(%rdi)
movq 0x30(%rcx), %rsi
andl $0x1, %esi
orq %rdi, %rsi
movq %rsi, 0x30(%rcx)
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 0x2f88a
cmpl $0x0, 0x8(%rax)
movq (%rax), %rax
js 0x2f893
movq 0x30(%rax), %rcx
andl $0x1, %ecx
orq %rdi, %rcx
jmp 0x2f87b
andq $-0x2, %r10
movq %r10, 0x30(%r9)
movq 0x30(%rcx), %r9
movq %r9, %r8
andq $-0x2, %r8
movq %r8, 0x28(%rsi)
andl $0x1, %r9d
orq %rsi, %r9
movq %r9, 0x30(%rcx)
movq 0x30(%r8), %r9
movq %r9, %r10
andq $-0x2, %r10
movq %r10, 0x28(%rsi)
andl $0x1, %r9d
orq %rsi, %r9
movq %r9, 0x30(%r8)
movq 0x30(%rcx), %rsi
andl $0x1, %esi
leaq (%rsi,%r8), %r9
movq %r9, 0x30(%rcx)
orq 0x28(%r8), %rsi
movq %rsi, 0x30(%rcx)
movq %rcx, 0x28(%r8)
movq %r8, %rcx
cmpq %rdx, %rdi
jne 0x2f7fa
movq %rcx, 0x1dae4(%rip)     # 0x4d2b0
jmp 0x2f897
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 0x2f816
movq (%rax), %rax
movq 0x30(%rax), %rdx
andl $0x1, %edx
orq %rcx, %rdx
movq %rdx, 0x30(%rax)
jmp 0x2f897
movq (%rax), %rax
movq %rcx, 0x28(%rax)
jmp 0x2f897
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)
movq 0x30(%rcx), %r8
andl $0x1, %r8d
orq %rdx, %r8
movq %r8, 0x30(%rcx)
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 0x2f881
movq (%rax), %rax
movq 0x30(%rax), %rcx
andl $0x1, %ecx
orq %rsi, %rcx
movq %rcx, 0x30(%rax)
jmp 0x2f897
movq (%rax), %rax
movq %rsi, 0x28(%rax)
jmp 0x2f897
movq %rdi, 0x1da1f(%rip)     # 0x4d2b0
jmp 0x2f897
movq %rdi, 0x28(%rax)
movq 0x18(%rbx), %r15
testq %r15, %r15
je 0x2f958
leaq 0x1d825(%rip), %r13     # 0x4d0d0
movq (%r13), %rax
notq %rax
andq %r15, %rax
cmpq %rax, %r15
je 0x2fa6b
movq (%rax), %r12
movq (%r13), %rax
notq %rax
andq %r15, %rax
movq %r15, %rcx
subq %rax, %rcx
je 0x2fa7b
shrq $0xc, %rcx
leaq 0x1d6de(%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 0x2fa9b
movl %ecx, %eax
leaq 0xbd39(%rip), %rcx      # 0x3b640
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 0x2fa8b
shrq $0xc, %r8
leaq 0x1d687(%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 0x2faaf
callq 0xdf6b
leaq 0x40(%rbx), %rsi
movq %r14, %rdi
callq 0x371dc
leaq 0x1d765(%rip), %r12     # 0x4d0d0
movq (%r12), %rax
notq %rax
andq %rbx, %rax
cmpq %rbx, %rax
je 0x2fa26
movq (%rax), %r15
movq (%r12), %rax
notq %rax
andq %rbx, %rax
cmpq %rbx, %rax
je 0x2fa36
movq %rbx, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
leaq 0x1d61b(%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 0x2fa50
movl %ecx, %eax
leaq 0xbc76(%rip), %rcx      # 0x3b640
movq (%rcx,%rax,8), %rax
negq %rax
lock
xaddq %rax, 0x90(%r15)
movq (%r12), %rdx
notq %rdx
andq %rbx, %rdx
cmpq %rbx, %rdx
je 0x2fa43
movq %rbx, %r8
subq %rdx, %r8
shrq $0xc, %r8
leaq 0x1d5c6(%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 0x2fa64
callq 0xdf6b
addq $0x800, %rsp            # imm = 0x800
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x2e39f
movq %rax, %r15
jmp 0x2f981
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2e4e2
jmp 0x2f9ce
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11227
jmp 0x2fa15
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
addq $-0x1000, %rax          # imm = 0xF000
jmp 0x2f9ce
callq 0xdfd3
jmp 0x2fa15
movq %r15, %rdi
callq 0x2e39f
movq %rax, %r12
jmp 0x2f8c1
movq %r14, %rdi
movq %r15, %rsi
callq 0x2e4e2
jmp 0x2f90b
movq %r14, %rdi
movq %r15, %rsi
callq 0x11227
jmp 0x2f958
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
addq $-0x1000, %rax          # imm = 0xF000
jmp 0x2f90b
callq 0xdfd3
jmp 0x2f958