	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xilinx_dma_terminate_all
_xilinx_dma_terminate_all:              ## @xilinx_dma_terminate_all
	.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
	callq	_to_xilinx_chan
	movq	%rax, %rbx
	cmpl	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_xilinx_dma_chan_reset
LBB0_2:
	movq	%rbx, %rdi
	callq	*8(%rbx)
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	40(%rbx), %r14d
	movq	_XILINX_DMA_REG_DMASR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dma_ctrl_read
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movq	%rbx, %rdx
	movl	%eax, %ecx
	callq	_dev_err
	movl	$1, 16(%rbx)
LBB0_4:
	movq	%rbx, %rdi
	callq	_xilinx_dma_free_descriptors
	movl	$1, 20(%rbx)
	cmpl	$0, (%rbx)
	je	LBB0_6
## %bb.5:
	movq	_XILINX_DMA_REG_DMACR@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_dma_ctrl_read
	movq	_XILINX_DMA_CR_CYCLIC_BD_EN_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_dma_ctrl_write
	movl	$0, (%rbx)
LBB0_6:
	movq	32(%rbx), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	_XDMA_TYPE_CDMA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.7:
	cmpq	$0, 24(%rbx)
	je	LBB0_9
## %bb.8:
	movq	_XILINX_DMA_REG_DMACR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_XILINX_CDMA_CR_SGMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_dma_ctrl_clr
LBB0_9:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot stop channel %p: %x\n"

	.comm	_XILINX_DMA_REG_DMASR,4,2       ## @XILINX_DMA_REG_DMASR
	.comm	_XILINX_DMA_REG_DMACR,4,2       ## @XILINX_DMA_REG_DMACR
	.comm	_XILINX_DMA_CR_CYCLIC_BD_EN_MASK,4,2 ## @XILINX_DMA_CR_CYCLIC_BD_EN_MASK
	.comm	_XDMA_TYPE_CDMA,8,3             ## @XDMA_TYPE_CDMA
	.comm	_XILINX_CDMA_CR_SGMODE,4,2      ## @XILINX_CDMA_CR_SGMODE
	.no_dead_strip	_xilinx_dma_terminate_all
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xilinx_dma_terminate_all
_xilinx_dma_terminate_all:              ; @xilinx_dma_terminate_all
	.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
	bl	_to_xilinx_chan
	mov	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_xilinx_dma_chan_reset
LBB0_2:
	ldr	x8, [x19, #8]
	mov	x0, x19
	blr	x8
	cbz	w0, LBB0_4
; %bb.3:
	ldr	w20, [x19, #40]
Lloh0:
	adrp	x8, _XILINX_DMA_REG_DMASR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XILINX_DMA_REG_DMASR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dma_ctrl_read
	mov	x3, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_dev_err
	mov	w8, #1
	str	w8, [x19, #16]
LBB0_4:
	mov	x0, x19
	bl	_xilinx_dma_free_descriptors
	mov	w8, #1
	str	w8, [x19, #20]
	ldr	w8, [x19]
	cbz	w8, LBB0_6
; %bb.5:
Lloh5:
	adrp	x20, _XILINX_DMA_REG_DMACR@GOTPAGE
Lloh6:
	ldr	x20, [x20, _XILINX_DMA_REG_DMACR@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_dma_ctrl_read
Lloh7:
	adrp	x8, _XILINX_DMA_CR_CYCLIC_BD_EN_MASK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _XILINX_DMA_CR_CYCLIC_BD_EN_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	bic	w2, w0, w8
	ldr	w1, [x20]
	mov	x0, x19
	bl	_dma_ctrl_write
	str	wzr, [x19]
LBB0_6:
	ldr	x8, [x19, #32]
	ldr	x8, [x8]
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _XDMA_TYPE_CDMA@GOTPAGE
Lloh11:
	ldr	x9, [x9, _XDMA_TYPE_CDMA@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.7:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_9
; %bb.8:
Lloh13:
	adrp	x8, _XILINX_DMA_REG_DMACR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _XILINX_DMA_REG_DMACR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _XILINX_CDMA_CR_SGMODE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _XILINX_CDMA_CR_SGMODE@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_dma_ctrl_clr
LBB0_9:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot stop channel %p: %x\n"

	.comm	_XILINX_DMA_REG_DMASR,4,2       ; @XILINX_DMA_REG_DMASR
	.comm	_XILINX_DMA_REG_DMACR,4,2       ; @XILINX_DMA_REG_DMACR
	.comm	_XILINX_DMA_CR_CYCLIC_BD_EN_MASK,4,2 ; @XILINX_DMA_CR_CYCLIC_BD_EN_MASK
	.comm	_XDMA_TYPE_CDMA,8,3             ; @XDMA_TYPE_CDMA
	.comm	_XILINX_CDMA_CR_SGMODE,4,2      ; @XILINX_CDMA_CR_SGMODE
	.no_dead_strip	_xilinx_dma_terminate_all
.subsections_via_symbols
