	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_es1938_playback1_prepare
_snd_es1938_playback1_prepare:          ## @snd_es1938_playback1_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, %r14
	callq	_snd_pcm_substream_chip
	movq	%rax, %r13
	movq	(%r14), %rbx
	movq	%r14, %rdi
	callq	_snd_pcm_lib_buffer_bytes
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_snd_pcm_lib_period_bytes
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r12d, (%r13)
	movl	8(%rbx), %eax
	movl	%eax, 8(%r13)
	movl	4(%rbx), %edi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	cmpl	$2, (%rbx)
	setge	%al
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	setl	%r12b
	callq	_snd_pcm_format_width
	xorl	%ecx, %ecx
	xorl	%r15d, %r15d
	cmpl	$16, %eax
	sete	%cl
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	setne	%r15b
	movl	4(%rbx), %edi
	callq	_snd_pcm_format_unsigned
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	addl	%r12d, %r15d
	movl	$2, %eax
	subl	%r15d, %eax
	movl	%eax, 4(%r13)
	movq	%r13, %rdi
	callq	_snd_es1938_reset_fifo
	movq	_DAC2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_snd_es1938_rate_set
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	shrl	%eax
	movl	$65536, %ebx                    ## imm = 0x10000
	subl	%eax, %ebx
	movq	_ESSSB_IREG_AUDIO2TCOUNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%bl, %edx
	movq	%r13, %rdi
	callq	_snd_es1938_mixer_write
	movq	_ESSSB_IREG_AUDIO2TCOUNTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shrl	$8, %ebx
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_snd_es1938_mixer_write
	movq	_ESSSB_IREG_AUDIO2CONTROL2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%eax, %eax
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	sete	%al
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	leal	(%rdx,%rcx,2), %ecx
	leal	(%rcx,%rax,4), %edx
	addl	$64, %edx
	movq	%r13, %rdi
	callq	_snd_es1938_mixer_write
	movq	%r13, %rdi
	callq	_snd_es1938_playback1_setdma
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DAC2,4,2                       ## @DAC2
	.comm	_ESSSB_IREG_AUDIO2TCOUNTL,4,2   ## @ESSSB_IREG_AUDIO2TCOUNTL
	.comm	_ESSSB_IREG_AUDIO2TCOUNTH,4,2   ## @ESSSB_IREG_AUDIO2TCOUNTH
	.comm	_ESSSB_IREG_AUDIO2CONTROL2,4,2  ## @ESSSB_IREG_AUDIO2CONTROL2
	.no_dead_strip	_snd_es1938_playback1_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_es1938_playback1_prepare
_snd_es1938_playback1_prepare:          ; @snd_es1938_playback1_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	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
	str	w21, [x19]
	ldr	w8, [x23, #8]
	str	w8, [x19, #8]
	ldp	w24, w0, [x23]
	cmp	w24, #1
	cset	w25, gt
	bl	_snd_pcm_format_width
	cmp	w0, #16
	cset	w26, eq
	cset	w27, ne
	ldr	w0, [x23, #4]
	bl	_snd_pcm_format_unsigned
	mov	x21, x0
	cmp	w24, #2
	mov	w8, #1
	cinc	w8, w8, ge
	sub	w8, w8, w27
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_snd_es1938_reset_fifo
Lloh0:
	adrp	x8, _DAC2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DAC2@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_snd_es1938_rate_set
	mov	w8, #65536
	sub	w20, w8, w22, lsr #1
Lloh3:
	adrp	x8, _ESSSB_IREG_AUDIO2TCOUNTL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ESSSB_IREG_AUDIO2TCOUNTL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	and	w2, w20, #0xff
	mov	x0, x19
	bl	_snd_es1938_mixer_write
Lloh6:
	adrp	x8, _ESSSB_IREG_AUDIO2TCOUNTH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ESSSB_IREG_AUDIO2TCOUNTH@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	lsr	w2, w20, #8
	mov	x0, x19
	bl	_snd_es1938_mixer_write
Lloh9:
	adrp	x8, _ESSSB_IREG_AUDIO2CONTROL2@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ESSSB_IREG_AUDIO2CONTROL2@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	w8, #64
	mov	w9, #68
	cmp	w21, #0
	csel	w8, w9, w8, eq
	bfi	w26, w25, #1, #1
	orr	w2, w26, w8
	mov	x0, x19
	bl	_snd_es1938_mixer_write
	mov	x0, x19
	bl	_snd_es1938_playback1_setdma
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DAC2,4,2                       ; @DAC2
	.comm	_ESSSB_IREG_AUDIO2TCOUNTL,4,2   ; @ESSSB_IREG_AUDIO2TCOUNTL
	.comm	_ESSSB_IREG_AUDIO2TCOUNTH,4,2   ; @ESSSB_IREG_AUDIO2TCOUNTH
	.comm	_ESSSB_IREG_AUDIO2CONTROL2,4,2  ; @ESSSB_IREG_AUDIO2CONTROL2
	.no_dead_strip	_snd_es1938_playback1_prepare
.subsections_via_symbols
