	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r520_mc_program
_r520_mc_program:                       ## @r520_mc_program
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	leaq	-32(%rbp), %rsi
	callq	_rv515_mc_stop
	movq	%r15, %rdi
	callq	_r520_mc_wait_for_idle
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	28(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_2:
	movq	_R_0000F8_CONFIG_MEMSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%r15), %esi
	callq	_WREG32
	movq	_R_000004_MC_FB_LOCATION@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movswl	6(%r15), %edi
	callq	_S_000004_MC_FB_START
	movl	%eax, %ebx
	movswl	10(%r15), %edi
	callq	_S_000004_MC_FB_TOP
	orl	%eax, %ebx
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_WREG32_MC
	movq	_R_000134_HDP_FB_LOCATION@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movswl	6(%r15), %edi
	callq	_S_000134_HDP_FB_START
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_WREG32
	movq	_RADEON_IS_AGP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_R_000005_MC_AGP_LOCATION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	testl	%eax, (%r15)
	je	LBB0_4
## %bb.3:
	movswl	14(%r15), %edi
	callq	_S_000005_MC_AGP_START
	movl	%eax, %ebx
	movswl	18(%r15), %edi
	callq	_S_000005_MC_AGP_TOP
	orl	%eax, %ebx
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_WREG32_MC
	movq	_R_000006_AGP_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	20(%r15), %edi
	callq	_lower_32_bits
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_WREG32_MC
	movq	_R_000007_AGP_BASE_2@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	20(%r15), %edi
	callq	_upper_32_bits
	movl	%eax, %edi
	callq	_S_000007_AGP_BASE_ADDR_2
	movl	%ebx, %edi
	movl	%eax, %esi
	jmp	LBB0_5
LBB0_4:
	movl	%r14d, %edi
	movl	$-1, %esi
	callq	_WREG32_MC
	movq	_R_000006_AGP_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_WREG32_MC
	movq	_R_000007_AGP_BASE_2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
LBB0_5:
	callq	_WREG32_MC
	leaq	-32(%rbp), %rsi
	movq	%r15, %rdi
	callq	_rv515_mc_resume
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wait MC idle timeout before updating MC.\n"

	.comm	_R_0000F8_CONFIG_MEMSIZE,4,2    ## @R_0000F8_CONFIG_MEMSIZE
	.comm	_R_000004_MC_FB_LOCATION,4,2    ## @R_000004_MC_FB_LOCATION
	.comm	_R_000134_HDP_FB_LOCATION,4,2   ## @R_000134_HDP_FB_LOCATION
	.comm	_RADEON_IS_AGP,4,2              ## @RADEON_IS_AGP
	.comm	_R_000005_MC_AGP_LOCATION,4,2   ## @R_000005_MC_AGP_LOCATION
	.comm	_R_000006_AGP_BASE,4,2          ## @R_000006_AGP_BASE
	.comm	_R_000007_AGP_BASE_2,4,2        ## @R_000007_AGP_BASE_2
	.no_dead_strip	_r520_mc_program
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r520_mc_program
_r520_mc_program:                       ; @r520_mc_program
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	add	x1, sp, #8
	bl	_rv515_mc_stop
	mov	x0, x19
	bl	_r520_mc_wait_for_idle
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #28]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_2:
Lloh2:
	adrp	x8, _R_0000F8_CONFIG_MEMSIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _R_0000F8_CONFIG_MEMSIZE@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	ldr	w1, [x19, #24]
	bl	_WREG32
Lloh5:
	adrp	x8, _R_000004_MC_FB_LOCATION@GOTPAGE
Lloh6:
	ldr	x8, [x8, _R_000004_MC_FB_LOCATION@GOTPAGEOFF]
Lloh7:
	ldr	w20, [x8]
	ldrsh	w0, [x19, #6]
	bl	_S_000004_MC_FB_START
	mov	x21, x0
	ldrsh	w0, [x19, #10]
	bl	_S_000004_MC_FB_TOP
	orr	w1, w0, w21
	mov	x0, x20
	bl	_WREG32_MC
Lloh8:
	adrp	x8, _R_000134_HDP_FB_LOCATION@GOTPAGE
Lloh9:
	ldr	x8, [x8, _R_000134_HDP_FB_LOCATION@GOTPAGEOFF]
Lloh10:
	ldr	w20, [x8]
	ldrsh	w0, [x19, #6]
	bl	_S_000134_HDP_FB_START
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
Lloh11:
	adrp	x8, _RADEON_IS_AGP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RADEON_IS_AGP@GOTPAGEOFF]
	ldr	w9, [x19]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x10, _R_000005_MC_AGP_LOCATION@GOTPAGE
Lloh15:
	ldr	x10, [x10, _R_000005_MC_AGP_LOCATION@GOTPAGEOFF]
Lloh16:
	ldr	w20, [x10]
	tst	w8, w9
	b.eq	LBB0_4
; %bb.3:
	ldrsh	w0, [x19, #14]
	bl	_S_000005_MC_AGP_START
	mov	x21, x0
	ldrsh	w0, [x19, #18]
	bl	_S_000005_MC_AGP_TOP
	orr	w1, w0, w21
	mov	x0, x20
	bl	_WREG32_MC
Lloh17:
	adrp	x8, _R_000006_AGP_BASE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _R_000006_AGP_BASE@GOTPAGEOFF]
Lloh19:
	ldr	w20, [x8]
	ldr	w0, [x19, #20]
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32_MC
Lloh20:
	adrp	x8, _R_000007_AGP_BASE_2@GOTPAGE
Lloh21:
	ldr	x8, [x8, _R_000007_AGP_BASE_2@GOTPAGEOFF]
Lloh22:
	ldr	w20, [x8]
	ldr	w0, [x19, #20]
	bl	_upper_32_bits
	bl	_S_000007_AGP_BASE_ADDR_2
	mov	x1, x0
	mov	x0, x20
	b	LBB0_5
LBB0_4:
	mov	x0, x20
	mov	w1, #-1
	bl	_WREG32_MC
Lloh23:
	adrp	x8, _R_000006_AGP_BASE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _R_000006_AGP_BASE@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_WREG32_MC
Lloh26:
	adrp	x8, _R_000007_AGP_BASE_2@GOTPAGE
Lloh27:
	ldr	x8, [x8, _R_000007_AGP_BASE_2@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	mov	w1, #0
LBB0_5:
	bl	_WREG32_MC
	add	x1, sp, #8
	mov	x0, x19
	bl	_rv515_mc_resume
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wait MC idle timeout before updating MC.\n"

	.comm	_R_0000F8_CONFIG_MEMSIZE,4,2    ; @R_0000F8_CONFIG_MEMSIZE
	.comm	_R_000004_MC_FB_LOCATION,4,2    ; @R_000004_MC_FB_LOCATION
	.comm	_R_000134_HDP_FB_LOCATION,4,2   ; @R_000134_HDP_FB_LOCATION
	.comm	_RADEON_IS_AGP,4,2              ; @RADEON_IS_AGP
	.comm	_R_000005_MC_AGP_LOCATION,4,2   ; @R_000005_MC_AGP_LOCATION
	.comm	_R_000006_AGP_BASE,4,2          ; @R_000006_AGP_BASE
	.comm	_R_000007_AGP_BASE_2,4,2        ; @R_000007_AGP_BASE_2
	.no_dead_strip	_r520_mc_program
.subsections_via_symbols
