	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32_mdma_prep_slave_sg
_stm32_mdma_prep_slave_sg:              ## @stm32_mdma_prep_slave_sg
	.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	%r8, %r12
	movl	%ecx, %ebx
	movl	%edx, %r13d
	movq	%rsi, %r15
	callq	_to_stm32_mdma_chan
	movq	%rax, %r14
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_chan2dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
	jmp	LBB0_9
LBB0_3:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_stm32_mdma_alloc_desc
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	movq	%rax, %r12
	movq	%r14, %rdi
	movq	%rax, %rsi
	movq	%r15, %rdx
	movl	%r13d, %ecx
	movl	%ebx, %r8d
	callq	_stm32_mdma_setup_xfer
	testl	%eax, %eax
	js	LBB0_5
## %bb.10:
	movl	$0, (%r12)
	addq	$4, %r14
	addq	$16, %r12
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vchan_tx_prep                  ## TAILCALL
LBB0_5:
	cmpl	$0, 4(%r12)
	jle	LBB0_8
## %bb.6:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	movq	8(%r12), %rax
	movl	(%rax,%rbx,8), %edx
	movl	4(%rax,%rbx,8), %esi
	callq	_dma_pool_free
	incq	%rbx
	movslq	4(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_7
LBB0_8:
	movq	%r12, %rdi
	callq	_kfree
LBB0_9:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Request not allowed when dma in cyclic mode\n"

	.no_dead_strip	_stm32_mdma_prep_slave_sg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stm32_mdma_prep_slave_sg
_stm32_mdma_prep_slave_sg:              ; @stm32_mdma_prep_slave_sg
	.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	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	bl	_to_stm32_mdma_chan
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_chan2dev
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_10
LBB0_3:
	mov	x0, x19
	mov	x1, x23
	bl	_stm32_mdma_alloc_desc
	cbz	x0, LBB0_10
; %bb.4:
	mov	x20, x0
	mov	x0, x19
	mov	x1, x20
	mov	x2, x24
	mov	x3, x23
	mov	x4, x22
	bl	_stm32_mdma_setup_xfer
	tbnz	w0, #31, LBB0_6
; %bb.5:
	str	wzr, [x20], #16
	add	x0, x19, #4
	mov	x1, x20
	mov	x2, 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	_vchan_tx_prep
LBB0_6:
	ldr	w8, [x20, #4]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.7:
	mov	x21, #0
	mov	x22, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	ldr	x8, [x20, #8]
	add	x8, x8, x21
	ldp	w2, w1, [x8]
	bl	_dma_pool_free
	add	x22, x22, #1
	ldrsw	x8, [x20, #4]
	add	x21, x21, #8
	cmp	x22, x8
	b.lt	LBB0_8
LBB0_9:
	mov	x0, x20
	bl	_kfree
LBB0_10:
	mov	x0, #0
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Request not allowed when dma in cyclic mode\n"

	.no_dead_strip	_stm32_mdma_prep_slave_sg
.subsections_via_symbols
