	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pdacf_pcm_prepare
_pdacf_pcm_prepare:                     ## @pdacf_pcm_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, %r15
	movq	_PDAUDIOCF_STAT_IS_STALE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_3
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_15
LBB0_3:
	movq	(%rbx), %rbx
	movl	16(%rbx), %eax
	movl	%eax, 40(%r15)
	movl	(%rbx), %edi
	callq	_snd_pcm_format_little_endian
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setg	%cl
	movl	%ecx, 4(%r15)
	movl	%ecx, 8(%r15)
	movl	(%rbx), %edi
	callq	_snd_pcm_format_unsigned
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	$-2147450880, 12(%r15)          ## imm = 0x80008000
LBB0_5:
	movq	%r15, %rdi
	callq	_pdacf_pcm_clear_sram
	testq	%rax, %rax
	js	LBB0_6
## %bb.7:
	movq	_PDAUDIOCF_REG_SCR@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_pdacf_reg_read
	movq	_PDAUDIOCF_DATAFMT0@GOTPCREL(%rip), %rcx
	movq	_PDAUDIOCF_DATAFMT1@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r14d
	orl	(%rcx), %r14d
	movl	%r14d, %edx
	notl	%edx
	andl	%eax, %edx
	movl	(%rbx), %ecx
	movl	%ecx, %esi
	andl	$-2, %esi
	orl	%eax, %r14d
	cmpl	$130, %esi
	cmovel	%edx, %r14d
	movl	$4, 16(%r15)
	leal	-128(%rcx), %edx
	cmpl	$2, %edx
	jb	LBB0_10
## %bb.8:
	addl	$-130, %ecx
	cmpl	$1, %ecx
	ja	LBB0_11
## %bb.9:
	movq	_AK4117_DIF_16R@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movabsq	$8589934594, %rdx               ## imm = 0x200000002
	movq	%rdx, 16(%r15)
	cmpl	%r14d, %eax
	jne	LBB0_13
	jmp	LBB0_14
LBB0_6:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_10:
	movl	$3, 16(%r15)
LBB0_11:
	movq	_AK4117_DIF_24R@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	$3, 20(%r15)
	movzwl	14(%r15), %edx
	shll	$16, %edx
	movl	%edx, 12(%r15)
	cmpl	%r14d, %eax
	je	LBB0_14
LBB0_13:
	movl	36(%r15), %edi
	movq	_AK4117_REG_IO@GOTPCREL(%rip), %rax
	movq	_AK4117_DIF2@GOTPCREL(%rip), %rsi
	movq	_AK4117_DIF1@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rsi), %edx
	movl	(%rax), %esi
	movq	_AK4117_DIF0@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	callq	_snd_ak4117_reg_write
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_pdacf_reg_write
LBB0_14:
	movq	_PDAUDIOCF_REG_IER@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_pdacf_reg_read
	movq	_PDAUDIOCF_IRQLVLEN1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	_PDAUDIOCF_IRQLVLEN0@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_pdacf_reg_write
	movl	12(%rbx), %eax
	movl	%eax, 32(%r15)
	movl	8(%rbx), %eax
	movl	%eax, 28(%r15)
	movl	4(%rbx), %eax
	movl	%eax, 24(%r15)
	xorl	%eax, %eax
LBB0_15:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PDAUDIOCF_STAT_IS_STALE,4,2    ## @PDAUDIOCF_STAT_IS_STALE
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EIO,4,2                        ## @EIO
	.comm	_PDAUDIOCF_REG_SCR,4,2          ## @PDAUDIOCF_REG_SCR
	.comm	_PDAUDIOCF_DATAFMT0,4,2         ## @PDAUDIOCF_DATAFMT0
	.comm	_PDAUDIOCF_DATAFMT1,4,2         ## @PDAUDIOCF_DATAFMT1
	.comm	_AK4117_DIF_16R,4,2             ## @AK4117_DIF_16R
	.comm	_AK4117_DIF_24R,4,2             ## @AK4117_DIF_24R
	.comm	_AK4117_REG_IO,4,2              ## @AK4117_REG_IO
	.comm	_AK4117_DIF2,4,2                ## @AK4117_DIF2
	.comm	_AK4117_DIF1,4,2                ## @AK4117_DIF1
	.comm	_AK4117_DIF0,4,2                ## @AK4117_DIF0
	.comm	_PDAUDIOCF_REG_IER,4,2          ## @PDAUDIOCF_REG_IER
	.comm	_PDAUDIOCF_IRQLVLEN1,4,2        ## @PDAUDIOCF_IRQLVLEN1
	.comm	_PDAUDIOCF_IRQLVLEN0,4,2        ## @PDAUDIOCF_IRQLVLEN0
	.no_dead_strip	_pdacf_pcm_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pdacf_pcm_prepare
_pdacf_pcm_prepare:                     ; @pdacf_pcm_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
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _PDAUDIOCF_STAT_IS_STALE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PDAUDIOCF_STAT_IS_STALE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_3:
	mov	x19, x0
	ldr	x21, [x20]
	ldr	w8, [x21, #16]
	str	w8, [x0, #40]
	ldr	w0, [x21]
	bl	_snd_pcm_format_little_endian
	cmp	x0, #0
	cset	w8, gt
	stp	w8, w8, [x19, #4]
	ldr	w0, [x21]
	bl	_snd_pcm_format_unsigned
	cbz	x0, LBB0_5
; %bb.4:
	mov	w8, #-2147450880
	str	w8, [x19, #12]
LBB0_5:
	mov	x0, x19
	bl	_pdacf_pcm_clear_sram
	tbnz	x0, #63, LBB0_9
; %bb.6:
Lloh5:
	adrp	x22, _PDAUDIOCF_REG_SCR@GOTPAGE
Lloh6:
	ldr	x22, [x22, _PDAUDIOCF_REG_SCR@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_pdacf_reg_read
Lloh7:
	adrp	x8, _PDAUDIOCF_DATAFMT0@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PDAUDIOCF_DATAFMT0@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _PDAUDIOCF_DATAFMT1@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PDAUDIOCF_DATAFMT1@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w9, w9, w8
	bic	w10, w0, w9
	ldr	w8, [x21]
	and	w11, w8, #0xfffffffe
	orr	w9, w9, w0
	cmp	w11, #130
	csel	w20, w10, w9, eq
	mov	w9, #4
	str	w9, [x19, #16]
	sub	w9, w8, #128
	cmp	w9, #2
	b.lo	LBB0_10
; %bb.7:
	sub	w8, w8, #130
	cmp	w8, #1
	b.hi	LBB0_11
; %bb.8:
Lloh13:
	adrp	x8, _AK4117_DIF_16R@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AK4117_DIF_16R@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	movi.2s	v0, #2
	str	d0, [x19, #16]
	cmp	w0, w20
	b.ne	LBB0_12
	b	LBB0_13
LBB0_9:
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_2
LBB0_10:
	mov	w8, #3
	str	w8, [x19, #16]
LBB0_11:
Lloh18:
	adrp	x8, _AK4117_DIF_24R@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AK4117_DIF_24R@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	mov	w8, #3
	str	w8, [x19, #20]
	ldrh	w8, [x19, #14]
	lsl	w8, w8, #16
	str	w8, [x19, #12]
	cmp	w0, w20
	b.eq	LBB0_13
LBB0_12:
	ldr	w0, [x19, #36]
Lloh21:
	adrp	x8, _AK4117_REG_IO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AK4117_REG_IO@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _AK4117_DIF2@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AK4117_DIF2@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	adrp	x9, _AK4117_DIF1@GOTPAGE
Lloh28:
	ldr	x9, [x9, _AK4117_DIF1@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh30:
	adrp	x9, _AK4117_DIF0@GOTPAGE
Lloh31:
	ldr	x9, [x9, _AK4117_DIF0@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w2, w8, w9
	bl	_snd_ak4117_reg_write
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x20
	bl	_pdacf_reg_write
LBB0_13:
Lloh33:
	adrp	x20, _PDAUDIOCF_REG_IER@GOTPAGE
Lloh34:
	ldr	x20, [x20, _PDAUDIOCF_REG_IER@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_pdacf_reg_read
Lloh35:
	adrp	x8, _PDAUDIOCF_IRQLVLEN1@GOTPAGE
Lloh36:
	ldr	x8, [x8, _PDAUDIOCF_IRQLVLEN1@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	bic	w8, w0, w8
Lloh38:
	adrp	x9, _PDAUDIOCF_IRQLVLEN0@GOTPAGE
Lloh39:
	ldr	x9, [x9, _PDAUDIOCF_IRQLVLEN0@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	orr	w2, w8, w9
	ldr	w1, [x20]
	mov	x0, x19
	bl	_pdacf_reg_write
	mov	w0, #0
	ldr	w8, [x21, #12]
	str	w8, [x19, #32]
	ldur	d0, [x21, #4]
	str	d0, [x19, #24]
LBB0_14:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_PDAUDIOCF_STAT_IS_STALE,4,2    ; @PDAUDIOCF_STAT_IS_STALE
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EIO,4,2                        ; @EIO
	.comm	_PDAUDIOCF_REG_SCR,4,2          ; @PDAUDIOCF_REG_SCR
	.comm	_PDAUDIOCF_DATAFMT0,4,2         ; @PDAUDIOCF_DATAFMT0
	.comm	_PDAUDIOCF_DATAFMT1,4,2         ; @PDAUDIOCF_DATAFMT1
	.comm	_AK4117_DIF_16R,4,2             ; @AK4117_DIF_16R
	.comm	_AK4117_DIF_24R,4,2             ; @AK4117_DIF_24R
	.comm	_AK4117_REG_IO,4,2              ; @AK4117_REG_IO
	.comm	_AK4117_DIF2,4,2                ; @AK4117_DIF2
	.comm	_AK4117_DIF1,4,2                ; @AK4117_DIF1
	.comm	_AK4117_DIF0,4,2                ; @AK4117_DIF0
	.comm	_PDAUDIOCF_REG_IER,4,2          ; @PDAUDIOCF_REG_IER
	.comm	_PDAUDIOCF_IRQLVLEN1,4,2        ; @PDAUDIOCF_IRQLVLEN1
	.comm	_PDAUDIOCF_IRQLVLEN0,4,2        ; @PDAUDIOCF_IRQLVLEN0
	.no_dead_strip	_pdacf_pcm_prepare
.subsections_via_symbols
