	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_ac97c_capture_prepare
_atmel_ac97c_capture_prepare:           ## @atmel_ac97c_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_snd_pcm_substream_chip
	movq	%rax, %r15
	movq	(%rbx), %r12
	movq	_ICA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ac97c_readl
	movq	%rax, %r13
	movq	_PCM_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AC97C_CH_MASK
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_PCM_RIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AC97C_CH_MASK
	movq	%rax, %r14
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	(%r12), %eax
	cmpl	$2, %eax
	je	LBB0_6
## %bb.1:
	cmpl	$1, %eax
	jne	LBB0_8
## %bb.2:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_PCM_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_AC97C_CH_ASSIGN
	jmp	LBB0_3
LBB0_6:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_PCM_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_A@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_AC97C_CH_ASSIGN
	movq	%rax, %rbx
	movq	_PCM_RIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12), %esi
	callq	_AC97C_CH_ASSIGN
	orq	%rbx, %rax
LBB0_3:
	movq	_ICA@GOTPCREL(%rip), %rbx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	orq	%rcx, %r14
	notq	%r14
	andq	%r14, %r13
	orq	%rax, %r13
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_ac97c_writel
	movq	_AC97C_CMR_DMAEN@GOTPCREL(%rip), %rax
	movq	_AC97C_CMR_SIZE_16@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	orq	(%rax), %rdx
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movl	4(%r12), %eax
	cmpl	$129, %eax
	je	LBB0_9
## %bb.4:
	cmpl	$128, %eax
	jne	LBB0_7
## %bb.5:
	movq	_AC97C_CMR_CEM_LITTLE@GOTPCREL(%rip), %rax
	orq	(%rax), %rdx
	jmp	LBB0_10
LBB0_9:
	movq	_AC97C_CMR_CEM_LITTLE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	notq	%rax
	andq	%rax, %rdx
LBB0_10:
	movq	_AC97C_CSR_OVRUN@GOTPCREL(%rip), %rax
	orq	(%rax), %rdx
	movq	_CAMR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ac97c_writel
	movq	_IMR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ac97c_readl
	movq	_AC97C_SR_CAEVT@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rax
	movq	_IER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r15, %rdi
	movq	%rax, %rdx
	callq	_ac97c_writel
	movl	8(%r12), %ebx
	movq	_MR@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_ac97c_readl
	movq	_AC97C_MR_VRA@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	%rdx, %rcx
	notq	%rcx
	andq	%rax, %rcx
	orq	%rax, %rdx
	cmpl	$48000, %ebx                    ## imm = 0xBB80
	cmoveq	%rcx, %rdx
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_ac97c_writel
	movl	16(%r15), %edi
	movq	_AC97_PCM_LR_ADC_RATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r12), %edx
	callq	_snd_ac97_set_rate
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movq	8(%r15), %rdi
	movl	8(%r12), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
LBB0_12:
	movq	_DMA_RX_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_test_bit
	testl	%eax, %eax
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	jne	LBB0_13
## %bb.14:
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_atmel_ac97c_prepare_dma        ## TAILCALL
LBB0_7:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_ac97c_readl
	movq	%rax, %r14
	movq	_PCM_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AC97C_CH_MASK
	movq	%rbx, %r12
	movq	%rax, %rbx
	movq	_PCM_RIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AC97C_CH_MASK
	orq	%rax, %rbx
	notq	%rbx
	andq	%r14, %rbx
	movl	(%r12), %esi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_ac97c_writel
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ICA,4,2                        ## @ICA
	.comm	_PCM_LEFT,4,2                   ## @PCM_LEFT
	.comm	_PCM_RIGHT,4,2                  ## @PCM_RIGHT
	.comm	_A,4,2                          ## @A
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AC97C_CMR_DMAEN,8,3            ## @AC97C_CMR_DMAEN
	.comm	_AC97C_CMR_SIZE_16,8,3          ## @AC97C_CMR_SIZE_16
	.comm	_AC97C_CMR_CEM_LITTLE,8,3       ## @AC97C_CMR_CEM_LITTLE
	.comm	_AC97C_CSR_OVRUN,8,3            ## @AC97C_CSR_OVRUN
	.comm	_CAMR,4,2                       ## @CAMR
	.comm	_IMR,4,2                        ## @IMR
	.comm	_AC97C_SR_CAEVT,8,3             ## @AC97C_SR_CAEVT
	.comm	_IER,4,2                        ## @IER
	.comm	_MR,4,2                         ## @MR
	.comm	_AC97C_MR_VRA,8,3               ## @AC97C_MR_VRA
	.comm	_AC97_PCM_LR_ADC_RATE,4,2       ## @AC97_PCM_LR_ADC_RATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not set rate %d Hz\n"

	.comm	_DMA_RX_READY,4,2               ## @DMA_RX_READY
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.no_dead_strip	_atmel_ac97c_capture_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_ac97c_capture_prepare
_atmel_ac97c_capture_prepare:           ; @atmel_ac97c_capture_prepare
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	bl	_snd_pcm_substream_chip
	mov	x19, x0
	ldr	x25, [x20]
Lloh0:
	adrp	x26, _ICA@GOTPAGE
Lloh1:
	ldr	x26, [x26, _ICA@GOTPAGEOFF]
	ldr	w1, [x26]
	bl	_ac97c_readl
	mov	x21, x0
Lloh2:
	adrp	x27, _PCM_LEFT@GOTPAGE
Lloh3:
	ldr	x27, [x27, _PCM_LEFT@GOTPAGEOFF]
	ldr	w0, [x27]
	bl	_AC97C_CH_MASK
	mov	x22, x0
Lloh4:
	adrp	x24, _PCM_RIGHT@GOTPAGE
Lloh5:
	ldr	x24, [x24, _PCM_RIGHT@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_AC97C_CH_MASK
	mov	x23, x0
	ldr	w8, [x25]
	cmp	w8, #2
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #1
	b.ne	LBB0_13
; %bb.2:
	ldr	w0, [x27]
Lloh6:
	adrp	x8, _A@GOTPAGE
Lloh7:
	ldr	x8, [x8, _A@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_AC97C_CH_ASSIGN
	b	LBB0_4
LBB0_3:
	ldr	w0, [x27]
Lloh9:
	adrp	x28, _A@GOTPAGE
Lloh10:
	ldr	x28, [x28, _A@GOTPAGEOFF]
	ldr	w1, [x28]
	bl	_AC97C_CH_ASSIGN
	mov	x8, x24
	mov	x24, x0
	ldr	w0, [x8]
	ldr	w1, [x28]
	bl	_AC97C_CH_ASSIGN
	orr	x0, x0, x24
LBB0_4:
	orr	x8, x23, x22
	bic	x8, x21, x8
	orr	x2, x0, x8
	ldr	w1, [x26]
	mov	x0, x19
	bl	_ac97c_writel
Lloh11:
	adrp	x8, _AC97C_CMR_DMAEN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AC97C_CMR_DMAEN@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
Lloh14:
	adrp	x9, _AC97C_CMR_SIZE_16@GOTPAGE
Lloh15:
	ldr	x9, [x9, _AC97C_CMR_SIZE_16@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	orr	x8, x9, x8
	ldr	w9, [x25, #4]
	cmp	w9, #129
	b.eq	LBB0_7
; %bb.5:
	cmp	w9, #128
	b.ne	LBB0_12
; %bb.6:
Lloh17:
	adrp	x9, _AC97C_CMR_CEM_LITTLE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _AC97C_CMR_CEM_LITTLE@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	orr	x8, x9, x8
	b	LBB0_8
LBB0_7:
Lloh20:
	adrp	x9, _AC97C_CMR_CEM_LITTLE@GOTPAGE
Lloh21:
	ldr	x9, [x9, _AC97C_CMR_CEM_LITTLE@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	bic	x8, x8, x9
LBB0_8:
Lloh23:
	adrp	x9, _AC97C_CSR_OVRUN@GOTPAGE
Lloh24:
	ldr	x9, [x9, _AC97C_CSR_OVRUN@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	orr	x2, x9, x8
Lloh26:
	adrp	x8, _CAMR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CAMR@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ac97c_writel
Lloh29:
	adrp	x8, _IMR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _IMR@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ac97c_readl
Lloh32:
	adrp	x8, _AC97C_SR_CAEVT@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AC97C_SR_CAEVT@GOTPAGEOFF]
Lloh34:
	ldr	x8, [x8]
	orr	x2, x8, x0
Lloh35:
	adrp	x8, _IER@GOTPAGE
Lloh36:
	ldr	x8, [x8, _IER@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ac97c_writel
	ldr	w21, [x25, #8]
Lloh38:
	adrp	x22, _MR@GOTPAGE
Lloh39:
	ldr	x22, [x22, _MR@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_ac97c_readl
Lloh40:
	adrp	x8, _AC97C_MR_VRA@GOTPAGE
Lloh41:
	ldr	x8, [x8, _AC97C_MR_VRA@GOTPAGEOFF]
Lloh42:
	ldr	x8, [x8]
	bic	x9, x0, x8
	orr	x8, x8, x0
	mov	w10, #48000
	cmp	w21, w10
	csel	x2, x9, x8, eq
	ldr	w1, [x22]
	mov	x0, x19
	bl	_ac97c_writel
	ldr	w0, [x19, #16]
Lloh43:
	adrp	x8, _AC97_PCM_LR_ADC_RATE@GOTPAGE
Lloh44:
	ldr	x8, [x8, _AC97_PCM_LR_ADC_RATE@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x8]
	ldr	w2, [x25, #8]
	bl	_snd_ac97_set_rate
	mov	x21, x0
	cbz	w0, LBB0_10
; %bb.9:
	ldr	x0, [x19, #8]
	ldr	w2, [x25, #8]
Lloh46:
	adrp	x1, l_.str@PAGE
Lloh47:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
LBB0_10:
Lloh48:
	adrp	x8, _DMA_RX_READY@GOTPAGE
Lloh49:
	ldr	x8, [x8, _DMA_RX_READY@GOTPAGEOFF]
Lloh50:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_bit
	cbnz	w0, LBB0_14
; %bb.11:
Lloh51:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh52:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh53:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_atmel_ac97c_prepare_dma
LBB0_12:
	ldr	w1, [x26]
	mov	x0, x19
	bl	_ac97c_readl
	mov	x20, x0
	ldr	w0, [x27]
	bl	_AC97C_CH_MASK
	mov	x21, x0
Lloh54:
	adrp	x8, _PCM_RIGHT@GOTPAGE
Lloh55:
	ldr	x8, [x8, _PCM_RIGHT@GOTPAGEOFF]
Lloh56:
	ldr	w0, [x8]
	bl	_AC97C_CH_MASK
	orr	x8, x0, x21
	bic	x2, x20, x8
	ldr	w1, [x26]
	mov	x0, x19
	bl	_ac97c_writel
LBB0_13:
Lloh57:
	adrp	x8, _EINVAL@GOTPAGE
Lloh58:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh59:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.cfi_endproc
                                        ; -- End function
	.comm	_ICA,4,2                        ; @ICA
	.comm	_PCM_LEFT,4,2                   ; @PCM_LEFT
	.comm	_PCM_RIGHT,4,2                  ; @PCM_RIGHT
	.comm	_A,4,2                          ; @A
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AC97C_CMR_DMAEN,8,3            ; @AC97C_CMR_DMAEN
	.comm	_AC97C_CMR_SIZE_16,8,3          ; @AC97C_CMR_SIZE_16
	.comm	_AC97C_CMR_CEM_LITTLE,8,3       ; @AC97C_CMR_CEM_LITTLE
	.comm	_AC97C_CSR_OVRUN,8,3            ; @AC97C_CSR_OVRUN
	.comm	_CAMR,4,2                       ; @CAMR
	.comm	_IMR,4,2                        ; @IMR
	.comm	_AC97C_SR_CAEVT,8,3             ; @AC97C_SR_CAEVT
	.comm	_IER,4,2                        ; @IER
	.comm	_MR,4,2                         ; @MR
	.comm	_AC97C_MR_VRA,8,3               ; @AC97C_MR_VRA
	.comm	_AC97_PCM_LR_ADC_RATE,4,2       ; @AC97_PCM_LR_ADC_RATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not set rate %d Hz\n"

	.comm	_DMA_RX_READY,4,2               ; @DMA_RX_READY
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.no_dead_strip	_atmel_ac97c_capture_prepare
.subsections_via_symbols
