	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_opl3_synth_setup           ## -- Begin function snd_opl3_synth_setup
	.p2align	4, 0x90
_snd_opl3_synth_setup:                  ## @snd_opl3_synth_setup
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	48(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	cmpq	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_2:
	movq	$1, 8(%rbx)
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_snd_opl3_reset
	movq	_MAX_OPL3_VOICES@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_5
## %bb.3:
	movq	40(%r14), %rax
	addq	$16, %rax
	xorl	%ecx, %ecx
	movq	_SNDRV_OPL3_ST_OFF@GOTPCREL(%rip), %rdx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdx), %esi
	movl	%esi, (%rax)
	movq	$0, -8(%rax)
	movl	$0, -16(%rax)
	incq	%rcx
	movslq	(%r15), %rsi
	addq	$24, %rax
	cmpq	%rsi, %rcx
	jl	LBB0_4
LBB0_5:
	movq	$0, 32(%r14)
	movl	$0, (%r14)
	movq	8(%r14), %rax
	movq	_OPL3_HW_OPL3@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jl	LBB0_7
## %bb.6:
	movq	_OPL3_RIGHT@GOTPCREL(%rip), %rax
	movq	_OPL3_REG_CONNECTION_SELECT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	*24(%r14)
	movl	(%r15), %eax
	movl	%eax, 16(%r14)
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_MAX_OPL3_VOICES,4,2            ## @MAX_OPL3_VOICES
	.comm	_SNDRV_OPL3_ST_OFF,4,2          ## @SNDRV_OPL3_ST_OFF
	.comm	_OPL3_HW_OPL3,8,3               ## @OPL3_HW_OPL3
	.comm	_OPL3_RIGHT,4,2                 ## @OPL3_RIGHT
	.comm	_OPL3_REG_CONNECTION_SELECT,4,2 ## @OPL3_REG_CONNECTION_SELECT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_opl3_synth_setup           ; -- Begin function snd_opl3_synth_setup
	.p2align	2
_snd_opl3_synth_setup:                  ; @snd_opl3_synth_setup
	.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, x0
	ldr	x20, [x0, #48]
	mov	x0, x20
	bl	_mutex_lock
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_mutex_unlock
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_2:
	mov	w8, #1
	str	x8, [x20, #8]
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	bl	_snd_opl3_reset
Lloh3:
	adrp	x20, _MAX_OPL3_VOICES@GOTPAGE
Lloh4:
	ldr	x20, [x20, _MAX_OPL3_VOICES@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x8, #0
	ldr	x9, [x19, #40]
	add	x9, x9, #16
Lloh5:
	adrp	x10, _SNDRV_OPL3_ST_OFF@GOTPAGE
Lloh6:
	ldr	x10, [x10, _SNDRV_OPL3_ST_OFF@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10]
	str	w11, [x9]
	stur	xzr, [x9, #-8]
	stur	wzr, [x9, #-16]
	add	x8, x8, #1
	ldrsw	x11, [x20]
	add	x9, x9, #24
	cmp	x8, x11
	b.lt	LBB0_4
LBB0_5:
	mov	w0, #0
	str	xzr, [x19, #32]
	str	wzr, [x19]
	ldr	x8, [x19, #8]
Lloh7:
	adrp	x9, _OPL3_HW_OPL3@GOTPAGE
Lloh8:
	ldr	x9, [x9, _OPL3_HW_OPL3@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_7
; %bb.6:
Lloh10:
	adrp	x8, _OPL3_RIGHT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _OPL3_RIGHT@GOTPAGEOFF]
	ldr	x9, [x19, #24]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x10, _OPL3_REG_CONNECTION_SELECT@GOTPAGE
Lloh14:
	ldr	x10, [x10, _OPL3_REG_CONNECTION_SELECT@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	orr	w1, w10, w8
	mov	x0, x19
	mov	w2, #0
	blr	x9
	mov	w0, #0
	ldr	w8, [x20]
	str	w8, [x19, #16]
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_MAX_OPL3_VOICES,4,2            ; @MAX_OPL3_VOICES
	.comm	_SNDRV_OPL3_ST_OFF,4,2          ; @SNDRV_OPL3_ST_OFF
	.comm	_OPL3_HW_OPL3,8,3               ; @OPL3_HW_OPL3
	.comm	_OPL3_RIGHT,4,2                 ; @OPL3_RIGHT
	.comm	_OPL3_REG_CONNECTION_SELECT,4,2 ; @OPL3_REG_CONNECTION_SELECT
.subsections_via_symbols
