	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32_dma_start_transfer
_stm32_dma_start_transfer:              ## @stm32_dma_start_transfer
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_stm32_dma_get_dev
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_stm32_dma_disable_chan
	testl	%eax, %eax
	js	LBB0_12
## %bb.1:
	movq	24(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	(%rbx), %r12
	cmpq	(%rax), %r12
	jne	LBB0_7
LBB0_6:
	movq	$0, (%rbx)
	xorl	%r12d, %r12d
LBB0_7:
	movq	16(%rax), %r15
	movl	16(%rbx), %edi
	callq	_STM32_DMA_SCR
	leaq	(%r12,%r12,2), %r12
	movl	(%r15,%r12,8), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_stm32_dma_write
	movl	16(%rbx), %edi
	callq	_STM32_DMA_SPAR
	movl	20(%r15,%r12,8), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_stm32_dma_write
	movl	16(%rbx), %edi
	callq	_STM32_DMA_SM0AR
	movl	16(%r15,%r12,8), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_stm32_dma_write
	movl	16(%rbx), %edi
	callq	_STM32_DMA_SFCR
	movl	12(%r15,%r12,8), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_stm32_dma_write
	movl	16(%rbx), %edi
	callq	_STM32_DMA_SM1AR
	movl	8(%r15,%r12,8), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_stm32_dma_write
	movl	16(%rbx), %edi
	callq	_STM32_DMA_SNDTR
	movl	4(%r15,%r12,8), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_stm32_dma_write
	incq	(%rbx)
	movq	%rbx, %rdi
	callq	_stm32_dma_irq_status
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_stm32_dma_irq_clear
LBB0_9:
	leaq	(%r15,%r12,8), %r15
	movq	24(%rbx), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	callq	_stm32_dma_configure_next_sg
LBB0_11:
	movq	%rbx, %rdi
	callq	_stm32_dma_dump_reg
	movq	_STM32_DMA_SCR_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
	movl	16(%rbx), %edi
	callq	_STM32_DMA_SCR
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_stm32_dma_write
	movl	$1, 8(%rbx)
	movq	%rbx, %rdi
	callq	_chan2dev
	addq	$12, %rbx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movq	%rbx, %rdx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_dbg                        ## TAILCALL
LBB0_3:
	leaq	12(%rbx), %rdi
	callq	_vchan_next_desc
	testq	%rax, %rax
	je	LBB0_12
## %bb.4:
	movq	%rax, %rdi
	callq	_to_stm32_dma_desc
	movq	%rax, 24(%rbx)
	movq	$0, (%rbx)
	xorl	%r12d, %r12d
	cmpq	(%rax), %r12
	je	LBB0_6
	jmp	LBB0_7
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STM32_DMA_SCR_EN,4,2           ## @STM32_DMA_SCR_EN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vchan %pK: started\n"

	.no_dead_strip	_stm32_dma_start_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stm32_dma_start_transfer
_stm32_dma_start_transfer:              ; @stm32_dma_start_transfer
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	bl	_stm32_dma_get_dev
	mov	x20, x0
	mov	x0, x19
	bl	_stm32_dma_disable_chan
	tbnz	w0, #31, LBB0_12
; %bb.1:
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_3
; %bb.2:
	ldr	x21, [x19]
	b	LBB0_5
LBB0_3:
	add	x0, x19, #12
	bl	_vchan_next_desc
	cbz	x0, LBB0_12
; %bb.4:
	bl	_to_stm32_dma_desc
	mov	x21, #0
	str	x0, [x19, #24]
	str	xzr, [x19]
LBB0_5:
	ldr	x8, [x0]
	cmp	x21, x8
	b.ne	LBB0_7
; %bb.6:
	mov	x21, #0
	str	xzr, [x19]
LBB0_7:
	ldr	x22, [x0, #16]
	ldr	w0, [x19, #16]
	bl	_STM32_DMA_SCR
	mov	x1, x0
	mov	w8, #24
	madd	x21, x21, x8, x22
	ldr	w2, [x21]
	mov	x0, x20
	bl	_stm32_dma_write
	ldr	w0, [x19, #16]
	bl	_STM32_DMA_SPAR
	mov	x1, x0
	ldr	w2, [x21, #20]
	mov	x0, x20
	bl	_stm32_dma_write
	ldr	w0, [x19, #16]
	bl	_STM32_DMA_SM0AR
	mov	x1, x0
	ldr	w2, [x21, #16]
	mov	x0, x20
	bl	_stm32_dma_write
	ldr	w0, [x19, #16]
	bl	_STM32_DMA_SFCR
	mov	x1, x0
	ldr	w2, [x21, #12]
	mov	x0, x20
	bl	_stm32_dma_write
	ldr	w0, [x19, #16]
	bl	_STM32_DMA_SM1AR
	mov	x1, x0
	ldr	w2, [x21, #8]
	mov	x0, x20
	bl	_stm32_dma_write
	ldr	w0, [x19, #16]
	bl	_STM32_DMA_SNDTR
	mov	x1, x0
	ldr	w2, [x21, #4]
	mov	x0, x20
	bl	_stm32_dma_write
	ldr	x8, [x19]
	add	x8, x8, #1
	str	x8, [x19]
	mov	x0, x19
	bl	_stm32_dma_irq_status
	cbz	x0, LBB0_9
; %bb.8:
	mov	x1, x0
	mov	x0, x19
	bl	_stm32_dma_irq_clear
LBB0_9:
	ldr	x8, [x19, #24]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_stm32_dma_configure_next_sg
LBB0_11:
	mov	x0, x19
	bl	_stm32_dma_dump_reg
Lloh0:
	adrp	x8, _STM32_DMA_SCR_EN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STM32_DMA_SCR_EN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x21]
	orr	w8, w9, w8
	str	w8, [x21]
	ldr	w0, [x19, #16]
	bl	_STM32_DMA_SCR
	mov	x1, x0
	ldr	w2, [x21]
	mov	x0, x20
	bl	_stm32_dma_write
	mov	w8, #1
	str	w8, [x19, #8]
	mov	x0, x19
	bl	_chan2dev
	add	x2, x19, #12
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_dev_dbg
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_STM32_DMA_SCR_EN,4,2           ; @STM32_DMA_SCR_EN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vchan %pK: started\n"

	.no_dead_strip	_stm32_dma_start_transfer
.subsections_via_symbols
