	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxs_dma_prep_dma_cyclic
_mxs_dma_prep_dma_cyclic:               ## @mxs_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	callq	_to_mxs_dma_chan
	movq	%rbx, %r8
	movq	%rax, %rbx
	movq	48(%rax), %rsi
	movq	%r14, %rax
	orq	%r8, %rax
	shrq	$32, %rax
	je	LBB0_1
## %bb.2:
	movq	%r14, %rax
	xorl	%edx, %edx
	divq	%r8
	movq	%rax, %rdx
	jmp	LBB0_3
LBB0_1:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%r8d
	movl	%eax, %edx
LBB0_3:
	movq	_DMA_IN_PROGRESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, (%rbx)
	je	LBB0_16
## %bb.4:
	movq	%rax, (%rbx)
	movq	_MXS_DMA_SG_LOOP@GOTPCREL(%rip), %rax
	movl	40(%rbx), %ecx
	orl	(%rax), %ecx
	movq	_MXS_DMA_USE_SEMAPHORE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 40(%rbx)
	movq	_NUM_CCW@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	cmpq	%rcx, %rdx
	jbe	LBB0_6
## %bb.5:
	movl	(%rsi), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_15
LBB0_6:
	movq	_MAX_XFER_BYTES@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	cmpq	%r8, %rcx
	jae	LBB0_7
## %bb.14:
	movl	(%rsi), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r8, %rdx
LBB0_15:
	callq	_dev_err
	movq	_DMA_ERROR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
LBB0_16:
	xorl	%ebx, %ebx
LBB0_17:
	movq	%rbx, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	testq	%r14, %r14
	je	LBB0_8
## %bb.9:
	movl	$32, %r13d
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	(%rax), %edi
	movq	_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_BF_CCW
	orl	%eax, -16(%r14,%r13)
	movq	%r12, %r8
	addq	%r12, %r15
	addq	$32, %r13
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	cmpq	%r14, %r15
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	jae	LBB0_13
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	incq	%rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	cmpq	%rdx, %rax
	movl	$0, %eax
	cmovneq	%r13, %rax
	movq	32(%rbx), %r14
	addq	24(%rbx), %rax
	movq	%rax, -8(%r14,%r13)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	addq	%r15, %rax
	movq	%rax, -32(%r14,%r13)
	movq	%r8, %r12
	movq	%r8, -24(%r14,%r13)
	movl	$0, -16(%r14,%r13)
	movq	_CCW_CHAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -16(%r14,%r13)
	movq	_CCW_IRQ@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -16(%r14,%r13)
	movq	_CCW_HALT_ON_TERM@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -16(%r14,%r13)
	movq	_CCW_TERM_FLUSH@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -16(%r14,%r13)
	movq	_CCW_DEC_SEM@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -16(%r14,%r13)
	movq	_MXS_DMA_CMD_READ@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rdx
	cmpl	%ecx, (%rdx)
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_MXS_DMA_CMD_WRITE@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_8:
	xorl	%eax, %eax
LBB0_13:
	movq	%rax, 8(%rbx)
	addq	$16, %rbx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_IN_PROGRESS,8,3            ## @DMA_IN_PROGRESS
	.comm	_MXS_DMA_SG_LOOP,4,2            ## @MXS_DMA_SG_LOOP
	.comm	_MXS_DMA_USE_SEMAPHORE,4,2      ## @MXS_DMA_USE_SEMAPHORE
	.comm	_NUM_CCW,8,3                    ## @NUM_CCW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"maximum number of sg exceeded: %d > %d\n"

	.comm	_MAX_XFER_BYTES,8,3             ## @MAX_XFER_BYTES
L_.str.1:                               ## @.str.1
	.asciz	"maximum period size exceeded: %zu > %d\n"

	.comm	_CCW_CHAIN,4,2                  ## @CCW_CHAIN
	.comm	_CCW_IRQ,4,2                    ## @CCW_IRQ
	.comm	_CCW_HALT_ON_TERM,4,2           ## @CCW_HALT_ON_TERM
	.comm	_CCW_TERM_FLUSH,4,2             ## @CCW_TERM_FLUSH
	.comm	_CCW_DEC_SEM,4,2                ## @CCW_DEC_SEM
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_MXS_DMA_CMD_WRITE,4,2          ## @MXS_DMA_CMD_WRITE
	.comm	_MXS_DMA_CMD_READ,4,2           ## @MXS_DMA_CMD_READ
	.comm	_COMMAND,4,2                    ## @COMMAND
	.comm	_DMA_ERROR,8,3                  ## @DMA_ERROR
	.no_dead_strip	_mxs_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 mxs_dma_prep_dma_cyclic
_mxs_dma_prep_dma_cyclic:               ; @mxs_dma_prep_dma_cyclic
	.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	x21, x4
	mov	x20, x3
	mov	x22, x2
	mov	x23, x1
	bl	_to_mxs_dma_chan
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _DMA_IN_PROGRESS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMA_IN_PROGRESS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	x0, #0
	b	LBB0_12
LBB0_2:
	mov	x19, x0
	ldr	x8, [x0, #48]
	str	x9, [x0]
Lloh3:
	adrp	x9, _MXS_DMA_SG_LOOP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MXS_DMA_SG_LOOP@GOTPAGEOFF]
	udiv	x24, x22, x20
Lloh5:
	ldr	w9, [x9]
	ldr	w10, [x0, #40]
	orr	w9, w10, w9
Lloh6:
	adrp	x10, _MXS_DMA_USE_SEMAPHORE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _MXS_DMA_USE_SEMAPHORE@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	orr	w9, w10, w9
	str	w9, [x0, #40]
Lloh9:
	adrp	x9, _NUM_CCW@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NUM_CCW@GOTPAGEOFF]
Lloh11:
	ldr	x3, [x9]
	cmp	x24, x3
	b.ls	LBB0_4
; %bb.3:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x24
	b	LBB0_6
LBB0_4:
Lloh14:
	adrp	x9, _MAX_XFER_BYTES@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MAX_XFER_BYTES@GOTPAGEOFF]
Lloh16:
	ldr	x3, [x9]
	cmp	x3, x20
	b.hs	LBB0_7
; %bb.5:
	ldr	w0, [x8]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
LBB0_6:
	bl	_dev_err
	mov	x0, #0
Lloh19:
	adrp	x8, _DMA_ERROR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DMA_ERROR@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	str	x8, [x19]
	b	LBB0_12
LBB0_7:
	cbz	x22, LBB0_10
; %bb.8:
	mov	x8, #0
	mov	x26, #0
	mov	x25, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	x25, x25, #1
	ldp	x10, x9, [x19, #24]
	add	x28, x8, #32
	cmp	x25, x24
	csel	x11, xzr, x28, eq
	add	x10, x10, x11
	add	x27, x9, x8
	str	x10, [x27, #24]
	str	wzr, [x27, #16]
Lloh22:
	adrp	x8, _CCW_CHAIN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CCW_CHAIN@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x27, #16]
Lloh25:
	adrp	x9, _CCW_IRQ@GOTPAGE
Lloh26:
	ldr	x9, [x9, _CCW_IRQ@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x27, #16]
Lloh28:
	adrp	x9, _CCW_HALT_ON_TERM@GOTPAGE
Lloh29:
	ldr	x9, [x9, _CCW_HALT_ON_TERM@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x27, #16]
Lloh31:
	adrp	x9, _CCW_TERM_FLUSH@GOTPAGE
Lloh32:
	ldr	x9, [x9, _CCW_TERM_FLUSH@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	add	x10, x23, x26
	orr	w8, w9, w8
	str	w8, [x27, #16]
Lloh34:
	adrp	x9, _CCW_DEC_SEM@GOTPAGE
Lloh35:
	ldr	x9, [x9, _CCW_DEC_SEM@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	orr	w8, w9, w8
	stp	x10, x20, [x27]
	str	w8, [x27, #16]
Lloh37:
	adrp	x8, _DMA_DEV_TO_MEM@GOTPAGE
Lloh38:
	ldr	x8, [x8, _DMA_DEV_TO_MEM@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	cmp	w8, w21
Lloh40:
	adrp	x8, _MXS_DMA_CMD_WRITE@GOTPAGE
Lloh41:
	ldr	x8, [x8, _MXS_DMA_CMD_WRITE@GOTPAGEOFF]
Lloh42:
	adrp	x9, _MXS_DMA_CMD_READ@GOTPAGE
Lloh43:
	ldr	x9, [x9, _MXS_DMA_CMD_READ@GOTPAGEOFF]
	csel	x8, x8, x9, eq
Lloh44:
	adrp	x9, _COMMAND@GOTPAGE
Lloh45:
	ldr	x9, [x9, _COMMAND@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x9]
	ldr	w0, [x8]
	bl	_BF_CCW
	ldr	w8, [x27, #16]
	orr	w8, w8, w0
	str	w8, [x27, #16]
	add	x26, x26, x20
	cmp	x26, x22
	mov	x8, x28
	b.lo	LBB0_9
	b	LBB0_11
LBB0_10:
	mov	x25, #0
LBB0_11:
	str	x25, [x19, #8]
	add	x0, x19, #16
LBB0_12:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_IN_PROGRESS,8,3            ; @DMA_IN_PROGRESS
	.comm	_MXS_DMA_SG_LOOP,4,2            ; @MXS_DMA_SG_LOOP
	.comm	_MXS_DMA_USE_SEMAPHORE,4,2      ; @MXS_DMA_USE_SEMAPHORE
	.comm	_NUM_CCW,8,3                    ; @NUM_CCW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"maximum number of sg exceeded: %d > %d\n"

	.comm	_MAX_XFER_BYTES,8,3             ; @MAX_XFER_BYTES
l_.str.1:                               ; @.str.1
	.asciz	"maximum period size exceeded: %zu > %d\n"

	.comm	_CCW_CHAIN,4,2                  ; @CCW_CHAIN
	.comm	_CCW_IRQ,4,2                    ; @CCW_IRQ
	.comm	_CCW_HALT_ON_TERM,4,2           ; @CCW_HALT_ON_TERM
	.comm	_CCW_TERM_FLUSH,4,2             ; @CCW_TERM_FLUSH
	.comm	_CCW_DEC_SEM,4,2                ; @CCW_DEC_SEM
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_MXS_DMA_CMD_WRITE,4,2          ; @MXS_DMA_CMD_WRITE
	.comm	_MXS_DMA_CMD_READ,4,2           ; @MXS_DMA_CMD_READ
	.comm	_COMMAND,4,2                    ; @COMMAND
	.comm	_DMA_ERROR,8,3                  ; @DMA_ERROR
	.no_dead_strip	_mxs_dma_prep_dma_cyclic
.subsections_via_symbols
