	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function evergreen_get_ih_wptr
_evergreen_get_ih_wptr:                 ## @evergreen_get_ih_wptr
	.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, %r14
	cmpq	$0, 24(%rdi)
	je	LBB0_2
## %bb.1:
	movq	_R600_WB_IH_WPTR_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	movq	16(%r14), %rax
	sarl	$2, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_le32_to_cpu
	jmp	LBB0_3
LBB0_2:
	movq	_IH_RB_WPTR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
LBB0_3:
	movl	%eax, %ebx
	movq	_RB_OVERFLOW@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_5
## %bb.4:
	movl	(%r14), %ecx
	movl	8(%r14), %edi
	leal	16(%rbx), %r15d
	movl	4(%r14), %r8d
	addl	%r15d, %r8d
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_warn
	andl	4(%r14), %r15d
	movl	%r15d, (%r14)
	movq	_IH_RB_CNTL@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_RREG32
	movq	_IH_WPTR_OVERFLOW_CLEAR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%r15), %edi
	movl	%eax, %esi
	callq	_WREG32
LBB0_5:
	andl	4(%r14), %ebx
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_R600_WB_IH_WPTR_OFFSET,4,2     ## @R600_WB_IH_WPTR_OFFSET
	.comm	_IH_RB_WPTR,4,2                 ## @IH_RB_WPTR
	.comm	_RB_OVERFLOW,4,2                ## @RB_OVERFLOW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"IH ring buffer overflow (0x%08X, %d, %d)\n"

	.comm	_IH_RB_CNTL,4,2                 ## @IH_RB_CNTL
	.comm	_IH_WPTR_OVERFLOW_CLEAR,4,2     ## @IH_WPTR_OVERFLOW_CLEAR
	.no_dead_strip	_evergreen_get_ih_wptr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function evergreen_get_ih_wptr
_evergreen_get_ih_wptr:                 ; @evergreen_get_ih_wptr
	.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	x8, [x0, #24]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x19, #16]
Lloh0:
	adrp	x9, _R600_WB_IH_WPTR_OFFSET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _R600_WB_IH_WPTR_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w10, w9, #3
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #2
	ldr	w0, [x8, w9, sxtw #2]
	bl	_le32_to_cpu
	b	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _IH_RB_WPTR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IH_RB_WPTR@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_RREG32
LBB0_3:
	mov	x20, x0
Lloh6:
	adrp	x8, _RB_OVERFLOW@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RB_OVERFLOW@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.4:
	ldp	w8, w0, [x19, #4]
	add	w21, w20, #16
	ldr	w3, [x19]
	add	w4, w8, w21
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_warn
	ldr	w8, [x19, #4]
	and	w8, w8, w21
	str	w8, [x19]
Lloh11:
	adrp	x21, _IH_RB_CNTL@GOTPAGE
Lloh12:
	ldr	x21, [x21, _IH_RB_CNTL@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_RREG32
Lloh13:
	adrp	x8, _IH_WPTR_OVERFLOW_CLEAR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _IH_WPTR_OVERFLOW_CLEAR@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	orr	w1, w8, w0
	ldr	w0, [x21]
	bl	_WREG32
LBB0_5:
	ldr	w8, [x19, #4]
	and	w0, w8, w20
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_R600_WB_IH_WPTR_OFFSET,4,2     ; @R600_WB_IH_WPTR_OFFSET
	.comm	_IH_RB_WPTR,4,2                 ; @IH_RB_WPTR
	.comm	_RB_OVERFLOW,4,2                ; @RB_OVERFLOW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"IH ring buffer overflow (0x%08X, %d, %d)\n"

	.comm	_IH_RB_CNTL,4,2                 ; @IH_RB_CNTL
	.comm	_IH_WPTR_OVERFLOW_CLEAR,4,2     ; @IH_WPTR_OVERFLOW_CLEAR
	.no_dead_strip	_evergreen_get_ih_wptr
.subsections_via_symbols
