	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msm_gem_purge                  ## -- Begin function msm_gem_purge
	.p2align	4, 0x90
_msm_gem_purge:                         ## @msm_gem_purge
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	16(%rdi), %r12
	callq	_to_msm_bo
	movq	%rax, %r14
	leaq	8(%r12), %rdi
	callq	_mutex_is_locked
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON
	movq	%r14, %rdi
	callq	_is_purgeable
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON
	movl	(%rbx), %edi
	callq	_WARN_ON
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_mutex_lock_nested
	movq	%rbx, %rdi
	callq	_put_iova
	movq	%rbx, %rdi
	callq	_msm_gem_vunmap_locked
	movq	%rbx, %rdi
	callq	_put_pages
	movq	___MSM_MADV_PURGED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	leaq	8(%rbx), %rdi
	movq	(%r12), %rax
	movl	(%rax), %esi
	callq	_drm_vma_node_unmap
	movq	%rbx, %rdi
	callq	_drm_gem_free_mmap_offset
	movl	4(%rbx), %edi
	callq	_file_inode
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$-1, %edx
	callq	_shmem_truncate_range
	movl	4(%rbx), %edi
	callq	_file_inode
	movl	(%rax), %edi
	xorl	%esi, %esi
	movl	$-1, %edx
	callq	_invalidate_mapping_pages
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	___MSM_MADV_PURGED,4,2          ## @__MSM_MADV_PURGED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msm_gem_purge                  ; -- Begin function msm_gem_purge
	.p2align	2
_msm_gem_purge:                         ; @msm_gem_purge
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x1
	mov	x20, x0
	ldr	x22, [x0, #16]
	bl	_to_msm_bo
	mov	x19, x0
	add	x0, x22, #8
	bl	_mutex_is_locked
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
	mov	x0, x19
	bl	_is_purgeable
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
	ldr	w0, [x20]
	bl	_WARN_ON
	mov	x0, x19
	mov	x1, x21
	bl	_mutex_lock_nested
	mov	x0, x20
	bl	_put_iova
	mov	x0, x20
	bl	_msm_gem_vunmap_locked
	mov	x0, x20
	bl	_put_pages
Lloh0:
	adrp	x8, ___MSM_MADV_PURGED@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___MSM_MADV_PURGED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	add	x0, x20, #8
	ldr	x8, [x22]
	ldr	w1, [x8]
	bl	_drm_vma_node_unmap
	mov	x0, x20
	bl	_drm_gem_free_mmap_offset
	ldr	w0, [x20, #4]
	bl	_file_inode
	mov	w1, #0
	mov	w2, #-1
	bl	_shmem_truncate_range
	ldr	w0, [x20, #4]
	bl	_file_inode
	ldr	w0, [x0]
	mov	w1, #0
	mov	w2, #-1
	bl	_invalidate_mapping_pages
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	___MSM_MADV_PURGED,4,2          ; @__MSM_MADV_PURGED
.subsections_via_symbols
