// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/deps/jemalloc/src/quarantine.c
// Function: je_quarantine
void
quarantine(tsd_t *tsd, void *ptr)
{
	quarantine_t *quarantine;
	size_t usize = isalloc(ptr, config_prof);

	cassert(config_fill);
	assert(opt_quarantine);

	if ((quarantine = tsd_quarantine_get(tsd)) == NULL) {
		idalloctm(tsd, ptr, NULL, false);
		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(tsd, quarantine, upper_bound);
	}
	/* Grow the quarantine ring buffer if it's full. */
	if (quarantine->curobjs == (ZU(1) << quarantine->lg_maxobjs))
		quarantine = quarantine_grow(tsd, 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 (config_fill && unlikely(opt_junk_free)) {
			/*
			 * Only do redzone validation if Valgrind isn't in
			 * operation.
			 */
			if ((!config_valgrind || likely(!in_valgrind))
			    && usize <= SMALL_MAXCLASS)
				arena_quarantine_junk_small(ptr, usize);
			else
				memset(ptr, 0x5a, usize);
		}
	} else {
		assert(quarantine->curbytes == 0);
		idalloctm(tsd, ptr, NULL, false);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x397b5(%rip), %rbp     # 0x846a0
movq (%rbp), %rax
notq %rax
andq %rsi, %rax
cmpq %rsi, %rax
je 0x4b23d
movq %rbx, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
leaq 0x39639(%rip), %rdx     # 0x84548
subq (%rdx), %rcx
movq 0x68(%rax,%rcx,8), %r15
movl %r15d, %eax
shrl $0x5, %eax
movl $0xff, %ecx
andl %ecx, %eax
cmpl %ecx, %eax
je 0x4b24d
movl %eax, %eax
leaq 0xe14b(%rip), %rcx      # 0x59080
movq (%rcx,%rax,8), %r15
movq 0x48(%r14), %r13
testq %r13, %r13
je 0x4afac
movq (%r13), %rax
leaq (%rax,%r15), %rdx
leaq 0x387e7(%rip), %rcx     # 0x83738
movq (%rcx), %rcx
cmpq %rcx, %rdx
jbe 0x4af80
xorl %r12d, %r12d
subq %r15, %rcx
cmovaeq %rcx, %r12
cmpq %r12, %rax
jbe 0x4af80
cmpq $0x0, 0x8(%r13)
je 0x4af80
movq %r14, %rdi
movq %r13, %rsi
callq 0x4b767
cmpq %r12, (%r13)
ja 0x4af68
movq 0x18(%r13), %rcx
movl $0x1, %eax
shlq %cl, %rax
cmpq %rax, 0x8(%r13)
je 0x4b055
movq %r13, %r12
movq (%r12), %rax
addq %r15, %rax
leaq 0x38791(%rip), %rcx     # 0x83738
cmpq (%rcx), %rax
jbe 0x4affa
movq (%rbp), %rsi
notq %rsi
andq %rbx, %rsi
cmpq %rbx, %rsi
je 0x4b263
movq %rbx, %rcx
subq %rsi, %rcx
shrq $0xc, %rcx
leaq 0x39578(%rip), %rax     # 0x84548
movq %rcx, %rdx
subq (%rax), %rdx
testb $0x2, 0x68(%rsi,%rdx,8)
movq (%rsi), %rdi
movq %rbx, %rdx
jne 0x4b27e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3b9e8
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rsi
movb 0x18(%r12), %cl
movq $-0x1, %rdi
shlq %cl, %rdi
addq %rdx, %rsi
notq %rdi
andq %rsi, %rdi
shlq $0x4, %rdi
movq %rbx, 0x20(%r12,%rdi)
movq %r15, 0x28(%r12,%rdi)
movq %rax, (%r12)
incq %rdx
movq %rdx, 0x8(%r12)
leaq 0x386f5(%rip), %rax     # 0x83732
cmpb $0x1, (%rax)
je 0x4b291
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incq %rcx
movq %r14, %rdi
movq %rcx, %rsi
callq 0x15573
testq %rax, %rax
je 0x4b0e2
movq %rax, %r12
movq (%r13), %rax
movq %rax, (%r12)
movq 0x8(%r13), %rax
movq %rax, 0x8(%r12)
movq 0x8(%r13), %rdx
movq 0x10(%r13), %rax
leaq (%rdx,%rax), %rsi
movb 0x18(%r13), %cl
movl $0x1, %ebp
shlq %cl, %rbp
cmpq %rbp, %rsi
jbe 0x4b0f2
subq %rax, %rbp
subq %rbp, %rdx
movq %rdx, 0x10(%rsp)
leaq 0x20(%r12), %rdi
leaq 0x20(%r13), %rcx
movq %rcx, 0x8(%rsp)
shlq $0x4, %rax
leaq (%rax,%r13), %rsi
addq $0x20, %rsi
shlq $0x4, %rbp
movq %rbp, %rdx
callq 0x12520
leaq (%r12,%rbp), %rdi
addq $0x20, %rdi
movq 0x10(%rsp), %rdx
shlq $0x4, %rdx
movq 0x8(%rsp), %rsi
jmp 0x4b109
movq %r14, %rdi
movq %r13, %rsi
callq 0x4b767
jmp 0x4af96
movq %r12, %rdi
addq $0x20, %rdi
shlq $0x4, %rax
leaq (%rax,%r13), %rsi
addq $0x20, %rsi
shlq $0x4, %rdx
callq 0x12520
movq 0x8(%r14), %r9
leaq 0x39587(%rip), %rax     # 0x846a0
movq (%rax), %rax
notq %rax
andq %r13, %rax
cmpq %rax, %r13
je 0x4b2a1
movq (%rax), %rbp
leaq 0x3956b(%rip), %rax     # 0x846a0
movq (%rax), %rax
notq %rax
andq %r13, %rax
movq %r13, %rcx
subq %rax, %rcx
je 0x4b2b7
shrq $0xc, %rcx
leaq 0x393f3(%rip), %rdx     # 0x84548
subq (%rdx), %rcx
movq 0x68(%rax,%rcx,8), %rax
movl %eax, %ecx
shrl $0x5, %ecx
movl $0xff, %edx
andl %edx, %ecx
cmpl %edx, %ecx
je 0x4b2e1
movl %ecx, %eax
leaq 0xdf06(%rip), %rcx      # 0x59080
movq (%rcx,%rax,8), %rax
negq %rax
lock
xaddq %rax, 0x58(%rbp)
leaq 0x39512(%rip), %rax     # 0x846a0
movq (%rax), %rsi
notq %rsi
andq %r13, %rsi
movq %r13, %rcx
subq %rsi, %rcx
je 0x4b2ce
shrq $0xc, %rcx
leaq 0x3939a(%rip), %rax     # 0x84548
movq %rcx, %rdx
subq (%rax), %rdx
movq 0x68(%rsi,%rdx,8), %rax
testb $0x2, %al
jne 0x4b2f5
testq %r9, %r9
je 0x4b32f
shrl $0x5, %eax
movzbl %al, %ecx
leaq 0x3855b(%rip), %rax     # 0x83732
cmpb $0x1, (%rax)
movl %ecx, %edx
je 0x4b33f
movl %ecx, %eax
shll $0x5, %eax
leaq (%r9,%rax), %rbp
addq $0x20, %rbp
leaq 0x39baa(%rip), %rax     # 0x84da0
movq (%rax), %rax
movl (%rax,%rdx,4), %r8d
cmpl %r8d, 0x10(%rbp)
je 0x4b372
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %ecx
movq %r13, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x10(%rbp)
movl 0x18(%r9), %eax
incl %eax
movl %eax, 0x18(%r9)
cmpl $0xe4, %eax
je 0x4b392
movq %r12, 0x48(%r14)
leaq 0x39468(%rip), %rbp     # 0x846a0
jmp 0x4af99
movq %rbx, %rdi
callq 0x48cd7
movq %rax, %r15
jmp 0x4af39
shrq %r15
andq $-0x1000, %r15          # imm = 0xF000
addq $-0x1000, %r15          # imm = 0xF000
jmp 0x4af39
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x488cb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3bb14
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1599f
jmp 0x4b046
movq %r13, %rdi
movq %r9, %rbp
callq 0x48ccc
movq %rbp, %r9
movq %rax, %rbp
jmp 0x4b12e
movq %r13, %rdi
movq %r9, 0x8(%rsp)
callq 0x48cd7
movq 0x8(%rsp), %r9
jmp 0x4b17e
movq %r14, %rdi
movq %r13, %rsi
movq %r9, %rdx
callq 0x488cb
jmp 0x4b22d
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
addq $-0x1000, %rax          # imm = 0xF000
jmp 0x4b17e
movq %r9, 0x8(%rsp)
testq %r9, %r9
je 0x4b31f
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
leaq -0x1000(%rax), %rbp
leaq 0x39aba(%rip), %rcx     # 0x84dd0
cmpq (%rcx), %rbp
jbe 0x4b3a2
movq (%rsi), %rdi
movq %r13, %rdx
callq 0x3bb14
jmp 0x4b22d
movq (%rsi), %rdi
movq %r13, %rdx
callq 0x3b9e8
jmp 0x4b22d
leaq (%rdx,%rdx,2), %rsi
shll $0x5, %esi
addq 0x22c7b(%rip), %rsi     # 0x6dfc8
movq %r13, %rdi
movq %r9, 0x8(%rsp)
movl %ecx, %ebp
movq %rdx, 0x10(%rsp)
callq 0x3b00b
movq 0x10(%rsp), %rdx
movl %ebp, %ecx
movq 0x8(%rsp), %r9
jmp 0x4b1e2
shrl %r8d
movq %r14, %rdi
movq %r9, %rsi
movq %rbp, %rdx
movq %r9, 0x8(%rsp)
callq 0x4e87e
movq 0x8(%rsp), %r9
jmp 0x4b207
movq %r14, %rdi
movq %r9, %rsi
callq 0x4e7cd
jmp 0x4b22d
cmpq $0x1000, %rbp           # imm = 0x1000
ja 0x4b428
addq $-0x1001, %rax          # imm = 0xEFFF
shrq $0x3, %rax
leaq 0xe444(%rip), %rcx      # 0x59800
movzbl (%rcx,%rax), %eax
movl %eax, 0x10(%rsp)
leaq 0x38367(%rip), %rax     # 0x83732
cmpb $0x1, (%rax)
je 0x4b432
movl 0x10(%rsp), %eax
leaq 0x399c5(%rip), %rcx     # 0x84da0
movq (%rcx), %rcx
movl (%rcx,%rax,4), %ecx
shlq $0x5, %rax
movq 0x8(%rsp), %rdx
leaq (%rdx,%rax), %rbp
addq $0x20, %rbp
cmpl %ecx, 0x10(%rbp)
je 0x4b43f
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %ecx
movq %r13, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x10(%rbp)
movq 0x8(%rsp), %rsi
movl 0x18(%rsi), %eax
incl %eax
movl %eax, 0x18(%rsi)
cmpl $0xe4, %eax
jne 0x4b22d
movq %r14, %rdi
jmp 0x4b398
movq %rbp, %rdi
callq 0x4b70b
jmp 0x4b3c0
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3b9ed
jmp 0x4b3d0
shrl %ecx
movq %r14, %rdi
movq %rbp, %rsi
movl 0x10(%rsp), %edx
movq 0x8(%rsp), %r8
callq 0x4ea32
jmp 0x4b3f7