// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/jemalloc/src/arena.c
// Function: arena_purge
static void
arena_purge(arena_t *arena, bool all)
{
	chunk_hooks_t chunk_hooks = chunk_hooks_get(arena);
	size_t npurge, npurgeable, npurged;
	arena_runs_dirty_link_t purge_runs_sentinel;
	extent_node_t purge_chunks_sentinel;

	arena->purging = true;

	/*
	 * Calls to arena_dirty_count() are disabled even for debug builds
	 * because overhead grows nonlinearly as memory usage increases.
	 */
	if (false && config_debug) {
		size_t ndirty = arena_dirty_count(arena);
		assert(ndirty == arena->ndirty);
	}
	assert((arena->nactive >> arena->lg_dirty_mult) < arena->ndirty || all);

	if (config_stats)
		arena->stats.npurge++;

	npurge = arena_compute_npurge(arena, all);
	qr_new(&purge_runs_sentinel, rd_link);
	extent_node_dirty_linkage_init(&purge_chunks_sentinel);

	npurgeable = arena_stash_dirty(arena, &chunk_hooks, all, npurge,
	    &purge_runs_sentinel, &purge_chunks_sentinel);
	assert(npurgeable >= npurge);
	npurged = arena_purge_stashed(arena, &chunk_hooks, &purge_runs_sentinel,
	    &purge_chunks_sentinel);
	assert(npurged == npurgeable);
	arena_unstash_purged(arena, &chunk_hooks, &purge_runs_sentinel,
	    &purge_chunks_sentinel);

	arena->purging = false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x28d7d
movq %rbx, %rdi
movb $0x1, 0xd8(%rbx)
incq 0x38(%rbx)
movl %ebp, 0x28(%rsp)
testl %ebp, %ebp
je 0x22a91
movq 0xe8(%rdi), %rax
movq %rax, 0x20(%rsp)
jmp 0x22ac1
movq 0xe0(%rdi), %rax
movb 0xd0(%rdi), %cl
shrq %cl, %rax
leaq 0x34c10(%rip), %rcx     # 0x576b8
movq (%rcx), %rcx
cmpq %rcx, %rax
cmovbeq %rcx, %rax
movq 0xe8(%rdi), %rcx
subq %rax, %rcx
movq %rcx, 0x20(%rsp)
leaq 0x30(%rsp), %rax
movq %rax, (%rax)
movq %rax, 0x8(%rax)
leaq 0xb8(%rsp), %rax
movq %rax, (%rax)
movq %rax, 0x8(%rax)
leaq 0x90(%rsp), %rax
movq %rax, 0x38(%rax)
movq %rax, 0x40(%rax)
leaq 0x158(%rdi), %rax
movq %rax, 0x40(%rsp)
movq 0x158(%rdi), %r12
movq 0x1a0(%rdi), %rbp
xorl %r14d, %r14d
movq %rdi, 0x18(%rsp)
cmpq 0x40(%rsp), %r12
je 0x22c45
movq (%r12), %r15
leaq 0x28(%rbp), %rbx
cmpq %rbx, %r12
je 0x22ba3
leaq 0x34b83(%rip), %rax     # 0x576b0
movq (%rax), %rcx
leaq -0x10(%r12), %rax
andq %rcx, %rax
notq %rcx
subq 0x34a1e(%rip), %rax     # 0x57560
andq %r12, %rcx
xorl %edx, %edx
pushq $0x60
popq %rsi
divq %rsi
movq 0x68(%rcx,%rax,8), %r13
cmpq %rcx, 0xc8(%rdi)
jne 0x22b65
callq 0x26729
movq 0x18(%rsp), %rdi
shrq %r13
movabsq $0x7ffffffffffff000, %rax # imm = 0x7FFFFFFFFFFFF000
andq %rax, %r13
movq %r12, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x26a10
movq 0x38(%rsp), %rax
movq %r12, (%rax)
movq 0x8(%r12), %rcx
leaq 0x30(%rsp), %rdx
movq %rdx, (%rcx)
movq %rcx, 0x38(%rsp)
movq %rax, 0x8(%r12)
jmp 0x22c1d
movq 0x38(%rbp), %r12
movb $0x0, 0x17(%rsp)
movq 0x8(%rbp), %rdx
movq 0x10(%rbp), %rcx
leaq 0x34aed(%rip), %rax     # 0x576a8
movq (%rax), %r8
andl $0x0, (%rsp)
leaq 0x58(%rsp), %rsi
leaq 0x17(%rsp), %r9
callq 0x28fe6
movq 0x38(%rsp), %rax
movq %rbx, (%rax)
movq 0x30(%rbp), %rcx
leaq 0x30(%rsp), %rdx
movq %rdx, (%rcx)
movq %rcx, 0x38(%rsp)
movq %rax, 0x30(%rbp)
movq 0xd0(%rsp), %rax
movq %rbp, 0x38(%rax)
movq 0x40(%rbp), %rcx
leaq 0x90(%rsp), %rdx
movq %rdx, 0x38(%rcx)
movq %rcx, 0xd0(%rsp)
movq %rax, 0x40(%rbp)
movq 0x10(%rbp), %r13
movq %r12, %rbp
shrq $0xc, %r13
addq %r13, %r14
movq %r15, %r12
cmpb $0x0, 0x28(%rsp)
movq 0x18(%rsp), %rdi
jne 0x22b0e
movq %r15, %r12
cmpq 0x20(%rsp), %r14
jb 0x22b0e
addq $0x8, %rdi
movq %rdi, 0x20(%rsp)
callq 0x10440
pxor %xmm2, %xmm2
movq 0xc8(%rsp), %rcx
leaq 0x30(%rsp), %r15
movq (%r15), %r15
leaq 0x30(%rsp), %rax
cmpq %rax, %r15
je 0x22dca
leaq 0x28(%rcx), %rax
cmpq %rax, %r15
je 0x22da4
movq %rcx, 0x28(%rsp)
movdqa %xmm2, 0x40(%rsp)
leaq 0x34a1c(%rip), %rax     # 0x576b0
movq (%rax), %r12
leaq -0x10(%r15), %rax
andq %r12, %rax
notq %r12
andq %r15, %r12
subq 0x348b5(%rip), %rax     # 0x57560
xorl %edx, %edx
pushq $0x60
popq %rcx
divq %rcx
movq 0x3489e(%rip), %r14     # 0x57558
addq %rax, %r14
movq 0x68(%r12,%rax,8), %rbx
movq %rbx, %r13
shrq %r13
movabsq $0x7ffffffffffff000, %rax # imm = 0x7FFFFFFFFFFFF000
andq %rax, %r13
leaq 0x349cc(%rip), %rax     # 0x576a8
movq (%rax), %rsi
movq %r14, %rbp
shlq $0xc, %rbp
movq 0x18(%rsp), %rax
movl (%rax), %r8d
movq %r12, %rdi
movq %rbp, %rdx
movq %r13, %rcx
callq *0x70(%rsp)
movl $0x0, %ecx
pushq $0x4
popq %rdx
testb %al, %al
je 0x22d32
leaq 0x3499a(%rip), %rax     # 0x576a8
movq (%rax), %rcx
movq 0x18(%rsp), %rdi
leaq 0x58(%rsp), %rsi
movq %r12, %rdx
movq %rbp, %r8
movq %r13, %r9
callq 0x29964
movzbl %al, %ecx
shll $0x3, %ecx
movq %rcx, %rdx
shrq $0xd, %rbx
leaq (%r14,%rbx), %rax
movq 0x34817(%rip), %rsi     # 0x57558
notq %rsi
addq %rax, %rsi
orq $0x1fe3, %rdx           # imm = 0x1FE3
movq %rdx, 0x68(%r12,%rsi,8)
movq %r14, %rax
subq 0x347fb(%rip), %rax     # 0x57558
addq %r13, %r13
orq %rdx, %r13
movq %r13, 0x68(%r12,%rax,8)
leaq -0x1(%rbx), %rax
leaq (%r12,%r14,8), %rdx
addq $0x70, %rdx
pushq $0x1
popq %rsi
movdqa 0x40(%rsp), %xmm2
cmpq %rax, %rsi
jae 0x22d9d
movq 0x347cf(%rip), %rdi     # 0x57558
shlq $0x3, %rdi
negq %rdi
movq %rcx, (%rdx,%rdi)
incq %rsi
addq $0x8, %rdx
jmp 0x22d7d
movq 0x28(%rsp), %rcx
jmp 0x22db0
movq 0x10(%rcx), %rbx
movq 0x38(%rcx), %rcx
shrq $0xc, %rbx
movq %rbx, %xmm0
movdqa 0x20153(%rip), %xmm1    # 0x42f10
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
paddq %xmm1, %xmm2
jmp 0x22c64
movq 0x20(%rsp), %rdi
movdqa %xmm2, 0x40(%rsp)
callq 0x106d0
movq 0x18(%rsp), %rax
movdqu 0x40(%rax), %xmm0
paddq 0x40(%rsp), %xmm0
movdqu %xmm0, 0x40(%rax)
leaq 0x30(%rsp), %rbx
movq (%rbx), %r14
movq 0xc8(%rsp), %r15
pushq $0x1
popq %rbp
leaq 0x28(%r15), %r12
movq %r14, %rsi
cmpq %rbx, %r14
je 0x22ee5
movq (%rsi), %r14
cmpq %r12, %rsi
je 0x22e7c
leaq 0x3488f(%rip), %rax     # 0x576b0
movq (%rax), %rcx
notq %rcx
leaq -0x10(%rsi), %rax
andq %rcx, %rax
addq 0x3472b(%rip), %rax     # 0x57560
andq %rsi, %rcx
negq %rax
addq %rsi, %rax
addq $-0x10, %rax
xorl %edx, %edx
pushq $0x60
popq %rdi
divq %rdi
movl 0x68(%rcx,%rax,8), %r8d
andl $0x4, %r8d
shrl $0x2, %r8d
movq 0x8(%rsi), %rax
movq %r14, (%rax)
movq (%rsi), %rcx
movq %rax, 0x8(%rcx)
movq %rsi, (%rsi)
movq %rsi, 0x8(%rsi)
movq 0x18(%rsp), %rdi
xorl %edx, %edx
movl %ebp, %ecx
callq 0x2761e
jmp 0x22e06
movq 0x38(%r15), %rax
movq %rax, 0x40(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x28(%rsp)
movq 0x10(%r15), %r13
movzbl 0x18(%r15), %eax
movl %eax, 0x20(%rsp)
movzbl 0x19(%r15), %eax
movl %eax, 0x54(%rsp)
movq %r15, %rdi
callq 0x2216f
movq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x22230
movq %r12, %rdi
leaq 0x58(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %r13, %rcx
movl 0x20(%rsp), %r8d
movl 0x54(%rsp), %r9d
callq 0x2983a
movq 0x40(%rsp), %r15
jmp 0x22e02
movq 0x18(%rsp), %rax
movb $0x0, 0xd8(%rax)
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq