	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_ad1816a_playback_prepare
_snd_ad1816a_playback_prepare:          ## @snd_ad1816a_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_snd_pcm_substream_chip
	movq	%rax, %r13
	movq	(%r15), %r14
	leaq	8(%rax), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	callq	_snd_pcm_lib_buffer_bytes
	movl	%eax, %r12d
	movl	%eax, (%r13)
	movq	_AD1816A_PLAYBACK_CONFIG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_AD1816A_PLAYBACK_ENABLE@GOTPCREL(%rip), %rax
	movq	_AD1816A_PLAYBACK_PIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	callq	_snd_ad1816a_out_mask
	movl	12(%r13), %edi
	movl	12(%r14), %esi
	movq	_DMA_MODE_WRITE@GOTPCREL(%rip), %rax
	movq	_DMA_AUTOINIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%r12d, %edx
	callq	_snd_dma_program
	movl	(%r14), %edx
	movl	4(%r13), %ecx
	testl	%ecx, %ecx
	je	LBB0_2
## %bb.1:
	imull	$33000, %edx, %eax              ## imm = 0x80E8
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %edx
LBB0_2:
	movq	_AD1816A_PLAYBACK_SAMPLE_RATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_snd_ad1816a_write
	movl	(%rbx), %r12d
	movq	_AD1816A_FMT_ALL@GOTPCREL(%rip), %rax
	movq	_AD1816A_FMT_STEREO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movl	4(%r14), %edx
	movl	8(%r14), %esi
	movq	%r13, %rdi
	callq	_snd_ad1816a_get_format
	movq	%r13, %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_snd_ad1816a_out_mask
	movq	_AD1816A_PLAYBACK_BASE_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_snd_pcm_lib_period_bytes
                                        ## kill: def $eax killed $eax def $rax
	leal	3(%rax), %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	sarl	$2, %edx
	decl	%edx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_snd_ad1816a_write
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	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	_AD1816A_PLAYBACK_CONFIG,4,2    ## @AD1816A_PLAYBACK_CONFIG
	.comm	_AD1816A_PLAYBACK_ENABLE,4,2    ## @AD1816A_PLAYBACK_ENABLE
	.comm	_AD1816A_PLAYBACK_PIO,4,2       ## @AD1816A_PLAYBACK_PIO
	.comm	_DMA_MODE_WRITE,4,2             ## @DMA_MODE_WRITE
	.comm	_DMA_AUTOINIT,4,2               ## @DMA_AUTOINIT
	.comm	_AD1816A_PLAYBACK_SAMPLE_RATE,4,2 ## @AD1816A_PLAYBACK_SAMPLE_RATE
	.comm	_AD1816A_FMT_ALL,4,2            ## @AD1816A_FMT_ALL
	.comm	_AD1816A_FMT_STEREO,4,2         ## @AD1816A_FMT_STEREO
	.comm	_AD1816A_PLAYBACK_BASE_COUNT,4,2 ## @AD1816A_PLAYBACK_BASE_COUNT
	.no_dead_strip	_snd_ad1816a_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_ad1816a_playback_prepare
_snd_ad1816a_playback_prepare:          ; @snd_ad1816a_playback_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	x21, x0
	bl	_snd_pcm_substream_chip
	mov	x20, x0
	ldr	x24, [x21]
	add	x19, x0, #8
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	x0, x21
	bl	_snd_pcm_lib_buffer_bytes
	mov	x22, x0
	str	w0, [x20]
Lloh0:
	adrp	x23, _AD1816A_PLAYBACK_CONFIG@GOTPAGE
Lloh1:
	ldr	x23, [x23, _AD1816A_PLAYBACK_CONFIG@GOTPAGEOFF]
Lloh2:
	adrp	x8, _AD1816A_PLAYBACK_ENABLE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AD1816A_PLAYBACK_ENABLE@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _AD1816A_PLAYBACK_PIO@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AD1816A_PLAYBACK_PIO@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x20
	mov	w3, #0
	bl	_snd_ad1816a_out_mask
	ldr	w0, [x20, #12]
Lloh8:
	adrp	x8, _DMA_MODE_WRITE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DMA_MODE_WRITE@GOTPAGEOFF]
	ldr	w1, [x24, #12]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _DMA_AUTOINIT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DMA_AUTOINIT@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x2, x22
	bl	_snd_dma_program
	ldr	w2, [x24]
	ldr	w8, [x20, #4]
	cbz	w8, LBB0_2
; %bb.1:
	mov	w9, #33000
	mul	w9, w2, w9
	udiv	w2, w9, w8
LBB0_2:
Lloh14:
	adrp	x8, _AD1816A_PLAYBACK_SAMPLE_RATE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AD1816A_PLAYBACK_SAMPLE_RATE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_snd_ad1816a_write
	ldr	w22, [x23]
Lloh17:
	adrp	x8, _AD1816A_FMT_ALL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AD1816A_FMT_ALL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _AD1816A_FMT_STEREO@GOTPAGE
Lloh21:
	ldr	x9, [x9, _AD1816A_FMT_STEREO@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w23, w9, w8
	ldp	w2, w1, [x24, #4]
	mov	x0, x20
	bl	_snd_ad1816a_get_format
	mov	x3, x0
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	bl	_snd_ad1816a_out_mask
Lloh23:
	adrp	x8, _AD1816A_PLAYBACK_BASE_COUNT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AD1816A_PLAYBACK_BASE_COUNT@GOTPAGEOFF]
Lloh25:
	ldr	w22, [x8]
	mov	x0, x21
	bl	_snd_pcm_lib_period_bytes
	add	w8, w0, #3
	cmp	w0, #0
	csel	w8, w8, w0, lt
	asr	w8, w8, #2
	sub	w2, w8, #1
	mov	x0, x20
	mov	x1, x22
	bl	_snd_ad1816a_write
	mov	x0, x19
	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 AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_AD1816A_PLAYBACK_CONFIG,4,2    ; @AD1816A_PLAYBACK_CONFIG
	.comm	_AD1816A_PLAYBACK_ENABLE,4,2    ; @AD1816A_PLAYBACK_ENABLE
	.comm	_AD1816A_PLAYBACK_PIO,4,2       ; @AD1816A_PLAYBACK_PIO
	.comm	_DMA_MODE_WRITE,4,2             ; @DMA_MODE_WRITE
	.comm	_DMA_AUTOINIT,4,2               ; @DMA_AUTOINIT
	.comm	_AD1816A_PLAYBACK_SAMPLE_RATE,4,2 ; @AD1816A_PLAYBACK_SAMPLE_RATE
	.comm	_AD1816A_FMT_ALL,4,2            ; @AD1816A_FMT_ALL
	.comm	_AD1816A_FMT_STEREO,4,2         ; @AD1816A_FMT_STEREO
	.comm	_AD1816A_PLAYBACK_BASE_COUNT,4,2 ; @AD1816A_PLAYBACK_BASE_COUNT
	.no_dead_strip	_snd_ad1816a_playback_prepare
.subsections_via_symbols
