	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opl3_open
_opl3_open:                             ## @opl3_open
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_devc@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_4
LBB0_2:
	movl	$1, (%rax)
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	cmpl	$2, 8(%rax)
	sete	%cl
	leal	9(%rcx,%rcx,8), %ecx
	movl	%ecx, 4(%rax)
	movq	24(%rax), %rdx
	movl	%ecx, (%rdx)
	movq	$0, 24(%rdx)
	movq	8(%rdx), %rcx
	movq	16(%rdx), %rdx
	movq	$0, (%rdx)
	movq	$0, (%rcx)
	movq	$0, 8(%rdx)
	movq	$0, 8(%rcx)
	movq	$0, 16(%rdx)
	movq	$0, 16(%rcx)
	movq	$0, 24(%rdx)
	movq	$0, 24(%rcx)
	movq	$0, 32(%rdx)
	movq	$0, 32(%rcx)
	movq	$0, 40(%rdx)
	movq	$0, 40(%rcx)
	movq	$0, 48(%rdx)
	movq	$0, 48(%rcx)
	movq	$0, 56(%rdx)
	movq	$0, 56(%rcx)
	movq	$0, 64(%rdx)
	movq	$0, 64(%rcx)
	movq	$0, 72(%rdx)
	movq	$0, 72(%rcx)
	movq	$0, 80(%rdx)
	movq	$0, 80(%rcx)
	movq	$0, 88(%rdx)
	movq	$0, 88(%rcx)
	movq	$0, 96(%rdx)
	movq	$0, 96(%rcx)
	movq	$0, 104(%rdx)
	movq	$0, 104(%rcx)
	movq	$0, 112(%rdx)
	movq	$0, 112(%rcx)
	movq	$0, 120(%rdx)
	movq	$0, 120(%rcx)
	movq	$0, 128(%rdx)
	movq	$0, 128(%rcx)
	movq	$0, 136(%rdx)
	movq	$0, 136(%rcx)
	movl	$0, 12(%rax)
	jne	LBB0_4
## %bb.3:
	movl	16(%rax), %edi
	movq	_CONNECTION_SELECT_REGISTER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_opl3_command
LBB0_4:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_devc,8,3                       ## @devc
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_CONNECTION_SELECT_REGISTER,4,2 ## @CONNECTION_SELECT_REGISTER
	.no_dead_strip	_opl3_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opl3_open
_opl3_open:                             ; @opl3_open
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, _devc@GOTPAGE
Lloh1:
	ldr	x8, [x8, _devc@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w9, [x8]
	cbz	w9, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	w0, #0
	ldr	w9, [x8, #8]
	mov	w10, #9
	mov	w11, #18
	cmp	w9, #2
	csel	w9, w11, w10, eq
	mov	w10, #1
	stp	w10, w9, [x8]
	ldr	x10, [x8, #24]
	str	w9, [x10]
	str	xzr, [x10, #24]
	ldp	x10, x9, [x10, #8]
	str	xzr, [x9]
	str	xzr, [x10]
	str	xzr, [x9, #8]
	str	xzr, [x10, #8]
	str	xzr, [x9, #16]
	str	xzr, [x10, #16]
	str	xzr, [x9, #24]
	str	xzr, [x10, #24]
	str	xzr, [x9, #32]
	str	xzr, [x10, #32]
	str	xzr, [x9, #40]
	str	xzr, [x10, #40]
	str	xzr, [x9, #48]
	str	xzr, [x10, #48]
	str	xzr, [x9, #56]
	str	xzr, [x10, #56]
	str	xzr, [x9, #64]
	str	xzr, [x10, #64]
	str	xzr, [x9, #72]
	str	xzr, [x10, #72]
	str	xzr, [x9, #80]
	str	xzr, [x10, #80]
	str	xzr, [x9, #88]
	str	xzr, [x10, #88]
	str	xzr, [x9, #96]
	str	xzr, [x10, #96]
	str	xzr, [x9, #104]
	str	xzr, [x10, #104]
	str	xzr, [x9, #112]
	str	xzr, [x10, #112]
	str	xzr, [x9, #120]
	str	xzr, [x10, #120]
	str	xzr, [x9, #128]
	str	xzr, [x10, #128]
	str	xzr, [x9, #136]
	str	xzr, [x10, #136]
	str	wzr, [x8, #12]
	b.ne	LBB0_4
; %bb.3:
	ldr	w0, [x8, #16]
Lloh6:
	adrp	x8, _CONNECTION_SELECT_REGISTER@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CONNECTION_SELECT_REGISTER@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_opl3_command
	mov	w0, #0
LBB0_4:
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_devc,8,3                       ; @devc
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_CONNECTION_SELECT_REGISTER,4,2 ; @CONNECTION_SELECT_REGISTER
	.no_dead_strip	_opl3_open
.subsections_via_symbols
