	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r100_ring_test                 ## -- Begin function r100_ring_test
	.p2align	4, 0x90
_r100_ring_test:                        ## @r100_ring_test
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	leaq	-36(%rbp), %rsi
	callq	_radeon_scratch_get
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_13
LBB0_2:
	movl	-36(%rbp), %edi
	movl	$-889266515, %esi               ## imm = 0xCAFEDEAD
	callq	_WREG32
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	$2, %edx
	callq	_radeon_ring_lock
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_12
LBB0_4:
	movl	-36(%rbp), %edi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	_PACKET0
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movq	%r15, %rdi
	movl	$-559038737, %esi               ## imm = 0xDEADBEEF
	callq	_radeon_ring_write
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_radeon_ring_unlock_commit
	cmpl	$0, (%r14)
	movl	$0, %r15d
	je	LBB0_11
## %bb.5:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	-36(%rbp), %edi
	callq	_RREG32
	movl	%eax, %r15d
	cmpl	$-559038737, %eax               ## imm = 0xDEADBEEF
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	$1, %edi
	callq	_udelay
	incl	%ebx
	movl	(%r14), %eax
	cmpl	%eax, %ebx
	jb	LBB0_6
## %bb.9:
	cmpl	%eax, %ebx
	jae	LBB0_11
LBB0_10:
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	callq	_DRM_INFO
	xorl	%r12d, %r12d
	jmp	LBB0_12
LBB0_7:
	movl	(%r14), %eax
	cmpl	%eax, %ebx
	jb	LBB0_10
LBB0_11:
	movl	-36(%rbp), %esi
	leaq	L_.str.3(%rip), %rdi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_12:
	movl	-36(%rbp), %esi
	movq	%r14, %rdi
	callq	_radeon_scratch_free
LBB0_13:
	movl	%r12d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"radeon: cp failed to get scratch reg (%d).\n"

L_.str.1:                               ## @.str.1
	.asciz	"radeon: cp failed to lock ring (%d).\n"

L_.str.2:                               ## @.str.2
	.asciz	"ring test succeeded in %d usecs\n"

L_.str.3:                               ## @.str.3
	.asciz	"radeon: ring test failed (scratch(0x%04X)=0x%08X)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r100_ring_test                 ; -- Begin function r100_ring_test
	.p2align	2
_r100_ring_test:                        ; @r100_ring_test
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x1
	mov	x19, x0
	add	x1, sp, #12
	bl	_radeon_scratch_get
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_DRM_ERROR
	b	LBB0_14
LBB0_2:
	ldr	w0, [sp, #12]
	mov	w1, #57005
	movk	w1, #51966, lsl #16
	bl	_WREG32
	mov	x0, x19
	mov	x1, x20
	mov	w2, #2
	bl	_radeon_ring_lock
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_DRM_ERROR
	b	LBB0_13
LBB0_4:
	mov	w22, #48879
	movk	w22, #57005, lsl #16
	ldr	w0, [sp, #12]
	mov	w1, #0
	bl	_PACKET0
	mov	x1, x0
	mov	x0, x20
	bl	_radeon_ring_write
	mov	x0, x20
	mov	w1, #48879
	movk	w1, #57005, lsl #16
	bl	_radeon_ring_write
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_radeon_ring_unlock_commit
	ldr	w8, [x19]
	cbz	w8, LBB0_9
; %bb.5:
	mov	w20, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [sp, #12]
	bl	_RREG32
	mov	x21, x0
	cmp	w0, w22
	b.eq	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w0, #1
	bl	_udelay
	add	w20, w20, #1
	ldr	w8, [x19]
	cmp	w20, w8
	b.lo	LBB0_6
; %bb.8:
	cmp	w20, w8
	b.lo	LBB0_11
	b	LBB0_12
LBB0_9:
	mov	w21, #0
	b	LBB0_12
LBB0_10:
	ldr	w8, [x19]
	cmp	w20, w8
	b.hs	LBB0_12
LBB0_11:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_DRM_INFO
	mov	w21, #0
	b	LBB0_13
LBB0_12:
	ldr	w1, [sp, #12]
	str	x21, [sp]
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_13:
	ldr	w1, [sp, #12]
	mov	x0, x19
	bl	_radeon_scratch_free
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"radeon: cp failed to get scratch reg (%d).\n"

l_.str.1:                               ; @.str.1
	.asciz	"radeon: cp failed to lock ring (%d).\n"

l_.str.2:                               ; @.str.2
	.asciz	"ring test succeeded in %d usecs\n"

l_.str.3:                               ; @.str.3
	.asciz	"radeon: ring test failed (scratch(0x%04X)=0x%08X)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
