	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r100_cp_fini                   ## -- Begin function r100_cp_fini
	.p2align	4, 0x90
_r100_cp_fini:                          ## @r100_cp_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
	movq	%rdi, %rbx
	callq	_r100_cp_wait_for_idle
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_2:
	movq	%rbx, %rdi
	callq	_r100_cp_disable
	movq	(%rbx), %rax
	movq	_RADEON_RING_TYPE_GFX_INDEX@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	movl	(%rax,%rcx,4), %esi
	movq	%rbx, %rdi
	callq	_radeon_scratch_free
	movq	(%r14), %rsi
	shlq	$2, %rsi
	addq	(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_radeon_ring_fini
	leaq	L_.str.1(%rip), %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_DRM_INFO                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wait for CP idle timeout, shutting down CP.\n"

	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ## @RADEON_RING_TYPE_GFX_INDEX
L_.str.1:                               ## @.str.1
	.asciz	"radeon: cp finalized\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r100_cp_fini                   ; -- Begin function r100_cp_fini
	.p2align	2
_r100_cp_fini:                          ; @r100_cp_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
	mov	x19, x0
	bl	_r100_cp_wait_for_idle
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_2:
	mov	x0, x19
	bl	_r100_cp_disable
	ldr	x8, [x19]
Lloh2:
	adrp	x20, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGE
Lloh3:
	ldr	x20, [x20, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGEOFF]
	ldr	x9, [x20]
	ldr	w1, [x8, x9, lsl #2]
	mov	x0, x19
	bl	_radeon_scratch_free
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x1, x8, x9, lsl #2
	mov	x0, x19
	bl	_radeon_ring_fini
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_DRM_INFO
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wait for CP idle timeout, shutting down CP.\n"

	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ; @RADEON_RING_TYPE_GFX_INDEX
l_.str.1:                               ; @.str.1
	.asciz	"radeon: cp finalized\n"

.subsections_via_symbols
