	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_wss_capture_prepare
_snd_wss_capture_prepare:               ## @snd_wss_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
	pushq	%rax
	.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, %r13
	movq	(%rbx), %r14
	movq	%rbx, %rdi
	callq	_snd_pcm_lib_buffer_bytes
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_snd_pcm_lib_period_bytes
	movl	%eax, %r15d
	leaq	20(%r13), %rdi
	movq	%rdi, %rbx
	callq	_spin_lock_irqsave
	movl	%r12d, (%r13)
	movq	_CS4231_RECORD_ENABLE@GOTPCREL(%rip), %rax
	movq	_CS4231_RECORD_PIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	movq	8(%r13), %rax
	movq	_CS4231_IFACE_CTRL@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	andl	%ecx, (%rax,%rdx,4)
	movl	32(%r13), %edi
	movl	(%r14), %esi
	movq	_DMA_MODE_READ@GOTPCREL(%rip), %rax
	movq	_DMA_AUTOINIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%r12d, %edx
	callq	_snd_dma_program
	movq	_WSS_HW_AD1848_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	8(%r13), %rax
	andl	16(%r13), %ecx
	jne	LBB0_1
## %bb.2:
	movq	_CS4231_REC_FORMAT@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_1:
	movq	_CS4231_PLAYBK_FORMAT@GOTPCREL(%rip), %rcx
LBB0_3:
	movq	%rbx, %r14
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %edi
	movl	%r15d, %esi
	callq	_snd_wss_get_count
	movl	%eax, %ebx
	cmpq	$0, 24(%r13)
	je	LBB0_6
## %bb.4:
	movl	16(%r13), %edx
	movq	_WSS_HW_INTERWAVE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edx
	jne	LBB0_5
LBB0_6:
	movq	_CS4231_REC_UPR_CNT@GOTPCREL(%rip), %r15
	movq	_CS4231_REC_LWR_CNT@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_5:
	movq	_CS4231_PLY_UPR_CNT@GOTPCREL(%rip), %r15
	movq	_CS4231_PLY_LWR_CNT@GOTPCREL(%rip), %rcx
LBB0_7:
	decl	%ebx
	movl	(%rcx), %esi
	movzbl	%bl, %edx
	movq	%r13, %rdi
	callq	_snd_wss_out
	movl	(%r15), %esi
	movzbl	%bh, %edx
	movq	%r13, %rdi
	callq	_snd_wss_out
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CS4231_RECORD_ENABLE,4,2       ## @CS4231_RECORD_ENABLE
	.comm	_CS4231_RECORD_PIO,4,2          ## @CS4231_RECORD_PIO
	.comm	_CS4231_IFACE_CTRL,8,3          ## @CS4231_IFACE_CTRL
	.comm	_DMA_MODE_READ,4,2              ## @DMA_MODE_READ
	.comm	_DMA_AUTOINIT,4,2               ## @DMA_AUTOINIT
	.comm	_WSS_HW_AD1848_MASK,4,2         ## @WSS_HW_AD1848_MASK
	.comm	_CS4231_PLAYBK_FORMAT,8,3       ## @CS4231_PLAYBK_FORMAT
	.comm	_CS4231_REC_FORMAT,8,3          ## @CS4231_REC_FORMAT
	.comm	_WSS_HW_INTERWAVE,4,2           ## @WSS_HW_INTERWAVE
	.comm	_CS4231_PLY_LWR_CNT,4,2         ## @CS4231_PLY_LWR_CNT
	.comm	_CS4231_PLY_UPR_CNT,4,2         ## @CS4231_PLY_UPR_CNT
	.comm	_CS4231_REC_LWR_CNT,4,2         ## @CS4231_REC_LWR_CNT
	.comm	_CS4231_REC_UPR_CNT,4,2         ## @CS4231_REC_UPR_CNT
	.no_dead_strip	_snd_wss_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_wss_capture_prepare
_snd_wss_capture_prepare:               ; @snd_wss_capture_prepare
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	bl	_snd_pcm_substream_chip
	mov	x19, x0
	ldr	x23, [x20]
	mov	x0, x20
	bl	_snd_pcm_lib_buffer_bytes
	mov	x21, x0
	mov	x0, x20
	bl	_snd_pcm_lib_period_bytes
	mov	x22, x0
	add	x20, x19, #20
	mov	x0, x20
	bl	_spin_lock_irqsave
	str	w21, [x19]
Lloh0:
	adrp	x8, _CS4231_RECORD_ENABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CS4231_RECORD_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _CS4231_RECORD_PIO@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CS4231_RECORD_PIO@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	x9, [x19, #8]
Lloh6:
	adrp	x10, _CS4231_IFACE_CTRL@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CS4231_IFACE_CTRL@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	lsl	x10, x10, #2
	ldr	w11, [x9, x10]
	bic	w8, w11, w8
	str	w8, [x9, x10]
	ldr	w0, [x19, #32]
Lloh9:
	adrp	x8, _DMA_MODE_READ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DMA_MODE_READ@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _DMA_AUTOINIT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _DMA_AUTOINIT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x2, x21
	bl	_snd_dma_program
Lloh15:
	adrp	x8, _WSS_HW_AD1848_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _WSS_HW_AD1848_MASK@GOTPAGEOFF]
	ldr	w9, [x19, #16]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x10, _CS4231_REC_FORMAT@GOTPAGE
Lloh19:
	ldr	x10, [x10, _CS4231_REC_FORMAT@GOTPAGEOFF]
Lloh20:
	adrp	x11, _CS4231_PLAYBK_FORMAT@GOTPAGE
Lloh21:
	ldr	x11, [x11, _CS4231_PLAYBK_FORMAT@GOTPAGEOFF]
	ldr	x12, [x19, #8]
	tst	w8, w9
	csel	x8, x10, x11, eq
	ldr	x8, [x8]
	ldr	w0, [x12, x8, lsl #2]
	mov	x1, x22
	bl	_snd_wss_get_count
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w8, [x19, #16]
Lloh22:
	adrp	x9, _WSS_HW_INTERWAVE@GOTPAGE
Lloh23:
	ldr	x9, [x9, _WSS_HW_INTERWAVE@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_3
LBB0_2:
Lloh25:
	adrp	x21, _CS4231_REC_UPR_CNT@GOTPAGE
Lloh26:
	ldr	x21, [x21, _CS4231_REC_UPR_CNT@GOTPAGEOFF]
Lloh27:
	adrp	x8, _CS4231_REC_LWR_CNT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CS4231_REC_LWR_CNT@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh29:
	adrp	x21, _CS4231_PLY_UPR_CNT@GOTPAGE
Lloh30:
	ldr	x21, [x21, _CS4231_PLY_UPR_CNT@GOTPAGEOFF]
Lloh31:
	adrp	x8, _CS4231_PLY_LWR_CNT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _CS4231_PLY_LWR_CNT@GOTPAGEOFF]
LBB0_4:
	sub	w22, w0, #1
	ldr	w1, [x8]
	and	w2, w22, #0xff
	mov	x0, x19
	bl	_snd_wss_out
	ldr	w1, [x21]
	ubfx	w2, w22, #8, #8
	mov	x0, x19
	bl	_snd_wss_out
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.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	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_CS4231_RECORD_ENABLE,4,2       ; @CS4231_RECORD_ENABLE
	.comm	_CS4231_RECORD_PIO,4,2          ; @CS4231_RECORD_PIO
	.comm	_CS4231_IFACE_CTRL,8,3          ; @CS4231_IFACE_CTRL
	.comm	_DMA_MODE_READ,4,2              ; @DMA_MODE_READ
	.comm	_DMA_AUTOINIT,4,2               ; @DMA_AUTOINIT
	.comm	_WSS_HW_AD1848_MASK,4,2         ; @WSS_HW_AD1848_MASK
	.comm	_CS4231_PLAYBK_FORMAT,8,3       ; @CS4231_PLAYBK_FORMAT
	.comm	_CS4231_REC_FORMAT,8,3          ; @CS4231_REC_FORMAT
	.comm	_WSS_HW_INTERWAVE,4,2           ; @WSS_HW_INTERWAVE
	.comm	_CS4231_PLY_LWR_CNT,4,2         ; @CS4231_PLY_LWR_CNT
	.comm	_CS4231_PLY_UPR_CNT,4,2         ; @CS4231_PLY_UPR_CNT
	.comm	_CS4231_REC_LWR_CNT,4,2         ; @CS4231_REC_LWR_CNT
	.comm	_CS4231_REC_UPR_CNT,4,2         ; @CS4231_REC_UPR_CNT
	.no_dead_strip	_snd_wss_capture_prepare
.subsections_via_symbols
