	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xilinx_cdma_prep_memcpy
_xilinx_cdma_prep_memcpy:               ## @xilinx_cdma_prep_memcpy
	.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	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rsi, %r14
	callq	_to_xilinx_chan
	testq	%rbx, %rbx
	je	LBB0_8
## %bb.1:
	movq	%rax, %r13
	movq	16(%rax), %rax
	cmpq	%rbx, (%rax)
	jb	LBB0_8
## %bb.2:
	movq	%r13, %rdi
	callq	_xilinx_dma_alloc_tx_descriptor
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	%rax, %r12
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rsi
	addq	$8, %rsi
	movq	%rax, %rdi
	callq	_dma_async_tx_descriptor_init
	movq	_xilinx_dma_tx_submit@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r12)
	movq	%r13, %rdi
	callq	_xilinx_cdma_alloc_tx_segment
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	movq	%rax, %r14
	movq	%rbx, 8(%rax)
	movq	%r15, 48(%rax)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, 40(%rax)
	cmpq	$0, (%r13)
	je	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	callq	_upper_32_bits
	movq	%rax, 32(%r14)
	movq	%rbx, %rdi
	callq	_upper_32_bits
	movq	%rax, 24(%r14)
LBB0_6:
	movq	%r14, %rdi
	addq	$4, %rdi
	movq	%r12, %rsi
	addq	$8, %rsi
	callq	_list_add_tail
	movl	(%r14), %eax
	movl	%eax, (%r12)
	movl	%eax, 16(%r14)
	jmp	LBB0_9
LBB0_7:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_xilinx_dma_free_tx_descriptor
LBB0_8:
	xorl	%r12d, %r12d
LBB0_9:
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_xilinx_dma_tx_submit,4,2       ## @xilinx_dma_tx_submit
	.no_dead_strip	_xilinx_cdma_prep_memcpy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xilinx_cdma_prep_memcpy
_xilinx_cdma_prep_memcpy:               ; @xilinx_cdma_prep_memcpy
	.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	x22, x3
	mov	x21, x2
	mov	x20, x1
	bl	_to_xilinx_chan
	cbz	x22, LBB0_8
; %bb.1:
	mov	x23, x0
	ldr	x8, [x0, #16]
	ldr	x8, [x8]
	cmp	x8, x22
	b.lo	LBB0_8
; %bb.2:
	mov	x0, x23
	bl	_xilinx_dma_alloc_tx_descriptor
	mov	x19, x0
	cbz	x0, LBB0_9
; %bb.3:
	add	x1, x23, #8
	mov	x0, x19
	bl	_dma_async_tx_descriptor_init
Lloh0:
	adrp	x8, _xilinx_dma_tx_submit@GOTPAGE
Lloh1:
	ldr	x8, [x8, _xilinx_dma_tx_submit@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	mov	x0, x23
	bl	_xilinx_cdma_alloc_tx_segment
	cbz	x0, LBB0_7
; %bb.4:
	mov	x24, x0
	str	x22, [x0, #8]
	stp	x20, x21, [x0, #40]
	ldr	x8, [x23]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x21
	bl	_upper_32_bits
	str	x0, [x24, #32]
	mov	x0, x20
	bl	_upper_32_bits
	str	x0, [x24, #24]
LBB0_6:
	add	x0, x24, #4
	add	x1, x19, #8
	bl	_list_add_tail
	ldr	w8, [x24]
	str	w8, [x19]
	str	w8, [x24, #16]
	b	LBB0_9
LBB0_7:
	mov	x0, x23
	mov	x1, x19
	bl	_xilinx_dma_free_tx_descriptor
LBB0_8:
	mov	x19, #0
LBB0_9:
	mov	x0, x19
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_xilinx_dma_tx_submit,4,2       ; @xilinx_dma_tx_submit
	.no_dead_strip	_xilinx_cdma_prep_memcpy
.subsections_via_symbols
