	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psp_hw_fini
_psp_hw_fini:                           ## @psp_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	cmpl	$2, (%rdi)
	jl	LBB0_3
## %bb.1:
	cmpl	$1, 96(%rbx)
	jne	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_psp_xgmi_terminate
LBB0_3:
	movq	88(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	callq	_psp_ras_terminate
LBB0_5:
	movq	_PSP_RING_TYPE__KM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_psp_ring_destroy
	movq	88(%rbx), %rdi
	callq	_amdgpu_sriov_vf
	testq	%rax, %rax
	leaq	-24(%rbp), %rdx
	cmoveq	%rax, %rdx
	leaq	80(%rbx), %rdi
	leaq	76(%rbx), %rsi
	callq	_amdgpu_bo_free_kernel
	leaq	72(%rbx), %rdi
	leaq	68(%rbx), %rsi
	movq	%r14, %rdx
	callq	_amdgpu_bo_free_kernel
	leaq	64(%rbx), %rdi
	leaq	60(%rbx), %rsi
	leaq	16(%rbx), %rdx
	callq	_amdgpu_bo_free_kernel
	leaq	56(%rbx), %rdi
	leaq	52(%rbx), %rsi
	leaq	24(%rbx), %rdx
	callq	_amdgpu_bo_free_kernel
	leaq	48(%rbx), %rdi
	leaq	44(%rbx), %rsi
	leaq	40(%rbx), %rdx
	callq	_amdgpu_bo_free_kernel
	movq	32(%rbx), %rdi
	callq	_kfree
	movq	$0, 32(%rbx)
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PSP_RING_TYPE__KM,4,2          ## @PSP_RING_TYPE__KM
	.no_dead_strip	_psp_hw_fini
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psp_hw_fini
_psp_hw_fini:                           ; @psp_hw_fini
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	mov	x20, x0
	ldr	w8, [x20], #8
	cmp	w8, #2
	b.lt	LBB0_3
; %bb.1:
	ldr	w8, [x19, #96]
	cmp	w8, #1
	b.ne	LBB0_3
; %bb.2:
	mov	x0, x20
	bl	_psp_xgmi_terminate
LBB0_3:
	ldr	x8, [x19, #88]
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x20
	bl	_psp_ras_terminate
LBB0_5:
Lloh0:
	adrp	x8, _PSP_RING_TYPE__KM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PSP_RING_TYPE__KM@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_psp_ring_destroy
	ldr	x0, [x19, #88]
	bl	_amdgpu_sriov_vf
	add	x8, sp, #8
	cmp	x0, #0
	csel	x2, xzr, x8, eq
	add	x0, x19, #80
	add	x1, x19, #76
	bl	_amdgpu_bo_free_kernel
	add	x0, x19, #72
	add	x1, x19, #68
	mov	x2, x20
	bl	_amdgpu_bo_free_kernel
	add	x0, x19, #64
	add	x1, x19, #60
	add	x2, x19, #16
	bl	_amdgpu_bo_free_kernel
	add	x0, x19, #56
	add	x1, x19, #52
	add	x2, x19, #24
	bl	_amdgpu_bo_free_kernel
	add	x0, x19, #48
	add	x1, x19, #44
	add	x2, x19, #40
	bl	_amdgpu_bo_free_kernel
	ldr	x0, [x19, #32]
	bl	_kfree
	str	xzr, [x19, #32]
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PSP_RING_TYPE__KM,4,2          ; @PSP_RING_TYPE__KM
	.no_dead_strip	_psp_hw_fini
.subsections_via_symbols
