	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rs400_init                     ## -- Begin function rs400_init
	.p2align	4, 0x90
_rs400_init:                            ## @rs400_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -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	4(%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_14:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rbx, %rdi
	callq	_radeon_combios_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.6:
	movq	%rbx, %rdi
	callq	_radeon_asic_reset
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	4(%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:
	movl	8(%rbx), %edi
	callq	_radeon_get_clock_info
	movq	%rbx, %rdi
	callq	_rs400_mc_init
	movq	%rbx, %rdi
	callq	_radeon_fence_driver_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.10:
	movq	%rbx, %rdi
	callq	_radeon_bo_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.11:
	movq	%rbx, %rdi
	callq	_rs400_gart_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.12:
	movq	%rbx, %rdi
	callq	_r300_set_reg_safe
	movl	$1, (%rbx)
	movq	%rbx, %rdi
	callq	_rs400_startup
	xorl	%r14d, %r14d
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	4(%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	_rs400_gart_fini
	movq	%rbx, %rdi
	callq	_radeon_irq_kms_fini
	movl	$0, (%rbx)
	jmp	LBB0_14
	.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
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	_rs400_init                     ; -- Begin function rs400_init
	.p2align	2
_rs400_init:                            ; @rs400_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, #4]
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, #4]
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:
	ldr	w0, [x19, #8]
	bl	_radeon_get_clock_info
	mov	x0, x19
	bl	_rs400_mc_init
	mov	x0, x19
	bl	_radeon_fence_driver_init
	cbnz	w0, LBB0_5
; %bb.11:
	mov	x0, x19
	bl	_radeon_bo_init
	cbnz	w0, LBB0_5
; %bb.12:
	mov	x0, x19
	bl	_rs400_gart_init
	cbnz	w0, LBB0_5
; %bb.13:
	mov	x0, x19
	bl	_r300_set_reg_safe
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x19
	bl	_rs400_startup
	cbz	w0, LBB0_5
; %bb.14:
	ldr	w0, [x19, #4]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	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	_rs400_gart_fini
	mov	x0, x19
	bl	_radeon_irq_kms_fini
	mov	w0, #0
	str	wzr, [x19]
	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 AdrpAdd	Lloh13, Lloh14
	.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
l_.str.2:                               ; @.str.2
	.asciz	"Disabling GPU acceleration\n"

.subsections_via_symbols
