	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cik_sdma_sw_init
_cik_sdma_sw_init:                      ## @cik_sdma_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, %r12
	callq	_cik_sdma_init_microcode
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_13
LBB0_2:
	movq	_AMDGPU_IRQ_CLIENTID_LEGACY@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	4(%r12), %r14
	movq	%r12, %rdi
	movl	$224, %edx
	movq	%r14, %rcx
	callq	_amdgpu_irq_add_id
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.3:
	movl	(%r13), %esi
	leaq	16(%r12), %r15
	movq	%r12, %rdi
	movl	$241, %edx
	movq	%r15, %rcx
	callq	_amdgpu_irq_add_id
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.4:
	movl	(%r13), %esi
	movq	%r12, %rdi
	movl	$247, %edx
	movq	%r15, %rcx
	callq	_amdgpu_irq_add_id
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_5
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	cmpl	$0, (%r12)
	jle	LBB0_6
## %bb.7:
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	leaq	(%rax,%r15), %rbx
	movq	$0, 8(%rax,%r15)
	movl	(%rax,%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edx
	callq	_sprintf
	movq	_AMDGPU_SDMA_IRQ_INSTANCE1@GOTPCREL(%rip), %rax
	testq	%r13, %r13
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_AMDGPU_SDMA_IRQ_INSTANCE0@GOTPCREL(%rip), %rax
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	(%rax), %r8d
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	$1024, %edx                     ## imm = 0x400
	movq	%r14, %rcx
	callq	_amdgpu_ring_init
	testl	%eax, %eax
	jne	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_9 Depth=1
	incq	%r13
	movslq	(%r12), %rax
	addq	$16, %r15
	xorl	%ebx, %ebx
	cmpq	%rax, %r13
	jl	LBB0_9
	jmp	LBB0_13
LBB0_6:
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_12:
	movl	%eax, %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to load sdma firmware!\n"

	.comm	_AMDGPU_IRQ_CLIENTID_LEGACY,4,2 ## @AMDGPU_IRQ_CLIENTID_LEGACY
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	_cik_sdma_sw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cik_sdma_sw_init
_cik_sdma_sw_init:                      ; @cik_sdma_sw_init
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	bl	_cik_sdma_init_microcode
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_5
LBB0_2:
Lloh2:
	adrp	x23, _AMDGPU_IRQ_CLIENTID_LEGACY@GOTPAGE
Lloh3:
	ldr	x23, [x23, _AMDGPU_IRQ_CLIENTID_LEGACY@GOTPAGEOFF]
	ldr	w1, [x23]
	add	x20, x19, #4
	mov	x0, x19
	mov	w2, #224
	mov	x3, x20
	bl	_amdgpu_irq_add_id
	mov	x22, x0
	cbnz	w0, LBB0_5
; %bb.3:
	ldr	w1, [x23]
	add	x21, x19, #16
	mov	x0, x19
	mov	w2, #241
	mov	x3, x21
	bl	_amdgpu_irq_add_id
	mov	x22, x0
	cbnz	w0, LBB0_5
; %bb.4:
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #247
	mov	x3, x21
	bl	_amdgpu_irq_add_id
	mov	x22, x0
	cbz	w0, LBB0_6
LBB0_5:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.7:
	mov	x24, #0
	mov	x21, #0
Lloh4:
	adrp	x25, _AMDGPU_SDMA_IRQ_INSTANCE0@GOTPAGE
Lloh5:
	ldr	x25, [x25, _AMDGPU_SDMA_IRQ_INSTANCE0@GOTPAGEOFF]
Lloh6:
	adrp	x26, _AMDGPU_SDMA_IRQ_INSTANCE1@GOTPAGE
Lloh7:
	ldr	x26, [x26, _AMDGPU_SDMA_IRQ_INSTANCE1@GOTPAGEOFF]
Lloh8:
	adrp	x23, l_.str.1@PAGE
Lloh9:
	add	x23, x23, l_.str.1@PAGEOFF
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x22, x8, x24
	str	xzr, [x22, #8]
	ldr	w0, [x22]
	mov	x1, x23
	mov	x2, x21
	bl	_sprintf
	cmp	x21, #0
	csel	x8, x25, x26, eq
	ldr	w4, [x8]
	mov	x0, x19
	mov	x1, x22
	mov	w2, #1024
	mov	x3, x20
	bl	_amdgpu_ring_init
	mov	x22, x0
	cbnz	w0, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x19]
	add	x24, x24, #16
	cmp	x21, x8
	b.lt	LBB0_8
	b	LBB0_5
LBB0_10:
	mov	w22, #0
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to load sdma firmware!\n"

	.comm	_AMDGPU_IRQ_CLIENTID_LEGACY,4,2 ; @AMDGPU_IRQ_CLIENTID_LEGACY
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	_cik_sdma_sw_init
.subsections_via_symbols
