	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_yrw801_detect              ## -- Begin function snd_yrw801_detect
	.p2align	4, 0x90
_snd_yrw801_detect:                     ## @snd_yrw801_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	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	leaq	-39(%rbp), %r14
	movq	%r14, %rsi
	movl	$4608, %edx                     ## imm = 0x1200
	movl	$15, %ecx
	callq	_snd_opl4_read_memory
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	$15, %edx
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	leaq	-39(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$2097150, %edx                  ## imm = 0x1FFFFE
	movl	$2, %ecx
	callq	_snd_opl4_read_memory
	cmpb	$1, -39(%rbp)
	jne	LBB0_1
## %bb.3:
	movsbl	-38(%rbp), %edx
	leaq	L_.str.1(%rip), %rdi
	movl	$1, %esi
	callq	_snd_printdd
	xorl	%eax, %eax
	jmp	LBB0_4
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-24(%rbp), %rcx
	jne	LBB0_6
## %bb.5:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CopyrightYAMAHA"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"YRW801 ROM version %02x.%02x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_snd_yrw801_detect              ; -- Begin function snd_yrw801_detect
	.p2align	2
_snd_yrw801_detect:                     ; @snd_yrw801_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	add	x1, sp, #9
	mov	w2, #4608
	mov	w3, #15
	bl	_snd_opl4_read_memory
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #9
	mov	w2, #15
	bl	_memcmp
	cbnz	x0, LBB0_3
; %bb.1:
	add	x1, sp, #9
	mov	x0, x19
	mov	w2, #2097150
	mov	w3, #2
	bl	_snd_opl4_read_memory
	ldrb	w8, [sp, #9]
	cmp	w8, #1
	b.ne	LBB0_3
; %bb.2:
	ldrsb	w2, [sp, #10]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	w1, #1
	bl	_snd_printdd
	mov	w0, #0
	b	LBB0_4
LBB0_3:
Lloh7:
	adrp	x8, _ENODEV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldr	x8, [sp, #24]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CopyrightYAMAHA"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"YRW801 ROM version %02x.%02x\n"

.subsections_via_symbols
