// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0x2280e(%rip), %rbp     # 0x5b6b0
movq (%rbp), %rax
notq %rax
andq %rsi, %rax
cmpq %rsi, %rax
je 0x391e2
movq %rbx, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
leaq 0x22692(%rip), %rdx     # 0x5b558
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 0x391f2
movl %eax, %eax
leaq 0xe954(%rip), %rcx      # 0x47840
movq (%rcx,%rax,8), %r15
movq 0x48(%r14), %r13
testq %r13, %r13
je 0x38f63
movq (%r13), %rax
leaq (%rax,%r15), %rdx
leaq 0x21720(%rip), %rcx     # 0x5a628
movq (%rcx), %rcx
cmpq %rcx, %rdx
jbe 0x38f37
xorl %r12d, %r12d
subq %r15, %rcx
cmovaeq %rcx, %r12
cmpq %r12, %rax
jbe 0x38f37
cmpq $0x0, 0x8(%r13)
je 0x38f37
movq %r14, %rdi
movq %r13, %rsi
callq 0x39729
cmpq %r12, (%r13)
ja 0x38f1f
movq 0x18(%r13), %rcx
movl $0x1, %eax
shlq %cl, %rax
cmpq %rax, 0x8(%r13)
je 0x3900c
movq %r13, %r12
movq (%r12), %rax
addq %r15, %rax
leaq 0x216ca(%rip), %rcx     # 0x5a628
cmpq (%rcx), %rax
jbe 0x38fb1
movq (%rbp), %rsi
notq %rsi
andq %rbx, %rsi
cmpq %rbx, %rsi
je 0x39208
movq %rbx, %rcx
subq %rsi, %rcx
shrq $0xc, %rcx
leaq 0x225d1(%rip), %rax     # 0x5b558
movq %rcx, %rdx
subq (%rax), %rdx
testb $0x2, 0x68(%rsi,%rdx,8)
movq (%rsi), %rdi
movq %rbx, %rdx
jne 0x39223
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x298af
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 0x2162e(%rip), %rax     # 0x5a622
cmpb $0x1, (%rax)
je 0x39236
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 0x12bd2
testq %rax, %rax
je 0x39095
movq %rax, %r12
movq (%r13), %rax
movq %rax, (%r12)
movq 0x8(%r13), %rdx
movq %rdx, 0x8(%r12)
movq 0x10(%r13), %rax
leaq (%rax,%rdx), %rsi
movb 0x18(%r13), %cl
movl $0x1, %ebp
shlq %cl, %rbp
cmpq %rbp, %rsi
jbe 0x390a5
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 0x10400
leaq (%r12,%rbp), %rdi
addq $0x20, %rdi
movq 0x10(%rsp), %rdx
shlq $0x4, %rdx
movq 0x8(%rsp), %rsi
jmp 0x390bc
movq %r14, %rdi
movq %r13, %rsi
callq 0x39729
jmp 0x38f4d
movq %r12, %rdi
addq $0x20, %rdi
shlq $0x4, %rax
leaq (%rax,%r13), %rsi
addq $0x20, %rsi
shlq $0x4, %rdx
callq 0x10400
movq 0x8(%r14), %r9
leaq 0x225e4(%rip), %rax     # 0x5b6b0
movq (%rax), %rax
notq %rax
andq %r13, %rax
cmpq %rax, %r13
je 0x39246
movq (%rax), %rbp
cmpq %r13, %rax
je 0x3926c
movq %r13, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
leaq 0x2245d(%rip), %rdx     # 0x5b558
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 0x39296
movl %ecx, %eax
leaq 0xe720(%rip), %rcx      # 0x47840
movq (%rcx,%rax,8), %rax
negq %rax
lock
xaddq %rax, 0x58(%rbp)
leaq 0x2257c(%rip), %rax     # 0x5b6b0
movq (%rax), %rsi
notq %rsi
andq %r13, %rsi
movq %r13, %rcx
subq %rsi, %rcx
je 0x39283
shrq $0xc, %rcx
leaq 0x22404(%rip), %rax     # 0x5b558
movq %rcx, %rdx
subq (%rax), %rdx
movq 0x68(%rsi,%rdx,8), %rax
testb $0x2, %al
jne 0x392aa
testq %r9, %r9
je 0x392e0
shrl $0x5, %eax
movzbl %al, %ecx
leaq 0x214a5(%rip), %rax     # 0x5a622
cmpb $0x1, (%rax)
je 0x392f0
movl %ecx, %eax
shll $0x5, %eax
leaq (%r9,%rax), %rbp
addq $0x20, %rbp
leaq 0x22c16(%rip), %rax     # 0x5bdb0
movq (%rax), %rax
movl 0x10(%rbp), %r8d
cmpl (%rax,%rcx,4), %r8d
je 0x3931b
movq 0x18(%rbp), %rax
movl %r8d, %ecx
movq %r13, (%rax,%rcx,8)
incl %r8d
movl %r8d, 0x10(%rbp)
movl 0x18(%r9), %eax
incl %eax
movl %eax, 0x18(%r9)
cmpl $0xd3, %eax
je 0x3933f
movq %r12, 0x48(%r14)
leaq 0x224d3(%rip), %rbp     # 0x5b6b0
jmp 0x38f50
movq %rbx, %rdi
callq 0x36d46
movq %rax, %r15
jmp 0x38ef0
shrq %r15
andq $-0x1000, %r15          # imm = 0xF000
addq $-0x1000, %r15          # imm = 0xF000
jmp 0x38ef0
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 0x36925
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x299db
movq %r15, %rdi
movq %rbx, %rsi
callq 0x12fc7
jmp 0x38ffd
movq %r13, %rdi
movq %r9, %rbp
callq 0x36d3b
movq %rbp, %r9
movq %rax, %rbp
leaq 0x22452(%rip), %rax     # 0x5b6b0
movq (%rax), %rax
notq %rax
andq %r13, %rax
jmp 0x390e1
movq %r13, %rdi
movq %r9, 0x8(%rsp)
callq 0x36d46
movq 0x8(%rsp), %r9
jmp 0x39124
movq %r14, %rdi
movq %r13, %rsi
movq %r9, %rdx
callq 0x36925
jmp 0x391d2
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
addq $-0x1000, %rax          # imm = 0xF000
jmp 0x39124
movq %r9, 0x8(%rsp)
testq %r9, %r9
je 0x392d0
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
leaq -0x1000(%rax), %rbp
leaq 0x22b15(%rip), %rcx     # 0x5bde0
cmpq (%rcx), %rbp
jbe 0x3934f
movq (%rsi), %rdi
movq %r13, %rdx
callq 0x299db
jmp 0x391d2
movq (%rsi), %rdi
movq %r13, %rdx
callq 0x298af
jmp 0x391d2
leaq (%rcx,%rcx,2), %rsi
shll $0x5, %esi
addq 0x1ecda(%rip), %rsi     # 0x57fd8
movq %r13, %rdi
movq %r9, 0x8(%rsp)
movq %rcx, %rbp
callq 0x2859f
movq %rbp, %rcx
movq 0x8(%rsp), %r9
jmp 0x39186
shrl %r8d
movq %r14, %rdi
movq %r9, %rsi
movq %rbp, %rdx
movq %r9, 0x8(%rsp)
callq 0x3c88f
movq 0x8(%rsp), %r9
movl 0x10(%rbp), %r8d
jmp 0x391ab
movq %r14, %rdi
movq %r9, %rsi
callq 0x3c7e1
jmp 0x391d2
cmpq $0x1000, %rbp           # imm = 0x1000
ja 0x393d6
addq $-0x1001, %rax          # imm = 0xEFFF
shrq $0x3, %rax
leaq 0xec57(%rip), %rcx      # 0x47fc0
movzbl (%rcx,%rax), %eax
movl %eax, 0x10(%rsp)
leaq 0x212aa(%rip), %rax     # 0x5a622
cmpb $0x1, (%rax)
je 0x393e0
movl 0x10(%rsp), %eax
movq %rax, %rcx
shlq $0x5, %rcx
movq 0x8(%rsp), %rdx
leaq (%rdx,%rcx), %rbp
addq $0x20, %rbp
leaq 0x22a14(%rip), %rcx     # 0x5bdb0
movq (%rcx), %rdx
movl 0x10(%rbp), %ecx
cmpl (%rdx,%rax,4), %ecx
je 0x393ed
movq 0x18(%rbp), %rax
movl %ecx, %edx
movq %r13, (%rax,%rdx,8)
incl %ecx
movl %ecx, 0x10(%rbp)
movq 0x8(%rsp), %rsi
movl 0x18(%rsi), %eax
incl %eax
movl %eax, 0x18(%rsi)
cmpl $0xd3, %eax
jne 0x391d2
movq %r14, %rdi
jmp 0x39345
movq %rbp, %rdi
callq 0x396cf
jmp 0x3936d
movq %r13, %rdi
movq %rbp, %rsi
callq 0x298b4
jmp 0x3937d
shrl %ecx
movq %r14, %rdi
movq %rbp, %rsi
movl 0x10(%rsp), %edx
movq 0x8(%rsp), %r8
callq 0x3ca47
movl 0x10(%rbp), %ecx
jmp 0x393a7