	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_opl4_note_on               ## -- Begin function snd_opl4_note_on
	.p2align	4, 0x90
_snd_opl4_note_on:                      ## @snd_opl4_note_on
	.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
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %r12d
	movl	%esi, %ebx
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$128, %ecx
	cmpq	$0, 8(%r14)
	jne	LBB0_2
## %bb.1:
	movl	(%r14), %ecx
	andl	$127, %ecx
LBB0_2:
	movq	_snd_yrw801_regions@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	shlq	$4, %rcx
	movl	(%rdx,%rcx), %eax
	testl	%eax, %eax
	jle	LBB0_3
## %bb.4:
	movq	8(%rdx,%rcx), %rcx
	addq	$8, %rcx
	xorl	%r15d, %r15d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	addq	$16, %rcx
	decq	%rax
	je	LBB0_10
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%ebx, -8(%rcx)
	jg	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%ebx, -4(%rcx)
	jl	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%r15d, %edx
	movq	%rcx, -80(%rbp,%rdx,8)
	testl	%r15d, %r15d
	movl	$1, %r15d
	jle	LBB0_9
## %bb.8:
	movl	%ebx, -84(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movl	$2, %r15d
	jmp	LBB0_12
LBB0_10:
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	testl	%r15d, %r15d
	jle	LBB0_27
## %bb.11:
	movl	%ebx, -84(%rbp)                 ## 4-byte Spill
LBB0_12:
	leaq	4(%r13), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	andl	$127, %r12d
	movl	%r15d, -100(%rbp)               ## 4-byte Spill
	movl	%r15d, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	%r13, -120(%rbp)                ## 8-byte Spill
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_snd_opl4_get_voice
	movq	%rax, %r15
	movq	%rax, -64(%rbp,%rbx,8)
	movl	%r12d, %r13d
	movq	%r14, %r12
	leaq	48(%rax), %r14
	movq	%r14, %rdi
	callq	_list_del
	movq	%r14, %rdi
	movq	%r12, %r14
	movl	%r13d, %r12d
	movq	-120(%rbp), %r13                ## 8-byte Reload
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	callq	_list_add_tail
	movq	%r14, 40(%r15)
	movl	-84(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r15)
	movl	%r12d, 4(%r15)
	movq	-80(%rbp,%rbx,8), %rax
	movq	%rax, 24(%r15)
	incq	%rbx
	cmpq	%rbx, -96(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_13
## %bb.14:
	xorl	%ebx, %ebx
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	-80(%rbp,%rbx,8), %r15
	movl	(%r15), %edx
	sarl	$8, %edx
	movq	_OPL4_TONE_NUMBER_BIT8@GOTPCREL(%rip), %rax
	andl	(%rax), %edx
	movq	-64(%rbp,%rbx,8), %r14
	movl	%edx, 8(%r14)
	movq	16(%r14), %rsi
	movq	_OPL4_REG_F_NUMBER@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movq	%r13, %rdi
	callq	_snd_opl4_write
	movq	16(%r14), %rsi
	movq	_OPL4_REG_TONE_NUMBER@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movzbl	(%r15), %edx
	movq	%r13, %rdi
	callq	_snd_opl4_write
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_15
## %bb.16:
	xorl	%r14d, %r14d
	movq	_OPL4_LEVEL_DIRECT_BIT@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	_OPL4_LFO_RESET_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-64(%rbp,%r14,8), %rbx
	movl	%eax, 12(%rbx)
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_snd_opl4_update_pan
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_snd_opl4_update_pitch
	movl	(%r15), %eax
	movl	%eax, 36(%rbx)
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_snd_opl4_update_volume
	incq	%r14
	cmpq	%r14, %r12
	jne	LBB0_17
## %bb.18:
	movb	$1, %bl
	movl	-100(%rbp), %r15d               ## 4-byte Reload
	jmp	LBB0_19
LBB0_3:
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	jmp	LBB0_19
LBB0_27:
	xorl	%ebx, %ebx
LBB0_19:
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r13, %rdi
	callq	_snd_opl4_wait_for_wave_headers
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	testb	%bl, %bl
	je	LBB0_25
## %bb.20:
	movl	%ebx, -96(%rbp)                 ## 4-byte Spill
	movl	%r15d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp,%rbx,8), %r12
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_snd_opl4_update_tone_parameters
	movq	24(%r12), %rax
	movl	4(%rax), %eax
	movl	%eax, 32(%r12)
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_snd_opl4_update_vibrato_depth
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_21
## %bb.22:
	cmpb	$0, -96(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_25
## %bb.23:
	xorl	%ebx, %ebx
	movq	_OPL4_KEY_ON_BIT@GOTPCREL(%rip), %r15
	movq	_OPL4_REG_MISC@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp,%rbx,8), %rax
	movl	12(%rax), %edx
	andl	$31, %edx
	orl	(%r15), %edx
	movl	%edx, 12(%rax)
	movq	16(%rax), %rsi
	addq	(%r12), %rsi
	movq	%r13, %rdi
	callq	_snd_opl4_write
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_24
LBB0_25:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_28
## %bb.26:
	movq	%r13, %rdi
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_28:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_snd_yrw801_regions,8,3         ## @snd_yrw801_regions
	.comm	_OPL4_TONE_NUMBER_BIT8,4,2      ## @OPL4_TONE_NUMBER_BIT8
	.comm	_OPL4_REG_F_NUMBER,8,3          ## @OPL4_REG_F_NUMBER
	.comm	_OPL4_REG_TONE_NUMBER,8,3       ## @OPL4_REG_TONE_NUMBER
	.comm	_OPL4_LFO_RESET_BIT,4,2         ## @OPL4_LFO_RESET_BIT
	.comm	_OPL4_LEVEL_DIRECT_BIT,4,2      ## @OPL4_LEVEL_DIRECT_BIT
	.comm	_OPL4_KEY_ON_BIT,4,2            ## @OPL4_KEY_ON_BIT
	.comm	_OPL4_REG_MISC,8,3              ## @OPL4_REG_MISC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_opl4_note_on               ; -- Begin function snd_opl4_note_on
	.p2align	2
_snd_opl4_note_on:                      ; @snd_opl4_note_on
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x3
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	ldr	x8, [x3, #8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w9, #128
	b	LBB0_3
LBB0_2:
	ldr	w8, [x20]
	and	x9, x8, #0x7f
LBB0_3:
Lloh3:
	adrp	x8, _snd_yrw801_regions@GOTPAGE
Lloh4:
	ldr	x8, [x8, _snd_yrw801_regions@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x8]
	lsl	x8, x9, #4
	ldr	w8, [x10, x8]
	cmp	w8, #0
	b.le	LBB0_12
; %bb.4:
	mov	w23, #0
	add	x9, x10, x9, lsl #4
	ldr	x9, [x9, #8]
	add	x9, x9, #8
	add	x10, sp, #24
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x9, x9, #16
	subs	x8, x8, #1
	b.eq	LBB0_10
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w11, [x9, #-8]
	cmp	w11, w21
	b.gt	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldur	w11, [x9, #-4]
	cmp	w11, w21
	b.lt	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	str	x9, [x10, w23, uxtw #3]
	cmp	w23, #1
	b.ge	LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w23, #1
	b	LBB0_5
LBB0_10:
	mov	x0, x19
	bl	_spin_lock_irqsave
	cmp	w23, #1
	b.ge	LBB0_14
; %bb.11:
	mov	w22, #0
	b	LBB0_21
LBB0_12:
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	w22, #0
	mov	w23, #0
	b	LBB0_21
LBB0_13:
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	w23, #2
LBB0_14:
	add	x8, x19, #4
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	and	w27, w22, #0x7f
	str	w23, [sp, #12]                  ; 4-byte Folded Spill
	mov	w23, w23
	add	x28, sp, #24
	add	x25, sp, #40
	mov	x26, x23
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_snd_opl4_get_voice
	mov	x22, x0
	str	x0, [x25], #8
	add	x24, x0, #48
	mov	x0, x24
	bl	_list_del
	mov	x0, x24
	ldr	x1, [sp, #16]                   ; 8-byte Folded Reload
	bl	_list_add_tail
	str	x20, [x22, #40]
	stp	w21, w27, [x22]
	ldr	x8, [x28], #8
	str	x8, [x22, #24]
	subs	x26, x26, #1
	b.ne	LBB0_15
; %bb.16:
	add	x20, sp, #40
Lloh6:
	adrp	x21, _OPL4_TONE_NUMBER_BIT8@GOTPAGE
Lloh7:
	ldr	x21, [x21, _OPL4_TONE_NUMBER_BIT8@GOTPAGEOFF]
	add	x22, sp, #24
Lloh8:
	adrp	x25, _OPL4_REG_F_NUMBER@GOTPAGE
Lloh9:
	ldr	x25, [x25, _OPL4_REG_F_NUMBER@GOTPAGEOFF]
Lloh10:
	adrp	x24, _OPL4_REG_TONE_NUMBER@GOTPAGE
Lloh11:
	ldr	x24, [x24, _OPL4_REG_TONE_NUMBER@GOTPAGEOFF]
	mov	x27, x23
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x26, [x22], #8
	ldr	w8, [x26]
	ldr	w9, [x21]
	and	w2, w9, w8, asr #8
	ldr	x28, [x20], #8
	str	w2, [x28, #8]
	ldr	x8, [x25]
	ldr	x9, [x28, #16]
	add	x1, x9, x8
	mov	x0, x19
	bl	_snd_opl4_write
	ldr	x8, [x24]
	ldr	x9, [x28, #16]
	add	x1, x9, x8
	ldrb	w2, [x26]
	mov	x0, x19
	bl	_snd_opl4_write
	subs	x27, x27, #1
	b.ne	LBB0_17
; %bb.18:
	add	x21, sp, #40
Lloh12:
	adrp	x22, _OPL4_LFO_RESET_BIT@GOTPAGE
Lloh13:
	ldr	x22, [x22, _OPL4_LFO_RESET_BIT@GOTPAGEOFF]
Lloh14:
	adrp	x24, _OPL4_LEVEL_DIRECT_BIT@GOTPAGE
Lloh15:
	ldr	x24, [x24, _OPL4_LEVEL_DIRECT_BIT@GOTPAGEOFF]
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22]
	ldr	x20, [x21], #8
	str	w8, [x20, #12]
	mov	x0, x19
	mov	x1, x20
	bl	_snd_opl4_update_pan
	mov	x0, x19
	mov	x1, x20
	bl	_snd_opl4_update_pitch
	ldr	w8, [x24]
	str	w8, [x20, #36]
	mov	x0, x19
	mov	x1, x20
	bl	_snd_opl4_update_volume
	subs	x23, x23, #1
	b.ne	LBB0_19
; %bb.20:
	mov	w22, #1
	ldr	w23, [sp, #12]                  ; 4-byte Folded Reload
LBB0_21:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_snd_opl4_wait_for_wave_headers
	mov	x0, x19
	bl	_spin_lock_irqsave
	cbz	w22, LBB0_27
; %bb.22:
	mov	w21, w23
	add	x23, sp, #40
	mov	x24, x21
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	x20, [x23], #8
	mov	x0, x19
	mov	x1, x20
	bl	_snd_opl4_update_tone_parameters
	ldr	x8, [x20, #24]
	ldr	w8, [x8, #4]
	str	w8, [x20, #32]
	mov	x0, x19
	mov	x1, x20
	bl	_snd_opl4_update_vibrato_depth
	subs	x24, x24, #1
	b.ne	LBB0_23
; %bb.24:
	cbz	w22, LBB0_27
; %bb.25:
	add	x20, sp, #40
Lloh16:
	adrp	x22, _OPL4_KEY_ON_BIT@GOTPAGE
Lloh17:
	ldr	x22, [x22, _OPL4_KEY_ON_BIT@GOTPAGEOFF]
Lloh18:
	adrp	x23, _OPL4_REG_MISC@GOTPAGE
Lloh19:
	ldr	x23, [x23, _OPL4_REG_MISC@GOTPAGEOFF]
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20], #8
	ldr	w9, [x8, #12]
	and	w9, w9, #0x1f
	ldr	w10, [x22]
	orr	w2, w9, w10
	str	w2, [x8, #12]
	ldr	x9, [x23]
	ldr	x8, [x8, #16]
	add	x1, x8, x9
	mov	x0, x19
	bl	_snd_opl4_write
	subs	x21, x21, #1
	b.ne	LBB0_26
LBB0_27:
	ldr	x8, [sp, #56]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_29
; %bb.28:
	mov	x0, x19
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	b	_spin_unlock_irqrestore
LBB0_29:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_snd_yrw801_regions,8,3         ; @snd_yrw801_regions
	.comm	_OPL4_TONE_NUMBER_BIT8,4,2      ; @OPL4_TONE_NUMBER_BIT8
	.comm	_OPL4_REG_F_NUMBER,8,3          ; @OPL4_REG_F_NUMBER
	.comm	_OPL4_REG_TONE_NUMBER,8,3       ; @OPL4_REG_TONE_NUMBER
	.comm	_OPL4_LFO_RESET_BIT,4,2         ; @OPL4_LFO_RESET_BIT
	.comm	_OPL4_LEVEL_DIRECT_BIT,4,2      ; @OPL4_LEVEL_DIRECT_BIT
	.comm	_OPL4_KEY_ON_BIT,4,2            ; @OPL4_KEY_ON_BIT
	.comm	_OPL4_REG_MISC,8,3              ; @OPL4_REG_MISC
.subsections_via_symbols
