	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function S_GetSoundtime
LCPI0_0:
	.long	0x447a0000                      ## float 1000
LCPI0_1:
	.long	0x3f800000                      ## float 1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_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	_CL_VideoRecording
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_cl_aviFrameRate@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movss	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	callq	_MIN
	movss	8(%r15), %xmm2                  ## xmm2 = mem[0],zero,zero,zero
	divss	%xmm0, %xmm2
	movss	LCPI0_1(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	movaps	%xmm2, %xmm0
	callq	_MAX
	movq	_clc@GOTPCREL(%rip), %rax
	addss	(%rax), %xmm0
	cvttss2si	%xmm0, %ecx
	movq	_s_soundtime@GOTPCREL(%rip), %rdx
	addl	%ecx, (%rdx)
	cvttps2dq	%xmm0, %xmm1
	cvtdq2ps	%xmm1, %xmm1
	subss	%xmm1, %xmm0
	movss	%xmm0, (%rax)
	jmp	LBB0_9
LBB0_2:
	xorl	%eax, %eax
	callq	_SNDDMA_GetDMAPos
	movl	%eax, %ebx
	cmpl	_S_GetSoundtime.oldsamplepos(%rip), %eax
	jge	LBB0_5
## %bb.3:
	incl	_S_GetSoundtime.buffers(%rip)
	movq	_s_paintedtime@GOTPCREL(%rip), %rax
	cmpl	$1073741825, (%rax)             ## imm = 0x40000001
	jl	LBB0_5
## %bb.4:
	movl	$0, _S_GetSoundtime.buffers(%rip)
	movl	%r14d, (%rax)
	xorl	%eax, %eax
	callq	_S_Base_StopAllSounds
LBB0_5:
	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	12(%r15), %ecx
	cmpl	$255, %ecx
	jg	LBB0_7
## %bb.6:
	cvtsi2ss	%eax, %xmm0
	movq	_s_mixPreStep@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cvtsi2ssl	(%rax), %xmm1
	mulss	8(%r15), %xmm1
	addss	%xmm0, %xmm1
	cvttss2si	%xmm1, %ecx
	jmp	LBB0_8
LBB0_7:
	addl	%eax, %ecx
LBB0_8:
	movq	_s_paintedtime@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
LBB0_9:
	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	_cl_aviFrameRate,8,3            ## @cl_aviFrameRate
	.comm	_clc,4,2                        ## @clc
	.comm	_s_soundtime,4,2                ## @s_soundtime
	.comm	_s_paintedtime,4,2              ## @s_paintedtime
	.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	w19, w21, [x20]
	bl	_CL_VideoRecording
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _cl_aviFrameRate@GOTPAGE
Lloh3:
	ldr	x8, [x8, _cl_aviFrameRate@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	w0, [x8]
	mov	w8, #1148846080
	fmov	s0, w8
	bl	_MIN
	ldr	s1, [x20, #8]
	fdiv	s0, s1, s0
	fmov	s1, #1.00000000
	bl	_MAX
Lloh5:
	adrp	x8, _clc@GOTPAGE
Lloh6:
	ldr	x8, [x8, _clc@GOTPAGEOFF]
	ldr	s1, [x8]
	fadd	s0, s0, s1
	fcvtzs	w9, s0
Lloh7:
	adrp	x10, _s_soundtime@GOTPAGE
Lloh8:
	ldr	x10, [x10, _s_soundtime@GOTPAGEOFF]
	ldr	w11, [x10]
	add	w9, w11, w9
	str	w9, [x10]
	fcvtzs	s1, s0
	scvtf	s1, s1
	fsub	s0, s0, s1
	str	s0, [x8]
	b	LBB0_9
LBB0_2:
	sdiv	w22, w19, w21
	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
Lloh9:
	adrp	x21, _s_paintedtime@GOTPAGE
Lloh10:
	ldr	x21, [x21, _s_paintedtime@GOTPAGEOFF]
	cmp	w0, w8
	b.ge	LBB0_5
; %bb.3:
	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_5
; %bb.4:
	str	wzr, [x24, _S_GetSoundtime.buffers@PAGEOFF]
	str	w22, [x21]
	bl	_S_Base_StopAllSounds
LBB0_5:
	str	w19, [x23, _S_GetSoundtime.oldsamplepos@PAGEOFF]
	ldr	w8, [x24, _S_GetSoundtime.buffers@PAGEOFF]
	ldr	w9, [x20, #4]
	sdiv	w9, w19, w9
	madd	w8, w8, w22, w9
Lloh11:
	adrp	x9, _s_soundtime@GOTPAGE
Lloh12:
	ldr	x9, [x9, _s_soundtime@GOTPAGEOFF]
Lloh13:
	str	w8, [x9]
	ldr	w9, [x20, #12]
	cmp	w9, #255
	b.gt	LBB0_7
; %bb.6:
	scvtf	s0, w8
Lloh14:
	adrp	x8, _s_mixPreStep@GOTPAGE
Lloh15:
	ldr	x8, [x8, _s_mixPreStep@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	ldr	s1, [x8]
	scvtf	s1, s1
	ldr	s2, [x20, #8]
	fmadd	s0, s1, s2, s0
	fcvtzs	w8, s0
	b	LBB0_8
LBB0_7:
	add	w8, w9, w8
LBB0_8:
	str	w8, [x21]
LBB0_9:
	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	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.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	_cl_aviFrameRate,8,3            ; @cl_aviFrameRate
	.comm	_clc,4,2                        ; @clc
	.comm	_s_soundtime,4,2                ; @s_soundtime
	.comm	_s_paintedtime,4,2              ; @s_paintedtime
	.comm	_s_mixPreStep,8,3               ; @s_mixPreStep
.subsections_via_symbols
