	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hdsp_hw_pointer
_hdsp_hw_pointer:                       ## @hdsp_hw_pointer
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_HDSP_statusRegister@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hdsp_read
                                        ## kill: def $eax killed $eax def $rax
	cmpl	$0, 4(%rbx)
	je	LBB0_1
## %bb.4:
	movq	_HDSP_BufferPositionMask@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	movl	(%rbx), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	decl	%eax
	andl	%ecx, %eax
	jmp	LBB0_5
LBB0_1:
	movq	_HDSP_BufferID@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.3:
	movl	(%rbx), %ecx
	leal	3(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$2, %eax
	jmp	LBB0_5
LBB0_2:
	xorl	%eax, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDSP_statusRegister,4,2        ## @HDSP_statusRegister
	.comm	_HDSP_BufferID,4,2              ## @HDSP_BufferID
	.comm	_HDSP_BufferPositionMask,4,2    ## @HDSP_BufferPositionMask
	.no_dead_strip	_hdsp_hw_pointer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hdsp_hw_pointer
_hdsp_hw_pointer:                       ; @hdsp_hw_pointer
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _HDSP_statusRegister@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HDSP_statusRegister@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_hdsp_read
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _HDSP_BufferPositionMask@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HDSP_BufferPositionMask@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ands	w8, w8, w0
	add	w9, w8, #3
	csel	w8, w9, w8, lt
	ldr	w9, [x19]
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w9, w9, #1
	sub	w9, w9, #1
	and	w0, w9, w8, asr #2
	b	LBB0_5
LBB0_2:
Lloh6:
	adrp	x8, _HDSP_BufferID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HDSP_BufferID@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.3:
	ldr	w8, [x19]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w0, w8, #2
	b	LBB0_5
LBB0_4:
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_HDSP_statusRegister,4,2        ; @HDSP_statusRegister
	.comm	_HDSP_BufferID,4,2              ; @HDSP_BufferID
	.comm	_HDSP_BufferPositionMask,4,2    ; @HDSP_BufferPositionMask
	.no_dead_strip	_hdsp_hw_pointer
.subsections_via_symbols
