	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r600_cp_start                  ## -- Begin function r600_cp_start
	.p2align	4, 0x90
_r600_cp_start:                         ## @r600_cp_start
	.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
	movq	_RADEON_RING_TYPE_GFX_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	shlq	$2, %rbx
	addq	16(%rdi), %rbx
	movq	%rbx, %rsi
	movl	$7, %edx
	callq	_radeon_ring_lock
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	callq	_DRM_ERROR
	jmp	LBB0_6
LBB0_2:
	movq	_PACKET3_ME_INITIALIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$5, %esi
	callq	_PACKET3
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_radeon_ring_write
	movq	(%r15), %rax
	movq	_CHIP_RV770@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_3
## %bb.4:
	movq	%rbx, %rdi
	movl	$3, %esi
	callq	_radeon_ring_write
	leaq	8(%r15), %rax
	jmp	LBB0_5
LBB0_3:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_radeon_ring_write
	leaq	12(%r15), %rax
LBB0_5:
	movl	(%rax), %esi
	decl	%esi
	movq	%rbx, %rdi
	callq	_radeon_ring_write
	movl	$1, %edi
	callq	_PACKET3_ME_INITIALIZE_DEVICE_ID
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_radeon_ring_write
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_radeon_ring_write
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_radeon_ring_unlock_commit
	movq	_R_0086D8_CP_ME_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$255, %esi
	callq	_WREG32
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ## @RADEON_RING_TYPE_GFX_INDEX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"radeon: cp failed to lock ring (%d).\n"

	.comm	_PACKET3_ME_INITIALIZE,4,2      ## @PACKET3_ME_INITIALIZE
	.comm	_CHIP_RV770,8,3                 ## @CHIP_RV770
	.comm	_R_0086D8_CP_ME_CNTL,4,2        ## @R_0086D8_CP_ME_CNTL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r600_cp_start                  ; -- Begin function r600_cp_start
	.p2align	2
_r600_cp_start:                         ; @r600_cp_start
	.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	x20, x0
	ldr	x8, [x0, #16]
Lloh0:
	adrp	x9, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x21, x8, x9, lsl #2
	mov	x1, x21
	mov	w2, #7
	bl	_radeon_ring_lock
	mov	x19, x0
	cbz	w0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_DRM_ERROR
	b	LBB0_6
LBB0_2:
Lloh5:
	adrp	x8, _PACKET3_ME_INITIALIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PACKET3_ME_INITIALIZE@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	w1, #5
	bl	_PACKET3
	mov	x1, x0
	mov	x0, x21
	bl	_radeon_ring_write
	mov	x0, x21
	mov	w1, #1
	bl	_radeon_ring_write
	ldr	x8, [x20]
Lloh8:
	adrp	x9, _CHIP_RV770@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CHIP_RV770@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	mov	x0, x21
	cmp	x8, x9
	b.ge	LBB0_4
; %bb.3:
	mov	w1, #3
	bl	_radeon_ring_write
	add	x8, x20, #8
	b	LBB0_5
LBB0_4:
	mov	w1, #0
	bl	_radeon_ring_write
	add	x8, x20, #12
LBB0_5:
	ldr	w8, [x8]
	sub	w1, w8, #1
	mov	x0, x21
	bl	_radeon_ring_write
	mov	w0, #1
	bl	_PACKET3_ME_INITIALIZE_DEVICE_ID
	mov	x1, x0
	mov	x0, x21
	bl	_radeon_ring_write
	mov	x0, x21
	mov	w1, #0
	bl	_radeon_ring_write
	mov	x0, x21
	mov	w1, #0
	bl	_radeon_ring_write
	mov	x0, x20
	mov	x1, x21
	bl	_radeon_ring_unlock_commit
Lloh11:
	adrp	x8, _R_0086D8_CP_ME_CNTL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _R_0086D8_CP_ME_CNTL@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	w1, #255
	bl	_WREG32
LBB0_6:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ; @RADEON_RING_TYPE_GFX_INDEX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"radeon: cp failed to lock ring (%d).\n"

	.comm	_PACKET3_ME_INITIALIZE,4,2      ; @PACKET3_ME_INITIALIZE
	.comm	_CHIP_RV770,8,3                 ; @CHIP_RV770
	.comm	_R_0086D8_CP_ME_CNTL,4,2        ; @R_0086D8_CP_ME_CNTL
.subsections_via_symbols
