	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_abdac_prepare_dma
_atmel_abdac_prepare_dma:               ## @atmel_abdac_prepare_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rsi), %rbx
	testb	$1, (%rbx)
	jne	LBB0_2
## %bb.1:
	movl	4(%rbx), %esi
	testb	$1, %sil
	jne	LBB0_2
## %bb.3:
	movq	16(%r14), %r15
	movq	%rbx, %rdi
	callq	_frames_to_bytes
	movq	%rax, %r12
	movl	8(%rbx), %esi
	movq	%rbx, %rdi
	callq	_frames_to_bytes
	movl	(%rbx), %esi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movq	%r15, %rdi
	movq	%r12, %rdx
	movq	%rax, %rcx
	callq	_dw_dma_cyclic_prep
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	24(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_2:
	movq	24(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_atmel_abdac_dma_period_done@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	%r14, (%rbx)
	movq	%rbx, 8(%r14)
	movq	_DMA_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_set_bit
	xorl	%eax, %eax
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"too complex transfer\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
L_.str.1:                               ## @.str.1
	.asciz	"could not prepare cyclic DMA\n"

	.comm	_atmel_abdac_dma_period_done,4,2 ## @atmel_abdac_dma_period_done
	.comm	_DMA_READY,4,2                  ## @DMA_READY
	.no_dead_strip	_atmel_abdac_prepare_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_abdac_prepare_dma
_atmel_abdac_prepare_dma:               ; @atmel_abdac_prepare_dma
	.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	x19, x0
	ldr	x20, [x1]
	ldrb	w8, [x20]
	tbnz	w8, #0, LBB0_4
; %bb.1:
	ldr	w1, [x20, #4]
	tbnz	w1, #0, LBB0_4
; %bb.2:
	ldr	x21, [x19, #16]
	mov	x0, x20
	bl	_frames_to_bytes
	mov	x22, x0
	ldr	w1, [x20, #8]
	mov	x0, x20
	bl	_frames_to_bytes
	mov	x3, x0
	ldr	w1, [x20]
Lloh0:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w4, [x8]
	mov	x0, x21
	mov	x2, x22
	bl	_dw_dma_cyclic_prep
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.3:
	ldr	x0, [x19, #24]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	x0, x20
	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
	b	_PTR_ERR
LBB0_4:
	ldr	x0, [x19, #24]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
LBB0_6:
Lloh10:
	adrp	x8, _atmel_abdac_dma_period_done@GOTPAGE
Lloh11:
	ldr	x8, [x8, _atmel_abdac_dma_period_done@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [x20, #8]
	str	x19, [x20]
	str	x20, [x19, #8]
Lloh13:
	adrp	x8, _DMA_READY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DMA_READY@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_set_bit
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"too complex transfer\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
l_.str.1:                               ; @.str.1
	.asciz	"could not prepare cyclic DMA\n"

	.comm	_atmel_abdac_dma_period_done,4,2 ; @atmel_abdac_dma_period_done
	.comm	_DMA_READY,4,2                  ; @DMA_READY
	.no_dead_strip	_atmel_abdac_prepare_dma
.subsections_via_symbols
