	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32_dma_prep_dma_cyclic
_stm32_dma_prep_dma_cyclic:             ## @stm32_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
	movq	%r9, -88(%rbp)                  ## 8-byte Spill
	movl	%r8d, %r14d
	movq	%rcx, %r12
	movq	%rdx, %r13
	movq	%rsi, %rbx
	callq	_to_stm32_dma_chan
	movq	%rax, %r15
	testq	%r13, %r13
	je	LBB0_6
## %bb.1:
	testq	%r12, %r12
	je	LBB0_6
## %bb.2:
	cmpl	$0, 24(%r15)
	je	LBB0_7
## %bb.3:
	movq	%r13, %rax
	orq	%r12, %rax
	shrq	$32, %rax
	je	LBB0_8
## %bb.4:
	movq	%r13, %rax
	xorl	%edx, %edx
	divq	%r12
	testq	%rdx, %rdx
	je	LBB0_9
LBB0_5:
	movq	%r15, %rdi
	callq	_chan2dev
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_11
LBB0_6:
	movq	%r15, %rdi
	callq	_chan2dev
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_11
LBB0_7:
	movq	%r15, %rdi
	callq	_chan2dev
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_11
LBB0_8:
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%r12d
                                        ## kill: def $edx killed $edx def $rdx
                                        ## kill: def $eax killed $eax def $rax
	testq	%rdx, %rdx
	jne	LBB0_5
LBB0_9:
	cmpq	$0, 16(%r15)
	je	LBB0_14
## %bb.10:
	movq	%r15, %rdi
	callq	_chan2dev
	leaq	L_.str.3(%rip), %rsi
LBB0_11:
	movl	%eax, %edi
	callq	_dev_err
LBB0_12:
	xorl	%eax, %eax
LBB0_13:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	-52(%rbp), %rdx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movq	%r12, %rcx
	callq	_stm32_dma_set_xfer_param
	testl	%eax, %eax
	js	LBB0_12
## %bb.15:
	movl	-52(%rbp), %ecx
	movq	%r12, %rax
	shrq	$32, %rax
	je	LBB0_18
## %bb.16:
	movq	%r12, %rax
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_19
LBB0_18:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_19:
	movq	_STM32_DMA_ALIGNED_MAX_DATA_ITEMS@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	jge	LBB0_21
## %bb.20:
	movq	%r15, %rdi
	callq	_chan2dev
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_11
LBB0_21:
	cmpq	%r12, %r13
	jne	LBB0_23
## %bb.22:
	movq	%rax, %r13
	movq	_STM32_DMA_SCR_CIRC@GOTPCREL(%rip), %rax
	jmp	LBB0_24
LBB0_23:
	movq	%rax, %r13
	movq	_STM32_DMA_SCR_DBM@GOTPCREL(%rip), %rax
LBB0_24:
	movl	12(%r15), %ecx
	orl	(%rax), %ecx
	movq	_STM32_DMA_SCR_PFCTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%ecx, %eax
	movl	%eax, 12(%r15)
	movq	_sg_req@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	%r14d, %edx
	callq	_struct_size
	movq	_GFP_NOWAIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.25:
	movq	%rax, %rsi
	testl	%r14d, %r14d
	jle	LBB0_28
## %bb.26:
	movq	%r13, %rcx
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	16(%rsi), %rax
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
LBB0_27:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, (%rax,%r13)
	leaq	(%rax,%r13), %rdi
	addq	$8, %rdi
	movq	%rsi, %r12
	callq	_stm32_dma_clear_reg
	movq	%r12, %rsi
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movl	12(%r15), %ecx
	movq	16(%rsi), %rax
	movl	%ecx, 36(%rax,%r13)
	movl	8(%r15), %ecx
	movl	%ecx, 32(%rax,%r13)
	movl	4(%r15), %ecx
	movl	%ecx, 28(%rax,%r13)
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rbx, 8(%rax,%r13)
	movq	%rbx, 16(%rax,%r13)
	movl	%ecx, 24(%rax,%r13)
	addq	%r12, %rbx
	incq	%r14
	addq	$40, %r13
	cmpq	-64(%rbp), %r14                 ## 8-byte Folded Reload
	jne	LBB0_27
LBB0_28:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, (%rsi)
	movl	$1, 4(%rsi)
	addq	$8, %rsi
	movq	%r15, %rdi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	callq	_vchan_tx_prep
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid buffer/period len\n"

L_.str.1:                               ## @.str.1
	.asciz	"dma channel is not configured\n"

L_.str.2:                               ## @.str.2
	.asciz	"buf_len not multiple of period_len\n"

L_.str.3:                               ## @.str.3
	.asciz	"Request not allowed when dma busy\n"

	.comm	_STM32_DMA_ALIGNED_MAX_DATA_ITEMS,4,2 ## @STM32_DMA_ALIGNED_MAX_DATA_ITEMS
L_.str.4:                               ## @.str.4
	.asciz	"number of items not supported\n"

	.comm	_STM32_DMA_SCR_CIRC,4,2         ## @STM32_DMA_SCR_CIRC
	.comm	_STM32_DMA_SCR_DBM,4,2          ## @STM32_DMA_SCR_DBM
	.comm	_STM32_DMA_SCR_PFCTRL,4,2       ## @STM32_DMA_SCR_PFCTRL
	.comm	_sg_req,4,2                     ## @sg_req
	.comm	_GFP_NOWAIT,4,2                 ## @GFP_NOWAIT
	.no_dead_strip	_stm32_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 stm32_dma_prep_dma_cyclic
_stm32_dma_prep_dma_cyclic:             ; @stm32_dma_prep_dma_cyclic
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x5
	mov	x25, x4
	mov	x21, x3
	mov	x24, x2
	mov	x22, x1
	bl	_to_stm32_dma_chan
	mov	x20, x0
	cbz	x24, LBB0_5
; %bb.1:
	cbz	x21, LBB0_5
; %bb.2:
	ldr	w8, [x20, #24]
	cbz	w8, LBB0_6
; %bb.3:
	udiv	x23, x24, x21
	msub	x8, x23, x21, x24
	cbz	x8, LBB0_7
; %bb.4:
	mov	x0, x20
	bl	_chan2dev
Lloh0:
	adrp	x1, l_.str.2@PAGE
Lloh1:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_5:
	mov	x0, x20
	bl	_chan2dev
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_9
LBB0_6:
	mov	x0, x20
	bl	_chan2dev
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_7:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_12
; %bb.8:
	mov	x0, x20
	bl	_chan2dev
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_9:
	bl	_dev_err
LBB0_10:
	mov	x0, #0
LBB0_11:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_12:
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x25
	mov	x3, x21
	bl	_stm32_dma_set_xfer_param
	tbnz	w0, #31, LBB0_10
; %bb.13:
	ldr	w8, [sp, #12]
	udiv	x25, x21, x8
Lloh8:
	adrp	x8, _STM32_DMA_ALIGNED_MAX_DATA_ITEMS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _STM32_DMA_ALIGNED_MAX_DATA_ITEMS@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w25
	b.ge	LBB0_15
; %bb.14:
	mov	x0, x20
	bl	_chan2dev
Lloh11:
	adrp	x1, l_.str.4@PAGE
Lloh12:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_9
LBB0_15:
Lloh13:
	adrp	x8, _STM32_DMA_SCR_CIRC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _STM32_DMA_SCR_CIRC@GOTPAGEOFF]
Lloh15:
	adrp	x9, _STM32_DMA_SCR_DBM@GOTPAGE
Lloh16:
	ldr	x9, [x9, _STM32_DMA_SCR_DBM@GOTPAGEOFF]
	cmp	x24, x21
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	ldr	w9, [x20, #12]
	orr	w8, w9, w8
Lloh17:
	adrp	x9, _STM32_DMA_SCR_PFCTRL@GOTPAGE
Lloh18:
	ldr	x9, [x9, _STM32_DMA_SCR_PFCTRL@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	bic	w8, w8, w9
	str	w8, [x20, #12]
Lloh20:
	adrp	x8, _sg_req@GOTPAGE
Lloh21:
	ldr	x8, [x8, _sg_req@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x2, x23
	bl	_struct_size
Lloh23:
	adrp	x8, _GFP_NOWAIT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _GFP_NOWAIT@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_11
; %bb.16:
	mov	x24, x0
	cmp	w23, #1
	b.lt	LBB0_19
; %bb.17:
	mov	x26, #0
	mov	x27, #0
	and	x28, x23, #0xffffffff
	ldr	x8, [x24, #16]
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	add	x0, x8, x26
	str	x21, [x0], #8
	bl	_stm32_dma_clear_reg
	ldr	w9, [x20, #12]
	ldr	x8, [x24, #16]
	add	x10, x8, x26
	str	w9, [x10, #36]
	ldur	d0, [x20, #4]
	stur	d0, [x10, #28]
	stp	x22, x22, [x10, #8]
	str	w25, [x10, #24]
	add	x22, x22, x21
	add	x27, x27, #1
	add	x26, x26, #40
	cmp	x27, x28
	b.ne	LBB0_18
LBB0_19:
	mov	w8, #1
	stp	w23, w8, [x24]
	add	x1, x24, #8
	mov	x0, x20
	mov	x2, x19
	bl	_vchan_tx_prep
	b	LBB0_11
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid buffer/period len\n"

l_.str.1:                               ; @.str.1
	.asciz	"dma channel is not configured\n"

l_.str.2:                               ; @.str.2
	.asciz	"buf_len not multiple of period_len\n"

l_.str.3:                               ; @.str.3
	.asciz	"Request not allowed when dma busy\n"

	.comm	_STM32_DMA_ALIGNED_MAX_DATA_ITEMS,4,2 ; @STM32_DMA_ALIGNED_MAX_DATA_ITEMS
l_.str.4:                               ; @.str.4
	.asciz	"number of items not supported\n"

	.comm	_STM32_DMA_SCR_CIRC,4,2         ; @STM32_DMA_SCR_CIRC
	.comm	_STM32_DMA_SCR_DBM,4,2          ; @STM32_DMA_SCR_DBM
	.comm	_STM32_DMA_SCR_PFCTRL,4,2       ; @STM32_DMA_SCR_PFCTRL
	.comm	_sg_req,4,2                     ; @sg_req
	.comm	_GFP_NOWAIT,4,2                 ; @GFP_NOWAIT
	.no_dead_strip	_stm32_dma_prep_dma_cyclic
.subsections_via_symbols
