	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_driver_postclose_kms    ## -- Begin function radeon_driver_postclose_kms
	.p2align	4, 0x90
_radeon_driver_postclose_kms:           ## @radeon_driver_postclose_kms
	.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
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	8(%rdi), %rbx
	movl	(%rdi), %edi
	callq	_pm_runtime_get_sync
	leaq	24(%rbx), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	cmpq	%r15, 40(%rbx)
	je	LBB0_1
## %bb.2:
	cmpq	%r15, 32(%rbx)
	je	LBB0_3
LBB0_4:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_radeon_uvd_free_handles
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_radeon_vce_free_handles
	movq	(%rbx), %rax
	movq	_CHIP_CAYMAN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_13
## %bb.5:
	movq	(%r15), %r12
	testq	%r12, %r12
	je	LBB0_13
## %bb.6:
	cmpq	$0, 16(%rbx)
	je	LBB0_12
## %bb.7:
	movl	8(%rbx), %edi
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	testl	%eax, %eax
	jne	LBB0_11
## %bb.8:
	movq	(%r12), %rsi
	testq	%rsi, %rsi
	je	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	callq	_radeon_vm_bo_rmv
LBB0_10:
	movl	8(%rbx), %edi
	callq	_radeon_bo_unreserve
LBB0_11:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_radeon_vm_fini
LBB0_12:
	movq	%r12, %rdi
	callq	_kfree
	movq	$0, (%r15)
LBB0_13:
	movl	(%r14), %edi
	callq	_pm_runtime_mark_last_busy
	movl	(%r14), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pm_runtime_put_autosuspend     ## TAILCALL
LBB0_1:
	movq	$0, 40(%rbx)
	cmpq	%r15, 32(%rbx)
	jne	LBB0_4
LBB0_3:
	movq	$0, 32(%rbx)
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_CHIP_CAYMAN,8,3                ## @CHIP_CAYMAN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_driver_postclose_kms    ; -- Begin function radeon_driver_postclose_kms
	.p2align	2
_radeon_driver_postclose_kms:           ; @radeon_driver_postclose_kms
	.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	x20, x1
	mov	x19, x0
	ldr	x21, [x0, #8]
	ldr	w0, [x0]
	bl	_pm_runtime_get_sync
	add	x22, x21, #24
	mov	x0, x22
	bl	_mutex_lock
	ldr	x8, [x21, #40]
	cmp	x8, x20
	b.ne	LBB0_2
; %bb.1:
	str	xzr, [x21, #40]
LBB0_2:
	ldr	x8, [x21, #32]
	cmp	x8, x20
	b.ne	LBB0_4
; %bb.3:
	str	xzr, [x21, #32]
LBB0_4:
	mov	x0, x22
	bl	_mutex_unlock
	mov	x0, x21
	mov	x1, x20
	bl	_radeon_uvd_free_handles
	mov	x0, x21
	mov	x1, x20
	bl	_radeon_vce_free_handles
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _CHIP_CAYMAN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_CAYMAN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_13
; %bb.5:
	ldr	x22, [x20]
	cbz	x22, LBB0_13
; %bb.6:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_12
; %bb.7:
	ldr	w0, [x21, #8]
	mov	w1, #0
	bl	_radeon_bo_reserve
	cbnz	w0, LBB0_11
; %bb.8:
	ldr	x1, [x22]
	cbz	x1, LBB0_10
; %bb.9:
	mov	x0, x21
	bl	_radeon_vm_bo_rmv
LBB0_10:
	ldr	w0, [x21, #8]
	bl	_radeon_bo_unreserve
LBB0_11:
	mov	x0, x21
	mov	x1, x22
	bl	_radeon_vm_fini
LBB0_12:
	mov	x0, x22
	bl	_kfree
	str	xzr, [x20]
LBB0_13:
	ldr	w0, [x19]
	bl	_pm_runtime_mark_last_busy
	ldr	w0, [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	_pm_runtime_put_autosuspend
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_CAYMAN,8,3                ; @CHIP_CAYMAN
.subsections_via_symbols
