	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v8_0_hw_fini
_gfx_v8_0_hw_fini:                      ## @gfx_v8_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	leaq	20(%rdi), %rsi
	xorl	%edx, %edx
	callq	_amdgpu_irq_put
	leaq	16(%rbx), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_amdgpu_irq_put
	leaq	12(%rbx), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_amdgpu_irq_put
	leaq	8(%rbx), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_amdgpu_irq_put
	movq	%rbx, %rdi
	callq	_gfx_v8_0_kcq_disable
	movq	%rbx, %rdi
	callq	_amdgpu_sriov_vf
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	jmp	LBB0_9
LBB0_2:
	movq	%rbx, %rdi
	callq	_amdgpu_gfx_rlc_enter_safe_mode
	movq	%rbx, %rdi
	callq	_gfx_v8_0_wait_for_idle
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_5
LBB0_3:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_gfx_v8_0_cp_enable
LBB0_5:
	movq	%rbx, %rdi
	callq	_gfx_v8_0_wait_for_rlc_idle
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_8
LBB0_6:
	movq	(%rbx), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
LBB0_8:
	movq	%rbx, %rdi
	callq	_amdgpu_gfx_rlc_exit_safe_mode
	movq	%rbx, %rdi
	callq	_gfx_v8_0_csb_vram_unpin
LBB0_9:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"For SRIOV client, shouldn't do anything.\n"

L_.str.1:                               ## @.str.1
	.asciz	"cp is busy, skip halt cp\n"

L_.str.2:                               ## @.str.2
	.asciz	"rlc is busy, skip halt rlc\n"

	.no_dead_strip	_gfx_v8_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_v8_0_hw_fini
_gfx_v8_0_hw_fini:                      ; @gfx_v8_0_hw_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
	add	x1, x0, #20
	mov	w2, #0
	bl	_amdgpu_irq_put
	add	x1, x19, #16
	mov	x0, x19
	mov	w2, #0
	bl	_amdgpu_irq_put
	add	x1, x19, #12
	mov	x0, x19
	mov	w2, #0
	bl	_amdgpu_irq_put
	add	x1, x19, #8
	mov	x0, x19
	mov	w2, #0
	bl	_amdgpu_irq_put
	mov	x0, x19
	bl	_gfx_v8_0_kcq_disable
	mov	x0, x19
	bl	_amdgpu_sriov_vf
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	b	LBB0_9
LBB0_2:
	mov	x0, x19
	bl	_amdgpu_gfx_rlc_enter_safe_mode
	mov	x0, x19
	bl	_gfx_v8_0_wait_for_idle
	cbz	w0, LBB0_4
; %bb.3:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	mov	w1, #0
	bl	_gfx_v8_0_cp_enable
LBB0_5:
	mov	x0, x19
	bl	_gfx_v8_0_wait_for_rlc_idle
	cbz	w0, LBB0_7
; %bb.6:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	b	LBB0_8
LBB0_7:
	ldr	x8, [x19]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
LBB0_8:
	mov	x0, x19
	bl	_amdgpu_gfx_rlc_exit_safe_mode
	mov	x0, x19
	bl	_gfx_v8_0_csb_vram_unpin
LBB0_9:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"For SRIOV client, shouldn't do anything.\n"

l_.str.1:                               ; @.str.1
	.asciz	"cp is busy, skip halt cp\n"

l_.str.2:                               ; @.str.2
	.asciz	"rlc is busy, skip halt rlc\n"

	.no_dead_strip	_gfx_v8_0_hw_fini
.subsections_via_symbols
