// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/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 $0xe8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x403f3
movq %rbx, %rdi
movb $0x1, 0xd8(%rbx)
incq 0x38(%rbx)
movl %ebp, 0x20(%rsp)
testl %ebp, %ebp
je 0x3a408
movq 0xe8(%rdi), %rax
movq %rax, 0x18(%rsp)
jmp 0x3a438
movq 0xe0(%rdi), %rax
movb 0xd0(%rdi), %cl
shrq %cl, %rax
leaq 0x4a289(%rip), %rcx     # 0x846a8
movq (%rcx), %rcx
cmpq %rcx, %rax
cmovbeq %rcx, %rax
movq 0xe8(%rdi), %rcx
subq %rax, %rcx
movq %rcx, 0x18(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, (%rax)
movq %rax, 0x8(%rax)
leaq 0xa8(%rsp), %rax
movq %rax, (%rax)
movq %rax, 0x8(%rax)
leaq 0x80(%rsp), %rax
movq %rax, 0x38(%rax)
movq %rax, 0x40(%rax)
leaq 0x158(%rdi), %r15
movq 0x158(%rdi), %r12
movq 0x1a0(%rdi), %rbx
xorl %r14d, %r14d
movq %rdi, 0x10(%rsp)
cmpq %r15, %r12
je 0x3a5d0
movq (%r12), %rbp
leaq 0x28(%rbx), %r13
cmpq %r13, %r12
je 0x3a52b
leaq 0x4a1ff(%rip), %rax     # 0x846a0
movq (%rax), %rcx
leaq -0x10(%r12), %rax
andq %rcx, %rax
notq %rcx
andq %r12, %rcx
subq 0x4a097(%rip), %rax     # 0x84550
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq $0x6, %rdx
movq 0x68(%rcx,%rdx,8), %r13
cmpq %rcx, 0xc8(%rdi)
jne 0x3a4e7
movq 0x10(%rsp), %rdi
callq 0x3d9df
movq 0x10(%rsp), %rdi
shrq %r13
movabsq $0x7ffffffffffff000, %rax # imm = 0x7FFFFFFFFFFFF000
andq %rax, %r13
movq %r12, %rsi
movq %r13, %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x3e02e
movq 0x30(%rsp), %rax
movq %r12, (%rax)
movq 0x8(%r12), %rcx
leaq 0x28(%rsp), %rdx
movq %rdx, (%rcx)
movq %rcx, 0x30(%rsp)
movq %rax, 0x8(%r12)
jmp 0x3a5a8
movq 0x38(%rbx), %r12
movb $0x0, 0xf(%rsp)
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rcx
leaq 0x4a155(%rip), %rax     # 0x84698
movq (%rax), %r8
movl $0x0, (%rsp)
leaq 0x48(%rsp), %rsi
leaq 0xf(%rsp), %r9
callq 0x406a5
movq 0x30(%rsp), %rax
movq %r13, (%rax)
movq 0x30(%rbx), %rcx
leaq 0x28(%rsp), %rdx
movq %rdx, (%rcx)
movq %rcx, 0x30(%rsp)
movq %rax, 0x30(%rbx)
movq 0xc0(%rsp), %rax
movq %rbx, 0x38(%rax)
movq 0x40(%rbx), %rcx
leaq 0x80(%rsp), %rdx
movq %rdx, 0x38(%rcx)
movq %rcx, 0xc0(%rsp)
movq %rax, 0x40(%rbx)
movq 0x10(%rbx), %r13
movq %r12, %rbx
shrq $0xc, %r13
addq %r13, %r14
movq %rbp, %r12
cmpb $0x0, 0x20(%rsp)
movq 0x10(%rsp), %rdi
jne 0x3a480
movq %rbp, %r12
cmpq 0x18(%rsp), %r14
jb 0x3a480
addq $0x8, %rdi
movq %rdi, 0x40(%rsp)
callq 0x125c0
movq 0x28(%rsp), %rbx
leaq 0x28(%rsp), %rax
cmpq %rax, %rbx
je 0x3a776
movq 0xb8(%rsp), %rcx
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%rsp), %rdi
leaq 0x4a08d(%rip), %r8      # 0x84698
leaq 0x28(%rcx), %rax
cmpq %rax, %rbx
je 0x3a6c3
movq %rcx, 0x38(%rsp)
movq %r12, 0x18(%rsp)
movq %r15, 0x20(%rsp)
leaq 0x4a072(%rip), %rax     # 0x846a0
movq (%rax), %r12
leaq -0x10(%rbx), %rax
andq %r12, %rax
notq %r12
subq 0x49f0e(%rip), %rax     # 0x84550
andq %rbx, %r12
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq $0x6, %rdx
movq 0x49eeb(%rip), %r15     # 0x84548
addq %rdx, %r15
movq 0x68(%r12,%rdx,8), %r14
movq %r14, %r13
shrq %r13
movabsq $0x7ffffffffffff000, %rax # imm = 0x7FFFFFFFFFFFF000
andq %rax, %r13
movq (%r8), %rsi
movq %r15, %rbp
shlq $0xc, %rbp
movl (%rdi), %r8d
movq %r12, %rdi
movq %rbp, %rdx
movq %r13, %rcx
callq *0x60(%rsp)
testb %al, %al
je 0x3a6d4
leaq 0x49ffb(%rip), %rax     # 0x84698
movq (%rax), %rcx
movq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq %r12, %rdx
movq %rbp, %r8
movq %r13, %r9
callq 0x410fc
movzbl %al, %eax
shll $0x3, %eax
movq %rax, %rcx
jmp 0x3a6db
movq 0x10(%rcx), %r14
movq 0x38(%rcx), %rcx
shrq $0xc, %r14
jmp 0x3a75d
movl $0x4, %ecx
xorl %eax, %eax
shrq $0xd, %r14
leaq (%r15,%r14), %rdx
movq 0x49e5e(%rip), %rsi     # 0x84548
notq %rsi
addq %rdx, %rsi
orq $0x1fe3, %rcx           # imm = 0x1FE3
movq %rcx, 0x68(%r12,%rsi,8)
movq %r15, %rdx
subq 0x49e42(%rip), %rdx     # 0x84548
addq %r13, %r13
orq %rcx, %r13
movq %r13, 0x68(%r12,%rdx,8)
leaq -0x1(%r14), %rcx
cmpq $0x2, %rcx
movq 0x10(%rsp), %rdi
leaq 0x49f73(%rip), %r8      # 0x84698
jb 0x3a74e
leaq -0x2(%r14), %rcx
leaq (%r12,%r15,8), %rdx
addq $0x70, %rdx
movq 0x49e0e(%rip), %rsi     # 0x84548
shlq $0x3, %rsi
negq %rsi
movq %rax, (%rdx,%rsi)
addq $0x8, %rdx
decq %rcx
jne 0x3a733
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %r12
movq 0x38(%rsp), %rcx
addq %r14, %r15
incq %r12
movq (%rbx), %rbx
leaq 0x28(%rsp), %rax
cmpq %rax, %rbx
jne 0x3a60b
jmp 0x3a77c
xorl %r12d, %r12d
xorl %r15d, %r15d
movq 0x40(%rsp), %rdi
callq 0x12960
movq 0x10(%rsp), %rdi
addq %r12, 0x40(%rdi)
addq %r15, 0x48(%rdi)
movq 0x28(%rsp), %rsi
leaq 0x28(%rsp), %rax
cmpq %rax, %rsi
je 0x3a8b6
movq 0xb8(%rsp), %r15
movq (%rsi), %rbx
leaq 0x28(%r15), %rax
cmpq %rax, %rsi
je 0x3a823
leaq 0x49edf(%rip), %rax     # 0x846a0
movq (%rax), %rcx
notq %rcx
leaq -0x10(%rsi), %rax
andq %rcx, %rax
addq 0x49d7b(%rip), %rax     # 0x84550
negq %rax
addq %rsi, %rax
addq $-0x10, %rax
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
andq %rsi, %rcx
shrq $0x6, %rdx
movl 0x68(%rcx,%rdx,8), %r8d
andl $0x4, %r8d
shrl $0x2, %r8d
movq 0x8(%rsi), %rax
movq %rbx, (%rax)
movq (%rsi), %rcx
movq %rax, 0x8(%rcx)
movq %rsi, (%rsi)
movq %rsi, 0x8(%rsi)
xorl %edx, %edx
movl $0x1, %ecx
callq 0x3eaa3
jmp 0x3a8a0
movq 0x38(%r15), %r14
movq 0x8(%r15), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%r15), %r13
movzbl 0x18(%r15), %ebp
movzbl 0x19(%r15), %ecx
movl %ecx, 0x18(%rsp)
movq 0x28(%r15), %rcx
movq 0x30(%r15), %rdx
movq %rcx, (%rdx)
movq 0x28(%r15), %rcx
movq %rdx, 0x8(%rcx)
movq %rax, 0x28(%r15)
movq %rax, 0x30(%r15)
movq 0x40(%r15), %rax
movq %r14, 0x38(%rax)
movq 0x38(%r15), %rcx
movq %rax, 0x40(%rcx)
movq %r15, 0x38(%r15)
movq %r15, 0x40(%r15)
movq %rdi, %r12
movq %r15, %rsi
callq 0x39c10
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %r13, %rcx
movl %ebp, %r8d
movl 0x18(%rsp), %r9d
callq 0x40fec
movq %r14, %r15
movq %rbx, %rsi
leaq 0x28(%rsp), %rax
cmpq %rax, %rbx
movq 0x10(%rsp), %rdi
jne 0x3a7ae
movb $0x0, 0xd8(%rdi)
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq