	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_ad1889_playback_prepare
_snd_ad1889_playback_prepare:           ## @snd_ad1889_playback_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), %r14
	movq	%rbx, %rdi
	callq	_snd_pcm_lib_buffer_bytes
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_snd_pcm_lib_period_bytes
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_AD_CHAN_WAV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ad1889_channel_reset
	movq	_AD_DS_WSMC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ad1889_readw
	movl	%eax, %r13d
	movq	_AD_DS_WSMC_WA16@GOTPCREL(%rip), %rcx
	movq	_AD_DS_WSMC_WAST@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	orl	(%rcx), %ebx
	notl	%ebx
	movl	12(%r14), %edi
	callq	_snd_pcm_format_width
	movl	$0, %r12d
	cmpl	$16, %eax
	jne	LBB0_2
## %bb.1:
	movq	_AD_DS_WSMC_WA16@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_2:
	andl	%ebx, %r13d
	cmpl	$2, (%r14)
	movl	$0, %eax
	jl	LBB0_4
## %bb.3:
	movq	_AD_DS_WSMC_WAST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_4:
	orl	%eax, %r13d
	orl	%r13d, %r12d
	leaq	12(%r15), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irq
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, (%r15)
	movl	%r12d, 4(%r15)
	movl	8(%r14), %eax
	movl	%eax, 8(%r15)
	movq	_AD_DS_WSMC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_ad1889_writew
	movq	_AD_DS_WAS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r14), %edx
	movq	%r15, %rdi
	callq	_ad1889_writew
	movl	8(%r15), %esi
	movq	%r15, %rdi
	callq	_ad1889_load_wave_buffer_address
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ad1889_load_wave_buffer_count
	movq	%r15, %rdi
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %esi
	callq	_ad1889_load_wave_interrupt_count
	movq	_AD_DS_WSMC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ad1889_readw
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irq
	movl	8(%r15), %esi
	movl	4(%r14), %r9d
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %edx
	movl	%ebx, %ecx
	movl	%r12d, %r8d
	callq	_ad1889_debug
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AD_CHAN_WAV,4,2                ## @AD_CHAN_WAV
	.comm	_AD_DS_WSMC,4,2                 ## @AD_DS_WSMC
	.comm	_AD_DS_WSMC_WA16,4,2            ## @AD_DS_WSMC_WA16
	.comm	_AD_DS_WSMC_WAST,4,2            ## @AD_DS_WSMC_WAST
	.comm	_AD_DS_WAS,4,2                  ## @AD_DS_WAS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"prepare playback: addr = 0x%x, count = %u, size = %u, reg = 0x%x, rate = %u\n"

	.no_dead_strip	_snd_ad1889_playback_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_ad1889_playback_prepare
_snd_ad1889_playback_prepare:           ; @snd_ad1889_playback_prepare
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x0
	bl	_snd_pcm_substream_chip
	mov	x20, x0
	ldr	x24, [x21]
	mov	x0, x21
	bl	_snd_pcm_lib_buffer_bytes
	mov	x19, x0
	mov	x0, x21
	bl	_snd_pcm_lib_period_bytes
	mov	x21, x0
Lloh0:
	adrp	x8, _AD_CHAN_WAV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AD_CHAN_WAV@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ad1889_channel_reset
Lloh3:
	adrp	x25, _AD_DS_WSMC@GOTPAGE
Lloh4:
	ldr	x25, [x25, _AD_DS_WSMC@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x20
	bl	_ad1889_readw
Lloh5:
	adrp	x22, _AD_DS_WSMC_WA16@GOTPAGE
Lloh6:
	ldr	x22, [x22, _AD_DS_WSMC_WA16@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh7:
	adrp	x23, _AD_DS_WSMC_WAST@GOTPAGE
Lloh8:
	ldr	x23, [x23, _AD_DS_WSMC_WAST@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w8, w9, w8
	bic	w26, w0, w8
	ldr	w0, [x24, #12]
	bl	_snd_pcm_format_width
	ldr	w8, [x22]
	cmp	w0, #16
	csel	w8, w8, wzr, eq
	orr	w8, w8, w26
	ldr	w9, [x24]
	ldr	w10, [x23]
	cmp	w9, #1
	csel	w9, w10, wzr, gt
	orr	w22, w8, w9
	add	x23, x20, #12
	mov	x0, x23
	bl	_spin_lock_irq
	stp	w19, w22, [x20]
	ldr	w8, [x24, #8]
	str	w8, [x20, #8]
	ldr	w1, [x25]
	mov	x0, x20
	mov	x2, x22
	bl	_ad1889_writew
Lloh9:
	adrp	x8, _AD_DS_WAS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AD_DS_WAS@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	w2, [x24, #4]
	mov	x0, x20
	bl	_ad1889_writew
	ldr	w1, [x20, #8]
	mov	x0, x20
	bl	_ad1889_load_wave_buffer_address
	mov	x0, x20
	mov	x1, x19
	bl	_ad1889_load_wave_buffer_count
	mov	x0, x20
	mov	x1, x21
	bl	_ad1889_load_wave_interrupt_count
	ldr	w1, [x25]
	mov	x0, x20
	bl	_ad1889_readw
	mov	x0, x23
	bl	_spin_unlock_irq
	ldr	w1, [x20, #8]
	ldr	w5, [x24, #4]
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x19
	mov	x4, x22
	bl	_ad1889_debug
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AD_CHAN_WAV,4,2                ; @AD_CHAN_WAV
	.comm	_AD_DS_WSMC,4,2                 ; @AD_DS_WSMC
	.comm	_AD_DS_WSMC_WA16,4,2            ; @AD_DS_WSMC_WA16
	.comm	_AD_DS_WSMC_WAST,4,2            ; @AD_DS_WSMC_WAST
	.comm	_AD_DS_WAS,4,2                  ; @AD_DS_WAS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"prepare playback: addr = 0x%x, count = %u, size = %u, reg = 0x%x, rate = %u\n"

	.no_dead_strip	_snd_ad1889_playback_prepare
.subsections_via_symbols
