	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function davinci_pcm_enqueue_dma
_davinci_pcm_enqueue_dma:               ## @davinci_pcm_enqueue_dma
	.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, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movq	16(%rax), %r15
	movq	%rax, %r12
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	(%r15), %r13d
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	callq	_snd_pcm_lib_period_bytes
	movl	%eax, %r14d
	movl	4(%r15), %ebx
	imull	%eax, %ebx
	addq	8(%r12), %rbx
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	movq	%rbx, %rdx
	movl	%eax, %ecx
	callq	_pr_debug
	movq	%r15, %r8
	movq	8(%r15), %rcx
	movl	(%rcx), %r12d
	xorl	%esi, %esi
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_SNDRV_PCM_STREAM_PLAYBACK@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	movq	8(%rcx), %rax
	movl	$0, %r14d
	cmovel	%r12d, %r14d
	cmovel	%esi, %r12d
	movq	%rbx, %r13
	cmoveq	%rax, %r13
	cmovneq	%rax, %rbx
	movzwl	4(%rcx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_INCR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_W8BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movq	%r8, %rbx
	callq	_edma_set_src
	movq	_INCR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_W8BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r15d, %edi
	movq	%r13, %rsi
	callq	_edma_set_dest
	movzwl	%r14w, %esi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_edma_set_src_index
	movzwl	%r12w, %esi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_edma_set_dest_index
	movq	_ASYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	%r15d, %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	_edma_set_transfer_params
	movl	4(%rbx), %eax
	incl	%eax
	movl	%eax, 4(%rbx)
	xorl	%edi, %edi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmpl	(%rcx), %eax
	setae	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	$0, 4(%rbx)
LBB0_2:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"davinci_pcm: audio_set_dma_params_play channel = %d dma_ptr = %x period_size=%x\n"

	.comm	_SNDRV_PCM_STREAM_PLAYBACK,8,3  ## @SNDRV_PCM_STREAM_PLAYBACK
	.comm	_INCR,4,2                       ## @INCR
	.comm	_W8BIT,4,2                      ## @W8BIT
	.comm	_ASYNC,4,2                      ## @ASYNC
	.no_dead_strip	_davinci_pcm_enqueue_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function davinci_pcm_enqueue_dma
_davinci_pcm_enqueue_dma:               ; @davinci_pcm_enqueue_dma
	.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
	ldr	x24, [x0, #8]
	ldr	x23, [x24, #16]
	ldr	w19, [x23]
	bl	_snd_pcm_lib_period_bytes
	mov	x21, x0
	ldr	w8, [x23, #4]
	mul	w8, w8, w0
	ldr	x9, [x24, #8]
	add	x22, x9, x8
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x2, x22
	mov	x3, x21
	bl	_pr_debug
	ldr	x8, [x23, #8]
	ldr	w9, [x8]
	udiv	w21, w21, w9
	ldr	x10, [x20]
Lloh2:
	adrp	x11, _SNDRV_PCM_STREAM_PLAYBACK@GOTPAGE
Lloh3:
	ldr	x11, [x11, _SNDRV_PCM_STREAM_PLAYBACK@GOTPAGEOFF]
Lloh4:
	ldr	x11, [x11]
	ldr	x12, [x8, #8]
	cmp	x10, x11
	csel	x20, x12, x22, eq
	csel	w25, wzr, w9, eq
	csel	w26, w9, wzr, eq
	csel	x1, x22, x12, eq
	ldrh	w22, [x8, #4]
Lloh5:
	adrp	x27, _INCR@GOTPAGE
Lloh6:
	ldr	x27, [x27, _INCR@GOTPAGEOFF]
	ldr	w2, [x27]
Lloh7:
	adrp	x28, _W8BIT@GOTPAGE
Lloh8:
	ldr	x28, [x28, _W8BIT@GOTPAGEOFF]
	ldr	w3, [x28]
	mov	x0, x19
	bl	_edma_set_src
	ldr	w2, [x27]
	ldr	w3, [x28]
	mov	x0, x19
	mov	x1, x20
	bl	_edma_set_dest
	and	w1, w26, #0xffff
	mov	x0, x19
	mov	w2, #0
	bl	_edma_set_src_index
	and	w1, w25, #0xffff
	mov	x0, x19
	mov	w2, #0
	bl	_edma_set_dest_index
Lloh9:
	adrp	x8, _ASYNC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ASYNC@GOTPAGEOFF]
Lloh11:
	ldr	w5, [x8]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	mov	w3, #1
	mov	w4, #0
	bl	_edma_set_transfer_params
	ldr	w8, [x23, #4]
	add	w8, w8, #1
	str	w8, [x23, #4]
	ldr	w9, [x24]
	cmp	w8, w9
	cset	w0, hs
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
	str	wzr, [x23, #4]
LBB0_2:
	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 AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"davinci_pcm: audio_set_dma_params_play channel = %d dma_ptr = %x period_size=%x\n"

	.comm	_SNDRV_PCM_STREAM_PLAYBACK,8,3  ; @SNDRV_PCM_STREAM_PLAYBACK
	.comm	_INCR,4,2                       ; @INCR
	.comm	_W8BIT,4,2                      ; @W8BIT
	.comm	_ASYNC,4,2                      ; @ASYNC
	.no_dead_strip	_davinci_pcm_enqueue_dma
.subsections_via_symbols
