	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_via8233_capture_prepare
_snd_via8233_capture_prepare:           ## @snd_via8233_capture_prepare
	.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, %rbx
	callq	_snd_pcm_substream_chip
	movq	%rax, %r12
	movq	(%rbx), %rbx
	movq	16(%rbx), %r14
	movq	8(%rax), %rdi
	addq	$4, %rdi
	movl	12(%rbx), %esi
	callq	_via_lock_rate
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	movl	(%r12), %edi
	movq	_AC97_PCM_LR_ADC_RATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	12(%rbx), %edx
	callq	_snd_ac97_set_rate
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_snd_via82xx_channel_reset
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_snd_via82xx_set_table_ptr
	movq	_VIA_REG_CAPTURE_FIFO_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_OFS_CAPTURE_FIFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_VIADEV_REG
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_outb
	movq	(%rbx), %rax
	movq	_SNDRV_PCM_FORMAT_S16_LE@GOTPCREL(%rip), %rcx
	movq	_VIA8233_REG_TYPE_16BIT@GOTPCREL(%rip), %rsi
	xorl	%r15d, %r15d
	cmpl	$2, 8(%rbx)
	movl	$0, %edx
	jl	LBB0_4
## %bb.3:
	movq	_VIA8233_REG_TYPE_STEREO@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_4:
	movl	$-16777216, %edi                ## imm = 0xFF000000
	movl	(%rsi), %ebx
	orl	%edi, %ebx
	cmpq	(%rcx), %rax
	cmovnel	%edi, %ebx
	orl	%edx, %ebx
	movq	_OFFSET_STOP_IDX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_VIADEV_REG
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_outl
	movl	$20, %edi
	callq	_udelay
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_snd_via82xx_codec_ready
	jmp	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_5:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AC97_PCM_LR_ADC_RATE,4,2       ## @AC97_PCM_LR_ADC_RATE
	.comm	_VIA_REG_CAPTURE_FIFO_ENABLE,4,2 ## @VIA_REG_CAPTURE_FIFO_ENABLE
	.comm	_OFS_CAPTURE_FIFO,4,2           ## @OFS_CAPTURE_FIFO
	.comm	_SNDRV_PCM_FORMAT_S16_LE,8,3    ## @SNDRV_PCM_FORMAT_S16_LE
	.comm	_VIA8233_REG_TYPE_16BIT,4,2     ## @VIA8233_REG_TYPE_16BIT
	.comm	_VIA8233_REG_TYPE_STEREO,4,2    ## @VIA8233_REG_TYPE_STEREO
	.comm	_OFFSET_STOP_IDX,4,2            ## @OFFSET_STOP_IDX
	.no_dead_strip	_snd_via8233_capture_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_via8233_capture_prepare
_snd_via8233_capture_prepare:           ; @snd_via8233_capture_prepare
	.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, x0
	bl	_snd_pcm_substream_chip
	mov	x19, x0
	ldr	x22, [x20]
	ldr	x20, [x22, #16]
	ldr	x8, [x0, #8]
	add	x0, x8, #4
	ldr	w1, [x22, #12]
	bl	_via_lock_rate
	tbnz	x0, #63, LBB0_2
; %bb.1:
	ldr	w0, [x19]
Lloh0:
	adrp	x8, _AC97_PCM_LR_ADC_RATE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AC97_PCM_LR_ADC_RATE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x22, #12]
	bl	_snd_ac97_set_rate
	mov	x0, x19
	mov	x1, x20
	bl	_snd_via82xx_channel_reset
	mov	x0, x19
	mov	x1, x20
	bl	_snd_via82xx_set_table_ptr
Lloh3:
	adrp	x8, _VIA_REG_CAPTURE_FIFO_ENABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VIA_REG_CAPTURE_FIFO_ENABLE@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
Lloh6:
	adrp	x8, _OFS_CAPTURE_FIFO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _OFS_CAPTURE_FIFO@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_VIADEV_REG
	mov	x1, x0
	mov	x0, x21
	bl	_outb
	ldr	x8, [x22]
Lloh9:
	adrp	x9, _SNDRV_PCM_FORMAT_S16_LE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SNDRV_PCM_FORMAT_S16_LE@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
Lloh12:
	adrp	x10, _VIA8233_REG_TYPE_16BIT@GOTPAGE
Lloh13:
	ldr	x10, [x10, _VIA8233_REG_TYPE_16BIT@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
Lloh15:
	adrp	x11, _VIA8233_REG_TYPE_STEREO@GOTPAGE
Lloh16:
	ldr	x11, [x11, _VIA8233_REG_TYPE_STEREO@GOTPAGEOFF]
	ldr	w12, [x22, #8]
Lloh17:
	ldr	w11, [x11]
	cmp	w12, #1
	csel	w11, w11, wzr, gt
	orr	w10, w10, #0xff000000
	cmp	x8, x9
	mov	w8, #-16777216
	csel	w8, w10, w8, eq
	orr	w21, w8, w11
Lloh18:
	adrp	x8, _OFFSET_STOP_IDX@GOTPAGE
Lloh19:
	ldr	x8, [x8, _OFFSET_STOP_IDX@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_VIADEV_REG
	mov	x1, x0
	mov	x0, x21
	bl	_outl
	mov	w0, #20
	bl	_udelay
	mov	x0, x19
	mov	w1, #0
	bl	_snd_via82xx_codec_ready
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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 AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AC97_PCM_LR_ADC_RATE,4,2       ; @AC97_PCM_LR_ADC_RATE
	.comm	_VIA_REG_CAPTURE_FIFO_ENABLE,4,2 ; @VIA_REG_CAPTURE_FIFO_ENABLE
	.comm	_OFS_CAPTURE_FIFO,4,2           ; @OFS_CAPTURE_FIFO
	.comm	_SNDRV_PCM_FORMAT_S16_LE,8,3    ; @SNDRV_PCM_FORMAT_S16_LE
	.comm	_VIA8233_REG_TYPE_16BIT,4,2     ; @VIA8233_REG_TYPE_16BIT
	.comm	_VIA8233_REG_TYPE_STEREO,4,2    ; @VIA8233_REG_TYPE_STEREO
	.comm	_OFFSET_STOP_IDX,4,2            ; @OFFSET_STOP_IDX
	.no_dead_strip	_snd_via8233_capture_prepare
.subsections_via_symbols
