	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r600_cp_load_microcode
_r600_cp_load_microcode:                ## @r600_cp_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, 8(%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rdi, %r12
	cmpq	$0, (%rdi)
	je	LBB0_2
## %bb.3:
	movq	%r12, %rdi
	callq	_r600_cp_stop
	movq	_CP_RB_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_RB_NO_UPDATE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	$15, %edi
	callq	_RB_BLKSZ
	movl	%eax, %ebx
	movl	$3, %edi
	callq	_RB_BUFSZ
	orl	%eax, %ebx
	orl	%r14d, %ebx
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_WREG32
	movq	_GRBM_SOFT_RESET@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_SOFT_RESET_CP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WREG32
	movl	(%rbx), %edi
	callq	_RREG32
	movl	$15, %edi
	callq	_mdelay
	movl	(%rbx), %edi
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	callq	_WREG32
	movq	_CP_ME_RAM_WADDR@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	xorl	%esi, %esi
	callq	_WREG32
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	8(%r12), %rax
	movq	(%rax), %rbx
	movl	(%r14), %edi
	xorl	%esi, %esi
	callq	_WREG32
	movq	_R600_PM4_UCODE_SIZE@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_6
## %bb.4:
	movq	_CP_ME_RAM_DATA@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %r15d
	movl	%ebx, %edi
	callq	_be32_to_cpup
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_WREG32
	incl	%r13d
	movl	(%r12), %eax
	leal	(%rax,%rax,2), %eax
	addl	$4, %ebx
	cmpl	%eax, %r13d
	jl	LBB0_5
LBB0_6:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax), %rbx
	movq	_CP_PFP_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	movq	_R600_PFP_UCODE_SIZE@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_9
## %bb.7:
	xorl	%r13d, %r13d
	movq	_CP_PFP_UCODE_DATA@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %r15d
	movl	%ebx, %edi
	callq	_be32_to_cpup
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_WREG32
	incl	%r13d
	addl	$4, %ebx
	cmpl	(%r12), %r13d
	jl	LBB0_8
LBB0_9:
	movq	_CP_PFP_UCODE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	movq	_CP_ME_RAM_WADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	movq	_CP_ME_RAM_RADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	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	_CP_RB_CNTL,4,2                 ## @CP_RB_CNTL
	.comm	_RB_NO_UPDATE,4,2               ## @RB_NO_UPDATE
	.comm	_GRBM_SOFT_RESET,4,2            ## @GRBM_SOFT_RESET
	.comm	_SOFT_RESET_CP,4,2              ## @SOFT_RESET_CP
	.comm	_CP_ME_RAM_WADDR,4,2            ## @CP_ME_RAM_WADDR
	.comm	_R600_PM4_UCODE_SIZE,4,2        ## @R600_PM4_UCODE_SIZE
	.comm	_CP_ME_RAM_DATA,4,2             ## @CP_ME_RAM_DATA
	.comm	_CP_PFP_UCODE_ADDR,4,2          ## @CP_PFP_UCODE_ADDR
	.comm	_R600_PFP_UCODE_SIZE,4,2        ## @R600_PFP_UCODE_SIZE
	.comm	_CP_PFP_UCODE_DATA,4,2          ## @CP_PFP_UCODE_DATA
	.comm	_CP_ME_RAM_RADDR,4,2            ## @CP_ME_RAM_RADDR
	.comm	_BUF_SWAP_32BIT,4,2             ## @BUF_SWAP_32BIT
	.no_dead_strip	_r600_cp_load_microcode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r600_cp_load_microcode
_r600_cp_load_microcode:                ; @r600_cp_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
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_9
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_9
; %bb.2:
	mov	x0, x19
	bl	_r600_cp_stop
Lloh0:
	adrp	x8, _CP_RB_CNTL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CP_RB_CNTL@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x8, _RB_NO_UPDATE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RB_NO_UPDATE@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	mov	w0, #15
	bl	_RB_BLKSZ
	orr	w21, w0, w21
	mov	w0, #3
	bl	_RB_BUFSZ
	orr	w1, w21, w0
	mov	x0, x20
	bl	_WREG32
Lloh6:
	adrp	x20, _GRBM_SOFT_RESET@GOTPAGE
Lloh7:
	ldr	x20, [x20, _GRBM_SOFT_RESET@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh8:
	adrp	x8, _SOFT_RESET_CP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SOFT_RESET_CP@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_WREG32
	ldr	w0, [x20]
	bl	_RREG32
	mov	w0, #15
	bl	_mdelay
	ldr	w0, [x20]
	mov	w1, #0
	bl	_WREG32
Lloh11:
	adrp	x22, _CP_ME_RAM_WADDR@GOTPAGE
Lloh12:
	ldr	x22, [x22, _CP_ME_RAM_WADDR@GOTPAGEOFF]
	ldr	w0, [x22]
	mov	w1, #0
	bl	_WREG32
	ldr	x8, [x19, #8]
	ldr	x20, [x8]
	ldr	w0, [x22]
	mov	w1, #0
	bl	_WREG32
Lloh13:
	adrp	x23, _R600_PM4_UCODE_SIZE@GOTPAGE
Lloh14:
	ldr	x23, [x23, _R600_PM4_UCODE_SIZE@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	mov	w24, #0
Lloh15:
	adrp	x25, _CP_ME_RAM_DATA@GOTPAGE
Lloh16:
	ldr	x25, [x25, _CP_ME_RAM_DATA@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w21, [x25]
	mov	x0, x20
	bl	_be32_to_cpup
	mov	x1, x0
	mov	x0, x21
	bl	_WREG32
	add	w24, w24, #1
	ldr	w8, [x23]
	add	w8, w8, w8, lsl #1
	add	w20, w20, #4
	cmp	w24, w8
	b.lt	LBB0_4
LBB0_5:
	ldr	x8, [x19]
	ldr	x19, [x8]
Lloh17:
	adrp	x21, _CP_PFP_UCODE_ADDR@GOTPAGE
Lloh18:
	ldr	x21, [x21, _CP_PFP_UCODE_ADDR@GOTPAGEOFF]
	ldr	w0, [x21]
	mov	w1, #0
	bl	_WREG32
Lloh19:
	adrp	x23, _R600_PFP_UCODE_SIZE@GOTPAGE
Lloh20:
	ldr	x23, [x23, _R600_PFP_UCODE_SIZE@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.6:
	mov	w24, #0
Lloh21:
	adrp	x25, _CP_PFP_UCODE_DATA@GOTPAGE
Lloh22:
	ldr	x25, [x25, _CP_PFP_UCODE_DATA@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w20, [x25]
	mov	x0, x19
	bl	_be32_to_cpup
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
	add	w24, w24, #1
	ldr	w8, [x23]
	add	w19, w19, #4
	cmp	w24, w8
	b.lt	LBB0_7
LBB0_8:
	ldr	w0, [x21]
	mov	w1, #0
	bl	_WREG32
	ldr	w0, [x22]
	mov	w1, #0
	bl	_WREG32
Lloh23:
	adrp	x8, _CP_ME_RAM_RADDR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CP_ME_RAM_RADDR@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_WREG32
	mov	w0, #0
	b	LBB0_10
LBB0_9:
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CP_RB_CNTL,4,2                 ; @CP_RB_CNTL
	.comm	_RB_NO_UPDATE,4,2               ; @RB_NO_UPDATE
	.comm	_GRBM_SOFT_RESET,4,2            ; @GRBM_SOFT_RESET
	.comm	_SOFT_RESET_CP,4,2              ; @SOFT_RESET_CP
	.comm	_CP_ME_RAM_WADDR,4,2            ; @CP_ME_RAM_WADDR
	.comm	_R600_PM4_UCODE_SIZE,4,2        ; @R600_PM4_UCODE_SIZE
	.comm	_CP_ME_RAM_DATA,4,2             ; @CP_ME_RAM_DATA
	.comm	_CP_PFP_UCODE_ADDR,4,2          ; @CP_PFP_UCODE_ADDR
	.comm	_R600_PFP_UCODE_SIZE,4,2        ; @R600_PFP_UCODE_SIZE
	.comm	_CP_PFP_UCODE_DATA,4,2          ; @CP_PFP_UCODE_DATA
	.comm	_CP_ME_RAM_RADDR,4,2            ; @CP_ME_RAM_RADDR
	.comm	_BUF_SWAP_32BIT,4,2             ; @BUF_SWAP_32BIT
	.no_dead_strip	_r600_cp_load_microcode
.subsections_via_symbols
