// File: /workspace/github_c_makefile_star2_O2/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 0x24027(%rip), %rdi     # 0x576b0
movq (%rdi), %rax
notq %rax
andq %rsi, %rax
cmpq %rsi, %rax
je 0x339b8
movq %rbx, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
leaq 0x23eac(%rip), %rdx     # 0x57558
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 0x339ce
movl %eax, %eax
leaq 0xecae(%rip), %rcx      # 0x42380
movq (%rcx,%rax,8), %r15
movq 0x48(%r14), %r13
testq %r13, %r13
je 0x33918
movq (%r13), %rcx
addq %r15, %rcx
leaq 0x22f37(%rip), %rax     # 0x56628
movq (%rax), %rax
cmpq %rax, %rcx
jbe 0x33713
xorl %edx, %edx
subq %r15, %rax
cmovaeq %rax, %rdx
movq %rdi, %r12
movq %r14, %rdi
movq %r13, %rsi
callq 0x33c5e
movq %r12, %rdi
movq 0x18(%r13), %rcx
pushq $0x1
popq %rbp
movq %rbp, %rax
shlq %cl, %rax
cmpq %rax, 0x8(%r13)
jne 0x337a5
incq %rcx
movq %r14, %rdi
movq %rcx, %rsi
callq 0x33279
testq %rax, %rax
je 0x337aa
movq %rax, %r12
movq %r14, 0x10(%rsp)
movq (%r13), %rax
movq %rax, (%r12)
movq 0x8(%r13), %r14
movq %r14, 0x8(%r12)
movq 0x10(%r13), %rax
leaq (%rax,%r14), %rdx
movb 0x18(%r13), %cl
shlq %cl, %rbp
cmpq %rbp, %rdx
jbe 0x337cb
subq %rax, %rbp
subq %rbp, %r14
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
shlq $0x4, %r14
movq 0x8(%rsp), %rsi
jmp 0x337e2
movq %r13, %r12
jmp 0x337bf
movq %r14, %rdi
movq %r13, %rsi
callq 0x33f92
movq %r13, %r12
leaq 0x23ef1(%rip), %rdi     # 0x576b0
leaq 0x22e62(%rip), %r13     # 0x56628
jmp 0x3390b
movq %r12, %rdi
addq $0x20, %rdi
shlq $0x4, %rax
leaq (%rax,%r13), %rsi
addq $0x20, %rsi
shlq $0x4, %r14
movq %r14, %rdx
callq 0x10400
movq 0x10(%rsp), %r14
movq 0x8(%r14), %r9
leaq 0x23eb6(%rip), %rdi     # 0x576b0
movq (%rdi), %rax
notq %rax
andq %r13, %rax
cmpq %rax, %r13
je 0x33a48
movq (%rax), %rbp
cmpq %r13, %rax
je 0x33a6e
movq %r13, %rcx
subq %rax, %rcx
shrq $0xc, %rcx
leaq 0x23d2f(%rip), %rdx     # 0x57558
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 0x33a9c
movl %ecx, %eax
leaq 0xeb32(%rip), %rcx      # 0x42380
movq (%rcx,%rax,8), %rax
negq %rax
lock
xaddq %rax, 0x58(%rbp)
movq (%rdi), %rsi
notq %rsi
andq %r13, %rsi
movq %r13, %rcx
subq %rsi, %rcx
je 0x33a8c
shrq $0xc, %rcx
leaq 0x23cdd(%rip), %rax     # 0x57558
movq %rcx, %rdx
subq (%rax), %rdx
movq 0x68(%rsi,%rdx,8), %rax
testb $0x2, %al
jne 0x33ab0
testq %r9, %r9
je 0x33ae7
shrl $0x5, %eax
movzbl %al, %r14d
leaq 0x22d7d(%rip), %rax     # 0x56622
cmpb $0x1, (%rax)
je 0x33b05
movl %r14d, %eax
shll $0x5, %eax
leaq (%r9,%rax), %rbp
addq $0x20, %rbp
leaq 0x244ed(%rip), %rax     # 0x57db0
movq (%rax), %rax
movl 0x10(%rbp), %r8d
cmpl (%rax,%r14,4), %r8d
je 0x33b2a
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
movq 0x10(%rsp), %r14
leaq 0x22d27(%rip), %r13     # 0x56628
je 0x33b56
movq %r12, 0x48(%r14)
movq (%r12), %rax
addq %r15, %rax
cmpq (%r13), %rax
jbe 0x33965
movq (%rdi), %rsi
notq %rsi
andq %rbx, %rsi
cmpq %rbx, %rsi
je 0x339e4
movq %rbx, %rcx
subq %rsi, %rcx
shrq $0xc, %rcx
leaq 0x23c1d(%rip), %rax     # 0x57558
movq %rcx, %rdx
subq (%rax), %rdx
testb $0x2, 0x68(%rsi,%rdx,8)
movq (%rsi), %rdi
movq %rbx, %rdx
jne 0x339ff
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x244f0
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rsi
movb 0x18(%r12), %cl
pushq $-0x1
popq %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 0x22c7e(%rip), %rax     # 0x56622
cmpb $0x1, (%rax)
je 0x33a12
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %r15
movq %rbx, %rdi
callq 0x311c1
movq %r15, %rdi
movq %rax, %r15
jmp 0x336d6
shrq %r15
andq $-0x1000, %r15          # imm = 0xF000
addq $-0x1000, %r15          # imm = 0xF000
jmp 0x336d6
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 0x30dbc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x24608
leaq 0x22c6b(%rip), %rax     # 0x56684
cmpb $0x0, (%rax)
jne 0x33b6d
cmpq $0x3800, %r15           # imm = 0x3800
ja 0x33b6d
movq %rbx, %rdi
movq %r15, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x234d9
movq %r13, %rdi
movq %r9, %rbp
callq 0x311b6
movq %rbp, %r9
leaq 0x23c53(%rip), %rdi     # 0x576b0
movq %rax, %rbp
movq (%rdi), %rax
notq %rax
andq %r13, %rax
jmp 0x3380f
movq %r13, %rdi
movq %r9, 0x8(%rsp)
callq 0x311c1
movq 0x8(%rsp), %r9
leaq 0x23c29(%rip), %rdi     # 0x576b0
jmp 0x33852
movq %r14, %rdi
movq %r13, %rsi
movq %r9, %rdx
callq 0x30dbc
jmp 0x33af2
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
addq $-0x1000, %rax          # imm = 0xF000
jmp 0x33852
testq %r9, %r9
je 0x33ad5
shrq %rax
andq $-0x1000, %rax          # imm = 0xF000
leaq -0x1000(%rax), %r14
leaq 0x24314(%rip), %rcx     # 0x57de0
cmpq (%rcx), %r14
jbe 0x33b89
movq (%rsi), %rdi
movq %r13, %rdx
callq 0x24608
movq 0x10(%rsp), %r14
jmp 0x33af2
movq (%rsi), %rdi
movq %r13, %rdx
callq 0x244f0
leaq 0x23bb7(%rip), %rdi     # 0x576b0
leaq 0x22b28(%rip), %r13     # 0x56628
jmp 0x33907
imulq $0x60, %r14, %rsi
addq 0x204c8(%rip), %rsi     # 0x53fd8
movq %r13, %rdi
movq %r9, %rbp
callq 0x233ee
movq %rbp, %r9
leaq 0x23b8b(%rip), %rdi     # 0x576b0
jmp 0x338ae
shrl %r8d
movq 0x10(%rsp), %rdi
movq %r9, %rsi
movq %rbp, %rdx
movl %r14d, %ecx
movq %r9, %r14
callq 0x37034
movq %r14, %r9
leaq 0x23b63(%rip), %rdi     # 0x576b0
movl 0x10(%rbp), %r8d
jmp 0x338d4
movq %r14, %rdi
movq %r9, %rsi
callq 0x36f85
leaq 0x23b48(%rip), %rdi     # 0x576b0
jmp 0x33907
pushq $0x5a
popq %rsi
movq %rbx, %rdi
movq %r15, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10270
movq %r9, %rbp
cmpq $0x1000, %r14           # imm = 0x1000
ja 0x33c25
addq $-0x1001, %rax          # imm = 0xEFFF
shrq $0x3, %rax
leaq 0xef56(%rip), %rcx      # 0x42b00
movzbl (%rcx,%rax), %eax
movl %eax, 0x8(%rsp)
leaq 0x22a69(%rip), %rax     # 0x56622
cmpb $0x1, (%rax)
je 0x33c32
movl 0x8(%rsp), %eax
movq %rax, %rcx
shlq $0x5, %rcx
leaq (%rcx,%rbp), %r14
addq $0x20, %r14
leaq 0x241d8(%rip), %rcx     # 0x57db0
movq (%rcx), %rdx
movl 0x10(%r14), %ecx
cmpl (%rdx,%rax,4), %ecx
je 0x33c42
movq 0x18(%r14), %rax
movl %ecx, %edx
movq %r13, (%rax,%rdx,8)
incl %ecx
movl %ecx, 0x10(%r14)
movl 0x18(%rbp), %eax
incl %eax
movl %eax, 0x18(%rbp)
cmpl $0xd3, %eax
movq 0x10(%rsp), %r14
leaq 0x23aa3(%rip), %rdi     # 0x576b0
leaq 0x22a14(%rip), %r13     # 0x56628
jne 0x33907
movq %r14, %rdi
movq %rbp, %rsi
jmp 0x33b5c
movq %r14, %rdi
callq 0x33f3c
jmp 0x33bae
movq %r13, %rdi
movq %r14, %rsi
callq 0x244f5
jmp 0x33bbe
shrl %ecx
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movl 0x8(%rsp), %edx
movq %rbp, %r8
callq 0x371b7
movl 0x10(%r14), %ecx
jmp 0x33be4