	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_via82xx_codec_valid
_snd_via82xx_codec_valid:               ## @snd_via82xx_codec_valid
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	testl	%esi, %esi
	jne	LBB0_1
## %bb.2:
	movq	_VIA_REG_AC97_PRIMARY_VALID@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_VIA_REG_AC97_SECONDARY_VALID@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r15d
	movl	$-1000, %ebx                    ## imm = 0xFC18
	movq	_VIA_REG_AC97_BUSY@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_snd_via82xx_codec_xread
	movl	(%r12), %ecx
	orl	%r15d, %ecx
	andl	%eax, %ecx
	cmpl	%r15d, %ecx
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, %edi
	callq	_udelay
	incl	%ebx
	jne	LBB0_4
## %bb.7:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_5:
	movzwl	%ax, %eax
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VIA_REG_AC97_PRIMARY_VALID,4,2 ## @VIA_REG_AC97_PRIMARY_VALID
	.comm	_VIA_REG_AC97_SECONDARY_VALID,4,2 ## @VIA_REG_AC97_SECONDARY_VALID
	.comm	_VIA_REG_AC97_BUSY,4,2          ## @VIA_REG_AC97_BUSY
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_snd_via82xx_codec_valid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_via82xx_codec_valid
_snd_via82xx_codec_valid:               ; @snd_via82xx_codec_valid
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _VIA_REG_AC97_PRIMARY_VALID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIA_REG_AC97_PRIMARY_VALID@GOTPAGEOFF]
Lloh2:
	adrp	x9, _VIA_REG_AC97_SECONDARY_VALID@GOTPAGE
Lloh3:
	ldr	x9, [x9, _VIA_REG_AC97_SECONDARY_VALID@GOTPAGEOFF]
	cmp	w1, #0
	csel	x8, x8, x9, eq
	ldr	w20, [x8]
	mov	w21, #-1000
Lloh4:
	adrp	x22, _VIA_REG_AC97_BUSY@GOTPAGE
Lloh5:
	ldr	x22, [x22, _VIA_REG_AC97_BUSY@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_snd_via82xx_codec_xread
	ldr	w8, [x22]
	orr	w8, w8, w20
	and	w8, w8, w0
	cmp	w8, w20
	b.eq	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #1
	bl	_udelay
	adds	w21, w21, #1
	b.lo	LBB0_1
; %bb.3:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_4:
	and	w0, w0, #0xffff
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_VIA_REG_AC97_PRIMARY_VALID,4,2 ; @VIA_REG_AC97_PRIMARY_VALID
	.comm	_VIA_REG_AC97_SECONDARY_VALID,4,2 ; @VIA_REG_AC97_SECONDARY_VALID
	.comm	_VIA_REG_AC97_BUSY,4,2          ; @VIA_REG_AC97_BUSY
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_snd_via82xx_codec_valid
.subsections_via_symbols
