	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_opl4_detect
_snd_opl4_detect:                       ## @snd_opl4_detect
	.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, %r15
	callq	_snd_opl4_enable_opl4
	movq	_OPL4_REG_MEMORY_CONFIGURATION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_snd_opl4_read
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_snd_printdd
	movq	_OPL4_DEVICE_ID_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	cmpl	$32, %ebx
	je	LBB0_3
## %bb.1:
	cmpl	$64, %ebx
	jne	LBB0_7
## %bb.2:
	movq	_OPL3_HW_OPL4_ML@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_OPL3_HW_OPL4@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movq	_OPL4_REG_MIX_CONTROL_FM@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_snd_opl4_write
	movq	_OPL4_REG_MIX_CONTROL_PCM@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	$255, %edx
	callq	_snd_opl4_write
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_snd_opl4_read
	movl	%eax, %ebx
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_snd_opl4_read
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_snd_printdd
	testl	%ebx, %ebx
	jne	LBB0_8
## %bb.5:
	cmpl	$255, %r12d
	jne	LBB0_8
## %bb.6:
	movq	_OPL4_REG_MIX_CONTROL_FM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$63, %edx
	callq	_snd_opl4_write
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	$63, %edx
	callq	_snd_opl4_write
	movq	_OPL4_REG_MEMORY_CONFIGURATION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_snd_opl4_write
	jmp	LBB0_10
LBB0_7:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_9
LBB0_8:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_9:
	subl	(%rax), %r14d
LBB0_10:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OPL4_REG_MEMORY_CONFIGURATION,4,2 ## @OPL4_REG_MEMORY_CONFIGURATION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OPL4[02]=%02x\n"

	.comm	_OPL4_DEVICE_ID_MASK,4,2        ## @OPL4_DEVICE_ID_MASK
	.comm	_OPL3_HW_OPL4,4,2               ## @OPL3_HW_OPL4
	.comm	_OPL3_HW_OPL4_ML,4,2            ## @OPL3_HW_OPL4_ML
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_OPL4_REG_MIX_CONTROL_FM,4,2    ## @OPL4_REG_MIX_CONTROL_FM
	.comm	_OPL4_REG_MIX_CONTROL_PCM,4,2   ## @OPL4_REG_MIX_CONTROL_PCM
L_.str.1:                               ## @.str.1
	.asciz	"OPL4 id1=%02x id2=%02x\n"

	.no_dead_strip	_snd_opl4_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_opl4_detect
_snd_opl4_detect:                       ; @snd_opl4_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	bl	_snd_opl4_enable_opl4
Lloh0:
	adrp	x22, _OPL4_REG_MEMORY_CONFIGURATION@GOTPAGE
Lloh1:
	ldr	x22, [x22, _OPL4_REG_MEMORY_CONFIGURATION@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_snd_opl4_read
	mov	x20, x0
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_snd_printdd
Lloh4:
	adrp	x8, _OPL4_DEVICE_ID_MASK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _OPL4_DEVICE_ID_MASK@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	and	w8, w8, w20
	cmp	w8, #32
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #64
	b.ne	LBB0_7
; %bb.2:
Lloh7:
	adrp	x8, _OPL3_HW_OPL4_ML@GOTPAGE
Lloh8:
	ldr	x8, [x8, _OPL3_HW_OPL4_ML@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh9:
	adrp	x8, _OPL3_HW_OPL4@GOTPAGE
Lloh10:
	ldr	x8, [x8, _OPL3_HW_OPL4@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	str	w8, [x19]
Lloh11:
	adrp	x23, _OPL4_REG_MIX_CONTROL_FM@GOTPAGE
Lloh12:
	ldr	x23, [x23, _OPL4_REG_MIX_CONTROL_FM@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #0
	bl	_snd_opl4_write
Lloh13:
	adrp	x24, _OPL4_REG_MIX_CONTROL_PCM@GOTPAGE
Lloh14:
	ldr	x24, [x24, _OPL4_REG_MIX_CONTROL_PCM@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x19
	mov	w2, #255
	bl	_snd_opl4_write
	ldr	w1, [x23]
	mov	x0, x19
	bl	_snd_opl4_read
	mov	x21, x0
	ldr	w1, [x24]
	mov	x0, x19
	bl	_snd_opl4_read
	mov	x20, x0
	str	x20, [sp]
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_snd_printdd
	cbnz	w21, LBB0_7
; %bb.5:
	cmp	w20, #255
	b.ne	LBB0_7
; %bb.6:
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #63
	bl	_snd_opl4_write
	ldr	w1, [x24]
	mov	x0, x19
	mov	w2, #63
	bl	_snd_opl4_write
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #0
	bl	_snd_opl4_write
	mov	w0, #0
	b	LBB0_8
LBB0_7:
Lloh17:
	adrp	x8, _ENODEV@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_OPL4_REG_MEMORY_CONFIGURATION,4,2 ; @OPL4_REG_MEMORY_CONFIGURATION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OPL4[02]=%02x\n"

	.comm	_OPL4_DEVICE_ID_MASK,4,2        ; @OPL4_DEVICE_ID_MASK
	.comm	_OPL3_HW_OPL4,4,2               ; @OPL3_HW_OPL4
	.comm	_OPL3_HW_OPL4_ML,4,2            ; @OPL3_HW_OPL4_ML
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_OPL4_REG_MIX_CONTROL_FM,4,2    ; @OPL4_REG_MIX_CONTROL_FM
	.comm	_OPL4_REG_MIX_CONTROL_PCM,4,2   ; @OPL4_REG_MIX_CONTROL_PCM
l_.str.1:                               ; @.str.1
	.asciz	"OPL4 id1=%02x id2=%02x\n"

	.no_dead_strip	_snd_opl4_detect
.subsections_via_symbols
