	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_v5_0_sw_init
_sdma_v5_0_sw_init:                     ## @sdma_v5_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_SOC15_IH_CLIENTID_SDMA0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SDMA0_5_0__SRCID__SDMA_TRAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	4(%rdi), %rbx
	movq	%rbx, %rcx
	callq	_amdgpu_irq_add_id
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.1:
	movq	_SOC15_IH_CLIENTID_SDMA1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SDMA1_5_0__SRCID__SDMA_TRAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%rbx, %rcx
	callq	_amdgpu_irq_add_id
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.2:
	movq	%r14, %rdi
	callq	_sdma_v5_0_init_microcode
	testl	%eax, %eax
	je	LBB0_3
## %bb.6:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_12:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	cmpl	$0, (%r14)
	jle	LBB0_4
## %bb.5:
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %r12
	leaq	(%r12,%r13), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	$0, 16(%r12,%r13)
	movl	$1, (%r12,%r13)
	leaq	L_.str.1(%rip), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_DRM_INFO
	xorl	%eax, %eax
	movq	_AMDGPU_SDMA_IRQ_INSTANCE1@GOTPCREL(%rip), %rbx
	testq	%r15, %r15
	setne	%cl
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	_AMDGPU_SDMA_IRQ_INSTANCE0@GOTPCREL(%rip), %rbx
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	16(%r14), %rdx
	movb	%cl, %al
	movl	(%rdx,%rax,4), %eax
	addl	%eax, %eax
	movl	%eax, 4(%r12,%r13)
	movl	8(%r12,%r13), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%r15d, %edx
	callq	_sprintf
	movl	(%rbx), %r8d
	movq	%r14, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	$1024, %edx                     ## imm = 0x400
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_amdgpu_ring_init
	testl	%eax, %eax
	jne	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=1
	incq	%r15
	movslq	(%r14), %rax
	addq	$24, %r13
	xorl	%r12d, %r12d
	cmpq	%rax, %r15
	jl	LBB0_8
	jmp	LBB0_12
LBB0_4:
	xorl	%r12d, %r12d
	jmp	LBB0_12
LBB0_11:
	movl	%eax, %r12d
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_SOC15_IH_CLIENTID_SDMA0,4,2    ## @SOC15_IH_CLIENTID_SDMA0
	.comm	_SDMA0_5_0__SRCID__SDMA_TRAP,4,2 ## @SDMA0_5_0__SRCID__SDMA_TRAP
	.comm	_SOC15_IH_CLIENTID_SDMA1,4,2    ## @SOC15_IH_CLIENTID_SDMA1
	.comm	_SDMA1_5_0__SRCID__SDMA_TRAP,4,2 ## @SDMA1_5_0__SRCID__SDMA_TRAP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to load sdma firmware!\n"

L_.str.1:                               ## @.str.1
	.asciz	"use_doorbell being set to: [%s]\n"

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

L_.str.4:                               ## @.str.4
	.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_v5_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_v5_0_sw_init
_sdma_v5_0_sw_init:                     ; @sdma_v5_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	x8, _SOC15_IH_CLIENTID_SDMA0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SOC15_IH_CLIENTID_SDMA0@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _SDMA0_5_0__SRCID__SDMA_TRAP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SDMA0_5_0__SRCID__SDMA_TRAP@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x20, x0, #4
	mov	x3, x20
	bl	_amdgpu_irq_add_id
	mov	x25, x0
	cbnz	w0, LBB0_4
; %bb.1:
Lloh6:
	adrp	x8, _SOC15_IH_CLIENTID_SDMA1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SOC15_IH_CLIENTID_SDMA1@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _SDMA1_5_0__SRCID__SDMA_TRAP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SDMA1_5_0__SRCID__SDMA_TRAP@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x20
	bl	_amdgpu_irq_add_id
	mov	x25, x0
	cbnz	w0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_sdma_v5_0_init_microcode
	cbz	w0, LBB0_5
; %bb.3:
	mov	x25, x0
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_4:
	mov	x0, x25
	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_5:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.6:
	mov	x26, #0
	mov	x21, #0
Lloh14:
	adrp	x23, l_.str.2@PAGE
Lloh15:
	add	x23, x23, l_.str.2@PAGEOFF
Lloh16:
	adrp	x28, _AMDGPU_SDMA_IRQ_INSTANCE0@GOTPAGE
Lloh17:
	ldr	x28, [x28, _AMDGPU_SDMA_IRQ_INSTANCE0@GOTPAGEOFF]
Lloh18:
	adrp	x27, _AMDGPU_SDMA_IRQ_INSTANCE1@GOTPAGE
Lloh19:
	ldr	x27, [x27, _AMDGPU_SDMA_IRQ_INSTANCE1@GOTPAGEOFF]
Lloh20:
	adrp	x24, l_.str.4@PAGE
Lloh21:
	add	x24, x24, l_.str.4@PAGEOFF
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x25, x8, x26
	str	xzr, [x25, #16]
	mov	w8, #1
	str	w8, [x25]
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x23
	bl	_DRM_INFO
	cmp	x21, #0
	cset	w8, ne
	ldr	x9, [x19, #16]
	ldr	w8, [x9, w8, uxtw #2]
	lsl	w8, w8, #1
	str	w8, [x25, #4]
	ldr	w0, [x25, #8]
	csel	x22, x28, x27, eq
	mov	x1, x24
	mov	x2, x21
	bl	_sprintf
	ldr	w4, [x22]
	mov	x0, x19
	mov	x1, x25
	mov	w2, #1024
	mov	x3, x20
	bl	_amdgpu_ring_init
	mov	x25, x0
	cbnz	w0, LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x19]
	add	x26, x26, #24
	cmp	x21, x8
	b.lt	LBB0_7
	b	LBB0_4
LBB0_9:
	mov	w25, #0
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_SOC15_IH_CLIENTID_SDMA0,4,2    ; @SOC15_IH_CLIENTID_SDMA0
	.comm	_SDMA0_5_0__SRCID__SDMA_TRAP,4,2 ; @SDMA0_5_0__SRCID__SDMA_TRAP
	.comm	_SOC15_IH_CLIENTID_SDMA1,4,2    ; @SOC15_IH_CLIENTID_SDMA1
	.comm	_SDMA1_5_0__SRCID__SDMA_TRAP,4,2 ; @SDMA1_5_0__SRCID__SDMA_TRAP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to load sdma firmware!\n"

l_.str.1:                               ; @.str.1
	.asciz	"use_doorbell being set to: [%s]\n"

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

l_.str.4:                               ; @.str.4
	.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_v5_0_sw_init
.subsections_via_symbols
