	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flctl_dma_fifo0_transfer
_flctl_dma_fifo0_transfer:              ## @flctl_dma_fifo0_transfer
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	cmpl	%ecx, %ebx
	sete	%al
	movq	16(%rdi,%rax,8), %r12
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	(%r12), %rax
	movl	(%rax), %edi
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	callq	_dma_map_single
	movl	%eax, %esi
	movq	(%r12), %rax
	movl	(%rax), %edi
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	callq	_dma_mapping_error
	testl	%eax, %eax
	je	LBB0_1
LBB0_7:
	movq	%r13, %rdi
	callq	_flctl_release_dma
	movq	(%r13), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_6:
	movq	%r13, %rdi
	callq	_FLINTDMACR
	movl	%eax, %edi
	callq	_readl
	movq	_DREQ0EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movq	%r13, %rdi
	callq	_FLINTDMACR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writel
	movq	(%r12), %rax
	movl	(%rax), %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_dma_unmap_single
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	cmpl	-52(%rbp), %ebx                 ## 4-byte Folded Reload
	cmovel	%r15d, %r14d
	movq	_DMA_PREP_INTERRUPT@GOTPCREL(%rip), %rax
	movq	_DMA_CTRL_ACK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	orl	(%rax), %r8d
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%r14d, %ecx
	callq	_dmaengine_prep_slave_single
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_FLINTDMACR
	movl	%eax, %edi
	callq	_readl
	movl	%eax, %ebx
	movq	_DREQ0EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r13, %rdi
	callq	_FLINTDMACR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writel
	movq	_flctl_dma_complete@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movq	%r13, (%r14)
	movq	%r14, %rdi
	callq	_dmaengine_submit
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_dma_submit_error
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%ebx, %edi
	callq	_dma_submit_error
	movl	%eax, %r14d
	movq	(%r13), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	jmp	LBB0_6
LBB0_4:
	movq	%r12, %rdi
	callq	_dma_async_issue_pending
	leaq	8(%r13), %rbx
	movl	$3000, %edi                     ## imm = 0xBB8
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	movl	%eax, %r14d
	testl	%eax, %eax
	jg	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	callq	_dmaengine_terminate_all
	movq	(%r13), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_DMA_PREP_INTERRUPT,4,2         ## @DMA_PREP_INTERRUPT
	.comm	_DMA_CTRL_ACK,4,2               ## @DMA_CTRL_ACK
	.comm	_DREQ0EN,4,2                    ## @DREQ0EN
	.comm	_flctl_dma_complete,4,2         ## @flctl_dma_complete
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA submit failed, falling back to PIO\n"

L_.str.1:                               ## @.str.1
	.asciz	"DMA failed, falling back to PIO\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"wait_for_completion_timeout\n"

	.no_dead_strip	_flctl_dma_fifo0_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flctl_dma_fifo0_transfer
_flctl_dma_fifo0_transfer:              ; @flctl_dma_fifo0_transfer
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x3
	mov	x20, x2
	mov	x22, x0
Lloh0:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	cmp	w24, w3
	mov	w8, #16
	mov	w9, #24
	csel	x8, x9, x8, eq
	ldr	x21, [x0, x8]
Lloh3:
	adrp	x8, _DMA_DEV_TO_MEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_DEV_TO_MEM@GOTPAGEOFF]
Lloh5:
	ldr	w25, [x8]
Lloh6:
	adrp	x8, _DMA_MEM_TO_DEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh8:
	ldr	w27, [x8]
	ldr	x8, [x21]
	ldr	w0, [x8]
	bl	_dma_map_single
	mov	x23, x0
	ldr	x8, [x21]
	ldr	w0, [x8]
	mov	x1, x23
	bl	_dma_mapping_error
Lloh9:
	adrp	x26, _DREQ0EN@GOTPAGE
Lloh10:
	ldr	x26, [x26, _DREQ0EN@GOTPAGEOFF]
	cbz	w0, LBB0_3
LBB0_1:
	mov	x0, x22
	bl	_flctl_release_dma
	ldr	x0, [x22]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
Lloh13:
	adrp	x8, _EIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_2:
	mov	x0, x22
	bl	_FLINTDMACR
	bl	_readl
	ldr	w8, [x26]
	bic	w25, w0, w8
	mov	x0, x22
	bl	_FLINTDMACR
	mov	x1, x0
	mov	x0, x25
	bl	_writel
	ldr	x8, [x21]
	ldr	w0, [x8]
	mov	x1, x23
	mov	x2, x20
	mov	x3, x19
	bl	_dma_unmap_single
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_3:
Lloh16:
	adrp	x8, _DMA_PREP_INTERRUPT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DMA_PREP_INTERRUPT@GOTPAGEOFF]
	cmp	w24, w19
	csel	w3, w25, w27, eq
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _DMA_CTRL_ACK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _DMA_CTRL_ACK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w4, w9, w8
	mov	x0, x21
	mov	x1, x23
	mov	x2, x20
	bl	_dmaengine_prep_slave_single
	cbz	x0, LBB0_1
; %bb.4:
	mov	x24, x0
	mov	x0, x22
	bl	_FLINTDMACR
	bl	_readl
	ldr	w8, [x26]
	orr	w25, w8, w0
	mov	x0, x22
	bl	_FLINTDMACR
	mov	x1, x0
	mov	x0, x25
	bl	_writel
Lloh22:
	adrp	x8, _flctl_dma_complete@GOTPAGE
Lloh23:
	ldr	x8, [x8, _flctl_dma_complete@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x24, #8]
	str	x22, [x24]
	mov	x0, x24
	bl	_dmaengine_submit
	mov	x24, x0
	bl	_dma_submit_error
	cbz	w0, LBB0_6
; %bb.5:
	mov	x0, x24
	bl	_dma_submit_error
	mov	x24, x0
	ldr	x0, [x22]
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
	b	LBB0_2
LBB0_6:
	mov	x0, x21
	bl	_dma_async_issue_pending
	add	x24, x22, #8
	mov	w0, #3000
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x24
	bl	_wait_for_completion_timeout
	mov	x24, x0
	cmp	w0, #1
	b.ge	LBB0_2
; %bb.7:
	mov	x0, x21
	bl	_dmaengine_terminate_all
	ldr	x0, [x22]
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_DMA_PREP_INTERRUPT,4,2         ; @DMA_PREP_INTERRUPT
	.comm	_DMA_CTRL_ACK,4,2               ; @DMA_CTRL_ACK
	.comm	_DREQ0EN,4,2                    ; @DREQ0EN
	.comm	_flctl_dma_complete,4,2         ; @flctl_dma_complete
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA submit failed, falling back to PIO\n"

l_.str.1:                               ; @.str.1
	.asciz	"DMA failed, falling back to PIO\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"wait_for_completion_timeout\n"

	.no_dead_strip	_flctl_dma_fifo0_transfer
.subsections_via_symbols
