	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_opl3_update_pitch
_snd_opl3_update_pitch:                 ## @snd_opl3_update_pitch
	.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, %ebx
	movq	%rdi, %r14
	movq	_MAX_OPL3_VOICES@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	%esi, (%rax)
	setle	%dil
	callq	_snd_BUG_ON
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	movq	16(%r14), %r15
	movslq	%ebx, %r12
	shlq	$5, %r12
	movq	16(%r15,%r12), %rcx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.2:
	movq	_MAX_OPL2_VOICES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edx, %edx
	cmpl	%ebx, %eax
	cmovlel	%eax, %edx
	movq	_OPL3_RIGHT@GOTPCREL(%rip), %rax
	cmovgq	_OPL3_LEFT@GOTPCREL(%rip), %rax
	subl	%edx, %ebx
	movzwl	(%rax), %r13d
	movl	24(%r15,%r12), %edx
	leaq	-42(%rbp), %rdi
	leaq	-41(%rbp), %rsi
	callq	_snd_opl3_calc_pitch
	movq	_OPL3_REG_FNUM_LOW@GOTPCREL(%rip), %rax
	movzbl	(%rax), %eax
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	orl	%r13d, %eax
	movzbl	-42(%rbp), %edx
	movzwl	%ax, %esi
	movq	%r14, %rdi
	callq	*8(%r14)
	movb	-41(%rbp), %al
	movb	%al, (%r15,%r12)
	movq	_OPL3_KEYON_BIT@GOTPCREL(%rip), %rax
	movb	-41(%rbp), %cl
	orb	(%rax), %cl
	movb	%cl, -41(%rbp)
	movq	_OPL3_REG_KEYON_BLOCK@GOTPCREL(%rip), %rax
	movzbl	(%rax), %eax
	addl	%ebx, %eax
	orl	%r13d, %eax
	movzwl	%ax, %esi
	movzbl	%cl, %edx
	movq	%r14, %rdi
	callq	*8(%r14)
	movslq	(%r14), %rax
	leal	1(%rax), %ecx
	movl	%ecx, (%r14)
	movq	%rax, 8(%r15,%r12)
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_OPL3_VOICES,4,2            ## @MAX_OPL3_VOICES
	.comm	_MAX_OPL2_VOICES,4,2            ## @MAX_OPL2_VOICES
	.comm	_OPL3_LEFT,2,1                  ## @OPL3_LEFT
	.comm	_OPL3_RIGHT,2,1                 ## @OPL3_RIGHT
	.comm	_OPL3_REG_FNUM_LOW,1,0          ## @OPL3_REG_FNUM_LOW
	.comm	_OPL3_KEYON_BIT,1,0             ## @OPL3_KEYON_BIT
	.comm	_OPL3_REG_KEYON_BLOCK,1,0       ## @OPL3_REG_KEYON_BLOCK
	.no_dead_strip	_snd_opl3_update_pitch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_opl3_update_pitch
_snd_opl3_update_pitch:                 ; @snd_opl3_update_pitch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _MAX_OPL3_VOICES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_OPL3_VOICES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	cset	w0, le
	bl	_snd_BUG_ON
	cbnz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x19, #16]
	sxtw	x9, w20
	add	x21, x8, x9, lsl #5
	ldr	x3, [x21, #16]
	cbz	x3, LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _MAX_OPL2_VOICES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_OPL2_VOICES@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w20
	csel	w8, wzr, w8, gt
Lloh6:
	adrp	x9, _OPL3_LEFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _OPL3_LEFT@GOTPAGEOFF]
Lloh8:
	adrp	x10, _OPL3_RIGHT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _OPL3_RIGHT@GOTPAGEOFF]
	csel	x9, x9, x10, gt
	sub	w20, w20, w8
	ldrh	w22, [x9]
	ldr	w2, [x21, #24]
	add	x0, sp, #15
	add	x1, sp, #14
	bl	_snd_opl3_calc_pitch
Lloh10:
	adrp	x8, _OPL3_REG_FNUM_LOW@GOTPAGE
Lloh11:
	ldr	x8, [x8, _OPL3_REG_FNUM_LOW@GOTPAGEOFF]
	ldrb	w8, [x8]
	and	w20, w20, #0xff
	add	w8, w20, w8
	orr	w8, w22, w8
	ldr	x9, [x19, #8]
	ldrb	w2, [sp, #15]
	and	w1, w8, #0xffff
	mov	x0, x19
	blr	x9
	ldrb	w8, [sp, #14]
	strb	w8, [x21]
Lloh12:
	adrp	x8, _OPL3_KEYON_BIT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _OPL3_KEYON_BIT@GOTPAGEOFF]
	ldrb	w8, [x8]
	ldrb	w9, [sp, #14]
	orr	w8, w9, w8
	strb	w8, [sp, #14]
Lloh14:
	adrp	x9, _OPL3_REG_KEYON_BLOCK@GOTPAGE
Lloh15:
	ldr	x9, [x9, _OPL3_REG_KEYON_BLOCK@GOTPAGEOFF]
	ldrb	w9, [x9]
	add	w9, w20, w9
	orr	w9, w22, w9
	ldr	x10, [x19, #8]
	and	w1, w9, #0xffff
	and	w2, w8, #0xff
	mov	x0, x19
	blr	x10
	ldrsw	x8, [x19]
	add	w9, w8, #1
	str	w9, [x19]
	str	x8, [x21, #8]
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_OPL3_VOICES,4,2            ; @MAX_OPL3_VOICES
	.comm	_MAX_OPL2_VOICES,4,2            ; @MAX_OPL2_VOICES
	.comm	_OPL3_LEFT,2,1                  ; @OPL3_LEFT
	.comm	_OPL3_RIGHT,2,1                 ; @OPL3_RIGHT
	.comm	_OPL3_REG_FNUM_LOW,1,0          ; @OPL3_REG_FNUM_LOW
	.comm	_OPL3_KEYON_BIT,1,0             ; @OPL3_KEYON_BIT
	.comm	_OPL3_REG_KEYON_BLOCK,1,0       ; @OPL3_REG_KEYON_BLOCK
	.no_dead_strip	_snd_opl3_update_pitch
.subsections_via_symbols
