	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_via82xx_codec_write
_snd_via82xx_codec_write:               ## @snd_via82xx_codec_write
	.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
	movl	%edx, %r15d
	movq	8(%rdi), %r14
	movq	_AC97_GPIO_STATUS@GOTPCREL(%rip), %rax
	cmpw	%si, (%rax)
	jne	LBB0_1
## %bb.5:
	movq	_GPI_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_VIAREG
	movzwl	%r15w, %edi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_outl                           ## TAILCALL
LBB0_1:
	movq	%rdi, %rbx
	movzwl	%si, %eax
	cmpl	$0, (%rdi)
	jne	LBB0_2
## %bb.3:
	movq	_VIA_REG_AC97_CODEC_ID_PRIMARY@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_2:
	movq	_VIA_REG_AC97_CODEC_ID_SECONDARY@GOTPCREL(%rip), %rcx
LBB0_4:
	movl	(%rcx), %edx
	movq	_VIA_REG_AC97_CODEC_ID_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	movq	_VIA_REG_AC97_CMD_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movzwl	%r15w, %esi
	movq	_VIA_REG_AC97_DATA_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	orl	%eax, %esi
	orl	%edx, %esi
	movq	%r14, %rdi
	callq	_snd_via82xx_codec_xwrite
	movl	(%rbx), %esi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_snd_via82xx_codec_ready        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AC97_GPIO_STATUS,2,1           ## @AC97_GPIO_STATUS
	.comm	_GPI_STATUS,4,2                 ## @GPI_STATUS
	.comm	_VIA_REG_AC97_CODEC_ID_PRIMARY,4,2 ## @VIA_REG_AC97_CODEC_ID_PRIMARY
	.comm	_VIA_REG_AC97_CODEC_ID_SECONDARY,4,2 ## @VIA_REG_AC97_CODEC_ID_SECONDARY
	.comm	_VIA_REG_AC97_CODEC_ID_SHIFT,4,2 ## @VIA_REG_AC97_CODEC_ID_SHIFT
	.comm	_VIA_REG_AC97_CMD_SHIFT,2,1     ## @VIA_REG_AC97_CMD_SHIFT
	.comm	_VIA_REG_AC97_DATA_SHIFT,2,1    ## @VIA_REG_AC97_DATA_SHIFT
	.no_dead_strip	_snd_via82xx_codec_write
.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_write
_snd_via82xx_codec_write:               ; @snd_via82xx_codec_write
	.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	x20, x2
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x8, _AC97_GPIO_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AC97_GPIO_STATUS@GOTPAGEOFF]
	ldrh	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _GPI_STATUS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GPI_STATUS@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_VIAREG
	mov	x1, x0
	mov	x0, x20
	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
	b	_outl
LBB0_2:
	mov	x21, x0
Lloh5:
	adrp	x8, _VIA_REG_AC97_CODEC_ID_PRIMARY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VIA_REG_AC97_CODEC_ID_PRIMARY@GOTPAGEOFF]
Lloh7:
	adrp	x9, _VIA_REG_AC97_CODEC_ID_SECONDARY@GOTPAGE
Lloh8:
	ldr	x9, [x9, _VIA_REG_AC97_CODEC_ID_SECONDARY@GOTPAGEOFF]
	ldr	w10, [x0]
	cmp	w10, #0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _VIA_REG_AC97_CODEC_ID_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VIA_REG_AC97_CODEC_ID_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	lsl	w8, w8, w9
Lloh12:
	adrp	x9, _VIA_REG_AC97_CMD_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _VIA_REG_AC97_CMD_SHIFT@GOTPAGEOFF]
	ldrh	w9, [x9]
	lsl	w9, w1, w9
	orr	w8, w9, w8
Lloh14:
	adrp	x9, _VIA_REG_AC97_DATA_SHIFT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _VIA_REG_AC97_DATA_SHIFT@GOTPAGEOFF]
	ldrh	w9, [x9]
	lsl	w9, w20, w9
	orr	w1, w8, w9
	mov	x0, x19
	bl	_snd_via82xx_codec_xwrite
	ldr	w1, [x21]
	mov	x0, x19
	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
	b	_snd_via82xx_codec_ready
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_AC97_GPIO_STATUS,2,1           ; @AC97_GPIO_STATUS
	.comm	_GPI_STATUS,4,2                 ; @GPI_STATUS
	.comm	_VIA_REG_AC97_CODEC_ID_PRIMARY,4,2 ; @VIA_REG_AC97_CODEC_ID_PRIMARY
	.comm	_VIA_REG_AC97_CODEC_ID_SECONDARY,4,2 ; @VIA_REG_AC97_CODEC_ID_SECONDARY
	.comm	_VIA_REG_AC97_CODEC_ID_SHIFT,4,2 ; @VIA_REG_AC97_CODEC_ID_SHIFT
	.comm	_VIA_REG_AC97_CMD_SHIFT,2,1     ; @VIA_REG_AC97_CMD_SHIFT
	.comm	_VIA_REG_AC97_DATA_SHIFT,2,1    ; @VIA_REG_AC97_DATA_SHIFT
	.no_dead_strip	_snd_via82xx_codec_write
.subsections_via_symbols
