// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/quarantine.c
// Function: quarantine
void
quarantine(void *ptr)
{
	quarantine_t *quarantine;
	size_t usize = isalloc(ptr, config_prof);

	cassert(config_fill);
	assert(opt_quarantine);

	quarantine = *quarantine_tsd_get();
	if ((uintptr_t)quarantine <= (uintptr_t)QUARANTINE_STATE_MAX) {
		if (quarantine == NULL) {
			if ((quarantine = quarantine_init(LG_MAXOBJS_INIT)) ==
			    NULL) {
				idalloc(ptr);
				return;
			}
		} else {
			if (quarantine == QUARANTINE_STATE_PURGATORY) {
				/*
				 * Make a note that quarantine() was called
				 * after quarantine_cleanup() was called.
				 */
				quarantine = QUARANTINE_STATE_REINCARNATED;
				quarantine_tsd_set(&quarantine);
			}
			idalloc(ptr);
			return;
		}
	}
	/*
	 * Drain one or more objects if the quarantine size limit would be
	 * exceeded by appending ptr.
	 */
	if (quarantine->curbytes + usize > opt_quarantine) {
		size_t upper_bound = (opt_quarantine >= usize) ? opt_quarantine
		    - usize : 0;
		quarantine_drain(quarantine, upper_bound);
	}
	/* Grow the quarantine ring buffer if it's full. */
	if (quarantine->curobjs == (ZU(1) << quarantine->lg_maxobjs))
		quarantine = quarantine_grow(quarantine);
	/* quarantine_grow() must free a slot if it fails to grow. */
	assert(quarantine->curobjs < (ZU(1) << quarantine->lg_maxobjs));
	/* Append ptr if its size doesn't exceed the quarantine size. */
	if (quarantine->curbytes + usize <= opt_quarantine) {
		size_t offset = (quarantine->first + quarantine->curobjs) &
		    ((ZU(1) << quarantine->lg_maxobjs) - 1);
		quarantine_obj_t *obj = &quarantine->objs[offset];
		obj->ptr = ptr;
		obj->usize = usize;
		quarantine->curbytes += usize;
		quarantine->curobjs++;
		if (opt_junk)
			memset(ptr, 0x5a, usize);
	} else {
		assert(quarantine->curbytes == 0);
		idalloc(ptr);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xd1000
movq %rax, -0x18(%rbp)
jmp 0xd0e3d
jmp 0xd0e3f
jmp 0xd0e41
callq 0xd1070
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x2, %rax
ja 0xd0eaf
cmpq $0x0, -0x10(%rbp)
jne 0xd0e82
movl $0xa, %edi
callq 0xd1090
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0xd0e80
movq -0x8(%rbp), %rdi
callq 0xd1120
jmp 0xd0ffa
jmp 0xd0ead
movl $0x2, %eax
cmpq %rax, -0x10(%rbp)
jne 0xd0e9f
movl $0x1, %eax
movq %rax, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
callq 0xd1140
movq -0x8(%rbp), %rdi
callq 0xd1120
jmp 0xd0ffa
jmp 0xd0eaf
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq -0x18(%rbp), %rax
leaq 0x575ef(%rip), %rcx     # 0x1284b0
cmpq (%rcx), %rax
jbe 0xd0f07
leaq 0x575e3(%rip), %rax     # 0x1284b0
movq (%rax), %rax
cmpq -0x18(%rbp), %rax
jb 0xd0eea
leaq 0x575d3(%rip), %rax     # 0x1284b0
movq (%rax), %rax
subq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xd0ef2
xorl %eax, %eax
movq %rax, -0x38(%rbp)
jmp 0xd0ef2
movq -0x38(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xd11b0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
cmpq %rcx, %rax
jne 0xd0f34
movq -0x10(%rbp), %rdi
callq 0xd1280
movq %rax, -0x10(%rbp)
jmp 0xd0f36
jmp 0xd0f38
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq -0x18(%rbp), %rax
leaq 0x57566(%rip), %rcx     # 0x1284b0
cmpq (%rcx), %rax
ja 0xd0fed
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
addq 0x8(%rcx), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
subq $0x1, %rcx
andq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq -0x28(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
leaq 0x574d7(%rip), %rax     # 0x1284ab
testb $0x1, (%rax)
je 0xd0feb
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x5a, %esi
callq 0x1f110
jmp 0xd0ffa
jmp 0xd0fef
jmp 0xd0ff1
movq -0x8(%rbp), %rdi
callq 0xd1120
addq $0x40, %rsp
popq %rbp
retq