	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ep93xx_dma_prep_dma_cyclic
_ep93xx_dma_prep_dma_cyclic:            ## @ep93xx_dma_prep_dma_cyclic
	.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
	movl	%r8d, %r15d
	movq	%rcx, %r14
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	callq	_to_ep93xx_dma_chan
	movq	%rax, %rbx
	movq	16(%rax), %rax
	cmpl	$0, (%rax)
	jne	LBB0_4
## %bb.1:
	movq	%r12, %rdi
	callq	_ep93xx_dma_chan_direction
	cmpl	%r15d, %eax
	jne	LBB0_2
LBB0_4:
	movq	_EP93XX_DMA_IS_CYCLIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	12(%rbx), %rsi
	callq	_test_and_set_bit
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_chan2dev
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_3
LBB0_6:
	movq	_DMA_MAX_CHAN_BYTES@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jae	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_chan2dev
	leaq	L_.str.2(%rip), %rsi
	xorl	%r13d, %r13d
	movl	%eax, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_dev_warn
	jmp	LBB0_20
LBB0_2:
	movq	%rbx, %rdi
	callq	_chan2dev
	leaq	L_.str(%rip), %rsi
LBB0_3:
	xorl	%r13d, %r13d
	movl	%eax, %edi
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_20:
	movq	%r13, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%rbx, %rdx
	addq	$8, %rdx
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_ep93xx_dma_slave_config_write
	cmpq	$0, -64(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_9
## %bb.10:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_11 Depth=1
	addq	%r14, %r15
	movq	%r13, %r12
	cmpq	-64(%rbp), %r15                 ## 8-byte Folded Reload
	jae	LBB0_19
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_ep93xx_dma_desc_get
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%rax, %r13
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	%r15, %rax
	movq	(%rbx), %rcx
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	(%rbx), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	addq	%r15, %rcx
LBB0_16:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	%rax, 32(%r13)
	movq	%rcx, 24(%r13)
	movq	%r14, (%r13)
	testq	%r12, %r12
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_11 Depth=1
	addq	$16, %r13
	leaq	12(%r12), %rsi
	movq	%r13, %rdi
	callq	_list_add_tail
	movq	%r12, %r13
	jmp	LBB0_18
LBB0_9:
	xorl	%r13d, %r13d
LBB0_19:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 8(%r13)
	addq	$8, %r13
	jmp	LBB0_20
LBB0_12:
	movq	%rbx, %rdi
	callq	_chan2dev
	leaq	L_.str.3(%rip), %rsi
	xorl	%r13d, %r13d
	movl	%eax, %edi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ep93xx_dma_desc_put
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"channel was configured with different direction\n"

	.comm	_EP93XX_DMA_IS_CYCLIC,4,2       ## @EP93XX_DMA_IS_CYCLIC
L_.str.1:                               ## @.str.1
	.asciz	"channel is already used for cyclic transfers\n"

	.comm	_DMA_MAX_CHAN_BYTES,8,3         ## @DMA_MAX_CHAN_BYTES
L_.str.2:                               ## @.str.2
	.asciz	"too big period length %zu\n"

L_.str.3:                               ## @.str.3
	.asciz	"couldn't get descriptor\n"

	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_ep93xx_dma_prep_dma_cyclic
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ep93xx_dma_prep_dma_cyclic
_ep93xx_dma_prep_dma_cyclic:            ; @ep93xx_dma_prep_dma_cyclic
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x21, x4
	mov	x20, x3
	mov	x22, x2
	mov	x23, x1
	mov	x24, x0
	bl	_to_ep93xx_dma_chan
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	w8, [x8]
	cbnz	w8, LBB0_2
; %bb.1:
	mov	x0, x24
	bl	_ep93xx_dma_chan_direction
	cmp	w0, w21
	b.ne	LBB0_6
LBB0_2:
Lloh0:
	adrp	x8, _EP93XX_DMA_IS_CYCLIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EP93XX_DMA_IS_CYCLIC@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x1, x19, #12
	bl	_test_and_set_bit
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_chan2dev
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_4:
Lloh5:
	adrp	x8, _DMA_MAX_CHAN_BYTES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DMA_MAX_CHAN_BYTES@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x8, x20
	b.hs	LBB0_10
; %bb.5:
	mov	x0, x19
	bl	_chan2dev
	str	x20, [sp]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_6:
	mov	x0, x19
	bl	_chan2dev
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
LBB0_7:
	bl	_dev_warn
LBB0_8:
	mov	x0, #0
LBB0_9:
	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
	add	sp, sp, #96
	ret
LBB0_10:
	add	x2, x19, #8
	mov	x0, x24
	mov	x1, x21
	bl	_ep93xx_dma_slave_config_write
	cbz	x22, LBB0_19
; %bb.11:
	mov	x25, #0
	mov	x24, #0
Lloh12:
	adrp	x26, _DMA_MEM_TO_DEV@GOTPAGE
Lloh13:
	ldr	x26, [x26, _DMA_MEM_TO_DEV@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x25, x25, x20
	cmp	x25, x22
	mov	x24, x0
	b.hs	LBB0_20
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_ep93xx_dma_desc_get
	cbz	x0, LBB0_21
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x26]
	cmp	w8, w21
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x8, x23, x25
	ldr	x9, [x19]
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x19]
	add	x9, x23, x25
LBB0_17:                                ;   in Loop: Header=BB0_13 Depth=1
	stp	x9, x8, [x0, #24]
	str	x20, [x0]
	cbz	x24, LBB0_12
; %bb.18:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x0, x0, #16
	add	x1, x24, #12
	bl	_list_add_tail
	mov	x0, x24
	b	LBB0_12
LBB0_19:
	mov	x0, #0
LBB0_20:
Lloh14:
	adrp	x8, _EBUSY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x0, #8]!
	b	LBB0_9
LBB0_21:
	mov	x0, x19
	bl	_chan2dev
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_warn
	mov	x0, x19
	mov	x1, x24
	bl	_ep93xx_dma_desc_put
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"channel was configured with different direction\n"

	.comm	_EP93XX_DMA_IS_CYCLIC,4,2       ; @EP93XX_DMA_IS_CYCLIC
l_.str.1:                               ; @.str.1
	.asciz	"channel is already used for cyclic transfers\n"

	.comm	_DMA_MAX_CHAN_BYTES,8,3         ; @DMA_MAX_CHAN_BYTES
l_.str.2:                               ; @.str.2
	.asciz	"too big period length %zu\n"

l_.str.3:                               ; @.str.3
	.asciz	"couldn't get descriptor\n"

	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_ep93xx_dma_prep_dma_cyclic
.subsections_via_symbols
