	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_vram_unpin             ## -- Begin function drm_gem_vram_unpin
	.p2align	4, 0x90
_drm_gem_vram_unpin:                    ## @drm_gem_vram_unpin
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	$0, -24(%rbp)
	xorl	%ebx, %ebx
	movl	$1, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ttm_bo_reserve
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	xorl	%edi, %edi
	cmpq	$0, 16(%r14)
	sete	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	jne	LBB0_19
## %bb.2:
	decq	16(%r14)
	jne	LBB0_19
## %bb.3:
	leaq	4(%r14), %rsi
	movl	4(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_18
## %bb.4:
	movq	8(%r14), %rcx
	cmpl	$8, %eax
	jb	LBB0_5
## %bb.7:
	movq	_TTM_PL_FLAG_NO_EVICT@GOTPCREL(%rip), %rdi
	leaq	4(%rdi), %rdx
	cmpq	%rdx, %rcx
	jae	LBB0_10
## %bb.8:
	leaq	(%rcx,%rax,4), %rdx
	cmpq	_TTM_PL_FLAG_NO_EVICT@GOTPCREL(%rip), %rdx
	jbe	LBB0_10
LBB0_5:
	xorl	%edx, %edx
LBB0_13:
	movq	%rdx, %rdi
	notq	%rdi
	testb	$1, %al
	je	LBB0_15
## %bb.14:
	movq	_TTM_PL_FLAG_NO_EVICT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ebx
	notl	%ebx
	andl	%ebx, (%rcx,%rdx,4)
	orq	$1, %rdx
LBB0_15:
	addq	%rax, %rdi
	je	LBB0_18
## %bb.16:
	movq	_TTM_PL_FLAG_NO_EVICT@GOTPCREL(%rip), %rdi
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdi), %ebx
	notl	%ebx
	andl	%ebx, (%rcx,%rdx,4)
	movl	(%rdi), %ebx
	notl	%ebx
	andl	%ebx, 4(%rcx,%rdx,4)
	addq	$2, %rdx
	cmpq	%rdx, %rax
	jne	LBB0_17
	jmp	LBB0_18
LBB0_6:
	movl	%eax, %ebx
	jmp	LBB0_20
LBB0_10:
	movl	%eax, %edx
	andl	$-8, %edx
	movd	(%rdi), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm1                ## xmm1 = xmm0[0,0,0,0]
	pcmpeqd	%xmm0, %xmm0
	pxor	%xmm1, %xmm0
	leaq	(,%rax,4), %rdi
	andq	$-32, %rdi
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rcx,%rbx), %xmm1
	movdqu	16(%rcx,%rbx), %xmm2
	pand	%xmm0, %xmm1
	pand	%xmm0, %xmm2
	movdqu	%xmm1, (%rcx,%rbx)
	movdqu	%xmm2, 16(%rcx,%rbx)
	addq	$32, %rbx
	cmpq	%rbx, %rdi
	jne	LBB0_11
## %bb.12:
	cmpq	%rax, %rdx
	jne	LBB0_13
LBB0_18:
	leaq	-24(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ttm_bo_validate
	movl	%eax, %ebx
	sarl	$31, %ebx
	andl	%eax, %ebx
LBB0_19:
	movq	%r14, %rdi
	callq	_ttm_bo_unreserve
LBB0_20:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TTM_PL_FLAG_NO_EVICT,4,2       ## @TTM_PL_FLAG_NO_EVICT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_vram_unpin             ; -- Begin function drm_gem_vram_unpin
	.p2align	2
_drm_gem_vram_unpin:                    ; @drm_gem_vram_unpin
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	str	xzr, [sp, #8]
	mov	w1, #1
	mov	w2, #0
	mov	x3, #0
	bl	_ttm_bo_reserve
	tbnz	w0, #31, LBB0_5
; %bb.1:
	ldr	x8, [x19, #16]
	cmp	x8, #0
	cset	w0, eq
	bl	_WARN_ON_ONCE
	cbnz	x0, LBB0_3
; %bb.2:
	ldr	x8, [x19, #16]
	subs	x8, x8, #1
	str	x8, [x19, #16]
	b.eq	LBB0_7
LBB0_3:
	mov	w20, #0
LBB0_4:
	mov	x0, x19
	bl	_ttm_bo_unreserve
	b	LBB0_6
LBB0_5:
	mov	x20, x0
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_7:
	mov	x1, x19
	ldr	w9, [x1, #4]!
	cmp	w9, #1
	b.lt	LBB0_14
; %bb.8:
	ldr	x10, [x19, #8]
Lloh0:
	adrp	x8, _TTM_PL_FLAG_NO_EVICT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TTM_PL_FLAG_NO_EVICT@GOTPAGEOFF]
	cmp	w9, #16
	b.lo	LBB0_11
; %bb.9:
	add	x11, x8, #4
	cmp	x10, x11
	b.hs	LBB0_15
; %bb.10:
	add	x11, x10, x9, lsl #2
	cmp	x11, x8
	b.ls	LBB0_15
LBB0_11:
	mov	x11, #0
LBB0_12:
	add	x10, x10, x11, lsl #2
	sub	x9, x9, x11
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x8]
	ldr	w12, [x10]
	bic	w11, w12, w11
	str	w11, [x10], #4
	subs	x9, x9, #1
	b.ne	LBB0_13
LBB0_14:
	add	x2, sp, #8
	mov	x0, x19
	bl	_ttm_bo_validate
	cmp	w0, #0
	csel	w20, w0, wzr, lt
	b	LBB0_4
LBB0_15:
	and	x11, x9, #0xfffffff0
	ldr	s0, [x8]
	mvn.16b	v0, v0
	dup.4s	v0, v0[0]
	add	x12, x10, #32
	mov	x13, x11
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldp	q1, q2, [x12, #-32]
	ldp	q3, q4, [x12]
	and.16b	v1, v1, v0
	and.16b	v2, v2, v0
	and.16b	v3, v3, v0
	and.16b	v4, v4, v0
	stp	q1, q2, [x12, #-32]
	stp	q3, q4, [x12], #64
	subs	x13, x13, #16
	b.ne	LBB0_16
; %bb.17:
	cmp	x11, x9
	b.eq	LBB0_14
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_PL_FLAG_NO_EVICT,4,2       ; @TTM_PL_FLAG_NO_EVICT
.subsections_via_symbols
