	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SNDDMA_GetDMAPos               ## -- Begin function SNDDMA_GetDMAPos
	.p2align	4, 0x90
_SNDDMA_GetDMAPos:                      ## @SNDDMA_GetDMAPos
	.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	_snd_inited@GOTPCREL(%rip), %r14
	xorl	%ebx, %ebx
	cmpq	$0, (%r14)
	je	LBB0_4
## %bb.1:
	movq	_audio_fd@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_SNDCTL_DSP_GETOPTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	callq	_ioctl
	cmpl	$-1, %eax
	je	LBB0_2
## %bb.3:
	movq	_dma@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	7(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	movl	-32(%rbp), %eax
	sarl	$3, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %ebx
	jmp	LBB0_4
LBB0_2:
	movq	_snddevice@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_perror
	leaq	L_.str(%rip), %rdi
	callq	_Com_Printf
	movl	(%r15), %edi
	callq	_close
	movq	$0, (%r14)
LBB0_4:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_snd_inited,8,3                 ## @snd_inited
	.comm	_audio_fd,4,2                   ## @audio_fd
	.comm	_SNDCTL_DSP_GETOPTR,4,2         ## @SNDCTL_DSP_GETOPTR
	.comm	_snddevice,8,3                  ## @snddevice
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Uh, sound dead.\n"

	.comm	_dma,4,2                        ## @dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SNDDMA_GetDMAPos               ; -- Begin function SNDDMA_GetDMAPos
	.p2align	2
_SNDDMA_GetDMAPos:                      ; @SNDDMA_GetDMAPos
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
Lloh0:
	adrp	x19, _snd_inited@GOTPAGE
Lloh1:
	ldr	x19, [x19, _snd_inited@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_3
; %bb.1:
Lloh2:
	adrp	x20, _audio_fd@GOTPAGE
Lloh3:
	ldr	x20, [x20, _audio_fd@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh4:
	adrp	x8, _SNDCTL_DSP_GETOPTR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SNDCTL_DSP_GETOPTR@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.2:
	ldr	w8, [sp, #8]
Lloh7:
	adrp	x9, _dma@GOTPAGE
Lloh8:
	ldr	x9, [x9, _dma@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	add	w10, w9, #7
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #3
	sdiv	w0, w8, w9
	b	LBB0_5
LBB0_3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh10:
	adrp	x8, _snddevice@GOTPAGE
Lloh11:
	ldr	x8, [x8, _snddevice@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_perror
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Com_Printf
	ldr	w0, [x20]
	bl	_close
	mov	w0, #0
	str	xzr, [x19]
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_snd_inited,8,3                 ; @snd_inited
	.comm	_audio_fd,4,2                   ; @audio_fd
	.comm	_SNDCTL_DSP_GETOPTR,4,2         ; @SNDCTL_DSP_GETOPTR
	.comm	_snddevice,8,3                  ; @snddevice
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Uh, sound dead.\n"

	.comm	_dma,4,2                        ; @dma
.subsections_via_symbols
