	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32_dma_configure_next_sg
_stm32_dma_configure_next_sg:           ## @stm32_dma_configure_next_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	%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
	movl	(%rbx), %r15d
	movl	%r15d, %edi
	callq	_STM32_DMA_SCR
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_stm32_dma_read
	movq	_STM32_DMA_SCR_DBM@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.1:
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_3
## %bb.2:
	movq	$0, 8(%rbx)
	xorl	%ecx, %ecx
LBB0_3:
	movq	8(%rdx), %rdx
	movq	_STM32_DMA_SCR_CT@GOTPCREL(%rip), %rsi
	testl	%eax, (%rsi)
	je	LBB0_6
## %bb.4:
	movl	(%rdx,%rcx,8), %r12d
	movl	%r15d, %edi
	callq	_STM32_DMA_SM0AR
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%r12d, %edx
	callq	_stm32_dma_write
	movq	%rbx, %rdi
	callq	_chan2dev
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_STM32_DMA_SM0AR
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_stm32_dma_read
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_5
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	4(%rdx,%rcx,8), %r12d
	movl	%r15d, %edi
	callq	_STM32_DMA_SM1AR
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%r12d, %edx
	callq	_stm32_dma_write
	movq	%rbx, %rdi
	callq	_chan2dev
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_STM32_DMA_SM1AR
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_stm32_dma_read
	leaq	L_.str.1(%rip), %rsi
LBB0_5:
	movl	%ebx, %edi
	movl	%eax, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_dbg                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_STM32_DMA_SCR_DBM,4,2          ## @STM32_DMA_SCR_DBM
	.comm	_STM32_DMA_SCR_CT,4,2           ## @STM32_DMA_SCR_CT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CT=1 <=> SM0AR: 0x%08x\n"

L_.str.1:                               ## @.str.1
	.asciz	"CT=0 <=> SM1AR: 0x%08x\n"

	.no_dead_strip	_stm32_dma_configure_next_sg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stm32_dma_configure_next_sg
_stm32_dma_configure_next_sg:           ; @stm32_dma_configure_next_sg
	.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	x21, x0
	bl	_stm32_dma_get_dev
	mov	x19, x0
	ldr	w20, [x21]
	mov	x0, x20
	bl	_STM32_DMA_SCR
	mov	x1, x0
	mov	x0, x19
	bl	_stm32_dma_read
Lloh0:
	adrp	x8, _STM32_DMA_SCR_DBM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STM32_DMA_SCR_DBM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.1:
	ldp	x8, x9, [x21, #8]
	ldr	x10, [x9]
	cmp	x8, x10
	b.ne	LBB0_3
; %bb.2:
	mov	x8, #0
	str	xzr, [x21, #8]
LBB0_3:
	ldr	x9, [x9, #8]
Lloh3:
	adrp	x10, _STM32_DMA_SCR_CT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _STM32_DMA_SCR_CT@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	tst	w10, w0
	b.eq	LBB0_6
; %bb.4:
	lsl	x8, x8, #3
	ldr	w22, [x9, x8]
	mov	x0, x20
	bl	_STM32_DMA_SM0AR
	mov	x1, x0
	mov	x0, x19
	mov	x2, x22
	bl	_stm32_dma_write
	mov	x0, x21
	bl	_chan2dev
	mov	x21, x0
	mov	x0, x20
	bl	_STM32_DMA_SM0AR
	mov	x1, x0
	mov	x0, x19
	bl	_stm32_dma_read
	mov	x2, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_5:
	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
LBB0_6:
	add	x8, x9, x8, lsl #3
	ldr	w22, [x8, #4]
	mov	x0, x20
	bl	_STM32_DMA_SM1AR
	mov	x1, x0
	mov	x0, x19
	mov	x2, x22
	bl	_stm32_dma_write
	mov	x0, x21
	bl	_chan2dev
	mov	x21, x0
	mov	x0, x20
	bl	_STM32_DMA_SM1AR
	mov	x1, x0
	mov	x0, x19
	bl	_stm32_dma_read
	mov	x2, x0
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_STM32_DMA_SCR_DBM,4,2          ; @STM32_DMA_SCR_DBM
	.comm	_STM32_DMA_SCR_CT,4,2           ; @STM32_DMA_SCR_CT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CT=1 <=> SM0AR: 0x%08x\n"

l_.str.1:                               ; @.str.1
	.asciz	"CT=0 <=> SM1AR: 0x%08x\n"

	.no_dead_strip	_stm32_dma_configure_next_sg
.subsections_via_symbols
