	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_v4_0_sw_init
_sdma_v4_0_sw_init:                     ## @sdma_v4_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
	cmpl	$0, (%rdi)
	jle	LBB0_16
## %bb.1:
	movq	%rdi, %r13
	leaq	4(%rdi), %r14
	xorl	%ebx, %ebx
	movq	_SDMA0_4_0__SRCID__SDMA_TRAP@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_sdma_v4_0_seq_to_irq_id
	movl	(%r15), %edx
	movq	%r13, %rdi
	movl	%eax, %esi
	movq	%r14, %rcx
	callq	_amdgpu_irq_add_id
	testl	%eax, %eax
	jne	LBB0_17
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	movl	(%r13), %eax
	cmpl	%eax, %ebx
	jl	LBB0_2
## %bb.4:
	testl	%eax, %eax
	jle	LBB0_16
## %bb.5:
	leaq	24(%r13), %r15
	xorl	%ebx, %ebx
	movq	_SDMA0_4_0__SRCID__SDMA_SRAM_ECC@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_sdma_v4_0_seq_to_irq_id
	movl	(%r12), %edx
	movq	%r13, %rdi
	movl	%eax, %esi
	movq	%r15, %rcx
	callq	_amdgpu_irq_add_id
	testl	%eax, %eax
	jne	LBB0_17
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	incl	%ebx
	movl	(%r13), %eax
	cmpl	%eax, %ebx
	jl	LBB0_6
## %bb.8:
	testl	%eax, %eax
	jle	LBB0_16
## %bb.9:
	movl	$24, %r12d
	xorl	%r15d, %r15d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%r15
	movslq	(%r13), %rcx
	addq	$48, %r12
	xorl	%eax, %eax
	cmpq	%rcx, %r15
	jge	LBB0_17
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rbx
	leaq	(%rbx,%r12), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	$0, 16(%rbx,%r12)
	movl	$1, (%rbx,%r12)
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_DRM_INFO
	movq	32(%r13), %rax
	movl	(%rax,%r15,4), %eax
	addl	%eax, %eax
	movl	%eax, 4(%rbx,%r12)
	movl	8(%rbx,%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%r15d, %edx
	callq	_sprintf
	movq	_AMDGPU_SDMA_IRQ_INSTANCE0@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	addq	%r15, %r8
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	$1024, %edx                     ## imm = 0x400
	movq	%r14, %rcx
	callq	_amdgpu_ring_init
	testl	%eax, %eax
	jne	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpq	$0, 16(%r13)
	je	LBB0_10
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	8(%r13), %rax
	leaq	(%rax,%r12), %rbx
	addq	$-24, %rbx
	movq	$0, -8(%rax,%r12)
	movl	$1, -24(%rax,%r12)
	movq	32(%r13), %rcx
	movl	(%rcx,%r15,4), %ecx
	leal	1024(%rcx,%rcx), %ecx
	movl	%ecx, -20(%rax,%r12)
	movl	-16(%rax,%r12), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%r15d, %edx
	callq	_sprintf
	movq	_AMDGPU_SDMA_IRQ_INSTANCE0@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	addq	%r15, %r8
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	$1024, %edx                     ## imm = 0x400
	movq	%r14, %rcx
	callq	_amdgpu_ring_init
	testl	%eax, %eax
	je	LBB0_10
	jmp	LBB0_17
LBB0_16:
	xorl	%eax, %eax
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDMA0_4_0__SRCID__SDMA_TRAP,4,2 ## @SDMA0_4_0__SRCID__SDMA_TRAP
	.comm	_SDMA0_4_0__SRCID__SDMA_SRAM_ECC,4,2 ## @SDMA0_4_0__SRCID__SDMA_SRAM_ECC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"use_doorbell being set to: [%s]\n"

L_.str.1:                               ## @.str.1
	.asciz	"true"

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

	.comm	_AMDGPU_SDMA_IRQ_INSTANCE0,8,3  ## @AMDGPU_SDMA_IRQ_INSTANCE0
L_.str.4:                               ## @.str.4
	.asciz	"page%d"

	.no_dead_strip	_sdma_v4_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_v4_0_sw_init
_sdma_v4_0_sw_init:                     ; @sdma_v4_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
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x19, x0
	mov	w21, #0
	add	x20, x0, #4
Lloh0:
	adrp	x22, _SDMA0_4_0__SRCID__SDMA_TRAP@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SDMA0_4_0__SRCID__SDMA_TRAP@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_sdma_v4_0_seq_to_irq_id
	mov	x1, x0
	ldr	w2, [x22]
	mov	x0, x19
	mov	x3, x20
	bl	_amdgpu_irq_add_id
	cbnz	w0, LBB0_15
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w21, w21, #1
	ldr	w8, [x19]
	cmp	w21, w8
	b.lt	LBB0_2
; %bb.4:
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.5:
	mov	w21, #0
	add	x22, x19, #24
Lloh2:
	adrp	x23, _SDMA0_4_0__SRCID__SDMA_SRAM_ECC@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SDMA0_4_0__SRCID__SDMA_SRAM_ECC@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_sdma_v4_0_seq_to_irq_id
	mov	x1, x0
	ldr	w2, [x23]
	mov	x0, x19
	mov	x3, x22
	bl	_amdgpu_irq_add_id
	cbnz	w0, LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w21, w21, #1
	ldr	w8, [x19]
	cmp	w21, w8
	b.lt	LBB0_6
; %bb.8:
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.9:
	mov	x21, #0
	mov	w27, #24
	mov	w28, #1
Lloh4:
	adrp	x22, l_.str@PAGE
Lloh5:
	add	x22, x22, l_.str@PAGEOFF
Lloh6:
	adrp	x23, l_.str.1@PAGE
Lloh7:
	add	x23, x23, l_.str.1@PAGEOFF
Lloh8:
	adrp	x24, l_.str.3@PAGE
Lloh9:
	add	x24, x24, l_.str.3@PAGEOFF
Lloh10:
	adrp	x25, _AMDGPU_SDMA_IRQ_INSTANCE0@GOTPAGE
Lloh11:
	ldr	x25, [x25, _AMDGPU_SDMA_IRQ_INSTANCE0@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	w0, #0
	add	x21, x21, #1
	ldrsw	x8, [x19]
	add	x27, x27, #48
	cmp	x21, x8
	b.ge	LBB0_15
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x26, x8, x27
	str	xzr, [x26, #16]
	str	w28, [x26]
	mov	x0, x22
	mov	x1, x23
	bl	_DRM_INFO
	ldr	x8, [x19, #32]
	ldr	w8, [x8, x21, lsl #2]
	lsl	w8, w8, #1
	str	w8, [x26, #4]
	ldr	w0, [x26, #8]
	mov	x1, x24
	mov	x2, x21
	bl	_sprintf
	ldr	x8, [x25]
	add	x4, x21, x8
	mov	x0, x19
	mov	x1, x26
	mov	w2, #1024
	mov	x3, x20
	bl	_amdgpu_ring_init
	cbnz	w0, LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x19, #8]
	add	x26, x8, x27
	str	w28, [x26, #-24]!
	str	xzr, [x26, #16]
	ldr	x8, [x19, #32]
	ldr	w8, [x8, x21, lsl #2]
	lsl	w8, w8, #1
	add	w8, w8, #1024
	str	w8, [x26, #4]
	ldr	w0, [x26, #8]
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x21
	bl	_sprintf
	ldr	x8, [x25]
	add	x4, x21, x8
	mov	x0, x19
	mov	x1, x26
	mov	w2, #1024
	mov	x3, x20
	bl	_amdgpu_ring_init
	cbz	w0, LBB0_10
	b	LBB0_15
LBB0_14:
	mov	w0, #0
LBB0_15:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SDMA0_4_0__SRCID__SDMA_TRAP,4,2 ; @SDMA0_4_0__SRCID__SDMA_TRAP
	.comm	_SDMA0_4_0__SRCID__SDMA_SRAM_ECC,4,2 ; @SDMA0_4_0__SRCID__SDMA_SRAM_ECC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"use_doorbell being set to: [%s]\n"

l_.str.1:                               ; @.str.1
	.asciz	"true"

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

	.comm	_AMDGPU_SDMA_IRQ_INSTANCE0,8,3  ; @AMDGPU_SDMA_IRQ_INSTANCE0
l_.str.4:                               ; @.str.4
	.asciz	"page%d"

	.no_dead_strip	_sdma_v4_0_sw_init
.subsections_via_symbols
