	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v9_0_hw_fini
_gfx_v9_0_hw_fini:                      ## @gfx_v9_0_hw_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	28(%rdi), %rsi
	xorl	%edx, %edx
	callq	_amdgpu_irq_put
	leaq	24(%rbx), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_amdgpu_irq_put
	leaq	20(%rbx), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_amdgpu_irq_put
	movq	%rbx, %rdi
	callq	_gfx_v9_0_kcq_disable
	movq	%rbx, %rdi
	callq	_amdgpu_sriov_vf
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_gfx_v9_0_cp_gfx_enable
	movq	_GC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_CP_PQ_WPTR_POLL_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	callq	_WREG32_FIELD15
	jmp	LBB0_6
LBB0_2:
	cmpl	$0, 40(%rbx)
	jne	LBB0_5
## %bb.3:
	cmpl	$0, 36(%rbx)
	jne	LBB0_5
## %bb.4:
	leaq	32(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	leaq	8(%rbx), %r15
	movl	16(%rbx), %esi
	movl	8(%rbx), %ecx
	movl	12(%rbx), %edx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	_soc15_grbm_select
	movq	%r15, %rdi
	callq	_gfx_v9_0_kiq_fini_register
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_soc15_grbm_select
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_5:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_gfx_v9_0_cp_enable
	movq	(%rbx), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
	movq	%rbx, %rdi
	callq	_gfx_v9_0_csb_vram_unpin
LBB0_6:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GC,4,2                         ## @GC
	.comm	_CP_PQ_WPTR_POLL_CNTL,4,2       ## @CP_PQ_WPTR_POLL_CNTL
	.comm	_EN,4,2                         ## @EN
	.no_dead_strip	_gfx_v9_0_hw_fini
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_v9_0_hw_fini
_gfx_v9_0_hw_fini:                      ; @gfx_v9_0_hw_fini
	.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	x19, x0
	add	x1, x0, #28
	mov	w2, #0
	bl	_amdgpu_irq_put
	add	x1, x19, #24
	mov	x0, x19
	mov	w2, #0
	bl	_amdgpu_irq_put
	add	x1, x19, #20
	mov	x0, x19
	mov	w2, #0
	bl	_amdgpu_irq_put
	mov	x0, x19
	bl	_gfx_v9_0_kcq_disable
	mov	x0, x19
	bl	_amdgpu_sriov_vf
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #0
	bl	_gfx_v9_0_cp_gfx_enable
Lloh0:
	adrp	x8, _GC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GC@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _CP_PQ_WPTR_POLL_CNTL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CP_PQ_WPTR_POLL_CNTL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _EN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EN@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	w1, #0
	mov	w4, #0
	bl	_WREG32_FIELD15
	b	LBB0_6
LBB0_2:
	ldr	w8, [x19, #40]
	cbnz	w8, LBB0_5
; %bb.3:
	ldr	w8, [x19, #36]
	cbnz	w8, LBB0_5
; %bb.4:
	add	x20, x19, #32
	mov	x0, x20
	bl	_mutex_lock
	ldp	w2, w1, [x19, #12]
	mov	x21, x19
	ldr	w3, [x21, #8]!
	mov	x0, x19
	mov	w4, #0
	bl	_soc15_grbm_select
	mov	x0, x21
	bl	_gfx_v9_0_kiq_fini_register
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_soc15_grbm_select
	mov	x0, x20
	bl	_mutex_unlock
LBB0_5:
	mov	x0, x19
	mov	w1, #0
	bl	_gfx_v9_0_cp_enable
	ldr	x8, [x19]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	x0, x19
	bl	_gfx_v9_0_csb_vram_unpin
LBB0_6:
	mov	w0, #0
	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
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_GC,4,2                         ; @GC
	.comm	_CP_PQ_WPTR_POLL_CNTL,4,2       ; @CP_PQ_WPTR_POLL_CNTL
	.comm	_EN,4,2                         ; @EN
	.no_dead_strip	_gfx_v9_0_hw_fini
.subsections_via_symbols
