	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gx_audio_Update                ## -- Begin function gx_audio_Update
	.p2align	4, 0x90
_gx_audio_Update:                       ## @gx_audio_Update
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_audio_sync@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	je	LBB0_2
## %bb.1:
	movq	_NO_SYNC@GOTPCREL(%rip), %rbx
	jmp	LBB0_7
LBB0_2:
	movq	_soundbuffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_mixbuffer@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movq	(%rax,%rcx,8), %rbx
	movq	%rbx, %rdi
	callq	_audio_update
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,4), %r14d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_DCFlushRange
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	_AUDIO_InitDMA
	movq	(%r12), %rax
	incq	%rax
	movq	_SOUND_BUFFER_NUM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_3
## %bb.4:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_5
LBB0_3:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_5:
	movq	%rdx, (%r12)
	movl	$1, (%r15)
	movq	_audioStarted@GOTPCREL(%rip), %r14
	movq	_SYNC_AUDIO@GOTPCREL(%rip), %rbx
	cmpl	$0, (%r14)
	jne	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	callq	_AUDIO_StopDMA
	xorl	%eax, %eax
	callq	_AUDIO_StartDMA
	movl	$1, (%r14)
LBB0_7:
	movl	(%rbx), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_audio_sync,4,2                 ## @audio_sync
	.comm	_soundbuffer,8,3                ## @soundbuffer
	.comm	_mixbuffer,8,3                  ## @mixbuffer
	.comm	_SOUND_BUFFER_NUM,8,3           ## @SOUND_BUFFER_NUM
	.comm	_audioStarted,4,2               ## @audioStarted
	.comm	_SYNC_AUDIO,4,2                 ## @SYNC_AUDIO
	.comm	_NO_SYNC,4,2                    ## @NO_SYNC
	.comm	_LOGSIZE,4,2                    ## @LOGSIZE
	.comm	_delta_samp,8,3                 ## @delta_samp
	.comm	_frame_cnt,4,2                  ## @frame_cnt
	.comm	_prevtime,8,3                   ## @prevtime
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gx_audio_Update                ; -- Begin function gx_audio_Update
	.p2align	2
_gx_audio_Update:                       ; @gx_audio_Update
	.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
Lloh0:
	adrp	x21, _audio_sync@GOTPAGE
Lloh1:
	ldr	x21, [x21, _audio_sync@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w8, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _NO_SYNC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NO_SYNC@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:
Lloh4:
	adrp	x8, _soundbuffer@GOTPAGE
Lloh5:
	ldr	x8, [x8, _soundbuffer@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
Lloh7:
	adrp	x22, _mixbuffer@GOTPAGE
Lloh8:
	ldr	x22, [x22, _mixbuffer@GOTPAGEOFF]
	ldr	x9, [x22]
	ldr	x19, [x8, x9, lsl #3]
	mov	x0, x19
	bl	_audio_update
	lsl	w20, w0, #2
	mov	x0, x19
	mov	x1, x20
	bl	_DCFlushRange
	mov	x0, x19
	mov	x1, x20
	bl	_AUDIO_InitDMA
	ldr	x8, [x22]
	add	x8, x8, #1
Lloh9:
	adrp	x9, _SOUND_BUFFER_NUM@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SOUND_BUFFER_NUM@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	udiv	x10, x8, x9
	msub	x8, x10, x9, x8
	str	x8, [x22]
	mov	w19, #1
	str	w19, [x21]
Lloh12:
	adrp	x20, _audioStarted@GOTPAGE
Lloh13:
	ldr	x20, [x20, _audioStarted@GOTPAGEOFF]
	ldr	w8, [x20]
	cbnz	w8, LBB0_4
; %bb.3:
	bl	_AUDIO_StopDMA
	bl	_AUDIO_StartDMA
	str	w19, [x20]
LBB0_4:
Lloh14:
	adrp	x8, _SYNC_AUDIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SYNC_AUDIO@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_audio_sync,4,2                 ; @audio_sync
	.comm	_soundbuffer,8,3                ; @soundbuffer
	.comm	_mixbuffer,8,3                  ; @mixbuffer
	.comm	_SOUND_BUFFER_NUM,8,3           ; @SOUND_BUFFER_NUM
	.comm	_audioStarted,4,2               ; @audioStarted
	.comm	_SYNC_AUDIO,4,2                 ; @SYNC_AUDIO
	.comm	_NO_SYNC,4,2                    ; @NO_SYNC
	.comm	_LOGSIZE,4,2                    ; @LOGSIZE
	.comm	_delta_samp,8,3                 ; @delta_samp
	.comm	_frame_cnt,4,2                  ; @frame_cnt
	.comm	_prevtime,8,3                   ; @prevtime
.subsections_via_symbols
