	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_opl4_update_volume
_snd_opl4_update_volume:                ## @snd_opl4_update_volume
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	24(%rsi), %r8
	movl	(%r8), %ecx
	movq	_snd_opl4_volume_table@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	(%rdi), %rsi
	movl	(%rsi), %esi
	andl	$127, %esi
	movq	32(%r14), %rax
	movl	(%rax), %ebx
	movl	4(%rax), %eax
	andl	$127, %ebx
	addl	(%rdx,%rsi,8), %ecx
	addl	(%rdx,%rbx,8), %ecx
	andl	$127, %eax
	addl	(%rdx,%rax,8), %ecx
	movq	(%r14), %rax
	addl	(%rdx,%rax,8), %ecx
	movl	$127, %eax
	subl	%ecx, %eax
	imull	4(%r8), %eax
	cltq
	imulq	$2130574327, %rax, %rcx         ## imm = 0x7EFDFBF7
	shrq	$32, %rcx
	subl	%eax, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	sarl	$7, %ecx
	addl	%eax, %ecx
	movq	_volume_boost@GOTPCREL(%rip), %rax
	subl	(%rax), %ecx
	movq	16(%r14), %rsi
	addl	$127, %ecx
	cmpl	$126, %ecx
	movl	$126, %eax
	cmovll	%ecx, %eax
	addl	%eax, %eax
	xorl	%edx, %edx
	testl	%ecx, %ecx
	cmovnsl	%eax, %edx
	movq	_OPL4_REG_LEVEL@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	orl	8(%r14), %edx
	callq	_snd_opl4_write
	movl	$0, 8(%r14)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_snd_opl4_volume_table,8,3      ## @snd_opl4_volume_table
	.comm	_volume_boost,4,2               ## @volume_boost
	.comm	_OPL4_REG_LEVEL,8,3             ## @OPL4_REG_LEVEL
	.no_dead_strip	_snd_opl4_update_volume
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_opl4_update_volume
_snd_opl4_update_volume:                ; @snd_opl4_update_volume
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
Lloh0:
	adrp	x8, _snd_opl4_volume_table@GOTPAGE
Lloh1:
	ldr	x8, [x8, _snd_opl4_volume_table@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x0]
	ldr	w9, [x9]
	and	x9, x9, #0x7f
	ldr	x9, [x8, x9, lsl #3]
	ldr	x10, [x1, #32]
	ldp	w11, w10, [x10]
	and	x11, x11, #0x7f
	ldr	x11, [x8, x11, lsl #3]
	and	x10, x10, #0x7f
	ldr	x10, [x8, x10, lsl #3]
	ldr	x12, [x1]
	ldr	x8, [x8, x12, lsl #3]
	ldp	x13, x12, [x1, #16]
	ldp	w14, w12, [x12]
	add	w9, w14, w9
	add	w9, w9, w11
	add	w9, w9, w10
	add	w8, w9, w8
	mov	w9, #127
	sub	w8, w9, w8
	mul	w8, w8, w12
	mov	w9, #64503
	movk	w9, #32509, lsl #16
	smull	x9, w8, w9
	lsr	x9, x9, #32
	sub	w8, w9, w8
	asr	w9, w8, #7
	add	w8, w9, w8, lsr #31
Lloh3:
	adrp	x9, _volume_boost@GOTPAGE
Lloh4:
	ldr	x9, [x9, _volume_boost@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	sub	w8, w8, w9
	add	w8, w8, #127
	mov	w9, #126
	cmp	w8, #126
	csel	w9, w8, w9, lt
	lsl	w9, w9, #1
	cmp	w8, #0
	csel	w8, wzr, w9, lt
Lloh6:
	adrp	x9, _OPL4_REG_LEVEL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _OPL4_REG_LEVEL@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x1, x13, x9
	ldr	w9, [x19, #8]
	orr	w2, w8, w9
	bl	_snd_opl4_write
	str	wzr, [x19, #8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_snd_opl4_volume_table,8,3      ; @snd_opl4_volume_table
	.comm	_volume_boost,4,2               ; @volume_boost
	.comm	_OPL4_REG_LEVEL,8,3             ; @OPL4_REG_LEVEL
	.no_dead_strip	_snd_opl4_update_volume
.subsections_via_symbols
