	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_bo_unpin                ## -- Begin function radeon_bo_unpin
	.p2align	4, 0x90
_radeon_bo_unpin:                       ## @radeon_bo_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	$0, -40(%rbp)
	movq	32(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	xorl	%r14d, %r14d
	decq	%rax
	movq	%rax, 32(%r15)
	jne	LBB0_15
## %bb.3:
	leaq	16(%r15), %rsi
	movl	16(%r15), %r9d
	testl	%r9d, %r9d
	jle	LBB0_10
## %bb.4:
	movq	24(%r15), %r8
	cmpl	$1, %r9d
	jne	LBB0_6
## %bb.5:
	xorl	%edx, %edx
	jmp	LBB0_8
LBB0_1:
	movq	(%r15), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	callq	_dev_warn
	xorl	%r14d, %r14d
LBB0_15:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	%r9d, %edi
	andl	$-2, %edi
	xorl	%edx, %edx
	movq	_TTM_PL_FLAG_NO_EVICT@GOTPCREL(%rip), %rax
	movq	%r8, %rcx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	$0, 8(%rcx)
	movl	(%rax), %ebx
	notl	%ebx
	andl	%ebx, (%rcx)
	movq	$0, 24(%rcx)
	movl	(%rax), %ebx
	notl	%ebx
	andl	%ebx, 16(%rcx)
	addq	$2, %rdx
	addq	$32, %rcx
	cmpq	%rdx, %rdi
	jne	LBB0_7
LBB0_8:
	testb	$1, %r9b
	je	LBB0_10
## %bb.9:
	shlq	$4, %rdx
	movq	$0, 8(%r8,%rdx)
	movq	_TTM_PL_FLAG_NO_EVICT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%r8,%rdx)
LBB0_10:
	leaq	8(%r15), %rdi
	leaq	-40(%rbp), %rdx
	callq	_ttm_bo_validate
	movl	%eax, %r14d
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_likely
	testq	%rax, %rax
	je	LBB0_14
## %bb.11:
	movq	8(%r15), %r12
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r15, %rdi
	callq	_radeon_bo_size
	movq	(%r15), %rcx
	cmpq	%rbx, %r12
	jne	LBB0_13
## %bb.12:
	subl	%eax, 8(%rcx)
	jmp	LBB0_15
LBB0_14:
	movq	(%r15), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdx
	callq	_dev_err
	jmp	LBB0_15
LBB0_13:
	subl	%eax, 4(%rcx)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%p unpin not necessary\n"

	.comm	_TTM_PL_FLAG_NO_EVICT,4,2       ## @TTM_PL_FLAG_NO_EVICT
	.comm	_TTM_PL_VRAM,8,3                ## @TTM_PL_VRAM
L_.str.1:                               ## @.str.1
	.asciz	"%p validate failed for unpin\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_bo_unpin                ; -- Begin function radeon_bo_unpin
	.p2align	2
_radeon_bo_unpin:                       ; @radeon_bo_unpin
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	str	xzr, [sp, #8]
	ldr	x8, [x0, #32]
	cbz	x8, LBB0_8
; %bb.1:
	subs	x8, x8, #1
	str	x8, [x19, #32]
	b.ne	LBB0_9
; %bb.2:
	mov	x1, x19
	ldr	w8, [x1, #16]!
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	ldr	x9, [x19, #24]
Lloh0:
	adrp	x10, _TTM_PL_FLAG_NO_EVICT@GOTPAGE
Lloh1:
	ldr	x10, [x10, _TTM_PL_FLAG_NO_EVICT@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	str	xzr, [x9, #8]
	ldr	w11, [x10]
	ldr	w12, [x9]
	bic	w11, w12, w11
	str	w11, [x9], #16
	subs	x8, x8, #1
	b.ne	LBB0_4
LBB0_5:
	add	x0, x19, #8
	add	x2, sp, #8
	bl	_ttm_bo_validate
	mov	x20, x0
	cmp	w0, #0
	cset	w0, eq
	bl	_likely
	cbz	x0, LBB0_11
; %bb.6:
	ldr	x21, [x19, #8]
Lloh2:
	adrp	x8, _TTM_PL_VRAM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh4:
	ldr	x22, [x8]
	mov	x0, x19
	bl	_radeon_bo_size
	ldr	x8, [x19]
	cmp	x21, x22
	b.ne	LBB0_12
; %bb.7:
	ldr	w9, [x8, #8]
	sub	w9, w9, w0
	str	w9, [x8, #8]
	b	LBB0_10
LBB0_8:
	ldr	x8, [x19]
	ldr	w0, [x8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_warn
LBB0_9:
	mov	w20, #0
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_11:
	ldr	x8, [x19]
	ldr	w0, [x8]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_dev_err
	b	LBB0_10
LBB0_12:
	ldr	w9, [x8, #4]
	sub	w9, w9, w0
	str	w9, [x8, #4]
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%p unpin not necessary\n"

	.comm	_TTM_PL_FLAG_NO_EVICT,4,2       ; @TTM_PL_FLAG_NO_EVICT
	.comm	_TTM_PL_VRAM,8,3                ; @TTM_PL_VRAM
l_.str.1:                               ; @.str.1
	.asciz	"%p validate failed for unpin\n"

.subsections_via_symbols
