	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rv770_init                     ## -- Begin function rv770_init
	.p2align	4, 0x90
_rv770_init:                            ## @rv770_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	_radeon_get_bios
	testl	%eax, %eax
	je	LBB0_17
LBB0_1:
	cmpl	$0, 56(%r14)
	je	LBB0_18
## %bb.2:
	movq	%r14, %rdi
	callq	_radeon_atombios_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_21
## %bb.3:
	movq	%r14, %rdi
	callq	_radeon_card_posted
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:
	cmpl	$0, 52(%r14)
	je	LBB0_22
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_INFO
	movl	48(%r14), %edi
	callq	_atom_asic_init
LBB0_6:
	movq	%r14, %rdi
	callq	_rv770_init_golden_registers
	movq	%r14, %rdi
	callq	_r600_scratch_init
	movq	%r14, %rdi
	callq	_radeon_surface_init
	movl	44(%r14), %edi
	callq	_radeon_get_clock_info
	movq	%r14, %rdi
	callq	_radeon_fence_driver_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_21
## %bb.7:
	movq	_RADEON_IS_AGP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_10
## %bb.8:
	movq	%r14, %rdi
	callq	_radeon_agp_init
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	_radeon_agp_disable
LBB0_10:
	movq	%r14, %rdi
	callq	_rv770_mc_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_21
## %bb.11:
	movq	%r14, %rdi
	callq	_radeon_bo_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_21
## %bb.12:
	cmpl	$0, 40(%r14)
	je	LBB0_15
## %bb.13:
	cmpl	$0, 36(%r14)
	je	LBB0_15
## %bb.14:
	cmpl	$0, 32(%r14)
	jne	LBB0_23
LBB0_15:
	movq	%r14, %rdi
	callq	_r600_init_microcode
	testl	%eax, %eax
	je	LBB0_23
## %bb.16:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_21
LBB0_17:
	movq	%r14, %rdi
	callq	_ASIC_IS_AVIVO
	testq	%rax, %rax
	jne	LBB0_20
	jmp	LBB0_1
LBB0_18:
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
LBB0_19:
	callq	_dev_err
LBB0_20:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_21:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_22:
	movl	8(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_19
LBB0_23:
	movq	%r14, %rdi
	callq	_radeon_pm_init
	movq	24(%r14), %rax
	movq	_RADEON_RING_TYPE_GFX_INDEX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rax,%rcx,8), %rsi
	movq	$0, (%rax,%rcx,8)
	movq	%r14, %rdi
	movl	$1048576, %edx                  ## imm = 0x100000
	callq	_r600_ring_init
	movq	24(%r14), %rax
	movq	_R600_RING_TYPE_DMA_INDEX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rax,%rcx,8), %rsi
	movq	$0, (%rax,%rcx,8)
	movq	%r14, %rdi
	movl	$65536, %edx                    ## imm = 0x10000
	callq	_r600_ring_init
	movq	%r14, %rdi
	callq	_rv770_uvd_init
	movq	$0, 16(%r14)
	movq	%r14, %rdi
	movl	$65536, %esi                    ## imm = 0x10000
	callq	_r600_ih_ring_init
	movq	%r14, %rdi
	callq	_r600_pcie_gart_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_21
## %bb.24:
	movl	$1, 4(%r14)
	movq	%r14, %rdi
	callq	_rv770_startup
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_21
## %bb.25:
	movl	8(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_err
	movq	%r14, %rdi
	callq	_r700_cp_fini
	movq	%r14, %rdi
	callq	_r600_dma_fini
	movq	%r14, %rdi
	callq	_r600_irq_fini
	movq	%r14, %rdi
	callq	_radeon_wb_fini
	movq	%r14, %rdi
	callq	_radeon_ib_pool_fini
	movq	%r14, %rdi
	callq	_radeon_irq_kms_fini
	movq	%r14, %rdi
	callq	_rv770_pcie_gart_fini
	movl	$0, 4(%r14)
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Expecting atombios for R600 GPU\n"

L_.str.1:                               ## @.str.1
	.asciz	"Card not posted and no BIOS - ignoring\n"

L_.str.2:                               ## @.str.2
	.asciz	"GPU not posted. posting now...\n"

	.comm	_RADEON_IS_AGP,4,2              ## @RADEON_IS_AGP
L_.str.3:                               ## @.str.3
	.asciz	"Failed to load firmware!\n"

	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ## @RADEON_RING_TYPE_GFX_INDEX
	.comm	_R600_RING_TYPE_DMA_INDEX,8,3   ## @R600_RING_TYPE_DMA_INDEX
L_.str.4:                               ## @.str.4
	.asciz	"disabling GPU acceleration\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rv770_init                     ; -- Begin function rv770_init
	.p2align	2
_rv770_init:                            ; @rv770_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	_radeon_get_bios
	cbz	w0, LBB0_17
LBB0_1:
	ldr	w8, [x19, #56]
	cbz	w8, LBB0_18
; %bb.2:
	mov	x0, x19
	bl	_radeon_atombios_init
	mov	x20, x0
	cbnz	w0, LBB0_21
; %bb.3:
	mov	x0, x19
	bl	_radeon_card_posted
	cbnz	w0, LBB0_6
; %bb.4:
	ldr	w8, [x19, #52]
	cbz	w8, LBB0_22
; %bb.5:
Lloh0:
	adrp	x0, l_.str.2@PAGE
Lloh1:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_INFO
	ldr	w0, [x19, #48]
	bl	_atom_asic_init
LBB0_6:
	mov	x0, x19
	bl	_rv770_init_golden_registers
	mov	x0, x19
	bl	_r600_scratch_init
	mov	x0, x19
	bl	_radeon_surface_init
	ldr	w0, [x19, #44]
	bl	_radeon_get_clock_info
	mov	x0, x19
	bl	_radeon_fence_driver_init
	mov	x20, x0
	cbnz	w0, LBB0_21
; %bb.7:
	ldr	w8, [x19]
Lloh2:
	adrp	x9, _RADEON_IS_AGP@GOTPAGE
Lloh3:
	ldr	x9, [x9, _RADEON_IS_AGP@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.8:
	mov	x0, x19
	bl	_radeon_agp_init
	cbz	w0, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_radeon_agp_disable
LBB0_10:
	mov	x0, x19
	bl	_rv770_mc_init
	mov	x20, x0
	cbnz	w0, LBB0_21
; %bb.11:
	mov	x0, x19
	bl	_radeon_bo_init
	mov	x20, x0
	cbnz	w0, LBB0_21
; %bb.12:
	ldr	w8, [x19, #40]
	cbz	w8, LBB0_15
; %bb.13:
	ldr	w8, [x19, #36]
	cbz	w8, LBB0_15
; %bb.14:
	ldr	w8, [x19, #32]
	cbnz	w8, LBB0_23
LBB0_15:
	mov	x0, x19
	bl	_r600_init_microcode
	cbz	w0, LBB0_23
; %bb.16:
	mov	x20, x0
Lloh5:
	adrp	x0, l_.str.3@PAGE
Lloh6:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_21
LBB0_17:
	mov	x0, x19
	bl	_ASIC_IS_AVIVO
	cbnz	x0, LBB0_20
	b	LBB0_1
LBB0_18:
	ldr	w0, [x19, #8]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
LBB0_19:
	bl	_dev_err
LBB0_20:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_21:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_22:
	ldr	w0, [x19, #8]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_19
LBB0_23:
	mov	x0, x19
	bl	_radeon_pm_init
	ldr	x8, [x19, #24]
Lloh14:
	adrp	x9, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGE
Lloh15:
	ldr	x9, [x9, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x1, x8, x9, lsl #3
	str	xzr, [x1]
	mov	x0, x19
	mov	w2, #1048576
	bl	_r600_ring_init
	ldr	x8, [x19, #24]
Lloh17:
	adrp	x9, _R600_RING_TYPE_DMA_INDEX@GOTPAGE
Lloh18:
	ldr	x9, [x9, _R600_RING_TYPE_DMA_INDEX@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x1, x8, x9, lsl #3
	str	xzr, [x1]
	mov	x0, x19
	mov	w2, #65536
	bl	_r600_ring_init
	mov	x0, x19
	bl	_rv770_uvd_init
	str	xzr, [x19, #16]
	mov	x0, x19
	mov	w1, #65536
	bl	_r600_ih_ring_init
	mov	x0, x19
	bl	_r600_pcie_gart_init
	mov	x20, x0
	cbnz	w0, LBB0_21
; %bb.24:
	mov	w8, #1
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_rv770_startup
	cbz	w0, LBB0_26
; %bb.25:
	ldr	w0, [x19, #8]
Lloh20:
	adrp	x1, l_.str.4@PAGE
Lloh21:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
	mov	x0, x19
	bl	_r700_cp_fini
	mov	x0, x19
	bl	_r600_dma_fini
	mov	x0, x19
	bl	_r600_irq_fini
	mov	x0, x19
	bl	_radeon_wb_fini
	mov	x0, x19
	bl	_radeon_ib_pool_fini
	mov	x0, x19
	bl	_radeon_irq_kms_fini
	mov	x0, x19
	bl	_rv770_pcie_gart_fini
	mov	w20, #0
	str	wzr, [x19, #4]
	b	LBB0_21
LBB0_26:
	mov	w20, #0
	b	LBB0_21
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Expecting atombios for R600 GPU\n"

l_.str.1:                               ; @.str.1
	.asciz	"Card not posted and no BIOS - ignoring\n"

l_.str.2:                               ; @.str.2
	.asciz	"GPU not posted. posting now...\n"

	.comm	_RADEON_IS_AGP,4,2              ; @RADEON_IS_AGP
l_.str.3:                               ; @.str.3
	.asciz	"Failed to load firmware!\n"

	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ; @RADEON_RING_TYPE_GFX_INDEX
	.comm	_R600_RING_TYPE_DMA_INDEX,8,3   ; @R600_RING_TYPE_DMA_INDEX
l_.str.4:                               ; @.str.4
	.asciz	"disabling GPU acceleration\n"

.subsections_via_symbols
