	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function my_audio_callback
_my_audio_callback:                     ## @my_audio_callback
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_l_PluginInit@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_3
## %bb.1:
	movl	%edx, %r15d
	movq	%rsi, %r14
	xorl	%eax, %eax
	callq	_SDL_GetTicks
	movl	%eax, %r8d
	movq	_last_callback_ticks@GOTPCREL(%rip), %rax
	movl	%r8d, (%rax)
	movq	_OutputFreq@GOTPCREL(%rip), %rax
	imull	$100, (%rax), %eax
	movq	_speed_factor@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, %r9d
	movq	_GameFreq@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_buffer_pos@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	%ebx, %edi
	imull	%r15d, %edi
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%r9d
	cmpl	%eax, %esi
	jbe	LBB0_2
## %bb.4:
	movq	_primaryBuffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_mixBuffer@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movl	%ebx, %edx
	movl	%r15d, %r8d
	callq	_resample
	movl	%eax, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_memset
	movq	(%r12), %rsi
	movq	_VolSDL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_SDL_MixAudio
	movq	_primaryBuffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movslq	%ebx, %rbx
	leaq	(%rdi,%rbx,4), %rsi
	movl	(%r13), %edx
	subl	%ebx, %edx
	callq	_memmove
	subl	%ebx, (%r13)
	movq	_M64MSG_VERBOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_last_callback_ticks@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	imulq	$274877907, %rcx, %rax          ## imm = 0x10624DD3
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$38, %rax
	addl	%edx, %eax
	imull	$1000, %eax, %eax               ## imm = 0x3E8
	subl	%eax, %ecx
	movq	_SDL_SAMPLE_BYTES@GOTPCREL(%rip), %rsi
	movl	%r15d, %eax
	cltd
	idivl	(%rsi)
	leaq	L_.str(%rip), %rsi
	movl	%ecx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DebugMessage                   ## TAILCALL
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_SDL_SAMPLE_BYTES@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	imull	%r9d, %ecx
	movl	%edi, %eax
	cltd
	idivl	%ecx
	movl	%eax, %r9d
	movq	_N64_SAMPLE_BYTES@GOTPCREL(%rip), %rcx
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	(%rcx)
	movq	_underrun_count@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ecx
	incl	%ecx
	movl	%ecx, (%rdx)
	movq	_M64MSG_VERBOSE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	movslq	%r8d, %rdx
	imulq	$274877907, %rdx, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$38, %rdx
	addl	%esi, %edx
	imull	$1000, %edx, %edx               ## imm = 0x3E8
	subl	%edx, %r8d
	leaq	L_.str.1(%rip), %rsi
	movl	%r8d, %edx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_DebugMessage
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memset                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_l_PluginInit,4,2               ## @l_PluginInit
	.comm	_last_callback_ticks,4,2        ## @last_callback_ticks
	.comm	_OutputFreq,4,2                 ## @OutputFreq
	.comm	_speed_factor,4,2               ## @speed_factor
	.comm	_GameFreq,4,2                   ## @GameFreq
	.comm	_buffer_pos,4,2                 ## @buffer_pos
	.comm	_primaryBuffer,8,3              ## @primaryBuffer
	.comm	_mixBuffer,8,3                  ## @mixBuffer
	.comm	_VolSDL,4,2                     ## @VolSDL
	.comm	_M64MSG_VERBOSE,4,2             ## @M64MSG_VERBOSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%03i my_audio_callback: used %i samples"

	.comm	_SDL_SAMPLE_BYTES,4,2           ## @SDL_SAMPLE_BYTES
	.comm	_N64_SAMPLE_BYTES,4,2           ## @N64_SAMPLE_BYTES
	.comm	_underrun_count,4,2             ## @underrun_count
L_.str.1:                               ## @.str.1
	.asciz	"%03i Buffer underflow (%i).  %i samples present, %i needed"

	.comm	_VOLUME_TYPE_OSS,8,3            ## @VOLUME_TYPE_OSS
	.comm	_VolumeControlType,8,3          ## @VolumeControlType
	.no_dead_strip	_my_audio_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function my_audio_callback
_my_audio_callback:                     ; @my_audio_callback
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x8, _l_PluginInit@GOTPAGE
Lloh1:
	ldr	x8, [x8, _l_PluginInit@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	bl	_SDL_GetTicks
Lloh3:
	adrp	x22, _last_callback_ticks@GOTPAGE
Lloh4:
	ldr	x22, [x22, _last_callback_ticks@GOTPAGEOFF]
	str	w0, [x22]
Lloh5:
	adrp	x8, _OutputFreq@GOTPAGE
Lloh6:
	ldr	x8, [x8, _OutputFreq@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	mov	w9, #100
Lloh8:
	adrp	x10, _speed_factor@GOTPAGE
Lloh9:
	ldr	x10, [x10, _speed_factor@GOTPAGEOFF]
	mul	w8, w8, w9
Lloh10:
	ldr	w9, [x10]
	sdiv	w5, w8, w9
Lloh11:
	adrp	x8, _GameFreq@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GameFreq@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x23, _buffer_pos@GOTPAGE
Lloh15:
	ldr	x23, [x23, _buffer_pos@GOTPAGEOFF]
	ldr	w1, [x23]
	mul	w8, w2, w19
	udiv	w9, w8, w5
	cmp	w1, w9
	b.ls	LBB0_4
; %bb.2:
Lloh16:
	adrp	x24, _primaryBuffer@GOTPAGE
Lloh17:
	ldr	x24, [x24, _primaryBuffer@GOTPAGEOFF]
	ldr	x0, [x24]
Lloh18:
	adrp	x25, _mixBuffer@GOTPAGE
Lloh19:
	ldr	x25, [x25, _mixBuffer@GOTPAGEOFF]
	ldr	x3, [x25]
	mov	x4, x19
	bl	_resample
	mov	x21, x0
	mov	x0, x20
	mov	w1, #0
	mov	x2, x19
	bl	_memset
	ldr	x1, [x25]
Lloh20:
	adrp	x8, _VolSDL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _VolSDL@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x2, x19
	bl	_SDL_MixAudio
	ldr	x0, [x24]
	add	x1, x0, w21, sxtw #2
	ldr	w8, [x23]
	sub	w2, w8, w21
	bl	_memmove
	ldr	w8, [x23]
	sub	w8, w8, w21
	str	w8, [x23]
Lloh23:
	adrp	x8, _M64MSG_VERBOSE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _M64MSG_VERBOSE@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	ldrsw	x8, [x22]
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	mul	x9, x8, x9
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
	mov	w10, #1000
	msub	w2, w9, w10, w8
Lloh26:
	adrp	x8, _SDL_SAMPLE_BYTES@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SDL_SAMPLE_BYTES@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	sdiv	w3, w19, w8
Lloh29:
	adrp	x1, l_.str@PAGE
Lloh30:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_DebugMessage
LBB0_3:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_4:
Lloh31:
	adrp	x9, _SDL_SAMPLE_BYTES@GOTPAGE
Lloh32:
	ldr	x9, [x9, _SDL_SAMPLE_BYTES@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	mul	w9, w9, w5
Lloh34:
	adrp	x10, _N64_SAMPLE_BYTES@GOTPAGE
Lloh35:
	ldr	x10, [x10, _N64_SAMPLE_BYTES@GOTPAGEOFF]
	sdiv	w8, w8, w9
Lloh36:
	ldr	w9, [x10]
Lloh37:
	adrp	x10, _underrun_count@GOTPAGE
Lloh38:
	ldr	x10, [x10, _underrun_count@GOTPAGEOFF]
	ldr	w11, [x10]
	add	w3, w11, #1
	str	w3, [x10]
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	smull	x10, w0, w10
	lsr	x11, x10, #63
	asr	x10, x10, #38
	add	w10, w10, w11
	mov	w11, #1000
	msub	w2, w10, w11, w0
Lloh39:
	adrp	x10, _M64MSG_VERBOSE@GOTPAGE
Lloh40:
	ldr	x10, [x10, _M64MSG_VERBOSE@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x10]
	udiv	w9, w1, w9
	stp	x9, x8, [sp]
Lloh42:
	adrp	x1, l_.str.1@PAGE
Lloh43:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_DebugMessage
	mov	x0, x20
	mov	w1, #0
	mov	x2, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_memset
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_l_PluginInit,4,2               ; @l_PluginInit
	.comm	_last_callback_ticks,4,2        ; @last_callback_ticks
	.comm	_OutputFreq,4,2                 ; @OutputFreq
	.comm	_speed_factor,4,2               ; @speed_factor
	.comm	_GameFreq,4,2                   ; @GameFreq
	.comm	_buffer_pos,4,2                 ; @buffer_pos
	.comm	_primaryBuffer,8,3              ; @primaryBuffer
	.comm	_mixBuffer,8,3                  ; @mixBuffer
	.comm	_VolSDL,4,2                     ; @VolSDL
	.comm	_M64MSG_VERBOSE,4,2             ; @M64MSG_VERBOSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%03i my_audio_callback: used %i samples"

	.comm	_SDL_SAMPLE_BYTES,4,2           ; @SDL_SAMPLE_BYTES
	.comm	_N64_SAMPLE_BYTES,4,2           ; @N64_SAMPLE_BYTES
	.comm	_underrun_count,4,2             ; @underrun_count
l_.str.1:                               ; @.str.1
	.asciz	"%03i Buffer underflow (%i).  %i samples present, %i needed"

	.comm	_VOLUME_TYPE_OSS,8,3            ; @VOLUME_TYPE_OSS
	.comm	_VolumeControlType,8,3          ; @VolumeControlType
	.no_dead_strip	_my_audio_callback
.subsections_via_symbols
