	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_ac97c_prepare_dma
_atmel_ac97c_prepare_dma:               ## @atmel_ac97c_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	%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, %r12
	movq	(%rsi), %rbx
	testb	$1, (%rbx)
	jne	LBB0_2
## %bb.1:
	movl	4(%rbx), %esi
	testb	$1, %sil
	jne	LBB0_2
## %bb.3:
	movl	%edx, %r14d
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpl	%edx, (%rcx)
	sete	%al
	movq	16(%r12,%rax,8), %r15
	movq	%rbx, %rdi
	callq	_frames_to_bytes
	movq	%rax, %r13
	movl	8(%rbx), %esi
	movq	%rbx, %rdi
	callq	_frames_to_bytes
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movq	%r13, %rdx
	movq	%rax, %rcx
	movl	%r14d, %r8d
	callq	_dw_dma_cyclic_prep
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	8(%r12), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_2:
	movq	8(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	movq	_atmel_ac97c_dma_capture_period_done@GOTPCREL(%rip), %rax
	cmoveq	_atmel_ac97c_dma_playback_period_done@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	_DMA_RX_READY@GOTPCREL(%rip), %rax
	cmoveq	_DMA_TX_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_set_bit
	movq	%r12, (%r15)
	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_ac97c_dma_playback_period_done,4,2 ## @atmel_ac97c_dma_playback_period_done
	.comm	_DMA_TX_READY,4,2               ## @DMA_TX_READY
	.comm	_atmel_ac97c_dma_capture_period_done,4,2 ## @atmel_ac97c_dma_capture_period_done
	.comm	_DMA_RX_READY,4,2               ## @DMA_RX_READY
	.no_dead_strip	_atmel_ac97c_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_ac97c_prepare_dma
_atmel_ac97c_prepare_dma:               ; @atmel_ac97c_prepare_dma
	.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	x19, x0
	ldr	x21, [x1]
	ldrb	w8, [x21]
	tbnz	w8, #0, LBB0_4
; %bb.1:
	ldr	w1, [x21, #4]
	tbnz	w1, #0, LBB0_4
; %bb.2:
	mov	x20, x2
Lloh0:
	adrp	x24, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _DMA_TO_DEVICE@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, w2
	mov	w8, #16
	mov	w9, #24
	csel	x8, x9, x8, eq
	ldr	x22, [x19, x8]
	mov	x0, x21
	bl	_frames_to_bytes
	mov	x23, x0
	ldr	w1, [x21, #8]
	mov	x0, x21
	bl	_frames_to_bytes
	mov	x3, x0
	ldr	w1, [x21]
	mov	x0, x22
	mov	x2, x23
	mov	x4, x20
	bl	_dw_dma_cyclic_prep
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.3:
	ldr	x0, [x19, #8]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	x0, x21
	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
	b	_PTR_ERR
LBB0_4:
	ldr	x0, [x19, #8]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
LBB0_6:
	ldr	w8, [x24]
Lloh9:
	adrp	x9, _atmel_ac97c_dma_playback_period_done@GOTPAGE
Lloh10:
	ldr	x9, [x9, _atmel_ac97c_dma_playback_period_done@GOTPAGEOFF]
Lloh11:
	adrp	x10, _atmel_ac97c_dma_capture_period_done@GOTPAGE
Lloh12:
	ldr	x10, [x10, _atmel_ac97c_dma_capture_period_done@GOTPAGEOFF]
	cmp	w8, w20
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	str	w8, [x21, #8]
Lloh13:
	adrp	x8, _DMA_TX_READY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DMA_TX_READY@GOTPAGEOFF]
Lloh15:
	adrp	x9, _DMA_RX_READY@GOTPAGE
Lloh16:
	ldr	x9, [x9, _DMA_RX_READY@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w0, [x8]
	mov	x1, x19
	bl	_set_bit
	mov	w0, #0
	str	x19, [x21]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.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_ac97c_dma_playback_period_done,4,2 ; @atmel_ac97c_dma_playback_period_done
	.comm	_DMA_TX_READY,4,2               ; @DMA_TX_READY
	.comm	_atmel_ac97c_dma_capture_period_done,4,2 ; @atmel_ac97c_dma_capture_period_done
	.comm	_DMA_RX_READY,4,2               ; @DMA_RX_READY
	.no_dead_strip	_atmel_ac97c_prepare_dma
.subsections_via_symbols
