	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_opl3_reset                 ## -- Begin function snd_opl3_reset
	.p2align	4, 0x90
_snd_opl3_reset:                        ## @snd_opl3_reset
	.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
	movq	%rdi, %rbx
	movq	(%rdi), %rcx
	movq	_OPL3_HW_OPL3@GOTPCREL(%rip), %rdx
	movq	_MAX_OPL2_VOICES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	cmpq	(%rdx), %rcx
	jl	LBB0_2
## %bb.1:
	movq	_MAX_OPL3_VOICES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
LBB0_2:
	testl	%esi, %esi
	jle	LBB0_5
## %bb.3:
	xorl	%r15d, %r15d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%eax, %r15d
	movl	$0, %ecx
	cmovll	%ecx, %eax
	movq	_OPL3_RIGHT@GOTPCREL(%rip), %rcx
	cmovlq	_OPL3_LEFT@GOTPCREL(%rip), %rcx
	movl	%r15d, %edx
	subl	%eax, %edx
	movq	_snd_opl3_regmap@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movzbl	%dl, %r12d
	movq	(%rax,%r12,8), %rax
	movzwl	(%rax), %eax
	movq	_OPL3_REG_KSL_LEVEL@GOTPCREL(%rip), %r13
	addw	(%r13), %ax
	movzwl	(%rcx), %r14d
	orl	%r14d, %eax
	movq	_OPL3_TOTAL_LEVEL_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movzwl	%ax, %esi
	movq	%rbx, %rdi
	callq	*24(%rbx)
	movq	_snd_opl3_regmap@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r12,8), %rax
	movzwl	2(%rax), %eax
	addw	(%r13), %ax
	orl	%r14d, %eax
	movq	_OPL3_TOTAL_LEVEL_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movzwl	%ax, %esi
	movq	%rbx, %rdi
	callq	*24(%rbx)
	movq	_OPL3_REG_KEYON_BLOCK@GOTPCREL(%rip), %rax
	movzbl	(%rax), %eax
	addl	%r12d, %eax
	orl	%r14d, %eax
	movzwl	%ax, %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	*24(%rbx)
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	_MAX_OPL2_VOICES@GOTPCREL(%rip), %rax
	incl	%r15d
	movl	(%rax), %eax
	cmpl	%r15d, %esi
	jne	LBB0_4
LBB0_5:
	movl	%eax, 8(%rbx)
	movq	_SNDRV_DM_FM_MODE_OPL2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_OPL3_LEFT@GOTPCREL(%rip), %r14
	movq	_OPL3_REG_TEST@GOTPCREL(%rip), %rax
	movzwl	(%rax), %eax
	orw	(%r14), %ax
	movq	_OPL3_ENABLE_WAVE_SELECT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movzwl	%ax, %esi
	movq	%rbx, %rdi
	callq	*24(%rbx)
	movq	_OPL3_REG_PERCUSSION@GOTPCREL(%rip), %rax
	movzwl	(%rax), %eax
	orw	(%r14), %ax
	movzwl	%ax, %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	*24(%rbx)
	movq	$0, 16(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OPL3_HW_OPL3,8,3               ## @OPL3_HW_OPL3
	.comm	_MAX_OPL2_VOICES,4,2            ## @MAX_OPL2_VOICES
	.comm	_MAX_OPL3_VOICES,4,2            ## @MAX_OPL3_VOICES
	.comm	_OPL3_LEFT,2,1                  ## @OPL3_LEFT
	.comm	_OPL3_RIGHT,2,1                 ## @OPL3_RIGHT
	.comm	_OPL3_REG_KSL_LEVEL,2,1         ## @OPL3_REG_KSL_LEVEL
	.comm	_snd_opl3_regmap,8,3            ## @snd_opl3_regmap
	.comm	_OPL3_TOTAL_LEVEL_MASK,4,2      ## @OPL3_TOTAL_LEVEL_MASK
	.comm	_OPL3_REG_KEYON_BLOCK,1,0       ## @OPL3_REG_KEYON_BLOCK
	.comm	_SNDRV_DM_FM_MODE_OPL2,4,2      ## @SNDRV_DM_FM_MODE_OPL2
	.comm	_OPL3_REG_TEST,2,1              ## @OPL3_REG_TEST
	.comm	_OPL3_ENABLE_WAVE_SELECT,4,2    ## @OPL3_ENABLE_WAVE_SELECT
	.comm	_OPL3_REG_PERCUSSION,2,1        ## @OPL3_REG_PERCUSSION
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_opl3_reset                 ; -- Begin function snd_opl3_reset
	.p2align	2
_snd_opl3_reset:                        ; @snd_opl3_reset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x9, [x0]
Lloh0:
	adrp	x8, _OPL3_HW_OPL3@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OPL3_HW_OPL3@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x8]
Lloh3:
	adrp	x22, _MAX_OPL2_VOICES@GOTPAGE
Lloh4:
	ldr	x22, [x22, _MAX_OPL2_VOICES@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh5:
	adrp	x11, _MAX_OPL3_VOICES@GOTPAGE
Lloh6:
	ldr	x11, [x11, _MAX_OPL3_VOICES@GOTPAGEOFF]
Lloh7:
	ldr	w11, [x11]
	cmp	x9, x10
	csel	w9, w8, w11, lt
Lloh8:
	adrp	x25, _OPL3_LEFT@GOTPAGE
Lloh9:
	ldr	x25, [x25, _OPL3_LEFT@GOTPAGEOFF]
	cmp	w9, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w23, #0
	str	w9, [sp, #12]                   ; 4-byte Folded Spill
Lloh10:
	adrp	x26, _OPL3_REG_KSL_LEVEL@GOTPAGE
Lloh11:
	ldr	x26, [x26, _OPL3_REG_KSL_LEVEL@GOTPAGEOFF]
Lloh12:
	adrp	x27, _snd_opl3_regmap@GOTPAGE
Lloh13:
	ldr	x27, [x27, _snd_opl3_regmap@GOTPAGEOFF]
Lloh14:
	adrp	x28, _OPL3_TOTAL_LEVEL_MASK@GOTPAGE
Lloh15:
	ldr	x28, [x28, _OPL3_TOTAL_LEVEL_MASK@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w23, w8
	csel	w8, wzr, w8, lt
Lloh16:
	adrp	x9, _OPL3_RIGHT@GOTPAGE
Lloh17:
	ldr	x9, [x9, _OPL3_RIGHT@GOTPAGEOFF]
	csel	x9, x25, x9, lt
	sub	w8, w23, w8
	ldrh	w20, [x9]
	ldrh	w9, [x26]
	ldr	x10, [x27]
	and	w21, w8, #0xff
	lsl	x24, x21, #3
	ldr	x8, [x10, x24]
	ldrh	w8, [x8]
	add	w8, w8, w9
	orr	w8, w8, w20
	ldr	x9, [x19, #24]
	ldr	w2, [x28]
	and	w1, w8, #0xffff
	mov	x0, x19
	blr	x9
	ldrh	w8, [x26]
	ldr	x9, [x27]
	ldr	x9, [x9, x24]
	ldrh	w9, [x9, #2]
	add	w8, w9, w8
	orr	w8, w8, w20
	ldr	x9, [x19, #24]
	ldr	w2, [x28]
	and	w1, w8, #0xffff
	mov	x0, x19
	blr	x9
Lloh18:
	adrp	x8, _OPL3_REG_KEYON_BLOCK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _OPL3_REG_KEYON_BLOCK@GOTPAGEOFF]
	ldrb	w8, [x8]
	add	w8, w21, w8
	orr	w8, w20, w8
	ldr	x9, [x19, #24]
	and	w1, w8, #0xffff
	mov	x0, x19
	mov	w2, #0
	blr	x9
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	add	w23, w23, #1
	ldr	w8, [x22]
	cmp	w9, w23
	b.ne	LBB0_2
LBB0_3:
Lloh20:
	adrp	x9, _SNDRV_DM_FM_MODE_OPL2@GOTPAGE
Lloh21:
	ldr	x9, [x9, _SNDRV_DM_FM_MODE_OPL2@GOTPAGEOFF]
	str	w8, [x19, #8]
Lloh22:
	ldr	w8, [x9]
	str	w8, [x19, #32]
	ldr	x8, [x19, #24]
Lloh23:
	adrp	x9, _OPL3_REG_TEST@GOTPAGE
Lloh24:
	ldr	x9, [x9, _OPL3_REG_TEST@GOTPAGEOFF]
	ldrh	w10, [x25]
	ldrh	w9, [x9]
	orr	w1, w9, w10
Lloh25:
	adrp	x9, _OPL3_ENABLE_WAVE_SELECT@GOTPAGE
Lloh26:
	ldr	x9, [x9, _OPL3_ENABLE_WAVE_SELECT@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x9]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19, #24]
	ldrh	w9, [x25]
Lloh28:
	adrp	x10, _OPL3_REG_PERCUSSION@GOTPAGE
Lloh29:
	ldr	x10, [x10, _OPL3_REG_PERCUSSION@GOTPAGEOFF]
	ldrh	w10, [x10]
	orr	w1, w10, w9
	mov	x0, x19
	mov	w2, #0
	blr	x8
	str	xzr, [x19, #16]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_OPL3_HW_OPL3,8,3               ; @OPL3_HW_OPL3
	.comm	_MAX_OPL2_VOICES,4,2            ; @MAX_OPL2_VOICES
	.comm	_MAX_OPL3_VOICES,4,2            ; @MAX_OPL3_VOICES
	.comm	_OPL3_LEFT,2,1                  ; @OPL3_LEFT
	.comm	_OPL3_RIGHT,2,1                 ; @OPL3_RIGHT
	.comm	_OPL3_REG_KSL_LEVEL,2,1         ; @OPL3_REG_KSL_LEVEL
	.comm	_snd_opl3_regmap,8,3            ; @snd_opl3_regmap
	.comm	_OPL3_TOTAL_LEVEL_MASK,4,2      ; @OPL3_TOTAL_LEVEL_MASK
	.comm	_OPL3_REG_KEYON_BLOCK,1,0       ; @OPL3_REG_KEYON_BLOCK
	.comm	_SNDRV_DM_FM_MODE_OPL2,4,2      ; @SNDRV_DM_FM_MODE_OPL2
	.comm	_OPL3_REG_TEST,2,1              ; @OPL3_REG_TEST
	.comm	_OPL3_ENABLE_WAVE_SELECT,4,2    ; @OPL3_ENABLE_WAVE_SELECT
	.comm	_OPL3_REG_PERCUSSION,2,1        ; @OPL3_REG_PERCUSSION
.subsections_via_symbols
