	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cik_sdma_load_microcode
_cik_sdma_load_microcode:               ## @cik_sdma_load_microcode
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_cik_sdma_enable
	cmpl	$0, (%rbx)
	jle	LBB0_11
## %bb.1:
	xorl	%r14d, %r14d
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx), %rax
	movq	(%rax,%r14,8), %rdi
	movq	_mmSDMA0_UCODE_ADDR@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	8(%rbx), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax,%rcx,8), %esi
	callq	_WREG32
	incq	%r14
	movslq	(%rbx), %rax
	cmpq	%rax, %r14
	jge	LBB0_10
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	8(%rbx), %rax
	leaq	(%r14,%r14,2), %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	16(%rax,%rcx,8), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rax), %r12
	movq	%r12, %rdi
	callq	_amdgpu_ucode_print_sdma_hdr
	movl	8(%r12), %edi
	callq	_le32_to_cpu
                                        ## kill: def $eax killed $eax def $rax
	leal	3(%rax), %r15d
	testl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	cmovnsl	%eax, %r15d
	movl	4(%r12), %edi
	callq	_le32_to_cpu
	movq	8(%rbx), %rcx
	leaq	(,%r14,8), %rdx
	leaq	(%rdx,%rdx,2), %r13
	movl	%eax, (%rcx,%r13)
	movl	12(%r12), %edi
	callq	_le32_to_cpu
	movq	8(%rbx), %rcx
	movl	%eax, 4(%rcx,%r13)
	cmpl	$20, %eax
	jl	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$1, 8(%rcx,%rax,8)
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rcx,%rax,8), %rax
	movq	(%rax), %r13
	movl	(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_sdma_offsets@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%rax,%r14,8), %rdi
	movq	_mmSDMA0_UCODE_ADDR@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	xorl	%esi, %esi
	callq	_WREG32
	cmpl	$4, -72(%rbp)                   ## 4-byte Folded Reload
	movq	_mmSDMA0_UCODE_DATA@GOTPCREL(%rip), %r12
	jl	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	sarl	$2, %r15d
	addl	-52(%rbp), %r13d                ## 4-byte Folded Reload
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rbx), %rax
	movq	(%rax,%r14,8), %rbx
	addq	(%r12), %rbx
	movl	%r13d, %edi
	callq	_le32_to_cpup
	movq	%rbx, %rdi
	movq	_sdma_offsets@GOTPCREL(%rip), %rbx
	movl	%eax, %esi
	callq	_WREG32
	addl	$4, %r13d
	decl	%r15d
	jne	LBB0_8
	jmp	LBB0_9
LBB0_10:
	xorl	%r14d, %r14d
	jmp	LBB0_11
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_mmSDMA0_UCODE_ADDR,8,3         ## @mmSDMA0_UCODE_ADDR
	.comm	_sdma_offsets,8,3               ## @sdma_offsets
	.comm	_mmSDMA0_UCODE_DATA,8,3         ## @mmSDMA0_UCODE_DATA
	.no_dead_strip	_cik_sdma_load_microcode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cik_sdma_load_microcode
_cik_sdma_load_microcode:               ; @cik_sdma_load_microcode
	.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
	mov	w1, #0
	bl	_cik_sdma_enable
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x22, #0
	mov	w23, #24
Lloh0:
	adrp	x25, _mmSDMA0_UCODE_ADDR@GOTPAGE
Lloh1:
	ldr	x25, [x25, _mmSDMA0_UCODE_ADDR@GOTPAGEOFF]
Lloh2:
	adrp	x26, _sdma_offsets@GOTPAGE
Lloh3:
	ldr	x26, [x26, _sdma_offsets@GOTPAGEOFF]
Lloh4:
	adrp	x27, _mmSDMA0_UCODE_DATA@GOTPAGE
Lloh5:
	ldr	x27, [x27, _mmSDMA0_UCODE_DATA@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x26]
	ldr	x8, [x8, x22, lsl #3]
	ldr	x9, [x25]
	add	x0, x8, x9
	ldr	x8, [x19, #8]
	mul	x9, x22, x23
	ldr	w1, [x8, x9]
	bl	_WREG32
	add	x22, x22, #1
	ldrsw	x8, [x19]
	cmp	x22, x8
	b.ge	LBB0_9
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x8, [x19, #8]
	madd	x8, x22, x23, x8
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x21, [x8]
	mov	x0, x21
	bl	_amdgpu_ucode_print_sdma_hdr
	ldr	w0, [x21, #8]
	bl	_le32_to_cpu
	mov	x20, x0
	add	w8, w0, #3
	cmp	w0, #0
	csel	w28, w8, w0, lt
	ldr	w0, [x21, #4]
	bl	_le32_to_cpu
	ldr	x8, [x19, #8]
	add	x9, x22, x22, lsl #1
	lsl	x24, x9, #3
	str	w0, [x8, x24]
	ldr	w0, [x21, #12]
	bl	_le32_to_cpu
	ldr	x8, [x19, #8]
	add	x9, x8, x24
	str	w0, [x9, #4]
	cmp	w0, #20
	b.lt	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	madd	x9, x22, x23, x8
	mov	w10, #1
	str	w10, [x9, #8]
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	madd	x8, x22, x23, x8
	ldr	x8, [x8, #16]
	ldr	x24, [x8]
	ldr	w0, [x21]
	bl	_le32_to_cpu
	mov	x21, x0
	ldr	x8, [x25]
	ldr	x9, [x26]
	ldr	x9, [x9, x22, lsl #3]
	add	x0, x9, x8
	mov	w1, #0
	bl	_WREG32
	cmp	w20, #4
	b.lt	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	asr	w28, w28, #2
	add	w20, w24, w21
LBB0_8:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x27]
	ldr	x9, [x26]
	ldr	x9, [x9, x22, lsl #3]
	add	x21, x9, x8
	mov	x0, x20
	bl	_le32_to_cpup
	mov	x1, x0
	mov	x0, x21
	bl	_WREG32
	add	w20, w20, #4
	subs	w28, w28, #1
	b.ne	LBB0_8
	b	LBB0_2
LBB0_9:
	mov	w0, #0
	b	LBB0_11
LBB0_10:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_mmSDMA0_UCODE_ADDR,8,3         ; @mmSDMA0_UCODE_ADDR
	.comm	_sdma_offsets,8,3               ; @sdma_offsets
	.comm	_mmSDMA0_UCODE_DATA,8,3         ; @mmSDMA0_UCODE_DATA
	.no_dead_strip	_cik_sdma_load_microcode
.subsections_via_symbols
