	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rv515_gpu_init
_rv515_gpu_init:                        ## @rv515_gpu_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	callq	_r100_gui_wait_for_idle
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
LBB0_2:
	movq	%r14, %rdi
	callq	_rv515_vga_render_disable
	movq	%r14, %rdi
	callq	_r420_pipes_init
	movq	_R400_GB_PIPE_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	movl	%eax, %ebx
	movq	_R300_DST_PIPE_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	shrb	$2, %al
	andb	$3, %al
	shrl	$4, %ebx
	andl	$240, %ebx
	btsl	%eax, %ebx
	movl	$13, %edi
	movl	%ebx, %esi
	callq	_WREG32_PLL
	movq	%r14, %rdi
	callq	_r100_gui_wait_for_idle
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
LBB0_4:
	movq	%r14, %rdi
	callq	_rv515_mc_wait_for_idle
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_pr_warn                        ## TAILCALL
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to wait GUI idle while resetting GPU. Bad things might happen.\n"

	.comm	_R400_GB_PIPE_SELECT,4,2        ## @R400_GB_PIPE_SELECT
	.comm	_R300_DST_PIPE_CONFIG,4,2       ## @R300_DST_PIPE_CONFIG
L_.str.1:                               ## @.str.1
	.asciz	"Failed to wait MC idle while programming pipes. Bad things might happen.\n"

	.no_dead_strip	_rv515_gpu_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rv515_gpu_init
_rv515_gpu_init:                        ; @rv515_gpu_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_r100_gui_wait_for_idle
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
LBB0_2:
	mov	x0, x19
	bl	_rv515_vga_render_disable
	mov	x0, x19
	bl	_r420_pipes_init
Lloh2:
	adrp	x8, _R400_GB_PIPE_SELECT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _R400_GB_PIPE_SELECT@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_RREG32
	mov	x20, x0
Lloh5:
	adrp	x8, _R300_DST_PIPE_CONFIG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _R300_DST_PIPE_CONFIG@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_RREG32
	ubfx	w8, w0, #2, #2
	mov	w9, #1
	lsl	w8, w9, w8
	lsr	w9, w20, #4
	and	w9, w9, #0xf0
	orr	w1, w8, w9
	mov	w0, #13
	bl	_WREG32_PLL
	mov	x0, x19
	bl	_r100_gui_wait_for_idle
	cbz	x0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
LBB0_4:
	mov	x0, x19
	bl	_rv515_mc_wait_for_idle
	cbz	x0, LBB0_6
; %bb.5:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_pr_warn
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to wait GUI idle while resetting GPU. Bad things might happen.\n"

	.comm	_R400_GB_PIPE_SELECT,4,2        ; @R400_GB_PIPE_SELECT
	.comm	_R300_DST_PIPE_CONFIG,4,2       ; @R300_DST_PIPE_CONFIG
l_.str.1:                               ; @.str.1
	.asciz	"Failed to wait MC idle while programming pipes. Bad things might happen.\n"

	.no_dead_strip	_rv515_gpu_init
.subsections_via_symbols
