	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_opl3_calc_pitch
_snd_opl3_calc_pitch:                   ## @snd_opl3_calc_pitch
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movslq	%edx, %rdx
	imulq	$715827883, %rdx, %r9           ## imm = 0x2AAAAAAB
	movq	%r9, %rax
	shrq	$63, %rax
	sarq	$33, %r9
	addl	%eax, %r9d
	leal	(,%r9,4), %eax
	leal	(%rax,%rax,2), %eax
	negl	%eax
	leal	(%rdx,%rax), %r8d
	addl	$2, %r8d
	movl	(%rcx), %edx
	testl	%edx, %edx
	je	LBB0_2
## %bb.1:
	cmpl	$8191, %edx                     ## imm = 0x1FFF
	movl	$8191, %ecx                     ## imm = 0x1FFF
	cmovll	%edx, %ecx
	movq	_opl3_note_table@GOTPCREL(%rip), %rdx
	leal	4095(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	movq	(%rdx), %r10
	movl	%eax, %edx
	sarl	$12, %edx
	addl	%r8d, %edx
	movslq	%edx, %rdx
	movl	(%r10,%rdx,4), %r8d
	movl	4(%r10,%rdx,4), %edx
	subl	%r8d, %edx
	andl	$-4096, %eax                    ## imm = 0xF000
	subl	%eax, %ecx
	imull	%edx, %ecx
	leal	4095(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$12, %edx
	addl	%r8d, %edx
	jmp	LBB0_3
LBB0_2:
	movq	_opl3_note_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r8d, %rcx
	movl	(%rax,%rcx,4), %edx
LBB0_3:
	movb	%dl, (%rdi)
	shrl	$8, %edx
	movq	_OPL3_FNUM_HIGH_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %edx
	andl	$7, %r9d
	leal	252(,%r9,4), %eax
	movq	_OPL3_BLOCKNUM_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	orl	%edx, %eax
	movb	%al, (%rsi)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_opl3_note_table,8,3            ## @opl3_note_table
	.comm	_OPL3_FNUM_HIGH_MASK,4,2        ## @OPL3_FNUM_HIGH_MASK
	.comm	_OPL3_BLOCKNUM_MASK,4,2         ## @OPL3_BLOCKNUM_MASK
	.no_dead_strip	_snd_opl3_calc_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_calc_pitch
_snd_opl3_calc_pitch:                   ; @snd_opl3_calc_pitch
	.cfi_startproc
; %bb.0:
	mov	w8, #43691
	movk	w8, #10922, lsl #16
	smull	x8, w2, w8
	lsr	x9, x8, #63
	asr	x8, x8, #33
	add	w8, w8, w9
	mov	w9, #12
	msub	w9, w8, w9, w2
	sxtw	x9, w9
	add	x9, x9, #2
	ldr	w10, [x3]
	cbz	w10, LBB0_2
; %bb.1:
	mov	w11, #8191
	cmp	w10, w11
	csel	w10, w10, w11, lt
	add	w11, w10, #4095
	cmp	w10, #0
	csel	w11, w11, w10, lt
Lloh0:
	adrp	x12, _opl3_note_table@GOTPAGE
Lloh1:
	ldr	x12, [x12, _opl3_note_table@GOTPAGEOFF]
Lloh2:
	ldr	x12, [x12]
	sbfx	x13, x11, #12, #20
	add	x9, x13, w9, sxtw
	add	x9, x12, x9, lsl #2
	ldp	w12, w9, [x9]
	sub	w9, w9, w12
	and	w11, w11, #0xfffff000
	sub	w10, w10, w11
	mul	w9, w9, w10
	add	w10, w9, #4095
	cmp	w9, #0
	csel	w9, w10, w9, lt
	add	w9, w12, w9, asr #12
	b	LBB0_3
LBB0_2:
Lloh3:
	adrp	x10, _opl3_note_table@GOTPAGE
Lloh4:
	ldr	x10, [x10, _opl3_note_table@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	ldr	w9, [x10, x9, lsl #2]
LBB0_3:
	strb	w9, [x0]
Lloh6:
	adrp	x10, _OPL3_FNUM_HIGH_MASK@GOTPAGE
Lloh7:
	ldr	x10, [x10, _OPL3_FNUM_HIGH_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	and	w9, w10, w9, lsr #8
	ubfiz	w8, w8, #2, #3
	add	w8, w8, #252
Lloh9:
	adrp	x10, _OPL3_BLOCKNUM_MASK@GOTPAGE
Lloh10:
	ldr	x10, [x10, _OPL3_BLOCKNUM_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	and	w8, w10, w8
	orr	w8, w8, w9
	strb	w8, [x1]
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_opl3_note_table,8,3            ; @opl3_note_table
	.comm	_OPL3_FNUM_HIGH_MASK,4,2        ; @OPL3_FNUM_HIGH_MASK
	.comm	_OPL3_BLOCKNUM_MASK,4,2         ; @OPL3_BLOCKNUM_MASK
	.no_dead_strip	_snd_opl3_calc_pitch
.subsections_via_symbols
