	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r300_init                      ## -- Begin function r300_init
	.p2align	4, 0x90
_r300_init:                             ## @r300_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_r100_vga_render_disable
	movq	%rbx, %rdi
	callq	_radeon_scratch_init
	movq	%rbx, %rdi
	callq	_radeon_surface_init
	movq	%rbx, %rdi
	callq	_r100_restore_sanity
	movq	%rbx, %rdi
	callq	_radeon_get_bios
	testl	%eax, %eax
	je	LBB0_1
LBB0_3:
	cmpq	$0, 16(%rbx)
	je	LBB0_5
## %bb.4:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_2
LBB0_1:
	movq	%rbx, %rdi
	callq	_ASIC_IS_AVIVO
	testq	%rax, %rax
	je	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_25:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rbx, %rdi
	callq	_radeon_combios_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_25
## %bb.6:
	movq	%rbx, %rdi
	callq	_radeon_asic_reset
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	8(%rbx), %r14d
	movq	_R_000E40_RBBM_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	movl	%eax, %r15d
	movq	_R_0007C0_CP_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_dev_warn
LBB0_8:
	movq	%rbx, %rdi
	callq	_radeon_boot_test_post_card
	testl	%eax, %eax
	je	LBB0_2
## %bb.9:
	movq	%rbx, %rdi
	callq	_r300_errata
	movl	12(%rbx), %edi
	callq	_radeon_get_clock_info
	movq	_RADEON_IS_AGP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_12
## %bb.10:
	movq	%rbx, %rdi
	callq	_radeon_agp_init
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movq	%rbx, %rdi
	callq	_radeon_agp_disable
LBB0_12:
	movq	%rbx, %rdi
	callq	_r300_mc_init
	movq	%rbx, %rdi
	callq	_radeon_fence_driver_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_25
## %bb.13:
	movq	%rbx, %rdi
	callq	_radeon_bo_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_25
## %bb.14:
	movl	(%rbx), %eax
	movq	_RADEON_IS_PCIE@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	je	LBB0_17
## %bb.15:
	movq	%rbx, %rdi
	callq	_rv370_pcie_gart_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_25
## %bb.16:
	movl	(%rbx), %eax
LBB0_17:
	movq	_RADEON_IS_PCI@GOTPCREL(%rip), %r12
	testl	%eax, (%r12)
	je	LBB0_19
## %bb.18:
	movq	%rbx, %rdi
	callq	_r100_pci_gart_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_25
LBB0_19:
	movq	%rbx, %rdi
	callq	_r300_set_reg_safe
	movl	$1, 4(%rbx)
	movq	%rbx, %rdi
	callq	_r300_startup
	xorl	%r14d, %r14d
	testl	%eax, %eax
	je	LBB0_25
## %bb.20:
	movl	8(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	%rbx, %rdi
	callq	_r100_cp_fini
	movq	%rbx, %rdi
	callq	_radeon_wb_fini
	movq	%rbx, %rdi
	callq	_radeon_ib_pool_fini
	movq	%rbx, %rdi
	callq	_radeon_irq_kms_fini
	movl	(%rbx), %eax
	testl	%eax, (%r15)
	je	LBB0_22
## %bb.21:
	movq	%rbx, %rdi
	callq	_rv370_pcie_gart_fini
	movl	(%rbx), %eax
LBB0_22:
	testl	%eax, (%r12)
	je	LBB0_24
## %bb.23:
	movq	%rbx, %rdi
	callq	_r100_pci_gart_fini
LBB0_24:
	movq	%rbx, %rdi
	callq	_radeon_agp_fini
	movl	$0, 4(%rbx)
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Expecting combios for RS400/RS480 GPU\n"

L_.str.1:                               ## @.str.1
	.asciz	"GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n"

	.comm	_R_000E40_RBBM_STATUS,4,2       ## @R_000E40_RBBM_STATUS
	.comm	_R_0007C0_CP_STAT,4,2           ## @R_0007C0_CP_STAT
	.comm	_RADEON_IS_AGP,4,2              ## @RADEON_IS_AGP
	.comm	_RADEON_IS_PCIE,4,2             ## @RADEON_IS_PCIE
	.comm	_RADEON_IS_PCI,4,2              ## @RADEON_IS_PCI
L_.str.2:                               ## @.str.2
	.asciz	"Disabling GPU acceleration\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r300_init                      ; -- Begin function r300_init
	.p2align	2
_r300_init:                             ; @r300_init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	bl	_r100_vga_render_disable
	mov	x0, x19
	bl	_radeon_scratch_init
	mov	x0, x19
	bl	_radeon_surface_init
	mov	x0, x19
	bl	_r100_restore_sanity
	mov	x0, x19
	bl	_radeon_get_bios
	cbz	w0, LBB0_3
LBB0_1:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_6
; %bb.2:
	ldr	w0, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_4
LBB0_3:
	mov	x0, x19
	bl	_ASIC_IS_AVIVO
	cbz	x0, LBB0_1
LBB0_4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x0, x19
	bl	_radeon_combios_init
	cbnz	w0, LBB0_5
; %bb.7:
	mov	x0, x19
	bl	_radeon_asic_reset
	cbz	x0, LBB0_9
; %bb.8:
	ldr	w20, [x19, #8]
Lloh5:
	adrp	x8, _R_000E40_RBBM_STATUS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _R_000E40_RBBM_STATUS@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_RREG32
	mov	x21, x0
Lloh8:
	adrp	x8, _R_0007C0_CP_STAT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _R_0007C0_CP_STAT@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_RREG32
	mov	x3, x0
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_dev_warn
LBB0_9:
	mov	x0, x19
	bl	_radeon_boot_test_post_card
	cbz	w0, LBB0_4
; %bb.10:
	mov	x0, x19
	bl	_r300_errata
	ldr	w0, [x19, #12]
	bl	_radeon_get_clock_info
	ldr	w8, [x19]
Lloh13:
	adrp	x9, _RADEON_IS_AGP@GOTPAGE
Lloh14:
	ldr	x9, [x9, _RADEON_IS_AGP@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.11:
	mov	x0, x19
	bl	_radeon_agp_init
	cbz	w0, LBB0_13
; %bb.12:
	mov	x0, x19
	bl	_radeon_agp_disable
LBB0_13:
	mov	x0, x19
	bl	_r300_mc_init
	mov	x0, x19
	bl	_radeon_fence_driver_init
	cbnz	w0, LBB0_5
; %bb.14:
	mov	x0, x19
	bl	_radeon_bo_init
	cbnz	w0, LBB0_5
; %bb.15:
	ldr	w8, [x19]
Lloh16:
	adrp	x20, _RADEON_IS_PCIE@GOTPAGE
Lloh17:
	ldr	x20, [x20, _RADEON_IS_PCIE@GOTPAGEOFF]
	ldr	w9, [x20]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.16:
	mov	x0, x19
	bl	_rv370_pcie_gart_init
	cbnz	w0, LBB0_5
; %bb.17:
	ldr	w8, [x19]
LBB0_18:
Lloh18:
	adrp	x21, _RADEON_IS_PCI@GOTPAGE
Lloh19:
	ldr	x21, [x21, _RADEON_IS_PCI@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.19:
	mov	x0, x19
	bl	_r100_pci_gart_init
	cbnz	w0, LBB0_5
LBB0_20:
	mov	x0, x19
	bl	_r300_set_reg_safe
	mov	w8, #1
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_r300_startup
	cbz	w0, LBB0_5
; %bb.21:
	ldr	w0, [x19, #8]
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	mov	x0, x19
	bl	_r100_cp_fini
	mov	x0, x19
	bl	_radeon_wb_fini
	mov	x0, x19
	bl	_radeon_ib_pool_fini
	mov	x0, x19
	bl	_radeon_irq_kms_fini
	ldr	w8, [x19]
	ldr	w9, [x20]
	tst	w9, w8
	b.eq	LBB0_23
; %bb.22:
	mov	x0, x19
	bl	_rv370_pcie_gart_fini
	ldr	w8, [x19]
LBB0_23:
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_25
; %bb.24:
	mov	x0, x19
	bl	_r100_pci_gart_fini
LBB0_25:
	mov	x0, x19
	bl	_radeon_agp_fini
	mov	w0, #0
	str	wzr, [x19, #4]
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Expecting combios for RS400/RS480 GPU\n"

l_.str.1:                               ; @.str.1
	.asciz	"GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n"

	.comm	_R_000E40_RBBM_STATUS,4,2       ; @R_000E40_RBBM_STATUS
	.comm	_R_0007C0_CP_STAT,4,2           ; @R_0007C0_CP_STAT
	.comm	_RADEON_IS_AGP,4,2              ; @RADEON_IS_AGP
	.comm	_RADEON_IS_PCIE,4,2             ; @RADEON_IS_PCIE
	.comm	_RADEON_IS_PCI,4,2              ; @RADEON_IS_PCI
l_.str.2:                               ; @.str.2
	.asciz	"Disabling GPU acceleration\n"

.subsections_via_symbols
