	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lpc32xx_dma_setup
_lpc32xx_dma_setup:                     ## @lpc32xx_dma_setup
	.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	%rdi, %rbx
	addq	$80, %rdi
	callq	_nand_to_mtd
	movq	%rax, %r14
	movq	72(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	cmpl	$0, (%rax)
	je	LBB0_2
## %bb.3:
	callq	_dma_cap_zero
	movq	_DMA_SLAVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_dma_cap_set
	movq	72(%rbx), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	callq	_dma_request_channel
	movl	%eax, (%rbx)
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	8(%rbx), %r15
	movl	%eax, 56(%rbx)
	movq	_DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 48(%rbx)
	movq	%rax, 40(%rbx)
	movabsq	$549755814016, %rax             ## imm = 0x8000000080
	movq	%rax, 8(%rbx)
	movl	$0, 16(%rbx)
	movl	64(%rbx), %edi
	callq	_MLC_BUFF
	movq	%rax, 32(%rbx)
	movl	64(%rbx), %edi
	callq	_MLC_BUFF
	movq	%rax, 24(%rbx)
	movl	(%rbx), %edi
	movq	%r15, %rsi
	callq	_dmaengine_slave_config
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	movl	(%rbx), %edi
	callq	_dma_release_channel
	movq	_ENXIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_8
LBB0_2:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENOENT@GOTPCREL(%rip), %rcx
LBB0_8:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_8
LBB0_6:
	xorl	%eax, %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no DMA platform data\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_DMA_SLAVE,4,2                  ## @DMA_SLAVE
L_.str.1:                               ## @.str.1
	.asciz	"nand-mlc"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to request DMA channel\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_DMA_SLAVE_BUSWIDTH_4_BYTES,8,3 ## @DMA_SLAVE_BUSWIDTH_4_BYTES
L_.str.3:                               ## @.str.3
	.asciz	"Failed to setup DMA slave\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_lpc32xx_dma_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lpc32xx_dma_setup
_lpc32xx_dma_setup:                     ; @lpc32xx_dma_setup
	.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	x19, x0
	add	x0, x0, #80
	bl	_nand_to_mtd
	mov	x20, x0
	ldr	x8, [x19, #72]
	cbz	x8, LBB0_5
; %bb.1:
	ldr	w8, [x8]
	cbz	w8, LBB0_5
; %bb.2:
	bl	_dma_cap_zero
Lloh0:
	adrp	x8, _DMA_SLAVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_SLAVE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_dma_cap_set
	ldr	x8, [x19, #72]
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str.1@PAGE
Lloh4:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_dma_request_channel
	str	w0, [x19]
	cbz	w0, LBB0_6
; %bb.3:
Lloh5:
	adrp	x8, _DMA_DEV_TO_MEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DMA_DEV_TO_MEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19, #56]
Lloh8:
	adrp	x8, _DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	stp	x8, x8, [x19, #40]
	movi.2s	v0, #128
	mov	x21, x19
	str	d0, [x21, #8]!
	str	wzr, [x19, #16]
	ldr	w0, [x19, #64]
	bl	_MLC_BUFF
	str	x0, [x19, #32]
	ldr	w0, [x19, #64]
	bl	_MLC_BUFF
	str	x0, [x19, #24]
	ldr	w0, [x19]
	mov	x1, x21
	bl	_dmaengine_slave_config
	cbz	x0, LBB0_8
; %bb.4:
	ldr	w0, [x20]
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	ldr	w0, [x19]
	bl	_dma_release_channel
Lloh13:
	adrp	x8, _ENXIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
	ldr	w0, [x20]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh17:
	adrp	x8, _ENOENT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
	ldr	w0, [x20]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh21:
	adrp	x8, _EBUSY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no DMA platform data\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_DMA_SLAVE,4,2                  ; @DMA_SLAVE
l_.str.1:                               ; @.str.1
	.asciz	"nand-mlc"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to request DMA channel\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_DMA_SLAVE_BUSWIDTH_4_BYTES,8,3 ; @DMA_SLAVE_BUSWIDTH_4_BYTES
l_.str.3:                               ; @.str.3
	.asciz	"Failed to setup DMA slave\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_lpc32xx_dma_setup
.subsections_via_symbols
