	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zynq_step_dma
_zynq_step_dma:                         ## @zynq_step_dma
	.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	%rdi, %rbx
	movq	(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpq	$0, 16(%rdi)
	je	LBB0_7
## %bb.1:
	movq	_DMA_SRC_LEN_OFFSET@GOTPCREL(%rip), %r12
	movq	_DMA_DEST_LEN_OFFSET@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%rbx), %rdi
	callq	_sg_next
	movq	%rax, 16(%rbx)
	incq	(%rbx)
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_DMA_SRC_ADDR_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_zynq_fpga_write
	movq	_DMA_DST_ADDR_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DMA_INVALID_ADDRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_zynq_fpga_write
	movl	(%r12), %esi
	leal	3(%r14), %edx
	testl	%r14d, %r14d
	cmovnsl	%r14d, %edx
	sarl	$2, %edx
	movq	%rbx, %rdi
	callq	_zynq_fpga_write
	movl	(%r13), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_zynq_fpga_write
	cmpq	$0, 16(%rbx)
	je	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_STATUS_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_zynq_fpga_read
	movq	_STATUS_DMA_Q_F@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%rbx), %rdi
	callq	_sg_dma_address
	movl	%eax, %r15d
	movq	16(%rbx), %rdi
	callq	_sg_dma_len
	movl	%eax, %r14d
	movq	(%rbx), %rax
	incq	%rax
	cmpq	8(%rbx), %rax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_DMA_SRC_LAST_TRANSFER@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	$0, 16(%rbx)
	jmp	LBB0_6
LBB0_7:
	movq	16(%rbx), %rax
	cmpq	$0, -48(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_8
## %bb.10:
	testq	%rax, %rax
	je	LBB0_11
## %bb.13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	movq	_IXR_DMA_DONE_MASK@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	movq	_IXR_D_P_DONE_MASK@GOTPCREL(%rip), %rax
LBB0_12:
	movq	_IXR_ERROR_FLAGS_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_zynq_fpga_set_irq              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_STATUS_OFFSET,4,2              ## @STATUS_OFFSET
	.comm	_STATUS_DMA_Q_F,4,2             ## @STATUS_DMA_Q_F
	.comm	_DMA_SRC_LAST_TRANSFER,4,2      ## @DMA_SRC_LAST_TRANSFER
	.comm	_DMA_SRC_ADDR_OFFSET,4,2        ## @DMA_SRC_ADDR_OFFSET
	.comm	_DMA_DST_ADDR_OFFSET,4,2        ## @DMA_DST_ADDR_OFFSET
	.comm	_DMA_INVALID_ADDRESS,4,2        ## @DMA_INVALID_ADDRESS
	.comm	_DMA_SRC_LEN_OFFSET,4,2         ## @DMA_SRC_LEN_OFFSET
	.comm	_DMA_DEST_LEN_OFFSET,4,2        ## @DMA_DEST_LEN_OFFSET
	.comm	_IXR_DMA_DONE_MASK,4,2          ## @IXR_DMA_DONE_MASK
	.comm	_IXR_ERROR_FLAGS_MASK,4,2       ## @IXR_ERROR_FLAGS_MASK
	.comm	_IXR_D_P_DONE_MASK,4,2          ## @IXR_D_P_DONE_MASK
	.no_dead_strip	_zynq_step_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zynq_step_dma
_zynq_step_dma:                         ; @zynq_step_dma
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x8, [x0]
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_7
; %bb.1:
Lloh0:
	adrp	x23, _STATUS_OFFSET@GOTPAGE
Lloh1:
	ldr	x23, [x23, _STATUS_OFFSET@GOTPAGEOFF]
Lloh2:
	adrp	x24, _STATUS_DMA_Q_F@GOTPAGE
Lloh3:
	ldr	x24, [x24, _STATUS_DMA_Q_F@GOTPAGEOFF]
Lloh4:
	adrp	x26, _DMA_SRC_ADDR_OFFSET@GOTPAGE
Lloh5:
	ldr	x26, [x26, _DMA_SRC_ADDR_OFFSET@GOTPAGEOFF]
Lloh6:
	adrp	x27, _DMA_DST_ADDR_OFFSET@GOTPAGE
Lloh7:
	ldr	x27, [x27, _DMA_DST_ADDR_OFFSET@GOTPAGEOFF]
Lloh8:
	adrp	x28, _DMA_INVALID_ADDRESS@GOTPAGE
Lloh9:
	ldr	x28, [x28, _DMA_INVALID_ADDRESS@GOTPAGEOFF]
Lloh10:
	adrp	x22, _DMA_SRC_LEN_OFFSET@GOTPAGE
Lloh11:
	ldr	x22, [x22, _DMA_SRC_LEN_OFFSET@GOTPAGEOFF]
Lloh12:
	adrp	x25, _DMA_DEST_LEN_OFFSET@GOTPAGE
Lloh13:
	ldr	x25, [x25, _DMA_DEST_LEN_OFFSET@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x19, #16]
	bl	_sg_next
	str	x0, [x19, #16]
	ldr	x8, [x19]
	add	x8, x8, #1
	str	x8, [x19]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x26]
	mov	x0, x19
	mov	x2, x21
	bl	_zynq_fpga_write
	ldr	w1, [x27]
	ldr	w2, [x28]
	mov	x0, x19
	bl	_zynq_fpga_write
	ldr	w1, [x22]
	add	w8, w20, #3
	cmp	w20, #0
	csel	w8, w8, w20, lt
	asr	w2, w8, #2
	mov	x0, x19
	bl	_zynq_fpga_write
	ldr	w1, [x25]
	mov	x0, x19
	mov	w2, #0
	bl	_zynq_fpga_write
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x19
	bl	_zynq_fpga_read
	ldr	w8, [x24]
	tst	w8, w0
	b.ne	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x19, #16]
	bl	_sg_dma_address
	mov	x21, x0
	ldr	x0, [x19, #16]
	bl	_sg_dma_len
	mov	x20, x0
	ldp	x8, x9, [x19]
	add	x8, x8, #1
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh14:
	adrp	x8, _DMA_SRC_LAST_TRANSFER@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DMA_SRC_LAST_TRANSFER@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	orr	w21, w8, w21
	str	xzr, [x19, #16]
	b	LBB0_3
LBB0_7:
	ldr	x8, [x19, #16]
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	cbz	x9, LBB0_10
; %bb.8:
	cbz	x8, LBB0_12
; %bb.9:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_10:
	cbz	x8, LBB0_12
; %bb.11:
Lloh17:
	adrp	x8, _IXR_DMA_DONE_MASK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IXR_DMA_DONE_MASK@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
Lloh19:
	adrp	x8, _IXR_D_P_DONE_MASK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IXR_D_P_DONE_MASK@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _IXR_ERROR_FLAGS_MASK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _IXR_ERROR_FLAGS_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_zynq_fpga_set_irq
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_STATUS_OFFSET,4,2              ; @STATUS_OFFSET
	.comm	_STATUS_DMA_Q_F,4,2             ; @STATUS_DMA_Q_F
	.comm	_DMA_SRC_LAST_TRANSFER,4,2      ; @DMA_SRC_LAST_TRANSFER
	.comm	_DMA_SRC_ADDR_OFFSET,4,2        ; @DMA_SRC_ADDR_OFFSET
	.comm	_DMA_DST_ADDR_OFFSET,4,2        ; @DMA_DST_ADDR_OFFSET
	.comm	_DMA_INVALID_ADDRESS,4,2        ; @DMA_INVALID_ADDRESS
	.comm	_DMA_SRC_LEN_OFFSET,4,2         ; @DMA_SRC_LEN_OFFSET
	.comm	_DMA_DEST_LEN_OFFSET,4,2        ; @DMA_DEST_LEN_OFFSET
	.comm	_IXR_DMA_DONE_MASK,4,2          ; @IXR_DMA_DONE_MASK
	.comm	_IXR_ERROR_FLAGS_MASK,4,2       ; @IXR_ERROR_FLAGS_MASK
	.comm	_IXR_D_P_DONE_MASK,4,2          ; @IXR_D_P_DONE_MASK
	.no_dead_strip	_zynq_step_dma
.subsections_via_symbols
