	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uvd_v6_0_ring_test_ring
_uvd_v6_0_ring_test_ring:               ## @uvd_v6_0_ring_test_ring
	.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	%rdi, %rbx
	movq	(%rdi), %r14
	movq	_mmUVD_CONTEXT_ID@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	$-889266515, %esi               ## imm = 0xCAFEDEAD
	callq	_WREG32
	movq	%rbx, %rdi
	movl	$3, %esi
	callq	_amdgpu_ring_alloc
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	movl	(%r15), %edi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	_PACKET0
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_amdgpu_ring_write
	movq	%rbx, %rdi
	movl	$-559038737, %esi               ## imm = 0xDEADBEEF
	callq	_amdgpu_ring_write
	movq	%rbx, %rdi
	callq	_amdgpu_ring_commit
	cmpl	$0, (%r14)
	movl	$0, %ecx
	movl	$0, %ebx
	je	LBB0_6
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_RREG32
	cmpl	$-559038737, %eax               ## imm = 0xDEADBEEF
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %edi
	callq	_udelay
	incl	%ebx
	movl	(%r14), %ecx
	cmpl	%ecx, %ebx
	jb	LBB0_3
	jmp	LBB0_6
LBB0_4:
	movl	(%r14), %ecx
LBB0_6:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	subl	(%rdx), %eax
	cmpl	%ecx, %ebx
	cmovbl	%r12d, %eax
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mmUVD_CONTEXT_ID,4,2           ## @mmUVD_CONTEXT_ID
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_uvd_v6_0_ring_test_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uvd_v6_0_ring_test_ring
_uvd_v6_0_ring_test_ring:               ; @uvd_v6_0_ring_test_ring
	.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
	ldr	x20, [x0]
Lloh0:
	adrp	x21, _mmUVD_CONTEXT_ID@GOTPAGE
Lloh1:
	ldr	x21, [x21, _mmUVD_CONTEXT_ID@GOTPAGEOFF]
	ldr	w0, [x21]
	mov	w1, #57005
	movk	w1, #51966, lsl #16
	bl	_WREG32
	mov	x0, x19
	mov	w1, #3
	bl	_amdgpu_ring_alloc
	cbnz	w0, LBB0_8
; %bb.1:
	mov	w22, #48879
	movk	w22, #57005, lsl #16
	ldr	w0, [x21]
	mov	w1, #0
	bl	_PACKET0
	mov	x1, x0
	mov	x0, x19
	bl	_amdgpu_ring_write
	mov	x0, x19
	mov	w1, #48879
	movk	w1, #57005, lsl #16
	bl	_amdgpu_ring_write
	mov	x0, x19
	bl	_amdgpu_ring_commit
	ldr	w8, [x20]
	cbz	w8, LBB0_5
; %bb.2:
	mov	w19, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_RREG32
	cmp	w0, w22
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #1
	bl	_udelay
	add	w19, w19, #1
	ldr	w8, [x20]
	cmp	w19, w8
	b.lo	LBB0_3
	b	LBB0_7
LBB0_5:
	mov	w19, #0
	b	LBB0_7
LBB0_6:
	ldr	w8, [x20]
LBB0_7:
Lloh2:
	adrp	x9, _ETIMEDOUT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ETIMEDOUT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w19, w8
	csneg	w0, wzr, w9, lo
LBB0_8:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_mmUVD_CONTEXT_ID,4,2           ; @mmUVD_CONTEXT_ID
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_uvd_v6_0_ring_test_ring
.subsections_via_symbols
