	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xilinx_vdma_channel_set_config ## -- Begin function xilinx_vdma_channel_set_config
	.p2align	4, 0x90
_xilinx_vdma_channel_set_config:        ## @xilinx_vdma_channel_set_config
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	callq	_to_xilinx_chan
	movq	%rax, %rbx
	cmpq	$0, 56(%r14)
	je	LBB0_1
## %bb.12:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_xilinx_dma_chan_reset          ## TAILCALL
LBB0_1:
	movq	_XILINX_DMA_REG_DMACR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_dma_ctrl_read
	movl	48(%r14), %ecx
	movl	%ecx, 40(%rbx)
	movq	24(%r14), %r8
	movq	%r8, 32(%rbx)
	movq	40(%r14), %rdx
	movq	%rdx, 24(%rbx)
	movl	(%r14), %edi
	movl	%edi, (%rbx)
	movq	_XILINX_DMA_DMACR_GENLOCK_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %esi
	notl	%esi
	andl	%eax, %esi
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.2:
	cmpq	$0, 48(%rbx)
	je	LBB0_4
## %bb.3:
	orl	%eax, %ecx
	movq	_XILINX_DMA_DMACR_MASTER_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%ecx, %eax
	movq	_XILINX_DMA_DMACR_MASTER_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edi
	orl	%eax, %edi
	movl	%edi, %esi
LBB0_4:
	movl	36(%r14), %eax
	movl	%eax, 20(%rbx)
	movl	32(%r14), %eax
	movl	%eax, 16(%rbx)
	testq	%r8, %r8
	je	LBB0_5
## %bb.6:
	movl	4(%r14), %eax
	jmp	LBB0_7
LBB0_5:
	movl	$-1, %eax
LBB0_7:
	movl	%eax, 4(%rbx)
	movl	8(%r14), %edx
	movl	%edx, 8(%rbx)
	movl	12(%r14), %eax
	movl	%eax, 12(%rbx)
	movq	_XILINX_DMA_DMACR_FRAME_COUNT_MAX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edx
	jg	LBB0_9
## %bb.8:
	movq	_XILINX_DMA_DMACR_FRAME_COUNT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %esi
	movq	_XILINX_DMA_DMACR_FRAME_COUNT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%edx, %esi
LBB0_9:
	movq	_XILINX_DMA_DMACR_DELAY_MAX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jg	LBB0_11
## %bb.10:
	movq	_XILINX_DMA_DMACR_DELAY_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_XILINX_DMA_DMACR_DELAY_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%eax, %edi
	shll	%cl, %edi
	notl	%edx
	andl	%edx, %esi
	orl	%edi, %esi
	movl	%eax, 12(%rbx)
LBB0_11:
	movq	_XILINX_DMA_DMACR_FSYNCSRC_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movq	_XILINX_DMA_DMACR_FSYNCSRC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	16(%r14), %edx
	shll	%cl, %edx
	notl	%eax
	andl	%esi, %eax
	orl	%eax, %edx
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_dma_ctrl_write
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XILINX_DMA_REG_DMACR,4,2       ## @XILINX_DMA_REG_DMACR
	.comm	_XILINX_DMA_DMACR_GENLOCK_EN,4,2 ## @XILINX_DMA_DMACR_GENLOCK_EN
	.comm	_XILINX_DMA_DMACR_MASTER_MASK,4,2 ## @XILINX_DMA_DMACR_MASTER_MASK
	.comm	_XILINX_DMA_DMACR_MASTER_SHIFT,4,2 ## @XILINX_DMA_DMACR_MASTER_SHIFT
	.comm	_XILINX_DMA_DMACR_FRAME_COUNT_MAX,4,2 ## @XILINX_DMA_DMACR_FRAME_COUNT_MAX
	.comm	_XILINX_DMA_DMACR_FRAME_COUNT_MASK,4,2 ## @XILINX_DMA_DMACR_FRAME_COUNT_MASK
	.comm	_XILINX_DMA_DMACR_FRAME_COUNT_SHIFT,4,2 ## @XILINX_DMA_DMACR_FRAME_COUNT_SHIFT
	.comm	_XILINX_DMA_DMACR_DELAY_MAX,4,2 ## @XILINX_DMA_DMACR_DELAY_MAX
	.comm	_XILINX_DMA_DMACR_DELAY_MASK,4,2 ## @XILINX_DMA_DMACR_DELAY_MASK
	.comm	_XILINX_DMA_DMACR_DELAY_SHIFT,4,2 ## @XILINX_DMA_DMACR_DELAY_SHIFT
	.comm	_XILINX_DMA_DMACR_FSYNCSRC_MASK,4,2 ## @XILINX_DMA_DMACR_FSYNCSRC_MASK
	.comm	_XILINX_DMA_DMACR_FSYNCSRC_SHIFT,4,2 ## @XILINX_DMA_DMACR_FSYNCSRC_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xilinx_vdma_channel_set_config ; -- Begin function xilinx_vdma_channel_set_config
	.p2align	2
_xilinx_vdma_channel_set_config:        ; @xilinx_vdma_channel_set_config
	.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	x20, x1
	bl	_to_xilinx_chan
	mov	x19, x0
	ldr	x8, [x20, #56]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	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	_xilinx_dma_chan_reset
LBB0_2:
Lloh0:
	adrp	x21, _XILINX_DMA_REG_DMACR@GOTPAGE
Lloh1:
	ldr	x21, [x21, _XILINX_DMA_REG_DMACR@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_dma_ctrl_read
	ldr	w8, [x20, #48]
	str	w8, [x19, #40]
	ldr	x9, [x20, #24]
	ldr	x12, [x20, #40]
	stp	x12, x9, [x19, #24]
	ldr	w10, [x20]
	str	w10, [x19]
Lloh2:
	adrp	x8, _XILINX_DMA_DMACR_GENLOCK_EN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _XILINX_DMA_DMACR_GENLOCK_EN@GOTPAGEOFF]
Lloh4:
	ldr	w11, [x8]
	bic	w8, w0, w11
	cbz	x12, LBB0_5
; %bb.3:
	ldr	x12, [x19, #48]
	cbz	x12, LBB0_5
; %bb.4:
	orr	w8, w11, w0
Lloh5:
	adrp	x11, _XILINX_DMA_DMACR_MASTER_MASK@GOTPAGE
Lloh6:
	ldr	x11, [x11, _XILINX_DMA_DMACR_MASTER_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w11, [x11]
	bic	w8, w8, w11
Lloh8:
	adrp	x11, _XILINX_DMA_DMACR_MASTER_SHIFT@GOTPAGE
Lloh9:
	ldr	x11, [x11, _XILINX_DMA_DMACR_MASTER_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w11, [x11]
	lsl	w10, w10, w11
	orr	w8, w10, w8
LBB0_5:
	ldr	d0, [x20, #32]
	str	d0, [x19, #16]
	cbz	x9, LBB0_7
; %bb.6:
	ldr	w9, [x20, #4]
	b	LBB0_8
LBB0_7:
	mov	w9, #-1
LBB0_8:
	str	w9, [x19, #4]
	ldp	w10, w9, [x20, #8]
	stp	w10, w9, [x19, #8]
Lloh11:
	adrp	x11, _XILINX_DMA_DMACR_FRAME_COUNT_MAX@GOTPAGE
Lloh12:
	ldr	x11, [x11, _XILINX_DMA_DMACR_FRAME_COUNT_MAX@GOTPAGEOFF]
Lloh13:
	ldr	w11, [x11]
	cmp	w10, w11
	b.gt	LBB0_10
; %bb.9:
Lloh14:
	adrp	x11, _XILINX_DMA_DMACR_FRAME_COUNT_MASK@GOTPAGE
Lloh15:
	ldr	x11, [x11, _XILINX_DMA_DMACR_FRAME_COUNT_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	bic	w8, w8, w11
Lloh17:
	adrp	x11, _XILINX_DMA_DMACR_FRAME_COUNT_SHIFT@GOTPAGE
Lloh18:
	ldr	x11, [x11, _XILINX_DMA_DMACR_FRAME_COUNT_SHIFT@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
	lsl	w10, w10, w11
	orr	w8, w10, w8
LBB0_10:
Lloh20:
	adrp	x10, _XILINX_DMA_DMACR_DELAY_MAX@GOTPAGE
Lloh21:
	ldr	x10, [x10, _XILINX_DMA_DMACR_DELAY_MAX@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	cmp	w9, w10
	b.gt	LBB0_12
; %bb.11:
Lloh23:
	adrp	x10, _XILINX_DMA_DMACR_DELAY_MASK@GOTPAGE
Lloh24:
	ldr	x10, [x10, _XILINX_DMA_DMACR_DELAY_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	bic	w8, w8, w10
Lloh26:
	adrp	x10, _XILINX_DMA_DMACR_DELAY_SHIFT@GOTPAGE
Lloh27:
	ldr	x10, [x10, _XILINX_DMA_DMACR_DELAY_SHIFT@GOTPAGEOFF]
Lloh28:
	ldr	w10, [x10]
	lsl	w10, w9, w10
	orr	w8, w10, w8
	str	w9, [x19, #12]
LBB0_12:
Lloh29:
	adrp	x9, _XILINX_DMA_DMACR_FSYNCSRC_MASK@GOTPAGE
Lloh30:
	ldr	x9, [x9, _XILINX_DMA_DMACR_FSYNCSRC_MASK@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	bic	w8, w8, w9
	ldr	w9, [x20, #16]
Lloh32:
	adrp	x10, _XILINX_DMA_DMACR_FSYNCSRC_SHIFT@GOTPAGE
Lloh33:
	ldr	x10, [x10, _XILINX_DMA_DMACR_FSYNCSRC_SHIFT@GOTPAGEOFF]
Lloh34:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w2, w9, w8
	ldr	w1, [x21]
	mov	x0, x19
	bl	_dma_ctrl_write
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_XILINX_DMA_REG_DMACR,4,2       ; @XILINX_DMA_REG_DMACR
	.comm	_XILINX_DMA_DMACR_GENLOCK_EN,4,2 ; @XILINX_DMA_DMACR_GENLOCK_EN
	.comm	_XILINX_DMA_DMACR_MASTER_MASK,4,2 ; @XILINX_DMA_DMACR_MASTER_MASK
	.comm	_XILINX_DMA_DMACR_MASTER_SHIFT,4,2 ; @XILINX_DMA_DMACR_MASTER_SHIFT
	.comm	_XILINX_DMA_DMACR_FRAME_COUNT_MAX,4,2 ; @XILINX_DMA_DMACR_FRAME_COUNT_MAX
	.comm	_XILINX_DMA_DMACR_FRAME_COUNT_MASK,4,2 ; @XILINX_DMA_DMACR_FRAME_COUNT_MASK
	.comm	_XILINX_DMA_DMACR_FRAME_COUNT_SHIFT,4,2 ; @XILINX_DMA_DMACR_FRAME_COUNT_SHIFT
	.comm	_XILINX_DMA_DMACR_DELAY_MAX,4,2 ; @XILINX_DMA_DMACR_DELAY_MAX
	.comm	_XILINX_DMA_DMACR_DELAY_MASK,4,2 ; @XILINX_DMA_DMACR_DELAY_MASK
	.comm	_XILINX_DMA_DMACR_DELAY_SHIFT,4,2 ; @XILINX_DMA_DMACR_DELAY_SHIFT
	.comm	_XILINX_DMA_DMACR_FSYNCSRC_MASK,4,2 ; @XILINX_DMA_DMACR_FSYNCSRC_MASK
	.comm	_XILINX_DMA_DMACR_FSYNCSRC_SHIFT,4,2 ; @XILINX_DMA_DMACR_FSYNCSRC_SHIFT
.subsections_via_symbols
