	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function at91_twi_dma_cleanup
_at91_twi_dma_cleanup:                  ## @at91_twi_dma_cleanup
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_at91_twi_irq_save
	cmpl	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movq	16(%rbx), %rax
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	movl	40(%rbx,%rdx,4), %edi
	callq	_dmaengine_terminate_all
	movl	$0, 8(%rbx)
LBB0_2:
	cmpl	$0, 24(%rbx)
	je	LBB0_4
## %bb.3:
	movl	4(%rbx), %r14d
	movq	32(%rbx), %rdi
	callq	_sg_dma_address
	movl	(%rbx), %edx
	movq	16(%rbx), %rcx
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_dma_unmap_single
	movl	$0, 24(%rbx)
LBB0_4:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_at91_twi_irq_restore           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_FROM_DEVICE,8,3            ## @DMA_FROM_DEVICE
	.no_dead_strip	_at91_twi_dma_cleanup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function at91_twi_dma_cleanup
_at91_twi_dma_cleanup:                  ; @at91_twi_dma_cleanup
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_at91_twi_irq_save
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	x8, [x19, #16]
Lloh0:
	adrp	x9, _DMA_FROM_DEVICE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	mov	w10, #40
	mov	w11, #44
	cmp	x8, x9
	csel	x8, x11, x10, eq
	ldr	w0, [x19, x8]
	bl	_dmaengine_terminate_all
	str	wzr, [x19, #8]
LBB0_2:
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_4
; %bb.3:
	ldr	w20, [x19, #4]
	ldr	x0, [x19, #32]
	bl	_sg_dma_address
	mov	x1, x0
	ldr	w2, [x19]
	ldr	x3, [x19, #16]
	mov	x0, x20
	bl	_dma_unmap_single
	str	wzr, [x19, #24]
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_at91_twi_irq_restore
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_FROM_DEVICE,8,3            ; @DMA_FROM_DEVICE
	.no_dead_strip	_at91_twi_dma_cleanup
.subsections_via_symbols
