	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_v3_0_sw_init
_sdma_v3_0_sw_init:                     ## @sdma_v3_0_sw_init
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	_AMDGPU_IRQ_CLIENTID_LEGACY@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_VISLANDS30_IV_SRCID_SDMA_TRAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	4(%rdi), %r14
	movq	%r14, %rcx
	callq	_amdgpu_irq_add_id
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.1:
	movl	(%r12), %esi
	leaq	16(%r13), %r15
	movq	%r13, %rdi
	movl	$241, %edx
	movq	%r15, %rcx
	callq	_amdgpu_irq_add_id
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.2:
	movl	(%r12), %esi
	movq	_VISLANDS30_IV_SRCID_SDMA_SRBM_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%r15, %rcx
	callq	_amdgpu_irq_add_id
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.3:
	movq	%r13, %rdi
	callq	_sdma_v3_0_init_microcode
	testl	%eax, %eax
	je	LBB0_4
## %bb.7:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	cmpl	$0, (%r13)
	jle	LBB0_5
## %bb.6:
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rbx
	movq	$0, 16(%rbx,%r15)
	movq	%r13, %rdi
	callq	_amdgpu_sriov_vf
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	$1, 4(%rbx,%r15)
	jmp	LBB0_12
LBB0_10:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	$1, (%rbx,%r15)
	movq	24(%r13), %rax
	movl	(%rax,%r12,4), %eax
	movl	%eax, 12(%rbx,%r15)
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	8(%rbx,%r15), %edi
	addq	%r15, %rbx
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edx
	callq	_sprintf
	movq	_AMDGPU_SDMA_IRQ_INSTANCE1@GOTPCREL(%rip), %rax
	testq	%r12, %r12
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_AMDGPU_SDMA_IRQ_INSTANCE0@GOTPCREL(%rip), %rax
LBB0_14:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	(%rax), %r8d
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	$1024, %edx                     ## imm = 0x400
	movq	%r14, %rcx
	callq	_amdgpu_ring_init
	testl	%eax, %eax
	jne	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_9 Depth=1
	incq	%r12
	movslq	(%r13), %rax
	addq	$24, %r15
	xorl	%ebx, %ebx
	cmpq	%rax, %r12
	jl	LBB0_9
	jmp	LBB0_16
LBB0_5:
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_15:
	movl	%eax, %ebx
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_IRQ_CLIENTID_LEGACY,4,2 ## @AMDGPU_IRQ_CLIENTID_LEGACY
	.comm	_VISLANDS30_IV_SRCID_SDMA_TRAP,4,2 ## @VISLANDS30_IV_SRCID_SDMA_TRAP
	.comm	_VISLANDS30_IV_SRCID_SDMA_SRBM_WRITE,4,2 ## @VISLANDS30_IV_SRCID_SDMA_SRBM_WRITE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to load sdma firmware!\n"

L_.str.1:                               ## @.str.1
	.asciz	"sdma%d"

	.comm	_AMDGPU_SDMA_IRQ_INSTANCE0,4,2  ## @AMDGPU_SDMA_IRQ_INSTANCE0
	.comm	_AMDGPU_SDMA_IRQ_INSTANCE1,4,2  ## @AMDGPU_SDMA_IRQ_INSTANCE1
	.no_dead_strip	_sdma_v3_0_sw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdma_v3_0_sw_init
_sdma_v3_0_sw_init:                     ; @sdma_v3_0_sw_init
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x22, _AMDGPU_IRQ_CLIENTID_LEGACY@GOTPAGE
Lloh1:
	ldr	x22, [x22, _AMDGPU_IRQ_CLIENTID_LEGACY@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x8, _VISLANDS30_IV_SRCID_SDMA_TRAP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VISLANDS30_IV_SRCID_SDMA_TRAP@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	add	x20, x0, #4
	mov	x3, x20
	bl	_amdgpu_irq_add_id
	mov	x23, x0
	cbnz	w0, LBB0_5
; %bb.1:
	ldr	w1, [x22]
	add	x21, x19, #16
	mov	x0, x19
	mov	w2, #241
	mov	x3, x21
	bl	_amdgpu_irq_add_id
	mov	x23, x0
	cbnz	w0, LBB0_5
; %bb.2:
	ldr	w1, [x22]
Lloh5:
	adrp	x8, _VISLANDS30_IV_SRCID_SDMA_SRBM_WRITE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VISLANDS30_IV_SRCID_SDMA_SRBM_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x21
	bl	_amdgpu_irq_add_id
	mov	x23, x0
	cbnz	w0, LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_sdma_v3_0_init_microcode
	cbz	w0, LBB0_6
; %bb.4:
	mov	x23, x0
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_5:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.7:
	mov	x24, #0
	mov	x21, #0
	mov	w25, #1
Lloh10:
	adrp	x26, _AMDGPU_SDMA_IRQ_INSTANCE0@GOTPAGE
Lloh11:
	ldr	x26, [x26, _AMDGPU_SDMA_IRQ_INSTANCE0@GOTPAGEOFF]
Lloh12:
	adrp	x27, _AMDGPU_SDMA_IRQ_INSTANCE1@GOTPAGE
Lloh13:
	ldr	x27, [x27, _AMDGPU_SDMA_IRQ_INSTANCE1@GOTPAGEOFF]
Lloh14:
	adrp	x22, l_.str.1@PAGE
Lloh15:
	add	x22, x22, l_.str.1@PAGEOFF
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x28, [x19, #8]
	add	x23, x28, x24
	str	xzr, [x23, #16]
	mov	x0, x19
	bl	_amdgpu_sriov_vf
	cbz	w0, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	str	w25, [x23, #4]
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	str	w25, [x23]
	ldr	x8, [x19, #24]
	ldr	w8, [x8, x21, lsl #2]
	str	w8, [x23, #12]
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x8, x28, x24
	ldr	w0, [x8, #8]
	mov	x1, x22
	mov	x2, x21
	bl	_sprintf
	cmp	x21, #0
	csel	x8, x26, x27, eq
	ldr	w4, [x8]
	mov	x0, x19
	mov	x1, x23
	mov	w2, #1024
	mov	x3, x20
	bl	_amdgpu_ring_init
	mov	x23, x0
	cbnz	w0, LBB0_5
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x19]
	add	x24, x24, #24
	cmp	x21, x8
	b.lt	LBB0_8
	b	LBB0_5
LBB0_13:
	mov	w23, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_IRQ_CLIENTID_LEGACY,4,2 ; @AMDGPU_IRQ_CLIENTID_LEGACY
	.comm	_VISLANDS30_IV_SRCID_SDMA_TRAP,4,2 ; @VISLANDS30_IV_SRCID_SDMA_TRAP
	.comm	_VISLANDS30_IV_SRCID_SDMA_SRBM_WRITE,4,2 ; @VISLANDS30_IV_SRCID_SDMA_SRBM_WRITE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to load sdma firmware!\n"

l_.str.1:                               ; @.str.1
	.asciz	"sdma%d"

	.comm	_AMDGPU_SDMA_IRQ_INSTANCE0,4,2  ; @AMDGPU_SDMA_IRQ_INSTANCE0
	.comm	_AMDGPU_SDMA_IRQ_INSTANCE1,4,2  ; @AMDGPU_SDMA_IRQ_INSTANCE1
	.no_dead_strip	_sdma_v3_0_sw_init
.subsections_via_symbols
