	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_opl3_calc_volume           ## -- Begin function snd_opl3_calc_volume
	.p2align	4, 0x90
_snd_opl3_calc_volume:                  ## @snd_opl3_calc_volume
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	imull	(%rdx), %esi
	imull	4(%rdx), %esi
	movslq	%esi, %rax
	imulq	$-2113531863, %rax, %rcx        ## imm = 0x82061029
	shrq	$32, %rcx
	addl	%ecx, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	sarl	$13, %eax
	addl	%ecx, %eax
	cmpl	$127, %eax
	movl	$127, %ecx
	cmovll	%eax, %ecx
	movq	_OPL3_TOTAL_LEVEL_MASK@GOTPCREL(%rip), %rax
	movzbl	(%rax), %esi
	movb	(%rdi), %r8b
	movl	%r8d, %edx
	andb	%sil, %dl
	movzbl	%dl, %edx
	movl	%esi, %eax
	subl	%edx, %eax
	movq	_opl3_volume_table@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movslq	%ecx, %rcx
	addl	(%rdx,%rcx,4), %eax
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmovgl	%eax, %ecx
	movq	_OPL3_KSL_MASK@GOTPCREL(%rip), %rdx
	andb	(%rdx), %r8b
	cmpl	%esi, %eax
	cmovgl	%esi, %ecx
	notb	%cl
	andb	%sil, %cl
	orb	%r8b, %cl
	movb	%cl, (%rdi)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OPL3_TOTAL_LEVEL_MASK,1,0      ## @OPL3_TOTAL_LEVEL_MASK
	.comm	_opl3_volume_table,8,3          ## @opl3_volume_table
	.comm	_OPL3_KSL_MASK,1,0              ## @OPL3_KSL_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_opl3_calc_volume           ; -- Begin function snd_opl3_calc_volume
	.p2align	2
_snd_opl3_calc_volume:                  ; @snd_opl3_calc_volume
	.cfi_startproc
; %bb.0:
	ldp	w8, w9, [x2]
	mul	w8, w8, w1
	mul	w8, w8, w9
	mov	w9, #4137
	movk	w9, #33286, lsl #16
	smull	x9, w8, w9
	lsr	x9, x9, #32
	add	w8, w9, w8
	asr	w9, w8, #13
	add	w8, w9, w8, lsr #31
	mov	w9, #127
	cmp	w8, #127
	csel	w8, w8, w9, lt
Lloh0:
	adrp	x9, _OPL3_TOTAL_LEVEL_MASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _OPL3_TOTAL_LEVEL_MASK@GOTPAGEOFF]
	ldrb	w9, [x9]
	ldrb	w10, [x0]
	bic	w11, w9, w10
Lloh2:
	adrp	x12, _opl3_volume_table@GOTPAGE
Lloh3:
	ldr	x12, [x12, _opl3_volume_table@GOTPAGEOFF]
Lloh4:
	ldr	x12, [x12]
	ldr	w8, [x12, w8, sxtw #2]
	add	w8, w11, w8
	cmp	w8, #0
	csel	w11, w8, wzr, gt
Lloh5:
	adrp	x12, _OPL3_KSL_MASK@GOTPAGE
Lloh6:
	ldr	x12, [x12, _OPL3_KSL_MASK@GOTPAGEOFF]
	ldrb	w12, [x12]
	and	w10, w12, w10
	cmp	w8, w9
	csel	w8, w9, w11, gt
	bic	w8, w9, w8
	orr	w8, w8, w10
	strb	w8, [x0]
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_OPL3_TOTAL_LEVEL_MASK,1,0      ; @OPL3_TOTAL_LEVEL_MASK
	.comm	_opl3_volume_table,8,3          ; @opl3_volume_table
	.comm	_OPL3_KSL_MASK,1,0              ; @OPL3_KSL_MASK
.subsections_via_symbols
