	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stop_note                      ## -- Begin function stop_note
	.p2align	4, 0x90
_stop_note:                             ## @stop_note
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movss	%xmm0, -12(%rbp)                ## 4-byte Spill
	cvttss2si	%xmm0, %esi
	leaq	L_.str(%rip), %rdi
	callq	_dprintf
	movq	_playing_note@GOTPCREL(%rip), %rbx
	cmpl	$0, (%rbx)
	je	LBB0_16
## %bb.1:
	movq	_audio_initialized@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_audio_init
LBB0_3:
	movq	_frequencies@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movss	28(%rax), %xmm0                 ## xmm0 = mem[0],zero,zero,zero
	movss	-12(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	jne	LBB0_17
	jp	LBB0_17
## %bb.4:
	movl	$0, 28(%rax)
	movq	_volumes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	$0, 56(%rax)
	jmp	LBB0_12
LBB0_17:
	movss	24(%rax), %xmm0                 ## xmm0 = mem[0],zero,zero,zero
	movl	$6, %ecx
	ucomiss	%xmm1, %xmm0
	jne	LBB0_18
	jnp	LBB0_5
LBB0_18:
	movss	20(%rax), %xmm0                 ## xmm0 = mem[0],zero,zero,zero
	movl	$5, %ecx
	ucomiss	%xmm1, %xmm0
	jne	LBB0_19
	jnp	LBB0_5
LBB0_19:
	movss	16(%rax), %xmm0                 ## xmm0 = mem[0],zero,zero,zero
	movl	$4, %ecx
	ucomiss	%xmm1, %xmm0
	jne	LBB0_20
	jnp	LBB0_5
LBB0_20:
	movss	12(%rax), %xmm0                 ## xmm0 = mem[0],zero,zero,zero
	movl	$3, %ecx
	ucomiss	%xmm1, %xmm0
	jne	LBB0_21
	jnp	LBB0_5
LBB0_21:
	movss	8(%rax), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	movl	$2, %ecx
	ucomiss	%xmm1, %xmm0
	jne	LBB0_22
	jnp	LBB0_5
LBB0_22:
	movss	4(%rax), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	movl	$1, %ecx
	ucomiss	%xmm1, %xmm0
	jne	LBB0_23
	jnp	LBB0_5
LBB0_23:
	movss	(%rax), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	jne	LBB0_12
	jp	LBB0_12
## %bb.24:
	xorl	%ecx, %ecx
LBB0_5:
	movl	$0, (%rax,%rcx,4)
	movq	_volumes@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	$0, (%rdx,%rcx,8)
	leaq	1(%rcx), %rsi
	movss	4(%rax,%rcx,4), %xmm0           ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rax,%rcx,4)
	movl	$0, 4(%rax,%rcx,4)
	movq	8(%rdx,%rcx,8), %rdi
	movq	%rdi, (%rdx,%rcx,8)
	movq	$0, 8(%rdx,%rcx,8)
	cmpq	$7, %rsi
	je	LBB0_12
## %bb.6:
	leaq	2(%rcx), %rsi
	movss	8(%rax,%rcx,4), %xmm0           ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 4(%rax,%rcx,4)
	movl	$0, 8(%rax,%rcx,4)
	movq	16(%rdx,%rcx,8), %rdi
	movq	%rdi, 8(%rdx,%rcx,8)
	movq	$0, 16(%rdx,%rcx,8)
	cmpq	$7, %rsi
	je	LBB0_12
## %bb.7:
	leaq	3(%rcx), %rsi
	movss	12(%rax,%rcx,4), %xmm0          ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 8(%rax,%rcx,4)
	movl	$0, 12(%rax,%rcx,4)
	movq	24(%rdx,%rcx,8), %rdi
	movq	%rdi, 16(%rdx,%rcx,8)
	movq	$0, 24(%rdx,%rcx,8)
	cmpq	$7, %rsi
	je	LBB0_12
## %bb.8:
	leaq	4(%rcx), %rsi
	movss	16(%rax,%rcx,4), %xmm0          ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 12(%rax,%rcx,4)
	movl	$0, 16(%rax,%rcx,4)
	movq	32(%rdx,%rcx,8), %rdi
	movq	%rdi, 24(%rdx,%rcx,8)
	movq	$0, 32(%rdx,%rcx,8)
	cmpq	$7, %rsi
	je	LBB0_12
## %bb.9:
	leaq	5(%rcx), %rsi
	movss	20(%rax,%rcx,4), %xmm0          ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 16(%rax,%rcx,4)
	movl	$0, 20(%rax,%rcx,4)
	movq	40(%rdx,%rcx,8), %rdi
	movq	%rdi, 32(%rdx,%rcx,8)
	movq	$0, 40(%rdx,%rcx,8)
	cmpq	$7, %rsi
	je	LBB0_12
## %bb.10:
	leaq	6(%rcx), %rsi
	movss	24(%rax,%rcx,4), %xmm0          ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 20(%rax,%rcx,4)
	movl	$0, 24(%rax,%rcx,4)
	movq	48(%rdx,%rcx,8), %rdi
	movq	%rdi, 40(%rdx,%rcx,8)
	movq	$0, 48(%rdx,%rcx,8)
	cmpq	$7, %rsi
	je	LBB0_12
## %bb.11:
	movss	28(%rax,%rcx,4), %xmm0          ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 24(%rax,%rcx,4)
	movl	$0, 28(%rax,%rcx,4)
	movq	56(%rdx,%rcx,8), %rax
	movq	%rax, 48(%rdx,%rcx,8)
	movq	$0, 56(%rdx,%rcx,8)
LBB0_12:
	movq	_voices@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	cmpq	$2, %rdx
	movl	$1, %eax
	cmovgeq	%rdx, %rax
	decq	%rax
	movq	%rax, (%rcx)
	movq	_voice_place@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	jl	LBB0_14
## %bb.13:
	movq	$0, (%rcx)
LBB0_14:
	testq	%rax, %rax
	jne	LBB0_16
## %bb.15:
	xorl	%eax, %eax
	callq	_STOP_CHANNEL_1
	xorl	%eax, %eax
	callq	_STOP_CHANNEL_2
	movq	_GPTD8@GOTPCREL(%rip), %rdi
	callq	_gptStopTimer
	movq	_frequency@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_frequency_alt@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_volume@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movl	$0, (%rbx)
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"audio stop note freq=%d"

	.comm	_playing_note,4,2               ## @playing_note
	.comm	_audio_initialized,4,2          ## @audio_initialized
	.comm	_frequencies,8,3                ## @frequencies
	.comm	_volumes,8,3                    ## @volumes
	.comm	_voices,8,3                     ## @voices
	.comm	_voice_place,8,3                ## @voice_place
	.comm	_GPTD8,4,2                      ## @GPTD8
	.comm	_frequency,8,3                  ## @frequency
	.comm	_frequency_alt,8,3              ## @frequency_alt
	.comm	_volume,8,3                     ## @volume
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stop_note                      ; -- Begin function stop_note
	.p2align	2
_stop_note:                             ; @stop_note
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [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 b8, -40
	.cfi_offset b9, -48
	fmov	s8, s0
	fcvtzs	w1, s0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintf
Lloh2:
	adrp	x19, _playing_note@GOTPAGE
Lloh3:
	ldr	x19, [x19, _playing_note@GOTPAGEOFF]
	ldr	w8, [x19]
	cbz	w8, LBB0_30
; %bb.1:
Lloh4:
	adrp	x8, _audio_initialized@GOTPAGE
Lloh5:
	ldr	x8, [x8, _audio_initialized@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cbnz	w8, LBB0_3
; %bb.2:
	bl	_audio_init
LBB0_3:
Lloh7:
	adrp	x8, _frequencies@GOTPAGE
Lloh8:
	ldr	x8, [x8, _frequencies@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	s0, [x8, #28]
	fcmp	s0, s8
	b.ne	LBB0_6
; %bb.4:
	str	wzr, [x8, #28]
Lloh10:
	adrp	x8, _volumes@GOTPAGE
Lloh11:
	ldr	x8, [x8, _volumes@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	add	x8, x8, #56
LBB0_5:
	str	xzr, [x8]
	b	LBB0_26
LBB0_6:
	ldr	s0, [x8, #24]
	fcmp	s0, s8
	b.ne	LBB0_8
; %bb.7:
	mov	w9, #6
	b	LBB0_20
LBB0_8:
	ldr	s0, [x8, #20]
	fcmp	s0, s8
	b.ne	LBB0_10
; %bb.9:
	mov	w9, #5
	b	LBB0_20
LBB0_10:
	ldr	s0, [x8, #16]
	fcmp	s0, s8
	b.ne	LBB0_12
; %bb.11:
	mov	w9, #4
	b	LBB0_20
LBB0_12:
	ldr	s0, [x8, #12]
	fcmp	s0, s8
	b.ne	LBB0_14
; %bb.13:
	mov	w9, #3
	b	LBB0_20
LBB0_14:
	ldr	s0, [x8, #8]
	fcmp	s0, s8
	b.ne	LBB0_16
; %bb.15:
	mov	w9, #2
	b	LBB0_20
LBB0_16:
	ldr	s0, [x8, #4]
	fcmp	s0, s8
	b.ne	LBB0_18
; %bb.17:
	mov	w9, #1
	b	LBB0_20
LBB0_18:
	ldr	s0, [x8]
	fcmp	s0, s8
	b.ne	LBB0_26
; %bb.19:
	mov	x9, #0
LBB0_20:
Lloh13:
	adrp	x10, _volumes@GOTPAGE
Lloh14:
	ldr	x10, [x10, _volumes@GOTPAGEOFF]
	add	x11, x9, #1
	lsl	x12, x11, #2
	ldr	s0, [x8, x12]
	str	s0, [x8, x9, lsl #2]
Lloh15:
	ldr	x10, [x10]
	str	wzr, [x8, x12]
	lsl	x12, x11, #3
	ldr	x13, [x10, x12]
	str	x13, [x10, x9, lsl #3]
	str	xzr, [x10, x12]
	cmp	x11, #7
	b.eq	LBB0_26
; %bb.21:
	add	x12, x9, #2
	lsl	x13, x12, #2
	ldr	s0, [x8, x13]
	str	s0, [x8, x11, lsl #2]
	str	wzr, [x8, x13]
	lsl	x13, x12, #3
	ldr	x14, [x10, x13]
	str	x14, [x10, x11, lsl #3]
	str	xzr, [x10, x13]
	cmp	x12, #7
	b.eq	LBB0_26
; %bb.22:
	add	x11, x9, #3
	lsl	x13, x11, #2
	ldr	s0, [x8, x13]
	str	s0, [x8, x12, lsl #2]
	str	wzr, [x8, x13]
	lsl	x13, x11, #3
	ldr	x14, [x10, x13]
	str	x14, [x10, x12, lsl #3]
	str	xzr, [x10, x13]
	cmp	x11, #7
	b.eq	LBB0_26
; %bb.23:
	add	x12, x9, #4
	lsl	x13, x12, #2
	ldr	s0, [x8, x13]
	str	s0, [x8, x11, lsl #2]
	str	wzr, [x8, x13]
	lsl	x13, x12, #3
	ldr	x14, [x10, x13]
	str	x14, [x10, x11, lsl #3]
	str	xzr, [x10, x13]
	cmp	x12, #7
	b.eq	LBB0_26
; %bb.24:
	add	x13, x9, #5
	lsl	x11, x13, #2
	ldr	s0, [x8, x11]
	str	s0, [x8, x12, lsl #2]
	str	wzr, [x8, x11]
	lsl	x11, x13, #3
	ldr	x14, [x10, x11]
	str	x14, [x10, x12, lsl #3]
	str	xzr, [x10, x11]
	cmp	x13, #7
	b.eq	LBB0_26
; %bb.25:
	add	x11, x9, #6
	lsl	x12, x11, #2
	ldr	s0, [x8, x12]
	str	s0, [x8, x13, lsl #2]
	str	wzr, [x8, x12]
	lsl	x12, x11, #3
	ldr	x14, [x10, x12]
	str	x14, [x10, x13, lsl #3]
	str	xzr, [x10, x12]
	cmp	x11, #7
	b.ne	LBB0_31
LBB0_26:
Lloh16:
	adrp	x9, _voices@GOTPAGE
Lloh17:
	ldr	x9, [x9, _voices@GOTPAGEOFF]
	ldr	x8, [x9]
	cmp	x8, #1
	csinc	x8, x8, xzr, gt
	sub	x8, x8, #1
	str	x8, [x9]
Lloh18:
	adrp	x9, _voice_place@GOTPAGE
Lloh19:
	ldr	x9, [x9, _voice_place@GOTPAGEOFF]
	ldr	x10, [x9]
	cmp	x10, x8
	b.lt	LBB0_28
; %bb.27:
	str	xzr, [x9]
LBB0_28:
	cbnz	x8, LBB0_30
; %bb.29:
	bl	_STOP_CHANNEL_1
	bl	_STOP_CHANNEL_2
Lloh20:
	adrp	x0, _GPTD8@GOTPAGE
Lloh21:
	ldr	x0, [x0, _GPTD8@GOTPAGEOFF]
	bl	_gptStopTimer
Lloh22:
	adrp	x8, _frequency@GOTPAGE
Lloh23:
	ldr	x8, [x8, _frequency@GOTPAGEOFF]
Lloh24:
	adrp	x9, _frequency_alt@GOTPAGE
Lloh25:
	ldr	x9, [x9, _frequency_alt@GOTPAGEOFF]
Lloh26:
	str	xzr, [x8]
Lloh27:
	str	xzr, [x9]
Lloh28:
	adrp	x8, _volume@GOTPAGE
Lloh29:
	ldr	x8, [x8, _volume@GOTPAGEOFF]
Lloh30:
	str	xzr, [x8]
	str	wzr, [x19]
LBB0_30:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #48               ; 16-byte Folded Reload
	ret
LBB0_31:
	add	x9, x9, #7
	lsl	x12, x9, #2
	ldr	s0, [x8, x12]
	str	s0, [x8, x11, lsl #2]
	str	wzr, [x8, x12]
	add	x8, x10, x9, lsl #3
	ldr	x9, [x8]
	str	x9, [x10, x11, lsl #3]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotStr	Lloh24, Lloh25, Lloh27
	.loh AdrpLdrGotStr	Lloh22, Lloh23, Lloh26
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"audio stop note freq=%d"

	.comm	_playing_note,4,2               ; @playing_note
	.comm	_audio_initialized,4,2          ; @audio_initialized
	.comm	_frequencies,8,3                ; @frequencies
	.comm	_volumes,8,3                    ; @volumes
	.comm	_voices,8,3                     ; @voices
	.comm	_voice_place,8,3                ; @voice_place
	.comm	_GPTD8,4,2                      ; @GPTD8
	.comm	_frequency,8,3                  ; @frequency
	.comm	_frequency_alt,8,3              ; @frequency_alt
	.comm	_volume,8,3                     ; @volume
.subsections_via_symbols
