// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/jemalloc/src/prof.c
// Function: prof_tctx_destroy
static void
prof_tctx_destroy(tsd_t *tsd, prof_tctx_t *tctx)
{
	prof_tdata_t *tdata = tctx->tdata;
	prof_gctx_t *gctx = tctx->gctx;
	bool destroy_tdata, destroy_tctx, destroy_gctx;

	assert(tctx->cnts.curobjs == 0);
	assert(tctx->cnts.curbytes == 0);
	assert(!opt_prof_accum);
	assert(tctx->cnts.accumobjs == 0);
	assert(tctx->cnts.accumbytes == 0);

	ckh_remove(tsd, &tdata->bt2tctx, &gctx->bt, NULL, NULL);
	destroy_tdata = prof_tdata_should_destroy(tdata, false);
	malloc_mutex_unlock(tdata->lock);

	malloc_mutex_lock(gctx->lock);
	switch (tctx->state) {
	case prof_tctx_state_nominal:
		tctx_tree_remove(&gctx->tctxs, tctx);
		destroy_tctx = true;
		if (prof_gctx_should_destroy(gctx)) {
			/*
			 * Increment gctx->nlimbo in order to keep another
			 * thread from winning the race to destroy gctx while
			 * this one has gctx->lock dropped.  Without this, it
			 * would be possible for another thread to:
			 *
			 * 1) Sample an allocation associated with gctx.
			 * 2) Deallocate the sampled object.
			 * 3) Successfully prof_gctx_try_destroy(gctx).
			 *
			 * The result would be that gctx no longer exists by the
			 * time this thread accesses it in
			 * prof_gctx_try_destroy().
			 */
			gctx->nlimbo++;
			destroy_gctx = true;
		} else
			destroy_gctx = false;
		break;
	case prof_tctx_state_dumping:
		/*
		 * A dumping thread needs tctx to remain valid until dumping
		 * has finished.  Change state such that the dumping thread will
		 * complete destruction during a late dump iteration phase.
		 */
		tctx->state = prof_tctx_state_purgatory;
		destroy_tctx = false;
		destroy_gctx = false;
		break;
	default:
		not_reached();
		destroy_tctx = false;
		destroy_gctx = false;
	}
	malloc_mutex_unlock(gctx->lock);
	if (destroy_gctx) {
		prof_gctx_try_destroy(tsd, prof_tdata_get(tsd, false), gctx,
		    tdata);
	}

	if (destroy_tdata)
		prof_tdata_destroy(tsd, tdata, false);

	if (destroy_tctx)
		idalloctm(tsd, tctx, tcache_get(tsd, false), true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x380, %rsp            # imm = 0x380
movq %rdi, -0x338(%rbp)
movq %rsi, -0x340(%rbp)
movq -0x340(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x348(%rbp)
movq -0x340(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x350(%rbp)
jmp 0x647ce
jmp 0x647d0
jmp 0x647d2
jmp 0x647d4
jmp 0x647d6
jmp 0x647d8
jmp 0x647da
jmp 0x647dc
jmp 0x647de
movq -0x338(%rbp), %rdi
movq -0x348(%rbp), %rsi
addq $0x40, %rsi
movq -0x350(%rbp), %rdx
addq $0xc8, %rdx
xorl %eax, %eax
movl %eax, -0x35c(%rbp)
movl %eax, %r8d
movq %r8, %rcx
callq 0x836e0
movl -0x35c(%rbp), %esi
movq -0x348(%rbp), %rdi
callq 0x695f0
movb %al, -0x351(%rbp)
movq -0x348(%rbp), %rax
movq (%rax), %rdi
callq 0x65380
movq -0x350(%rbp), %rax
movq (%rax), %rdi
callq 0x64720
movq -0x340(%rbp), %rax
movl 0x5c(%rax), %eax
movl %eax, -0x358(%rbp)
subl $0x1, %eax
je 0x6486b
jmp 0x6485e
movl -0x358(%rbp), %eax
subl $0x2, %eax
je 0x648bd
jmp 0x648db
movq -0x350(%rbp), %rdi
addq $0x10, %rdi
movq -0x340(%rbp), %rsi
callq 0x69650
movb $0x1, -0x352(%rbp)
movq -0x350(%rbp), %rdi
callq 0x6a430
testb $0x1, %al
jne 0x6489b
jmp 0x648b4
movq -0x350(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movb $0x1, -0x353(%rbp)
jmp 0x648bb
movb $0x0, -0x353(%rbp)
jmp 0x648dd
movq -0x340(%rbp), %rax
movl $0x3, 0x5c(%rax)
movb $0x0, -0x352(%rbp)
movb $0x0, -0x353(%rbp)
jmp 0x648dd
jmp 0x648dd
movq -0x350(%rbp), %rax
movq (%rax), %rdi
callq 0x65380
testb $0x1, -0x353(%rbp)
je 0x6490a
movq -0x338(%rbp), %rax
movq %rax, -0x328(%rbp)
movb $0x0, -0x329(%rbp)
testb $0x1, -0x351(%rbp)
je 0x64928
movq -0x338(%rbp), %rdi
movq -0x348(%rbp), %rsi
xorl %edx, %edx
callq 0x6a490
testb $0x1, -0x352(%rbp)
je 0x65375
movq -0x338(%rbp), %rax
movq %rax, -0x370(%rbp)
movq -0x340(%rbp), %rax
movq %rax, -0x368(%rbp)
movq -0x338(%rbp), %rax
movq %rax, -0x310(%rbp)
movb $0x0, -0x311(%rbp)
movq -0x310(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movq -0x2e0(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq -0x2c8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x320(%rbp)
testb $0x1, -0x311(%rbp)
jne 0x649ad
movq -0x320(%rbp), %rax
movq %rax, -0x308(%rbp)
jmp 0x64a1f
cmpq $0x0, -0x320(%rbp)
sete %al
testb $0x1, %al
jne 0x649be
jmp 0x64a11
movq -0x310(%rbp), %rdi
callq 0x69550
testb $0x1, %al
jne 0x649d0
jmp 0x64a11
movq -0x310(%rbp), %rdi
callq 0x79eb0
movq %rax, -0x320(%rbp)
movq -0x310(%rbp), %rcx
movq -0x320(%rbp), %rax
movq %rcx, -0x2d0(%rbp)
movq %rax, -0x2d8(%rbp)
movq -0x2d8(%rbp), %rcx
movq -0x2d0(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x320(%rbp), %rax
movq %rax, -0x308(%rbp)
movq -0x368(%rbp), %rcx
movq -0x370(%rbp), %rdx
movq -0x308(%rbp), %rax
movq %rdx, -0x2e8(%rbp)
movq %rcx, -0x2f0(%rbp)
movq %rax, -0x2f8(%rbp)
movb $0x1, -0x2f9(%rbp)
testb $0x1, -0x2f9(%rbp)
je 0x64db9
movq -0x2f0(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq -0x2c0(%rbp), %rax
movq %rax, -0x2a0(%rbp)
movq -0x2a0(%rbp), %rax
leaq 0x3dca9(%rip), %rcx     # 0xa2730
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x2a8(%rbp)
movq -0x2a8(%rbp), %rax
cmpq -0x2a0(%rbp), %rax
setne %al
testb $0x1, %al
jne 0x64aaf
jmp 0x64ac4
movq -0x2a8(%rbp), %rdi
callq 0x6b6e0
movq %rax, -0x298(%rbp)
jmp 0x64ad7
movq -0x2a0(%rbp), %rdi
callq 0x63b70
movq %rax, -0x298(%rbp)
movq -0x298(%rbp), %rax
movq %rax, -0x378(%rbp)
movq -0x2f0(%rbp), %rax
movq %rax, -0x2b0(%rbp)
movb $0x0, -0x2b1(%rbp)
movq -0x2b0(%rbp), %rcx
movb -0x2b1(%rbp), %al
movq %rcx, -0x268(%rbp)
andb $0x1, %al
movb %al, -0x269(%rbp)
movq -0x268(%rbp), %rax
leaq 0x3dc0c(%rip), %rcx     # 0xa2730
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x280(%rbp)
movq -0x280(%rbp), %rax
cmpq -0x268(%rbp), %rax
setne %al
testb $0x1, %al
jne 0x64b4f
jmp 0x64d93
movq -0x268(%rbp), %rax
movq -0x280(%rbp), %rcx
subq %rcx, %rax
shrq $0xc, %rax
movq %rax, -0x288(%rbp)
movq -0x280(%rbp), %rcx
movq -0x288(%rbp), %rax
movq %rcx, -0x238(%rbp)
movq %rax, -0x240(%rbp)
movq -0x238(%rbp), %rcx
movq -0x240(%rbp), %rax
movq %rcx, -0x200(%rbp)
movq %rax, -0x208(%rbp)
movq -0x200(%rbp), %rcx
movq -0x208(%rbp), %rax
movq %rcx, -0x1e0(%rbp)
movq %rax, -0x1e8(%rbp)
movq -0x1e0(%rbp), %rcx
movq -0x1e8(%rbp), %rax
movq %rcx, -0x1b0(%rbp)
movq %rax, -0x1b8(%rbp)
movq -0x1b0(%rbp), %rax
addq $0x68, %rax
movq -0x1b8(%rbp), %rcx
leaq 0x3d9e4(%rip), %rdx     # 0xa25d8
subq (%rdx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x1f8(%rbp)
movq -0x1f8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x248(%rbp)
movq -0x248(%rbp), %rax
andq $0x1fe0, %rax           # imm = 0x1FE0
shrq $0x5, %rax
movl %eax, -0x24c(%rbp)
movl -0x24c(%rbp), %eax
movl %eax, -0x28c(%rbp)
movl -0x28c(%rbp), %eax
movl %eax, %ecx
movb $0x1, %al
cmpq $0xff, %rcx
movb %al, -0x379(%rbp)
je 0x64c5c
xorl %eax, %eax
movb %al, -0x379(%rbp)
jmp 0x64c5c
movb -0x379(%rbp), %al
testb $0x1, %al
jne 0x64c6b
jmp 0x64d51
movq -0x280(%rbp), %rcx
movq -0x288(%rbp), %rax
movq %rcx, -0x220(%rbp)
movq %rax, -0x228(%rbp)
movq -0x220(%rbp), %rcx
movq -0x228(%rbp), %rax
movq %rcx, -0x210(%rbp)
movq %rax, -0x218(%rbp)
movq -0x210(%rbp), %rcx
movq -0x218(%rbp), %rax
movq %rcx, -0x1d0(%rbp)
movq %rax, -0x1d8(%rbp)
movq -0x1d0(%rbp), %rcx
movq -0x1d8(%rbp), %rax
movq %rcx, -0x1c0(%rbp)
movq %rax, -0x1c8(%rbp)
movq -0x1c0(%rbp), %rax
addq $0x68, %rax
movq -0x1c8(%rbp), %rcx
leaq 0x3d8e4(%rip), %rdx     # 0xa25d8
subq (%rdx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x1f0(%rbp)
movq -0x1f0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x230(%rbp)
movq -0x230(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rax
andq $-0x2000, %rax          # imm = 0xE000
shrq %rax
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rax
subq $0x1000, %rax           # imm = 0x1000
movq %rax, -0x278(%rbp)
jmp 0x64d91
movl -0x28c(%rbp), %eax
movl %eax, -0x25c(%rbp)
movl -0x25c(%rbp), %eax
movl %eax, -0x250(%rbp)
movl -0x250(%rbp), %eax
movl %eax, %ecx
leaq 0x29788(%rip), %rax     # 0x8e500
movq (%rax,%rcx,8), %rax
movq %rax, -0x258(%rbp)
movq -0x258(%rbp), %rax
movq %rax, -0x278(%rbp)
jmp 0x64da6
movq -0x268(%rbp), %rdi
callq 0x63ba0
movq %rax, -0x278(%rbp)
movq -0x378(%rbp), %rdi
movq -0x278(%rbp), %rsi
callq 0x6b700
movq -0x2e8(%rbp), %rdx
movq -0x2f0(%rbp), %rcx
movq -0x2f8(%rbp), %rax
movq %rdx, -0x160(%rbp)
movq %rcx, -0x168(%rbp)
movq %rax, -0x170(%rbp)
movq -0x168(%rbp), %rax
leaq 0x3d93f(%rip), %rcx     # 0xa2730
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rax
cmpq -0x168(%rbp), %rax
setne %al
testb $0x1, %al
jne 0x64e1c
jmp 0x65359
movq -0x168(%rbp), %rax
movq -0x178(%rbp), %rcx
subq %rcx, %rax
shrq $0xc, %rax
movq %rax, -0x180(%rbp)
movq -0x178(%rbp), %rcx
movq -0x180(%rbp), %rax
movq %rcx, -0x128(%rbp)
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rcx
movq -0x130(%rbp), %rax
movq %rcx, -0x108(%rbp)
movq %rax, -0x110(%rbp)
movq -0x108(%rbp), %rcx
movq -0x110(%rbp), %rax
movq %rcx, -0xd8(%rbp)
movq %rax, -0xe0(%rbp)
movq -0xd8(%rbp), %rax
addq $0x68, %rax
movq -0xe0(%rbp), %rcx
leaq 0x3d733(%rip), %rdx     # 0xa25d8
subq (%rdx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
andq $0x2, %rax
cmpq $0x0, %rax
sete %al
testb $0x1, %al
jne 0x64ee2
jmp 0x650bb
cmpq $0x0, -0x170(%rbp)
setne %al
testb $0x1, %al
jne 0x64ef6
jmp 0x6508d
movq -0x168(%rbp), %rcx
movq -0x188(%rbp), %rax
movq %rcx, -0xb0(%rbp)
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
andq $0x1fe0, %rax           # imm = 0x1FE0
shrq $0x5, %rax
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
movl %eax, -0x18c(%rbp)
movq -0x160(%rbp), %rsi
movq -0x170(%rbp), %rdx
movq -0x168(%rbp), %rcx
movl -0x18c(%rbp), %eax
movq %rsi, -0x80(%rbp)
movq %rdx, -0x88(%rbp)
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq 0x3c733(%rip), %rax     # 0xa16a2
movb (%rax), %al
testb $0x1, %al
jne 0x64f77
jmp 0x64f97
movq -0x90(%rbp), %rdi
movl -0x94(%rbp), %eax
leaq 0x3c795(%rip), %rsi     # 0xa1720
imulq $0x60, %rax, %rax
addq %rax, %rsi
callq 0x3d680
movq -0x88(%rbp), %rax
addq $0x20, %rax
movl -0x94(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
leaq 0x3deeb(%rip), %rax     # 0xa2ea8
movq (%rax), %rax
movl -0x94(%rbp), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rax
movl 0x10(%rax), %eax
movq -0xa8(%rbp), %rcx
cmpl (%rcx), %eax
sete %al
testb $0x1, %al
jne 0x64ff0
jmp 0x6501a
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movl -0x94(%rbp), %ecx
movq -0xa8(%rbp), %rax
movl (%rax), %r8d
shrl %r8d
callq 0x79510
movq -0x90(%rbp), %rdx
movq -0xa0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0xa0(%rbp), %rcx
movl 0x10(%rcx), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0xa0(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x80(%rbp), %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x70(%rbp)
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0x78(%rbp), %rax
cmpl $0xd3, 0x18(%rax)
sete %al
testb $0x1, %al
jne 0x6507e
jmp 0x6508b
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x793c0
jmp 0x650b6
movq -0x178(%rbp), %rdi
callq 0x6b6e0
movq %rax, %rdi
movq -0x178(%rbp), %rsi
movq -0x168(%rbp), %rdx
movq -0x180(%rbp), %rcx
callq 0x3ff30
jmp 0x65357
movq -0x178(%rbp), %rcx
movq -0x180(%rbp), %rax
movq %rcx, -0x148(%rbp)
movq %rax, -0x150(%rbp)
movq -0x148(%rbp), %rcx
movq -0x150(%rbp), %rax
movq %rcx, -0x138(%rbp)
movq %rax, -0x140(%rbp)
movq -0x138(%rbp), %rcx
movq -0x140(%rbp), %rax
movq %rcx, -0xf8(%rbp)
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rcx
movq -0x100(%rbp), %rax
movq %rcx, -0xe8(%rbp)
movq %rax, -0xf0(%rbp)
movq -0xe8(%rbp), %rax
addq $0x68, %rax
movq -0xf0(%rbp), %rcx
leaq 0x3d494(%rip), %rdx     # 0xa25d8
subq (%rdx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
andq $-0x2000, %rax          # imm = 0xE000
shrq %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x198(%rbp)
cmpq $0x0, -0x170(%rbp)
setne %al
testb $0x1, %al
jne 0x651ad
jmp 0x65333
movq -0x198(%rbp), %rax
subq $0x1000, %rax           # imm = 0x1000
leaq 0x3dd17(%rip), %rcx     # 0xa2ed8
cmpq (%rcx), %rax
ja 0x65333
movq -0x160(%rbp), %rsi
movq -0x170(%rbp), %rdx
movq -0x168(%rbp), %rcx
movq -0x198(%rbp), %rax
subq $0x1000, %rax           # imm = 0x1000
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x1000, -0x30(%rbp)    # imm = 0x1000
setbe %al
testb $0x1, %al
jne 0x65215
jmp 0x65241
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rcx
subq $0x1, %rcx
shrq $0x3, %rcx
leaq 0x29a50(%rip), %rax     # 0x8ec80
movzbl (%rax,%rcx), %eax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl %eax, -0x24(%rbp)
jmp 0x6524d
movq -0x30(%rbp), %rdi
callq 0x6b550
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq 0x3c448(%rip), %rax     # 0xa16a2
movb (%rax), %al
testb $0x1, %al
jne 0x65262
jmp 0x6526f
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x3ffa0
movq -0x40(%rbp), %rax
addq $0x20, %rax
movl -0x54(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
leaq 0x3dc1c(%rip), %rax     # 0xa2ea8
movq (%rax), %rax
movl -0x54(%rbp), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x68(%rbp), %rcx
cmpl (%rcx), %eax
sete %al
testb $0x1, %al
jne 0x652b3
jmp 0x652cf
movq -0x38(%rbp), %rdi
movq -0x60(%rbp), %rsi
movl -0x54(%rbp), %edx
movq -0x68(%rbp), %rax
movl (%rax), %ecx
shrl %ecx
movq -0x40(%rbp), %r8
callq 0x797c0
movq -0x48(%rbp), %rdx
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x60(%rbp), %rcx
movl 0x10(%rcx), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x60(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0x20(%rbp), %rax
cmpl $0xd3, 0x18(%rax)
sete %al
testb $0x1, %al
jne 0x65324
jmp 0x65331
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x793c0
jmp 0x65355
movq -0x178(%rbp), %rdi
callq 0x6b6e0
movq %rax, %rdi
movq -0x178(%rbp), %rsi
movq -0x168(%rbp), %rdx
callq 0x40280
jmp 0x65357
jmp 0x65373
movq -0x160(%rbp), %rdi
movq -0x168(%rbp), %rsi
movq -0x170(%rbp), %rdx
callq 0x62f50
jmp 0x65375
addq $0x380, %rsp            # imm = 0x380
popq %rbp
retq
nop