	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function OPLLWriteReg
_OPLLWriteReg:                          ## @OPLLWriteReg
	.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
	movl	%esi, %r13d
	movl	%edi, %eax
	movzbl	%r13b, %r14d
	movl	%edi, %ecx
	shrl	$4, %ecx
	andl	$15, %ecx
	leal	-1(%rcx), %esi
	cmpl	$2, %esi
	jb	LBB0_27
## %bb.1:
	cmpl	$3, %ecx
	je	LBB0_35
## %bb.2:
	testl	%ecx, %ecx
	jne	LBB0_40
## %bb.3:
	movl	%eax, %ecx
	andl	$15, %ecx
	cmpl	$8, %ecx
	jae	LBB0_4
## %bb.41:
	movzbl	%al, %edi
	movq	_ym2413@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movl	%edi, %ecx
	movl	%r14d, (%rax,%rcx,4)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_update_instrument_zero         ## TAILCALL
LBB0_27:
	movl	%eax, %ecx
	andl	$15, %ecx
	leal	-9(%rcx), %r15d
	cmpl	$9, %ecx
	cmovbl	%ecx, %r15d
	movq	_ym2413@GOTPCREL(%rip), %rdx
	movq	32(%rdx), %r12
	shlq	$5, %r15
	testb	$16, %al
	jne	LBB0_28
## %bb.29:
	movl	%r13d, %r14d
	andl	$15, %r14d
	shll	$8, %r14d
	movq	%r13, %rcx
	leaq	(%r12,%r15), %r13
	addq	$4, %r13
	movzbl	4(%r12,%r15), %ebx
	movq	_SLOT1@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,2), %rdi
	shlq	$2, %rdi
	addq	24(%r12,%r15), %rdi
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	testb	$16, %cl
	jne	LBB0_30
## %bb.31:
	movl	$-2, %esi
	callq	_KEY_OFF
	movq	_SLOT2@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,2), %rdi
	shlq	$2, %rdi
	addq	20(%r13), %rdi
	movl	$-2, %esi
	callq	_KEY_OFF
	jmp	LBB0_32
LBB0_35:
	andl	$15, %eax
	leal	-9(%rax), %edi
	cmpl	$9, %eax
	cmovbl	%eax, %edi
	movq	_ym2413@GOTPCREL(%rip), %r9
	movq	32(%r9), %rsi
	movq	%rdi, %rbx
	shlq	$5, %rbx
	movq	24(%rsi,%rbx), %r11
	movq	_SLOT2@GOTPCREL(%rip), %r10
	leal	(,%r13,4), %eax
	andl	$60, %eax
	movq	_ENV_BITS@GOTPCREL(%rip), %r8
	movb	(%r8), %cl
	addb	$-9, %cl
	shll	%cl, %eax
	movq	(%r10), %rcx
	leaq	(%rcx,%rcx,2), %rdx
	movl	%eax, (%r11,%rdx,4)
	movl	(%rsi,%rbx), %ebx
	movb	8(%r11,%rdx,4), %cl
	movl	%ebx, %esi
	sarl	%cl, %esi
	addl	%eax, %esi
	movl	%esi, 4(%r11,%rdx,4)
	cmpl	$6, %edi
	jb	LBB0_39
## %bb.36:
	testb	$32, 8(%r9)
	jne	LBB0_37
LBB0_39:
	movq	16(%r9), %rax
	xorl	(%rax,%rdi,4), %r13d
	testb	$-16, %r13b
	je	LBB0_40
## %bb.42:
	movl	%r14d, (%rax,%rdi,4)
	leal	(%rdi,%rdi), %esi
	movq	(%r9), %rax
	shrl	$4, %r14d
	movq	(%rax,%r14,8), %rdx
                                        ## kill: def $edi killed $edi killed $rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_load_instrument                ## TAILCALL
LBB0_28:
	movl	4(%r12,%r15), %eax
	movl	%eax, %ebx
	andl	$3840, %ebx                     ## imm = 0xF00
	orl	%r14d, %ebx
	cmpl	%ebx, %eax
	jne	LBB0_34
	jmp	LBB0_40
LBB0_30:
	movl	$1, %esi
	callq	_KEY_ON
	movq	_SLOT2@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,2), %rdi
	shlq	$2, %rdi
	addq	20(%r13), %rdi
	movl	$1, %esi
	callq	_KEY_ON
LBB0_32:
	movq	_ym2413@GOTPCREL(%rip), %rdx
	orl	%r14d, %ebx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	andl	$32, %eax
	movl	%eax, 8(%r12,%r15)
	movl	(%r13), %eax
	cmpl	%ebx, %eax
	je	LBB0_40
LBB0_34:
	leaq	(%r12,%r15), %r14
	movl	%ebx, 4(%r12,%r15)
	movl	%ebx, %eax
	shrl	$8, %eax
	movl	%eax, 12(%r12,%r15)
	movq	_ksl_tab@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%ebx, %ecx
	shrl	$5, %ecx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, (%r14)
	leal	(%rbx,%rbx), %ecx
	shrl	$9, %ebx
	movq	24(%rdx), %rdx
	andl	$1022, %ecx                     ## imm = 0x3FE
	movl	(%rdx,%rcx,4), %edx
	xorb	$7, %bl
	movl	%ebx, %ecx
	sarl	%cl, %edx
	movl	%edx, 16(%r12,%r15)
	movq	24(%r12,%r15), %rdx
	movq	_SLOT1@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rcx,%rcx,2), %rsi
	movb	8(%rdx,%rsi,4), %cl
	movl	%eax, %edi
	sarl	%cl, %edi
	addl	(%rdx,%rsi,4), %edi
	movl	%edi, 4(%rdx,%rsi,4)
	movq	_SLOT2@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	movb	8(%rdx,%rdi,4), %cl
	sarl	%cl, %eax
	leaq	(%rdx,%rsi,4), %rsi
	addl	(%rdx,%rdi,4), %eax
	movl	%eax, 4(%rdx,%rdi,4)
	movq	%r14, %rdi
	callq	_CALC_FCSLOT
	movq	(%rbx), %rax
	leaq	(%rax,%rax,2), %rsi
	shlq	$2, %rsi
	addq	24(%r12,%r15), %rsi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_CALC_FCSLOT                    ## TAILCALL
LBB0_37:
	cmpl	$7, %edi
	jb	LBB0_40
## %bb.38:
	shrl	$2, %r13d
	andl	$60, %r13d
	movb	(%r8), %cl
	addb	$-9, %cl
	shll	%cl, %r13d
	movq	_SLOT1@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,2), %rax
	movl	%r13d, (%r11,%rax,4)
	movb	8(%r11,%rax,4), %cl
	sarl	%cl, %ebx
	addl	%r13d, %ebx
	movl	%ebx, 4(%r11,%rax,4)
	jmp	LBB0_40
LBB0_4:
	cmpl	$14, %ecx
	jne	LBB0_40
## %bb.5:
	movq	_ym2413@GOTPCREL(%rip), %rbx
	movl	8(%rbx), %eax
	testb	$32, %r13b
	jne	LBB0_6
## %bb.22:
	testb	$32, %al
	je	LBB0_24
## %bb.23:
	movq	(%rbx), %rax
	movq	16(%rbx), %rcx
	movl	24(%rcx), %ecx
	sarl	$4, %ecx
	movslq	%ecx, %rcx
	movq	(%rax,%rcx,8), %rdx
	movl	$6, %edi
	movl	$12, %esi
	callq	_load_instrument
	movq	(%rbx), %rax
	movq	16(%rbx), %rcx
	movl	28(%rcx), %ecx
	sarl	$4, %ecx
	movslq	%ecx, %rcx
	movq	(%rax,%rcx,8), %rdx
	movl	$7, %edi
	movl	$14, %esi
	callq	_load_instrument
	movq	(%rbx), %rax
	movq	16(%rbx), %rcx
	movl	32(%rcx), %ecx
	sarl	$4, %ecx
	movslq	%ecx, %rcx
	movq	(%rax,%rcx,8), %rdx
	movl	$8, %edi
	movl	$16, %esi
	callq	_load_instrument
LBB0_24:
	movq	32(%rbx), %rax
	movq	_SLOT1@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	216(%rax), %rdi
	movl	$-3, %esi
	callq	_KEY_OFF
	movq	32(%rbx), %rax
	movq	_SLOT2@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	216(%rax), %rdi
	movl	$-3, %esi
	callq	_KEY_OFF
	movq	32(%rbx), %rax
	movq	(%r14), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	248(%rax), %rdi
	movl	$-3, %esi
	callq	_KEY_OFF
	movq	32(%rbx), %rax
	movq	(%r15), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	248(%rax), %rdi
	movl	$-3, %esi
	callq	_KEY_OFF
	movq	32(%rbx), %rax
	movq	(%r14), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	280(%rax), %rdi
	movl	$-3, %esi
	callq	_KEY_OFF
	movq	32(%rbx), %rax
	movq	(%r15), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	280(%rax), %rdi
	jmp	LBB0_25
LBB0_6:
	testb	$32, %al
	jne	LBB0_8
## %bb.7:
	movq	(%rbx), %rax
	movq	128(%rax), %rdx
	movl	$6, %edi
	movl	$12, %esi
	callq	_load_instrument
	movq	(%rbx), %rax
	movq	136(%rax), %rdx
	movl	$7, %edi
	movl	$14, %esi
	callq	_load_instrument
	movq	16(%rbx), %rax
	movq	32(%rbx), %rdx
	movq	248(%rdx), %rsi
	movq	_SLOT1@GOTPCREL(%rip), %r14
	movl	28(%rax), %eax
	sarl	$2, %eax
	andl	$-4, %eax
	movq	_ENV_BITS@GOTPCREL(%rip), %r15
	movb	(%r15), %cl
	addb	$-9, %cl
	shll	%cl, %eax
	movq	(%r14), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	movl	%eax, (%rsi,%rdi,4)
	movl	224(%rdx), %edx
	movb	8(%rsi,%rdi,4), %cl
	sarl	%cl, %edx
	addl	%eax, %edx
	movl	%edx, 4(%rsi,%rdi,4)
	movq	(%rbx), %rax
	movq	144(%rax), %rdx
	movl	$8, %edi
	movl	$16, %esi
	callq	_load_instrument
	movq	16(%rbx), %rax
	movq	32(%rbx), %rdx
	movq	280(%rdx), %rsi
	movl	32(%rax), %eax
	sarl	$2, %eax
	andl	$-4, %eax
	movb	(%r15), %cl
	addb	$-9, %cl
	shll	%cl, %eax
	movq	(%r14), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	movl	%eax, (%rsi,%rdi,4)
	movl	256(%rdx), %edx
	movb	8(%rsi,%rdi,4), %cl
	sarl	%cl, %edx
	addl	%eax, %edx
	movl	%edx, 4(%rsi,%rdi,4)
LBB0_8:
	movq	32(%rbx), %rax
	movq	_SLOT1@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	216(%rax), %rdi
	testb	$16, %r13b
	jne	LBB0_9
## %bb.10:
	movl	$-3, %esi
	callq	_KEY_OFF
	movq	32(%rbx), %rax
	movq	_SLOT2@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	216(%rax), %rdi
	movl	$-3, %esi
	callq	_KEY_OFF
	jmp	LBB0_11
LBB0_9:
	movl	$2, %esi
	callq	_KEY_ON
	movq	32(%rbx), %rax
	movq	_SLOT2@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	216(%rax), %rdi
	movl	$2, %esi
	callq	_KEY_ON
LBB0_11:
	movq	32(%rbx), %rax
	movq	(%r15), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	248(%rax), %rdi
	testb	$1, %r13b
	jne	LBB0_12
## %bb.13:
	movl	$-3, %esi
	callq	_KEY_OFF
	jmp	LBB0_14
LBB0_12:
	movl	$2, %esi
	callq	_KEY_ON
LBB0_14:
	movq	32(%rbx), %rax
	movq	_SLOT2@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	248(%rax), %rdi
	testb	$8, %r13b
	jne	LBB0_15
## %bb.16:
	movl	$-3, %esi
	callq	_KEY_OFF
	jmp	LBB0_17
LBB0_15:
	movl	$2, %esi
	callq	_KEY_ON
LBB0_17:
	movq	32(%rbx), %rax
	movq	(%r15), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	280(%rax), %rdi
	testb	$4, %r13b
	jne	LBB0_18
## %bb.19:
	movl	$-3, %esi
	callq	_KEY_OFF
	jmp	LBB0_20
LBB0_18:
	movl	$2, %esi
	callq	_KEY_ON
LBB0_20:
	movq	32(%rbx), %rax
	movq	(%r14), %rcx
	leaq	(%rcx,%rcx,2), %rdi
	shlq	$2, %rdi
	addq	280(%rax), %rdi
	testb	$2, %r13b
	jne	LBB0_21
LBB0_25:
	movl	$-3, %esi
	callq	_KEY_OFF
	jmp	LBB0_26
LBB0_21:
	movl	$2, %esi
	callq	_KEY_ON
LBB0_26:
	andl	$63, %r13d
	movl	%r13d, 8(%rbx)
LBB0_40:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ym2413,40,3                    ## @ym2413
	.comm	_SLOT1,8,3                      ## @SLOT1
	.comm	_ENV_BITS,4,2                   ## @ENV_BITS
	.comm	_SLOT2,8,3                      ## @SLOT2
	.comm	_ksl_tab,8,3                    ## @ksl_tab
	.no_dead_strip	_OPLLWriteReg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function OPLLWriteReg
_OPLLWriteReg:                          ; @OPLLWriteReg
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	and	w8, w1, #0xff
	ubfx	w9, w0, #4, #4
	sub	w10, w9, #1
	cmp	w10, #2
	b.lo	LBB0_5
; %bb.1:
	cmp	w9, #3
	b.eq	LBB0_8
; %bb.2:
	cbnz	w9, LBB0_41
; %bb.3:
	and	w9, w0, #0xf
	cmp	w9, #8
	b.hs	LBB0_18
; %bb.4:
Lloh0:
	adrp	x9, _ym2413@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ym2413@GOTPAGEOFF]
	and	w0, w0, #0xff
Lloh2:
	ldr	x9, [x9]
	ldr	x9, [x9]
	str	w8, [x9, w0, uxtw #2]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_update_instrument_zero
LBB0_5:
	and	w9, w0, #0xf
	sub	w10, w9, #9
	cmp	w9, #8
	csel	w22, w10, w9, hi
Lloh3:
	adrp	x21, _ym2413@GOTPAGE
Lloh4:
	ldr	x21, [x21, _ym2413@GOTPAGEOFF]
	ldr	x24, [x21, #32]
	add	x20, x24, x22, lsl #5
	tbnz	w0, #4, LBB0_12
; %bb.6:
	mov	x25, x20
	ldrb	w23, [x25, #4]!
	mov	x26, x25
	ldr	x8, [x26, #20]!
	bfi	w23, w19, #8, #4
Lloh5:
	adrp	x9, _SLOT1@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SLOT1@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	mov	w10, #12
	madd	x0, x9, x10, x8
	tbnz	w19, #4, LBB0_13
; %bb.7:
	mov	w1, #-2
	bl	_KEY_OFF
	ldr	x8, [x26]
Lloh8:
	adrp	x9, _SLOT2@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SLOT2@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	mov	w10, #12
	madd	x0, x9, x10, x8
	mov	w1, #-2
	bl	_KEY_OFF
	b	LBB0_14
LBB0_8:
	and	w9, w0, #0xf
	sub	w10, w9, #9
	cmp	w9, #8
	csel	w0, w10, w9, hi
Lloh11:
	adrp	x9, _ym2413@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ym2413@GOTPAGEOFF]
	ldr	x10, [x9, #32]
	add	x11, x10, x0, lsl #5
	ldr	x10, [x11, #24]
Lloh13:
	adrp	x12, _SLOT2@GOTPAGE
Lloh14:
	ldr	x12, [x12, _SLOT2@GOTPAGEOFF]
Lloh15:
	ldr	x13, [x12]
	ubfiz	w14, w19, #2, #4
Lloh16:
	adrp	x12, _ENV_BITS@GOTPAGE
Lloh17:
	ldr	x12, [x12, _ENV_BITS@GOTPAGEOFF]
	ldr	w15, [x12]
	sub	w15, w15, #9
	lsl	w14, w14, w15
	mov	w15, #12
	madd	x13, x13, x15, x10
	ldr	w11, [x11]
	ldr	w15, [x13, #8]
	asr	w15, w11, w15
	add	w15, w15, w14
	stp	w14, w15, [x13]
	cmp	w0, #6
	b.lo	LBB0_10
; %bb.9:
	ldrb	w13, [x9, #8]
	tbnz	w13, #5, LBB0_16
LBB0_10:
	ldr	x10, [x9, #16]
	ldr	w11, [x10, x0, lsl #2]
	eor	w11, w11, w19
	tst	w11, #0xf0
	b.eq	LBB0_41
; %bb.11:
	str	w8, [x10, x0, lsl #2]
	lsl	w1, w0, #1
	ldr	x9, [x9]
	lsr	w8, w8, #4
	ldr	x2, [x9, w8, uxtw #3]
                                        ; kill: def $w0 killed $w0 killed $x0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_load_instrument
LBB0_12:
	ldr	w9, [x20, #4]
	and	w10, w9, #0xf00
	orr	w23, w10, w8
	cmp	w9, w23
	b.ne	LBB0_15
	b	LBB0_41
LBB0_13:
	mov	w1, #1
	bl	_KEY_ON
	ldr	x8, [x26]
Lloh18:
	adrp	x9, _SLOT2@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SLOT2@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	mov	w10, #12
	madd	x0, x9, x10, x8
	mov	w1, #1
	bl	_KEY_ON
LBB0_14:
	and	w8, w19, #0x20
	add	x9, x24, x22, lsl #5
	str	w8, [x9, #8]
	ldr	w9, [x25]
	cmp	w9, w23
	b.eq	LBB0_41
LBB0_15:
	add	x19, x24, x22, lsl #5
	str	w23, [x19, #4]
	lsr	w8, w23, #8
	str	w8, [x19, #12]
Lloh21:
	adrp	x8, _ksl_tab@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ksl_tab@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	lsr	w9, w23, #5
	ldr	w8, [x8, w9, uxtw #2]
	str	w8, [x20]
	ldr	x9, [x21, #24]
	ubfiz	w10, w23, #1, #9
	ldr	w9, [x9, w10, uxtw #2]
	ubfx	w10, w23, #9, #22
	eor	w10, w10, #0x7
	asr	w9, w9, w10
	str	w9, [x19, #16]
Lloh24:
	adrp	x9, _SLOT1@GOTPAGE
Lloh25:
	ldr	x9, [x9, _SLOT1@GOTPAGEOFF]
	ldr	x10, [x19, #24]
Lloh26:
	ldr	x9, [x9]
	mov	w21, #12
	madd	x1, x9, x21, x10
	ldr	w9, [x1]
	ldr	w11, [x1, #8]
	asr	w11, w8, w11
	add	w9, w11, w9
	str	w9, [x1, #4]
Lloh27:
	adrp	x22, _SLOT2@GOTPAGE
Lloh28:
	ldr	x22, [x22, _SLOT2@GOTPAGEOFF]
	ldr	x9, [x22]
	madd	x9, x9, x21, x10
	ldr	w10, [x9]
	ldr	w11, [x9, #8]
	asr	w8, w8, w11
	add	w8, w8, w10
	str	w8, [x9, #4]
	mov	x0, x20
	bl	_CALC_FCSLOT
	ldr	x8, [x19, #24]
	ldr	x9, [x22]
	madd	x1, x9, x21, x8
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_CALC_FCSLOT
LBB0_16:
	cmp	w0, #7
	b.lo	LBB0_41
; %bb.17:
Lloh29:
	adrp	x8, _SLOT1@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SLOT1@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	lsr	w9, w19, #2
	and	w9, w9, #0x3c
	ldr	w12, [x12]
	sub	w12, w12, #9
	lsl	w9, w9, w12
	mov	w12, #12
	madd	x8, x8, x12, x10
	ldr	w10, [x8, #8]
	asr	w10, w11, w10
	add	w10, w10, w9
	stp	w9, w10, [x8]
	b	LBB0_41
LBB0_18:
	cmp	w9, #14
	b.ne	LBB0_41
; %bb.19:
Lloh32:
	adrp	x20, _ym2413@GOTPAGE
Lloh33:
	ldr	x20, [x20, _ym2413@GOTPAGEOFF]
	ldr	w8, [x20, #8]
	tbnz	w19, #5, LBB0_23
; %bb.20:
	tbz	w8, #5, LBB0_22
; %bb.21:
	ldr	x8, [x20]
	ldr	x9, [x20, #16]
	ldr	w9, [x9, #24]
	asr	w9, w9, #4
	ldr	x2, [x8, w9, sxtw #3]
	mov	w0, #6
	mov	w1, #12
	bl	_load_instrument
	ldr	x8, [x20]
	ldr	x9, [x20, #16]
	ldr	w9, [x9, #28]
	asr	w9, w9, #4
	ldr	x2, [x8, w9, sxtw #3]
	mov	w0, #7
	mov	w1, #14
	bl	_load_instrument
	ldr	x8, [x20]
	ldr	x9, [x20, #16]
	ldr	w9, [x9, #32]
	asr	w9, w9, #4
	ldr	x2, [x8, w9, sxtw #3]
	mov	w0, #8
	mov	w1, #16
	bl	_load_instrument
LBB0_22:
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #216]
Lloh34:
	adrp	x21, _SLOT1@GOTPAGE
Lloh35:
	ldr	x21, [x21, _SLOT1@GOTPAGEOFF]
	ldr	x9, [x21]
	mov	w22, #12
	madd	x0, x9, x22, x8
	mov	w1, #-3
	bl	_KEY_OFF
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #216]
Lloh36:
	adrp	x23, _SLOT2@GOTPAGE
Lloh37:
	ldr	x23, [x23, _SLOT2@GOTPAGEOFF]
	ldr	x9, [x23]
	madd	x0, x9, x22, x8
	mov	w1, #-3
	bl	_KEY_OFF
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #248]
	ldr	x9, [x21]
	madd	x0, x9, x22, x8
	mov	w1, #-3
	bl	_KEY_OFF
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #248]
	ldr	x9, [x23]
	madd	x0, x9, x22, x8
	mov	w1, #-3
	bl	_KEY_OFF
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #280]
	ldr	x9, [x21]
	madd	x0, x9, x22, x8
	mov	w1, #-3
	bl	_KEY_OFF
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #280]
	ldr	x9, [x23]
	madd	x0, x9, x22, x8
	b	LBB0_38
LBB0_23:
Lloh38:
	adrp	x21, _SLOT1@GOTPAGE
Lloh39:
	ldr	x21, [x21, _SLOT1@GOTPAGEOFF]
	tbnz	w8, #5, LBB0_25
; %bb.24:
	ldr	x8, [x20]
	ldr	x2, [x8, #128]
	mov	w22, #12
	mov	w0, #6
	mov	w1, #12
	bl	_load_instrument
	ldr	x8, [x20]
	ldr	x2, [x8, #136]
	mov	w0, #7
	mov	w1, #14
	bl	_load_instrument
	ldr	x8, [x20, #32]
	ldr	x9, [x8, #248]
	ldr	x10, [x21]
	ldr	x11, [x20, #16]
	ldr	w11, [x11, #28]
	asr	w11, w11, #2
	and	w11, w11, #0xfffffffc
Lloh40:
	adrp	x23, _ENV_BITS@GOTPAGE
Lloh41:
	ldr	x23, [x23, _ENV_BITS@GOTPAGEOFF]
	ldr	w12, [x23]
	sub	w12, w12, #9
	lsl	w11, w11, w12
	madd	x9, x10, x22, x9
	ldr	w8, [x8, #224]
	ldr	w10, [x9, #8]
	asr	w8, w8, w10
	add	w8, w8, w11
	stp	w11, w8, [x9]
	ldr	x8, [x20]
	ldr	x2, [x8, #144]
	mov	w0, #8
	mov	w1, #16
	bl	_load_instrument
	ldr	x8, [x20, #32]
	ldr	x9, [x8, #280]
	ldr	x10, [x21]
	ldr	x11, [x20, #16]
	ldr	w11, [x11, #32]
	asr	w11, w11, #2
	and	w11, w11, #0xfffffffc
	ldr	w12, [x23]
	sub	w12, w12, #9
	lsl	w11, w11, w12
	madd	x9, x10, x22, x9
	ldr	w8, [x8, #256]
	ldr	w10, [x9, #8]
	asr	w8, w8, w10
	add	w8, w8, w11
	stp	w11, w8, [x9]
LBB0_25:
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #216]
	ldr	x9, [x21]
	mov	w10, #12
	madd	x0, x9, x10, x8
Lloh42:
	adrp	x22, _SLOT2@GOTPAGE
Lloh43:
	ldr	x22, [x22, _SLOT2@GOTPAGEOFF]
	tbnz	w19, #4, LBB0_27
; %bb.26:
	mov	w1, #-3
	bl	_KEY_OFF
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #216]
	ldr	x9, [x22]
	mov	w10, #12
	madd	x0, x9, x10, x8
	mov	w1, #-3
	bl	_KEY_OFF
	b	LBB0_28
LBB0_27:
	mov	w1, #2
	bl	_KEY_ON
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #216]
	ldr	x9, [x22]
	mov	w10, #12
	madd	x0, x9, x10, x8
	mov	w1, #2
	bl	_KEY_ON
LBB0_28:
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #248]
	ldr	x9, [x21]
	mov	w10, #12
	madd	x0, x9, x10, x8
	tbnz	w19, #0, LBB0_30
; %bb.29:
	mov	w1, #-3
	bl	_KEY_OFF
	b	LBB0_31
LBB0_30:
	mov	w1, #2
	bl	_KEY_ON
LBB0_31:
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #248]
	ldr	x9, [x22]
	mov	w10, #12
	madd	x0, x9, x10, x8
	tbnz	w19, #3, LBB0_33
; %bb.32:
	mov	w1, #-3
	bl	_KEY_OFF
	b	LBB0_34
LBB0_33:
	mov	w1, #2
	bl	_KEY_ON
LBB0_34:
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #280]
	ldr	x9, [x21]
	mov	w10, #12
	madd	x0, x9, x10, x8
	tbnz	w19, #2, LBB0_36
; %bb.35:
	mov	w1, #-3
	bl	_KEY_OFF
	b	LBB0_37
LBB0_36:
	mov	w1, #2
	bl	_KEY_ON
LBB0_37:
	ldr	x8, [x20, #32]
	ldr	x8, [x8, #280]
	ldr	x9, [x22]
	mov	w10, #12
	madd	x0, x9, x10, x8
	tbnz	w19, #1, LBB0_39
LBB0_38:
	mov	w1, #-3
	bl	_KEY_OFF
	b	LBB0_40
LBB0_39:
	mov	w1, #2
	bl	_KEY_ON
LBB0_40:
	and	w8, w19, #0x3f
	str	w8, [x20, #8]
LBB0_41:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_ym2413,40,3                    ; @ym2413
	.comm	_SLOT1,8,3                      ; @SLOT1
	.comm	_ENV_BITS,4,2                   ; @ENV_BITS
	.comm	_SLOT2,8,3                      ; @SLOT2
	.comm	_ksl_tab,8,3                    ; @ksl_tab
	.no_dead_strip	_OPLLWriteReg
.subsections_via_symbols
