	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_v4_0_load_microcode
_sdma_v4_0_load_microcode:              ## @sdma_v4_0_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	_sdma_v4_0_enable
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rbx)
	jle	LBB0_9
## %bb.1:
	xorl	%r15d, %r15d
	movq	_mmSDMA0_UCODE_DATA@GOTPCREL(%rip), %r14
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_mmSDMA0_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	8(%r12), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax,%rcx), %edx
	movl	%r15d, %edi
	callq	_WREG32_SDMA
	incq	%r15
	movslq	(%r12), %rax
	cmpq	%rax, %r15
	jge	LBB0_8
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	8(%r12), %rax
	movq	%r15, %rcx
	shlq	$4, %rcx
	movq	8(%rax,%rcx), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rax), %rbx
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	callq	_amdgpu_ucode_print_sdma_hdr
	movl	4(%rbx), %edi
	callq	_le32_to_cpu
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leal	3(%rax), %r13d
	testl	%eax, %eax
	cmovnsl	%eax, %r13d
	movq	8(%r12), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rax,%rcx), %rax
	movq	(%rax), %rbx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_le32_to_cpu
	movl	%eax, %r12d
	movq	_mmSDMA0_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_WREG32_SDMA
	cmpl	$4, -72(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	sarl	$2, %r13d
	addl	%r12d, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r14), %r12d
	movl	%ebx, %edi
	callq	_le32_to_cpup
	movl	%r15d, %edi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_WREG32_SDMA
	addl	$4, %ebx
	decl	%r13d
	jne	LBB0_6
	jmp	LBB0_7
LBB0_8:
	xorl	%r14d, %r14d
	jmp	LBB0_9
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_9:
	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,4,2         ## @mmSDMA0_UCODE_ADDR
	.comm	_mmSDMA0_UCODE_DATA,4,2         ## @mmSDMA0_UCODE_DATA
	.no_dead_strip	_sdma_v4_0_load_microcode
.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_load_microcode
_sdma_v4_0_load_microcode:              ; @sdma_v4_0_load_microcode
	.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
	mov	w1, #0
	bl	_sdma_v4_0_enable
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x20, #0
Lloh0:
	adrp	x23, _mmSDMA0_UCODE_ADDR@GOTPAGE
Lloh1:
	ldr	x23, [x23, _mmSDMA0_UCODE_ADDR@GOTPAGEOFF]
Lloh2:
	adrp	x24, _mmSDMA0_UCODE_DATA@GOTPAGE
Lloh3:
	ldr	x24, [x24, _mmSDMA0_UCODE_DATA@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x23]
	ldr	x8, [x19, #8]
	lsl	x9, x20, #4
	ldr	w2, [x8, x9]
	mov	x0, x20
	bl	_WREG32_SDMA
	add	x20, x20, #1
	ldrsw	x8, [x19]
	cmp	x20, x8
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	ldr	x8, [x19, #8]
	add	x8, x8, x20, lsl #4
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x21, [x8]
	mov	x0, x21
	bl	_amdgpu_ucode_print_sdma_hdr
	ldr	w0, [x21, #4]
	bl	_le32_to_cpu
	mov	x22, x0
	add	w8, w0, #3
	cmp	w0, #0
	csel	w25, w8, w0, lt
	ldr	x8, [x19, #8]
	add	x8, x8, x20, lsl #4
	ldr	x8, [x8, #8]
	ldr	x26, [x8]
	ldr	w0, [x21]
	bl	_le32_to_cpu
	mov	x21, x0
	ldr	w1, [x23]
	mov	x0, x20
	mov	w2, #0
	bl	_WREG32_SDMA
	cmp	w22, #4
	b.lt	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	asr	w25, w25, #2
	add	w21, w26, w21
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w22, [x24]
	mov	x0, x21
	bl	_le32_to_cpup
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	bl	_WREG32_SDMA
	add	w21, w21, #4
	subs	w25, w25, #1
	b.ne	LBB0_6
	b	LBB0_2
LBB0_7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_mmSDMA0_UCODE_ADDR,4,2         ; @mmSDMA0_UCODE_ADDR
	.comm	_mmSDMA0_UCODE_DATA,4,2         ; @mmSDMA0_UCODE_DATA
	.no_dead_strip	_sdma_v4_0_load_microcode
.subsections_via_symbols
