	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cayman_gfx_get_rptr            ## -- Begin function cayman_gfx_get_rptr
	.p2align	4, 0x90
_cayman_gfx_get_rptr:                   ## @cayman_gfx_get_rptr
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	cmpq	$0, 8(%rdi)
	je	LBB0_1
## %bb.7:
	movl	(%rsi), %eax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	movq	(%rdi), %rax
	sarl	$2, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	popq	%rbp
	retq
LBB0_1:
	movq	8(%rsi), %rax
	movq	_RADEON_RING_TYPE_GFX_INDEX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.2:
	movq	_CP_RB0_RPTR@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_4:
	movq	_CAYMAN_RING_TYPE_CP1_INDEX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	_CP_RB1_RPTR@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_6:
	movq	_CP_RB2_RPTR@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %edi
	popq	%rbp
	jmp	_RREG32                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ## @RADEON_RING_TYPE_GFX_INDEX
	.comm	_CP_RB0_RPTR,4,2                ## @CP_RB0_RPTR
	.comm	_CAYMAN_RING_TYPE_CP1_INDEX,8,3 ## @CAYMAN_RING_TYPE_CP1_INDEX
	.comm	_CP_RB1_RPTR,4,2                ## @CP_RB1_RPTR
	.comm	_CP_RB2_RPTR,4,2                ## @CP_RB2_RPTR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cayman_gfx_get_rptr            ; -- Begin function cayman_gfx_get_rptr
	.p2align	2
_cayman_gfx_get_rptr:                   ; @cayman_gfx_get_rptr
	.cfi_startproc
; %bb.0:
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x0]
	ldr	w9, [x1]
	add	w10, w9, #3
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #2
	ldr	w0, [x8, w9, sxtw #2]
	ret
LBB0_2:
	ldr	x8, [x1, #8]
Lloh0:
	adrp	x9, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _CP_RB0_RPTR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CP_RB0_RPTR@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	_RREG32
LBB0_4:
Lloh6:
	adrp	x9, _CAYMAN_RING_TYPE_CP1_INDEX@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CAYMAN_RING_TYPE_CP1_INDEX@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
Lloh9:
	adrp	x8, _CP_RB1_RPTR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CP_RB1_RPTR@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	b	_RREG32
LBB0_6:
Lloh12:
	adrp	x8, _CP_RB2_RPTR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CP_RB2_RPTR@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	b	_RREG32
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ; @RADEON_RING_TYPE_GFX_INDEX
	.comm	_CP_RB0_RPTR,4,2                ; @CP_RB0_RPTR
	.comm	_CAYMAN_RING_TYPE_CP1_INDEX,8,3 ; @CAYMAN_RING_TYPE_CP1_INDEX
	.comm	_CP_RB1_RPTR,4,2                ; @CP_RB1_RPTR
	.comm	_CP_RB2_RPTR,4,2                ; @CP_RB2_RPTR
.subsections_via_symbols
