	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rdi)
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	xorl	%esi, %esi
	callq	_cik_sdma_enable
	cmpq	$0, 8(%rbx)
	movq	(%rbx), %rax
	movq	(%rax), %r15
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_9
## %bb.3:
	movq	%r15, %rdi
	callq	_radeon_ucode_print_sdma_hdr
	movq	(%rbx), %rax
	movq	(%rax), %r12
	movl	4(%r15), %edi
	callq	_le32_to_cpu
	movl	%eax, %r13d
	movl	(%r15), %edi
	callq	_le32_to_cpu
	movl	%eax, %ebx
	leal	3(%rbx), %r14d
	testl	%eax, %eax
	cmovnsl	%eax, %r14d
	movq	_SDMA0_UCODE_ADDR@GOTPCREL(%rip), %rax
	movq	_SDMA0_REGISTER_OFFSET@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	addq	(%rax), %rdi
	xorl	%esi, %esi
	callq	_WREG32
	cmpl	$4, %ebx
	jl	LBB0_6
## %bb.4:
	sarl	$2, %r14d
	addl	%r13d, %r12d
	movq	_SDMA0_UCODE_DATA@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_SDMA0_REGISTER_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	addq	(%r13), %rbx
	movl	%r12d, %edi
	callq	_le32_to_cpup
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_WREG32
	addl	$4, %r12d
	decl	%r14d
	jne	LBB0_5
LBB0_6:
	movq	_SDMA0_UCODE_DATA@GOTPCREL(%rip), %rcx
	movq	_SDMA0_REGISTER_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%rcx), %rdi
	movq	_CIK_SDMA_UCODE_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WREG32
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax), %r12
	movl	4(%r15), %edi
	callq	_le32_to_cpu
	movl	%eax, %ebx
	movl	(%r15), %edi
	callq	_le32_to_cpu
	movl	%eax, %r15d
	leal	3(%r15), %r14d
	testl	%eax, %eax
	cmovnsl	%eax, %r14d
	movq	_SDMA1_REGISTER_OFFSET@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	movq	_SDMA0_UCODE_ADDR@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	xorl	%esi, %esi
	callq	_WREG32
	cmpl	$4, %r15d
	movq	_SDMA0_UCODE_DATA@GOTPCREL(%rip), %r15
	jl	LBB0_13
## %bb.7:
	sarl	$2, %r14d
	addl	%ebx, %r12d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rbx
	addq	(%r15), %rbx
	movl	%r12d, %edi
	callq	_le32_to_cpup
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_WREG32
	addl	$4, %r12d
	decl	%r14d
	jne	LBB0_8
	jmp	LBB0_13
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_9:
	movq	_SDMA0_UCODE_ADDR@GOTPCREL(%rip), %rax
	movq	_SDMA0_REGISTER_OFFSET@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	(%rax), %rdi
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	callq	_WREG32
	movq	_CIK_SDMA_UCODE_SIZE@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_11
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %r14
	movq	%rbx, %r12
	movq	(%rbx), %rbx
	movq	_SDMA0_UCODE_DATA@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	movl	%r15d, %edi
	callq	_be32_to_cpup
	movq	%rbx, %rdi
	movq	%r12, %rbx
	movq	%r14, %r12
	movl	%eax, %esi
	callq	_WREG32
	incl	%r13d
	addl	$4, %r15d
	cmpl	(%r14), %r13d
	jl	LBB0_10
LBB0_11:
	movq	_SDMA0_UCODE_DATA@GOTPCREL(%rip), %rax
	movq	(%rbx), %rdi
	addq	(%rax), %rdi
	movq	_CIK_SDMA_UCODE_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WREG32
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax), %r14
	movq	_SDMA1_REGISTER_OFFSET@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	movq	_SDMA0_UCODE_ADDR@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_WREG32
	cmpl	$0, (%r12)
	jle	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rbx
	movq	_SDMA0_UCODE_DATA@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	movl	%r14d, %edi
	callq	_be32_to_cpup
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_WREG32
	incl	%r15d
	addl	$4, %r14d
	cmpl	(%r12), %r15d
	jl	LBB0_12
LBB0_13:
	movq	_SDMA0_UCODE_DATA@GOTPCREL(%rip), %rax
	movq	_SDMA1_REGISTER_OFFSET@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	(%rax), %rdi
	movq	_CIK_SDMA_UCODE_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WREG32
	movq	_SDMA0_UCODE_ADDR@GOTPCREL(%rip), %r15
	movq	_SDMA0_REGISTER_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r15), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_WREG32
	movq	(%r14), %rdi
	addq	(%r15), %rdi
	xorl	%esi, %esi
	callq	_WREG32
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SDMA0_UCODE_ADDR,8,3           ## @SDMA0_UCODE_ADDR
	.comm	_SDMA0_REGISTER_OFFSET,8,3      ## @SDMA0_REGISTER_OFFSET
	.comm	_SDMA0_UCODE_DATA,8,3           ## @SDMA0_UCODE_DATA
	.comm	_CIK_SDMA_UCODE_VERSION,4,2     ## @CIK_SDMA_UCODE_VERSION
	.comm	_SDMA1_REGISTER_OFFSET,8,3      ## @SDMA1_REGISTER_OFFSET
	.comm	_CIK_SDMA_UCODE_SIZE,4,2        ## @CIK_SDMA_UCODE_SIZE
	.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
	ldr	x8, [x0]
	cbz	x8, LBB0_8
; %bb.1:
	mov	x19, x0
	mov	w1, #0
	bl	_cik_sdma_enable
	ldp	x9, x8, [x19]
	ldr	x20, [x9]
Lloh0:
	adrp	x27, _SDMA0_UCODE_DATA@GOTPAGE
Lloh1:
	ldr	x27, [x27, _SDMA0_UCODE_DATA@GOTPAGEOFF]
Lloh2:
	adrp	x23, _SDMA1_REGISTER_OFFSET@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SDMA1_REGISTER_OFFSET@GOTPAGEOFF]
Lloh4:
	adrp	x28, _CIK_SDMA_UCODE_VERSION@GOTPAGE
Lloh5:
	ldr	x28, [x28, _CIK_SDMA_UCODE_VERSION@GOTPAGEOFF]
Lloh6:
	adrp	x24, _SDMA0_UCODE_ADDR@GOTPAGE
Lloh7:
	ldr	x24, [x24, _SDMA0_UCODE_ADDR@GOTPAGEOFF]
Lloh8:
	adrp	x25, _SDMA0_REGISTER_OFFSET@GOTPAGE
Lloh9:
	ldr	x25, [x25, _SDMA0_REGISTER_OFFSET@GOTPAGEOFF]
	cbz	x8, LBB0_9
; %bb.2:
	mov	x0, x20
	bl	_radeon_ucode_print_sdma_hdr
	ldr	x8, [x19]
	ldr	x28, [x8]
	ldr	w0, [x20, #4]
	bl	_le32_to_cpu
	mov	x21, x0
	ldr	w0, [x20]
	bl	_le32_to_cpu
	mov	x22, x0
	add	w8, w0, #3
	cmp	w0, #0
	csel	w26, w8, w0, lt
	ldr	x8, [x24]
	ldr	x9, [x25]
	add	x0, x9, x8
	mov	w1, #0
	bl	_WREG32
	cmp	w22, #4
	b.lt	LBB0_5
; %bb.3:
	asr	w26, w26, #2
	add	w21, w28, w21
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x27]
	ldr	x9, [x25]
	add	x22, x9, x8
	mov	x0, x21
	bl	_le32_to_cpup
	mov	x1, x0
	mov	x0, x22
	bl	_WREG32
	add	w21, w21, #4
	subs	w26, w26, #1
	b.ne	LBB0_4
LBB0_5:
	ldr	x8, [x27]
	ldr	x9, [x25]
	add	x0, x9, x8
Lloh10:
	adrp	x28, _CIK_SDMA_UCODE_VERSION@GOTPAGE
Lloh11:
	ldr	x28, [x28, _CIK_SDMA_UCODE_VERSION@GOTPAGEOFF]
	ldr	w1, [x28]
	bl	_WREG32
	ldr	x8, [x19]
	ldr	x21, [x8]
	ldr	w0, [x20, #4]
	bl	_le32_to_cpu
	mov	x19, x0
	ldr	w0, [x20]
	bl	_le32_to_cpu
	mov	x20, x0
	add	w8, w0, #3
	cmp	w0, #0
	csel	w22, w8, w0, lt
	ldr	x8, [x24]
	ldr	x9, [x23]
	add	x0, x9, x8
	mov	w1, #0
	bl	_WREG32
	cmp	w20, #4
	b.lt	LBB0_15
; %bb.6:
	asr	w22, w22, #2
	add	w19, w21, w19
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x27]
	ldr	x9, [x23]
	add	x20, x9, x8
	mov	x0, x19
	bl	_le32_to_cpup
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
	add	w19, w19, #4
	subs	w22, w22, #1
	b.ne	LBB0_7
	b	LBB0_15
LBB0_8:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
LBB0_9:
	ldr	x8, [x24]
	ldr	x9, [x25]
	add	x0, x9, x8
	mov	w1, #0
	bl	_WREG32
Lloh15:
	adrp	x22, _CIK_SDMA_UCODE_SIZE@GOTPAGE
Lloh16:
	ldr	x22, [x22, _CIK_SDMA_UCODE_SIZE@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.10:
	mov	w26, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x27]
	ldr	x9, [x25]
	add	x21, x9, x8
	mov	x0, x20
	bl	_be32_to_cpup
	mov	x1, x0
	mov	x0, x21
	bl	_WREG32
	add	w26, w26, #1
	ldr	w8, [x22]
	add	w20, w20, #4
	cmp	w26, w8
	b.lt	LBB0_11
LBB0_12:
	ldr	x8, [x27]
	ldr	x9, [x25]
	add	x0, x9, x8
	ldr	w1, [x28]
	bl	_WREG32
	ldr	x8, [x19]
	ldr	x19, [x8]
	ldr	x8, [x24]
	ldr	x9, [x23]
	add	x0, x9, x8
	mov	w1, #0
	bl	_WREG32
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.13:
	mov	w21, #0
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x27]
	ldr	x9, [x23]
	add	x20, x9, x8
	mov	x0, x19
	bl	_be32_to_cpup
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
	add	w21, w21, #1
	ldr	w8, [x22]
	add	w19, w19, #4
	cmp	w21, w8
	b.lt	LBB0_14
LBB0_15:
	ldr	x8, [x27]
	ldr	x9, [x23]
	add	x0, x9, x8
	ldr	w1, [x28]
	bl	_WREG32
	ldr	x8, [x24]
	ldr	x9, [x25]
	add	x0, x9, x8
	mov	w1, #0
	bl	_WREG32
	ldr	x8, [x24]
	ldr	x9, [x23]
	add	x0, x9, x8
	mov	w1, #0
	bl	_WREG32
	mov	w0, #0
LBB0_16:
	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	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SDMA0_UCODE_ADDR,8,3           ; @SDMA0_UCODE_ADDR
	.comm	_SDMA0_REGISTER_OFFSET,8,3      ; @SDMA0_REGISTER_OFFSET
	.comm	_SDMA0_UCODE_DATA,8,3           ; @SDMA0_UCODE_DATA
	.comm	_CIK_SDMA_UCODE_VERSION,4,2     ; @CIK_SDMA_UCODE_VERSION
	.comm	_SDMA1_REGISTER_OFFSET,8,3      ; @SDMA1_REGISTER_OFFSET
	.comm	_CIK_SDMA_UCODE_SIZE,4,2        ; @CIK_SDMA_UCODE_SIZE
	.no_dead_strip	_cik_sdma_load_microcode
.subsections_via_symbols
