	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omap_nand_dma_transfer
_omap_nand_dma_transfer:                ## @omap_nand_dma_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
	movl	%ecx, %r15d
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %r13
	callq	_mtd_to_omap
	movq	%rax, %r14
	testl	%r15d, %r15d
	jne	LBB0_1
## %bb.2:
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_virt_addr_valid
	testl	%eax, %eax
	je	LBB0_16
## %bb.4:
	movq	%r12, %rsi
	movq	%r13, %r12
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %edx
	callq	_sg_init_one
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	movl	$1, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_dma_map_sg
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movq	8(%r14), %rdi
	testl	%r15d, %r15d
	jne	LBB0_7
## %bb.8:
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_5:
	movq	32(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	callq	_dev_err
	movq	%r12, %r13
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_7:
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rcx
LBB0_9:
	movq	%r12, %r13
	movl	(%rcx), %ecx
	movq	_DMA_PREP_INTERRUPT@GOTPCREL(%rip), %rdx
	movq	_DMA_CTRL_ACK@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r8d
	orl	(%rdx), %r8d
	leaq	-48(%rbp), %rsi
	movl	%eax, %edx
	callq	_dmaengine_prep_slave_sg
	testq	%rax, %rax
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	je	LBB0_15
## %bb.10:
	movq	_omap_nand_dma_callback@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rax)
	movq	%r14, %rbx
	addq	$24, %rbx
	movq	%rbx, (%rax)
	movq	%rax, %rdi
	callq	_dmaengine_submit
	movq	%rbx, %rdi
	callq	_init_completion
	movq	8(%r14), %rdi
	callq	_dma_async_issue_pending
	movl	16(%r14), %edi
	movq	_PREFETCH_FIFOTHRESHOLD_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%r15d, %r8d
	movq	%r14, %r9
	callq	_omap_prefetch_enable
	testl	%eax, %eax
	je	LBB0_11
LBB0_15:
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	leaq	-48(%rbp), %rsi
	movl	$1, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_dma_unmap_sg
LBB0_16:
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_20
## %bb.17:
	movq	%r13, %rdi
	movq	%r12, %rsi
	testl	%r15d, %r15d
	je	LBB0_18
## %bb.19:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_omap_write_buf16
	jmp	LBB0_23
LBB0_20:
	movq	%r13, %rdi
	movq	%r12, %rsi
	testl	%r15d, %r15d
	je	LBB0_21
## %bb.22:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_omap_write_buf8
	jmp	LBB0_23
LBB0_18:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_omap_read_buf16
	jmp	LBB0_23
LBB0_21:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_omap_read_buf8
	jmp	LBB0_23
LBB0_11:
	movq	%rbx, %rdi
	callq	_wait_for_completion
	movq	_loops_per_jiffy@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_OMAP_NAND_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, %r15
	imulq	%rbx, %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_cpu_relax
	movl	20(%r14), %edi
	callq	_readl
	movq	%rax, %rdi
	callq	_PREFETCH_STATUS_COUNT
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	leaq	1(%rbx), %rax
	cmpq	%r15, %rbx
	movq	%rax, %rbx
	jb	LBB0_12
LBB0_14:
	movl	16(%r14), %edi
	movq	%r14, %rsi
	callq	_omap_prefetch_reset
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	leaq	-48(%rbp), %rsi
	movl	$1, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_dma_unmap_sg
LBB0_23:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't DMA map a %d byte buffer\n"

	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_DMA_PREP_INTERRUPT,4,2         ## @DMA_PREP_INTERRUPT
	.comm	_DMA_CTRL_ACK,4,2               ## @DMA_CTRL_ACK
	.comm	_omap_nand_dma_callback,4,2     ## @omap_nand_dma_callback
	.comm	_PREFETCH_FIFOTHRESHOLD_MAX,4,2 ## @PREFETCH_FIFOTHRESHOLD_MAX
	.comm	_loops_per_jiffy,8,3            ## @loops_per_jiffy
	.comm	_OMAP_NAND_TIMEOUT_MS,4,2       ## @OMAP_NAND_TIMEOUT_MS
	.comm	_NAND_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
	.no_dead_strip	_omap_nand_dma_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omap_nand_dma_transfer
_omap_nand_dma_transfer:                ; @omap_nand_dma_transfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x24, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	bl	_mtd_to_omap
	mov	x19, x0
Lloh0:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh2:
	adrp	x9, _DMA_FROM_DEVICE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DMA_FROM_DEVICE@GOTPAGEOFF]
	cmp	w24, #0
	csel	x8, x9, x8, eq
	ldr	w20, [x8]
	mov	x0, x22
	bl	_virt_addr_valid
	cbz	w0, LBB0_6
; %bb.1:
	add	x0, sp, #8
	mov	x1, x22
	mov	x2, x21
	bl	_sg_init_one
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	add	x1, sp, #8
	mov	w2, #1
	mov	x3, x20
	bl	_dma_map_sg
	cbz	w0, LBB0_5
; %bb.2:
	mov	x2, x0
	ldr	x0, [x19, #8]
Lloh4:
	adrp	x8, _DMA_MEM_TO_DEV@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh6:
	adrp	x9, _DMA_DEV_TO_MEM@GOTPAGE
Lloh7:
	ldr	x9, [x9, _DMA_DEV_TO_MEM@GOTPAGEOFF]
	cmp	w24, #0
	csel	x8, x9, x8, eq
Lloh8:
	adrp	x9, _DMA_PREP_INTERRUPT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _DMA_PREP_INTERRUPT@GOTPAGEOFF]
	ldr	w3, [x8]
Lloh10:
	ldr	w8, [x9]
Lloh11:
	adrp	x9, _DMA_CTRL_ACK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DMA_CTRL_ACK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w4, w9, w8
	add	x1, sp, #8
	bl	_dmaengine_prep_slave_sg
	cbz	x0, LBB0_4
; %bb.3:
Lloh14:
	adrp	x8, _omap_nand_dma_callback@GOTPAGE
Lloh15:
	ldr	x8, [x8, _omap_nand_dma_callback@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	add	x25, x19, #24
	str	x25, [x0]
	bl	_dmaengine_submit
	mov	x0, x25
	bl	_init_completion
	ldr	x0, [x19, #8]
	bl	_dma_async_issue_pending
	ldr	w0, [x19, #16]
Lloh17:
	adrp	x8, _PREFETCH_FIFOTHRESHOLD_MAX@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PREFETCH_FIFOTHRESHOLD_MAX@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	w2, #1
	mov	x3, x21
	mov	x4, x24
	mov	x5, x19
	bl	_omap_prefetch_enable
	cbz	w0, LBB0_13
LBB0_4:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	add	x1, sp, #8
	mov	w2, #1
	mov	x3, x20
	bl	_dma_unmap_sg
	b	LBB0_6
LBB0_5:
	ldr	x0, [x19, #32]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_err
LBB0_6:
	ldr	w8, [x19]
Lloh22:
	adrp	x9, _NAND_BUSWIDTH_16@GOTPAGE
Lloh23:
	ldr	x9, [x9, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	tst	w9, w8
	b.eq	LBB0_9
; %bb.7:
	cbz	w24, LBB0_11
; %bb.8:
	bl	_omap_write_buf16
	b	LBB0_16
LBB0_9:
	cbz	w24, LBB0_12
; %bb.10:
	bl	_omap_write_buf8
	b	LBB0_16
LBB0_11:
	bl	_omap_read_buf16
	b	LBB0_16
LBB0_12:
	bl	_omap_read_buf8
	b	LBB0_16
LBB0_13:
	mov	x0, x25
	bl	_wait_for_completion
Lloh25:
	adrp	x8, _loops_per_jiffy@GOTPAGE
Lloh26:
	ldr	x8, [x8, _loops_per_jiffy@GOTPAGEOFF]
Lloh27:
	ldr	x21, [x8]
Lloh28:
	adrp	x8, _OMAP_NAND_TIMEOUT_MS@GOTPAGE
Lloh29:
	ldr	x8, [x8, _OMAP_NAND_TIMEOUT_MS@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x22, #0
	mul	x21, x0, x21
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	bl	_cpu_relax
	ldr	w0, [x19, #20]
	bl	_readl
	bl	_PREFETCH_STATUS_COUNT
	cmp	x0, #0
	ccmp	x22, x21, #2, ne
	add	x22, x22, #1
	b.lo	LBB0_14
; %bb.15:
	ldr	w0, [x19, #16]
	mov	x1, x19
	bl	_omap_prefetch_reset
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	add	x1, sp, #8
	mov	w2, #1
	mov	x3, x20
	bl	_dma_unmap_sg
LBB0_16:
	mov	w0, #0
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't DMA map a %d byte buffer\n"

	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_DMA_PREP_INTERRUPT,4,2         ; @DMA_PREP_INTERRUPT
	.comm	_DMA_CTRL_ACK,4,2               ; @DMA_CTRL_ACK
	.comm	_omap_nand_dma_callback,4,2     ; @omap_nand_dma_callback
	.comm	_PREFETCH_FIFOTHRESHOLD_MAX,4,2 ; @PREFETCH_FIFOTHRESHOLD_MAX
	.comm	_loops_per_jiffy,8,3            ; @loops_per_jiffy
	.comm	_OMAP_NAND_TIMEOUT_MS,4,2       ; @OMAP_NAND_TIMEOUT_MS
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
	.no_dead_strip	_omap_nand_dma_transfer
.subsections_via_symbols
