	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmnand_dma_trans
_brcmnand_dma_trans:                    ## @brcmnand_dma_trans
	.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
	movl	%r8d, %r15d
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	movq	_CMD_PAGE_READ@GOTPCREL(%rip), %rax
	cmpl	%r8d, (%rax)
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	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), %r12d
	movl	8(%r14), %edi
	movq	%rdx, %rsi
	movl	%ecx, %edx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%r12d, %ecx
	callq	_dma_map_single
	movl	%eax, %r13d
	movl	8(%r14), %edi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_5:
	movq	(%r14), %rsi
	subq	$8, %rsp
	movq	%rbx, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	%r15d, %r9d
	pushq	$0
	pushq	$1
	pushq	$1
	callq	_brcmnand_fill_dma_desc
	addq	$32, %rsp
	movl	12(%r14), %esi
	movq	%rbx, %rdi
	callq	_brcmnand_dma_run
	movl	8(%r14), %edi
	movl	%r13d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r12d, %ecx
	callq	_dma_unmap_single
	movq	(%r14), %rax
	movl	(%rax), %eax
	movq	_FLASH_DMA_ECC_ERROR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	movq	_EBADMSG@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_7:
	movq	_FLASH_DMA_CORR_ERROR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.9:
	movq	_EUCLEAN@GOTPCREL(%rip), %rcx
LBB0_10:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_PAGE_READ,4,2              ## @CMD_PAGE_READ
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to map buffer for DMA\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_FLASH_DMA_ECC_ERROR,4,2        ## @FLASH_DMA_ECC_ERROR
	.comm	_EBADMSG,4,2                    ## @EBADMSG
	.comm	_FLASH_DMA_CORR_ERROR,4,2       ## @FLASH_DMA_CORR_ERROR
	.comm	_EUCLEAN,4,2                    ## @EUCLEAN
	.no_dead_strip	_brcmnand_dma_trans
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmnand_dma_trans
_brcmnand_dma_trans:                    ; @brcmnand_dma_trans
	.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	x22, x4
	mov	x19, x3
	mov	x23, x1
	mov	x20, x0
	ldr	x25, [x0]
Lloh0:
	adrp	x8, _CMD_PAGE_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CMD_PAGE_READ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _DMA_FROM_DEVICE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh5:
	adrp	x10, _DMA_TO_DEVICE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _DMA_TO_DEVICE@GOTPAGEOFF]
	cmp	w8, w4
	csel	x8, x9, x10, eq
	ldr	w21, [x8]
	ldr	w0, [x25, #8]
	mov	x1, x2
	mov	x2, x3
	mov	x3, x21
	bl	_dma_map_single
	mov	x24, x0
	ldr	w0, [x25, #8]
	mov	x1, x24
	bl	_dma_mapping_error
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x25, #8]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:
	ldr	x1, [x25]
	str	wzr, [sp]
	mov	x0, x20
	mov	x2, x23
	mov	x3, x24
	mov	x4, x19
	mov	x5, x22
	mov	w6, #1
	mov	w7, #1
	bl	_brcmnand_fill_dma_desc
	ldr	w1, [x25, #12]
	mov	x0, x20
	bl	_brcmnand_dma_run
	ldr	w0, [x25, #8]
	mov	x1, x24
	mov	x2, x19
	mov	x3, x21
	bl	_dma_unmap_single
	ldr	x8, [x25]
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _FLASH_DMA_ECC_ERROR@GOTPAGE
Lloh12:
	ldr	x9, [x9, _FLASH_DMA_ECC_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh14:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
Lloh16:
	adrp	x9, _FLASH_DMA_CORR_ERROR@GOTPAGE
Lloh17:
	ldr	x9, [x9, _FLASH_DMA_CORR_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.5:
Lloh19:
	adrp	x8, _EUCLEAN@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EUCLEAN@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
LBB0_8:
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_PAGE_READ,4,2              ; @CMD_PAGE_READ
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to map buffer for DMA\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_FLASH_DMA_ECC_ERROR,4,2        ; @FLASH_DMA_ECC_ERROR
	.comm	_EBADMSG,4,2                    ; @EBADMSG
	.comm	_FLASH_DMA_CORR_ERROR,4,2       ; @FLASH_DMA_CORR_ERROR
	.comm	_EUCLEAN,4,2                    ; @EUCLEAN
	.no_dead_strip	_brcmnand_dma_trans
.subsections_via_symbols
