	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_vce_ring_test           ## -- Begin function radeon_vce_ring_test
	.p2align	4, 0x90
_radeon_vce_ring_test:                  ## @radeon_vce_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	callq	_vce_v1_0_get_rptr
	movq	%rax, %r15
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	$16, %edx
	callq	_radeon_ring_lock
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movl	(%r14), %esi
	leaq	L_.str(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_9
LBB0_2:
	movq	_VCE_CMD_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le32
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_radeon_ring_unlock_commit
	cmpl	$0, (%r12)
	je	LBB0_8
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_vce_v1_0_get_rptr
	cmpq	%r15, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %edi
	callq	_udelay
	incl	%ebx
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	jb	LBB0_3
## %bb.6:
	cmpl	%eax, %ebx
	jae	LBB0_8
LBB0_7:
	movl	(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %edx
	callq	_DRM_INFO
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_4:
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	jb	LBB0_7
LBB0_8:
	movl	(%r14), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	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: vce failed to lock ring %d (%d).\n"

	.comm	_VCE_CMD_END,4,2                ## @VCE_CMD_END
L_.str.1:                               ## @.str.1
	.asciz	"ring test on %d succeeded in %d usecs\n"

L_.str.2:                               ## @.str.2
	.asciz	"radeon: ring %d test failed\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_vce_ring_test           ; -- Begin function radeon_vce_ring_test
	.p2align	2
_radeon_vce_ring_test:                  ; @radeon_vce_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	x19, x1
	mov	x20, x0
	bl	_vce_v1_0_get_rptr
	mov	x21, x0
	mov	x0, x20
	mov	x1, x19
	mov	w2, #16
	bl	_radeon_ring_lock
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
	ldr	w1, [x19]
	str	x22, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_10
LBB0_2:
Lloh2:
	adrp	x8, _VCE_CMD_END@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VCE_CMD_END@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_cpu_to_le32
	mov	x1, x0
	mov	x0, x19
	bl	_radeon_ring_write
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_radeon_ring_unlock_commit
	ldr	w8, [x20]
	cbz	w8, LBB0_9
; %bb.3:
	mov	w22, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_vce_v1_0_get_rptr
	cmp	x0, x21
	b.ne	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	bl	_udelay
	add	w22, w22, #1
	ldr	w8, [x20]
	cmp	w22, w8
	b.lo	LBB0_4
; %bb.6:
	cmp	w22, w8
	b.hs	LBB0_9
LBB0_7:
	ldr	w1, [x19]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_DRM_INFO
	mov	w22, #0
	b	LBB0_10
LBB0_8:
	ldr	w8, [x20]
	cmp	w22, w8
	b.lo	LBB0_7
LBB0_9:
	ldr	w1, [x19]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
Lloh9:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_10:
	mov	x0, x22
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"radeon: vce failed to lock ring %d (%d).\n"

	.comm	_VCE_CMD_END,4,2                ; @VCE_CMD_END
l_.str.1:                               ; @.str.1
	.asciz	"ring test on %d succeeded in %d usecs\n"

l_.str.2:                               ; @.str.2
	.asciz	"radeon: ring %d test failed\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
