	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_v4_0_sw_fini
_sdma_v4_0_sw_fini:                     ## @sdma_v4_0_sw_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, %r15
	movq	_AMDGPU_RAS_BLOCK__SDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_amdgpu_ras_is_supported
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	24(%r15), %r14
	testq	%r14, %r14
	je	LBB0_3
## %bb.2:
	movl	(%r14), %eax
	movl	%eax, -32(%rbp)
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_ras_debugfs_remove
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_ras_sysfs_remove
	leaq	-32(%rbp), %rsi
	movq	%r15, %rdi
	callq	_amdgpu_ras_interrupt_remove_handler
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_amdgpu_ras_feature_enable
	movq	%r14, %rdi
	callq	_kfree
LBB0_3:
	cmpl	$0, (%r15)
	jle	LBB0_8
## %bb.4:
	movl	$4, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%r14
	movslq	(%r15), %rax
	addq	$8, %rbx
	cmpq	%rax, %r14
	jge	LBB0_8
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rdi
	addq	%rbx, %rdi
	callq	_amdgpu_ring_fini
	cmpq	$0, 16(%r15)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%r15), %rax
	leaq	(%rax,%rbx), %rdi
	addq	$-4, %rdi
	callq	_amdgpu_ring_fini
	jmp	LBB0_7
LBB0_8:
	movq	%r15, %rdi
	callq	_sdma_v4_0_destroy_inst_ctx
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_RAS_BLOCK__SDMA,4,2     ## @AMDGPU_RAS_BLOCK__SDMA
	.no_dead_strip	_sdma_v4_0_sw_fini
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdma_v4_0_sw_fini
_sdma_v4_0_sw_fini:                     ; @sdma_v4_0_sw_fini
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x8, _AMDGPU_RAS_BLOCK__SDMA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMDGPU_RAS_BLOCK__SDMA@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_amdgpu_ras_is_supported
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x20, [x19, #24]
	cbz	x20, LBB0_3
; %bb.2:
	ldr	w8, [x20]
	str	w8, [sp, #8]
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_ras_debugfs_remove
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_ras_sysfs_remove
	add	x1, sp, #8
	mov	x0, x19
	bl	_amdgpu_ras_interrupt_remove_handler
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_amdgpu_ras_feature_enable
	mov	x0, x20
	bl	_kfree
LBB0_3:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.4:
	mov	x20, #0
	mov	w21, #4
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x19]
	add	x21, x21, #8
	cmp	x20, x8
	b.ge	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x21
	bl	_amdgpu_ring_fini
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x21
	sub	x0, x8, #4
	bl	_amdgpu_ring_fini
	b	LBB0_5
LBB0_8:
	mov	x0, x19
	bl	_sdma_v4_0_destroy_inst_ctx
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_RAS_BLOCK__SDMA,4,2     ; @AMDGPU_RAS_BLOCK__SDMA
	.no_dead_strip	_sdma_v4_0_sw_fini
.subsections_via_symbols
