	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_GetSoundtime                 ## -- Begin function S_GetSoundtime
	.p2align	4, 0x90
_S_GetSoundtime:                        ## @S_GetSoundtime
	.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	_dma@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	cltd
	idivl	4(%r15)
	movl	%eax, %r14d
	xorl	%eax, %eax
	callq	_SNDDMA_GetDMAPos
	movl	%eax, %ebx
	cmpl	_S_GetSoundtime.oldsamplepos(%rip), %eax
	jge	LBB0_3
## %bb.1:
	incl	_S_GetSoundtime.buffers(%rip)
	movq	_s_paintedtime@GOTPCREL(%rip), %rax
	cmpl	$1073741825, (%rax)             ## imm = 0x40000001
	jl	LBB0_3
## %bb.2:
	movl	$0, _S_GetSoundtime.buffers(%rip)
	movl	%r14d, (%rax)
	xorl	%eax, %eax
	callq	_S_StopAllSounds
LBB0_3:
	movl	%ebx, _S_GetSoundtime.oldsamplepos(%rip)
	imull	_S_GetSoundtime.buffers(%rip), %r14d
	movl	%ebx, %eax
	cltd
	idivl	4(%r15)
	addl	%r14d, %eax
	movq	_s_soundtime@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	8(%r15), %ecx
	cmpl	$255, %ecx
	jg	LBB0_5
## %bb.4:
	movq	_s_mixPreStep@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movl	12(%r15), %ecx
	imull	(%rdx), %ecx
LBB0_5:
	addl	%eax, %ecx
	movq	_s_paintedtime@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_S_GetSoundtime.buffers,4,2 ## @S_GetSoundtime.buffers
.zerofill __DATA,__bss,_S_GetSoundtime.oldsamplepos,4,2 ## @S_GetSoundtime.oldsamplepos
	.comm	_dma,16,2                       ## @dma
	.comm	_s_paintedtime,4,2              ## @s_paintedtime
	.comm	_s_soundtime,4,2                ## @s_soundtime
	.comm	_s_mixPreStep,8,3               ## @s_mixPreStep
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_GetSoundtime                 ; -- Begin function S_GetSoundtime
	.p2align	2
_S_GetSoundtime:                        ; @S_GetSoundtime
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x20, _dma@GOTPAGE
Lloh1:
	ldr	x20, [x20, _dma@GOTPAGEOFF]
	ldp	w8, w9, [x20]
	sdiv	w22, w8, w9
	bl	_SNDDMA_GetDMAPos
	mov	x19, x0
	adrp	x23, _S_GetSoundtime.oldsamplepos@PAGE
	ldr	w8, [x23, _S_GetSoundtime.oldsamplepos@PAGEOFF]
	adrp	x24, _S_GetSoundtime.buffers@PAGE
Lloh2:
	adrp	x21, _s_paintedtime@GOTPAGE
Lloh3:
	ldr	x21, [x21, _s_paintedtime@GOTPAGEOFF]
	cmp	w0, w8
	b.ge	LBB0_3
; %bb.1:
	ldr	w8, [x24, _S_GetSoundtime.buffers@PAGEOFF]
	add	w8, w8, #1
	str	w8, [x24, _S_GetSoundtime.buffers@PAGEOFF]
	ldr	w8, [x21]
	mov	w9, #1
	movk	w9, #16384, lsl #16
	cmp	w8, w9
	b.lt	LBB0_3
; %bb.2:
	str	wzr, [x24, _S_GetSoundtime.buffers@PAGEOFF]
	str	w22, [x21]
	bl	_S_StopAllSounds
LBB0_3:
	str	w19, [x23, _S_GetSoundtime.oldsamplepos@PAGEOFF]
	ldr	w8, [x24, _S_GetSoundtime.buffers@PAGEOFF]
	ldp	w10, w9, [x20, #4]
	sdiv	w10, w19, w10
	madd	w8, w8, w22, w10
Lloh4:
	adrp	x10, _s_soundtime@GOTPAGE
Lloh5:
	ldr	x10, [x10, _s_soundtime@GOTPAGEOFF]
Lloh6:
	str	w8, [x10]
	cmp	w9, #255
	b.gt	LBB0_5
; %bb.4:
Lloh7:
	adrp	x9, _s_mixPreStep@GOTPAGE
Lloh8:
	ldr	x9, [x9, _s_mixPreStep@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	ldr	w9, [x9]
	ldr	w10, [x20, #12]
	mul	w9, w10, w9
LBB0_5:
	add	w8, w9, w8
	str	w8, [x21]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_S_GetSoundtime.buffers,4,2 ; @S_GetSoundtime.buffers
.zerofill __DATA,__bss,_S_GetSoundtime.oldsamplepos,4,2 ; @S_GetSoundtime.oldsamplepos
	.comm	_dma,16,2                       ; @dma
	.comm	_s_paintedtime,4,2              ; @s_paintedtime
	.comm	_s_soundtime,4,2                ; @s_soundtime
	.comm	_s_mixPreStep,8,3               ; @s_mixPreStep
.subsections_via_symbols
