	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_play_note                      ## -- Begin function play_note
	.p2align	4, 0x90
_play_note:                             ## @play_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %r14d
	movq	_audio_initialized@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	movss	%xmm0, -20(%rbp)                ## 4-byte Spill
	callq	_audio_init
	movss	-20(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
LBB0_2:
	movq	_audio_config@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.3:
	movq	_voices@GOTPCREL(%rip), %rbx
	cmpl	$7, (%rbx)
	jg	LBB0_8
## %bb.4:
	movq	_playing_notes@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	movss	%xmm0, -20(%rbp)                ## 4-byte Spill
	callq	_stop_all_notes
	movss	-20(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
LBB0_6:
	movq	_playing_note@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movq	_envelope_index@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	xorps	%xmm1, %xmm1
	ucomiss	%xmm1, %xmm0
	jbe	LBB0_8
## %bb.7:
	movq	_frequencies@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	(%rbx), %rcx
	movss	%xmm0, (%rax,%rcx,4)
	movq	_volumes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%r14d, (%rax,%rcx,4)
	incl	(%rbx)
LBB0_8:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_audio_initialized,4,2          ## @audio_initialized
	.comm	_audio_config,8,3               ## @audio_config
	.comm	_voices,4,2                     ## @voices
	.comm	_DISABLE_AUDIO_COUNTER_3_ISR,4,2 ## @DISABLE_AUDIO_COUNTER_3_ISR
	.comm	_playing_notes,8,3              ## @playing_notes
	.comm	_playing_note,4,2               ## @playing_note
	.comm	_envelope_index,8,3             ## @envelope_index
	.comm	_frequencies,8,3                ## @frequencies
	.comm	_volumes,8,3                    ## @volumes
	.comm	_ENABLE_AUDIO_COUNTER_3_ISR,4,2 ## @ENABLE_AUDIO_COUNTER_3_ISR
	.comm	_ENABLE_AUDIO_COUNTER_3_OUTPUT,4,2 ## @ENABLE_AUDIO_COUNTER_3_OUTPUT
	.comm	_SAMPLE_RATE,4,2                ## @SAMPLE_RATE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_play_note                      ; -- Begin function play_note
	.p2align	2
_play_note:                             ; @play_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
	mov	x19, x0
	fmov	s8, s0
Lloh0:
	adrp	x8, _audio_initialized@GOTPAGE
Lloh1:
	ldr	x8, [x8, _audio_initialized@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbnz	w8, LBB0_2
; %bb.1:
	bl	_audio_init
LBB0_2:
Lloh3:
	adrp	x8, _audio_config@GOTPAGE
Lloh4:
	ldr	x8, [x8, _audio_config@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x20, _voices@GOTPAGE
Lloh7:
	ldr	x20, [x20, _voices@GOTPAGEOFF]
	ldr	w9, [x20]
	cmp	x8, #0
	ccmp	w9, #7, #0, ne
	b.gt	LBB0_7
; %bb.3:
Lloh8:
	adrp	x8, _playing_notes@GOTPAGE
Lloh9:
	ldr	x8, [x8, _playing_notes@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.4:
	bl	_stop_all_notes
LBB0_5:
Lloh11:
	adrp	x8, _playing_note@GOTPAGE
Lloh12:
	ldr	x8, [x8, _playing_note@GOTPAGEOFF]
	mov	w9, #1
Lloh13:
	str	w9, [x8]
Lloh14:
	adrp	x8, _envelope_index@GOTPAGE
Lloh15:
	ldr	x8, [x8, _envelope_index@GOTPAGEOFF]
Lloh16:
	str	xzr, [x8]
	fcmp	s8, #0.0
	b.le	LBB0_7
; %bb.6:
Lloh17:
	adrp	x8, _frequencies@GOTPAGE
Lloh18:
	ldr	x8, [x8, _frequencies@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	ldrsw	x9, [x20]
	lsl	x9, x9, #2
	str	s8, [x8, x9]
Lloh20:
	adrp	x8, _volumes@GOTPAGE
Lloh21:
	ldr	x8, [x8, _volumes@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	str	w19, [x8, x9]
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_audio_initialized,4,2          ; @audio_initialized
	.comm	_audio_config,8,3               ; @audio_config
	.comm	_voices,4,2                     ; @voices
	.comm	_DISABLE_AUDIO_COUNTER_3_ISR,4,2 ; @DISABLE_AUDIO_COUNTER_3_ISR
	.comm	_playing_notes,8,3              ; @playing_notes
	.comm	_playing_note,4,2               ; @playing_note
	.comm	_envelope_index,8,3             ; @envelope_index
	.comm	_frequencies,8,3                ; @frequencies
	.comm	_volumes,8,3                    ; @volumes
	.comm	_ENABLE_AUDIO_COUNTER_3_ISR,4,2 ; @ENABLE_AUDIO_COUNTER_3_ISR
	.comm	_ENABLE_AUDIO_COUNTER_3_OUTPUT,4,2 ; @ENABLE_AUDIO_COUNTER_3_OUTPUT
	.comm	_SAMPLE_RATE,4,2                ; @SAMPLE_RATE
.subsections_via_symbols
