	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_ttm_fini                ## -- Begin function radeon_ttm_fini
	.p2align	4, 0x90
_radeon_ttm_fini:                       ## @radeon_ttm_fini
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpl	$0, (%rdi)
	je	LBB0_6
## %bb.1:
	movq	%rdi, %rbx
	movq	8(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.2:
	leaq	8(%rbx), %r14
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	(%r14), %rdi
	callq	_radeon_bo_unpin
	movq	(%r14), %rdi
	callq	_radeon_bo_unreserve
LBB0_4:
	movq	%r14, %rdi
	callq	_radeon_bo_unref
LBB0_5:
	leaq	4(%rbx), %r14
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ttm_bo_clean_mm
	movq	_TTM_PL_TT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ttm_bo_clean_mm
	movq	%r14, %rdi
	callq	_ttm_bo_device_release
	movq	%rbx, %rdi
	callq	_radeon_gart_fini
	movq	%rbx, %rdi
	callq	_radeon_ttm_global_fini
	movl	$0, (%rbx)
	leaq	L_.str(%rip), %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_DRM_INFO                       ## TAILCALL
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TTM_PL_VRAM,4,2                ## @TTM_PL_VRAM
	.comm	_TTM_PL_TT,4,2                  ## @TTM_PL_TT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"radeon: ttm finalized\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_ttm_fini                ; -- Begin function radeon_ttm_fini
	.p2align	2
_radeon_ttm_fini:                       ; @radeon_ttm_fini
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	w8, [x0]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x19, x0
	mov	x20, x0
	ldr	x0, [x20, #8]!
	cbz	x0, LBB0_5
; %bb.2:
	mov	w1, #0
	bl	_radeon_bo_reserve
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	x0, [x20]
	bl	_radeon_bo_unpin
	ldr	x0, [x20]
	bl	_radeon_bo_unreserve
LBB0_4:
	mov	x0, x20
	bl	_radeon_bo_unref
LBB0_5:
	add	x20, x19, #4
Lloh0:
	adrp	x8, _TTM_PL_VRAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ttm_bo_clean_mm
Lloh3:
	adrp	x8, _TTM_PL_TT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TTM_PL_TT@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ttm_bo_clean_mm
	mov	x0, x20
	bl	_ttm_bo_device_release
	mov	x0, x19
	bl	_radeon_gart_fini
	mov	x0, x19
	bl	_radeon_ttm_global_fini
	str	wzr, [x19]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_DRM_INFO
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_PL_VRAM,4,2                ; @TTM_PL_VRAM
	.comm	_TTM_PL_TT,4,2                  ; @TTM_PL_TT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"radeon: ttm finalized\n"

.subsections_via_symbols
