	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lpc32xx_nand_setup
_lpc32xx_nand_setup:                    ## @lpc32xx_nand_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	%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, %r15
	movq	_MLCCMD_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	(%rdi), %edi
	callq	_MLC_CMD
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writel
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_udelay
	movl	16(%r15), %edi
	callq	_clk_get_rate
	movl	%eax, %r14d
	testl	%eax, %eax
	movl	$104000000, %eax                ## imm = 0x632EA00
	cmovel	%eax, %r14d
	movq	_MLCLOCKPR_MAGIC@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	movl	(%r15), %edi
	callq	_MLC_LOCK_PR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writew
	movq	_MLCICR_LARGEBLOCK@GOTPCREL(%rip), %rax
	movq	_MLCICR_LONGADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movl	(%r15), %edi
	callq	_MLC_ICR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writel
	movl	(%r12), %ebx
	movl	(%r15), %edi
	callq	_MLC_LOCK_PR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writew
	movq	8(%r15), %rcx
	movl	%r14d, %eax
	cltd
	idivl	(%rcx)
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %edi
	callq	_MLCTIMEREG_TCEA_DELAY
	movl	%eax, %r12d
	movq	8(%r15), %rcx
	movl	%r14d, %eax
	cltd
	idivl	4(%rcx)
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %edi
	callq	_MLCTIMEREG_BUSY_DELAY
	orl	%eax, %r12d
	movq	8(%r15), %rcx
	movl	%r14d, %eax
	cltd
	idivl	8(%rcx)
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %edi
	callq	_MLCTIMEREG_NAND_TA
	movl	%eax, %r13d
	movq	8(%r15), %rcx
	movl	%r14d, %eax
	cltd
	idivl	12(%rcx)
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %edi
	callq	_MLCTIMEREG_RD_HIGH
	orl	%eax, %r13d
	orl	%r12d, %r13d
	movq	8(%r15), %rcx
	movl	%r14d, %eax
	cltd
	idivl	16(%rcx)
	movl	%eax, %edi
	callq	_MLCTIMEREG_RD_LOW
	movl	%eax, %ebx
	movq	8(%r15), %rcx
	movl	%r14d, %eax
	cltd
	idivl	20(%rcx)
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %edi
	callq	_MLCTIMEREG_WR_HIGH
	orl	%eax, %ebx
	movq	8(%r15), %rcx
	movl	%r14d, %eax
	cltd
	idivl	24(%rcx)
	movl	%eax, %edi
	callq	_MLCTIMEREG_WR_LOW
	orl	%eax, %ebx
	orl	%r13d, %ebx
	movl	(%r15), %edi
	callq	_MLC_TIME_REG
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writel
	movq	_MLCIRQ_CONTROLLER_READY@GOTPCREL(%rip), %rax
	movq	_MLCIRQ_NAND_READY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movl	(%r15), %edi
	callq	_MLC_IRQ_MR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writeb
	movq	_MLCCEH_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	(%r15), %edi
	callq	_MLC_CEH
	movl	%ebx, %edi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MLCCMD_RESET,4,2               ## @MLCCMD_RESET
	.comm	_MLCLOCKPR_MAGIC,4,2            ## @MLCLOCKPR_MAGIC
	.comm	_MLCICR_LARGEBLOCK,4,2          ## @MLCICR_LARGEBLOCK
	.comm	_MLCICR_LONGADDR,4,2            ## @MLCICR_LONGADDR
	.comm	_MLCIRQ_CONTROLLER_READY,4,2    ## @MLCIRQ_CONTROLLER_READY
	.comm	_MLCIRQ_NAND_READY,4,2          ## @MLCIRQ_NAND_READY
	.comm	_MLCCEH_NORMAL,4,2              ## @MLCCEH_NORMAL
	.no_dead_strip	_lpc32xx_nand_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lpc32xx_nand_setup
_lpc32xx_nand_setup:                    ; @lpc32xx_nand_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
Lloh0:
	adrp	x8, _MLCCMD_RESET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLCCMD_RESET@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	ldr	w0, [x0]
	bl	_MLC_CMD
	mov	x1, x0
	mov	x0, x20
	bl	_writel
	mov	w0, #1000
	bl	_udelay
	ldr	w0, [x19, #16]
	bl	_clk_get_rate
	mov	w8, #59904
	movk	w8, #1586, lsl #16
	cmp	w0, #0
	csel	w21, w8, w0, eq
Lloh3:
	adrp	x22, _MLCLOCKPR_MAGIC@GOTPAGE
Lloh4:
	ldr	x22, [x22, _MLCLOCKPR_MAGIC@GOTPAGEOFF]
	ldr	w20, [x22]
	ldr	w0, [x19]
	bl	_MLC_LOCK_PR
	mov	x1, x0
	mov	x0, x20
	bl	_writew
Lloh5:
	adrp	x8, _MLCICR_LARGEBLOCK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MLCICR_LARGEBLOCK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _MLCICR_LONGADDR@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MLCICR_LONGADDR@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w20, w9, w8
	ldr	w0, [x19]
	bl	_MLC_ICR
	mov	x1, x0
	mov	x0, x20
	bl	_writel
	ldr	w20, [x22]
	ldr	w0, [x19]
	bl	_MLC_LOCK_PR
	mov	x1, x0
	mov	x0, x20
	bl	_writew
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	sdiv	w8, w21, w8
	add	w0, w8, #1
	bl	_MLCTIMEREG_TCEA_DELAY
	mov	x20, x0
	ldr	x8, [x19, #8]
	ldr	w8, [x8, #4]
	sdiv	w8, w21, w8
	add	w0, w8, #1
	bl	_MLCTIMEREG_BUSY_DELAY
	orr	w20, w0, w20
	ldr	x8, [x19, #8]
	ldr	w8, [x8, #8]
	sdiv	w8, w21, w8
	add	w0, w8, #1
	bl	_MLCTIMEREG_NAND_TA
	orr	w20, w20, w0
	ldr	x8, [x19, #8]
	ldr	w8, [x8, #12]
	sdiv	w8, w21, w8
	add	w0, w8, #1
	bl	_MLCTIMEREG_RD_HIGH
	orr	w20, w20, w0
	ldr	x8, [x19, #8]
	ldr	w8, [x8, #16]
	sdiv	w0, w21, w8
	bl	_MLCTIMEREG_RD_LOW
	orr	w20, w20, w0
	ldr	x8, [x19, #8]
	ldr	w8, [x8, #20]
	sdiv	w8, w21, w8
	add	w0, w8, #1
	bl	_MLCTIMEREG_WR_HIGH
	orr	w20, w20, w0
	ldr	x8, [x19, #8]
	ldr	w8, [x8, #24]
	sdiv	w0, w21, w8
	bl	_MLCTIMEREG_WR_LOW
	orr	w20, w20, w0
	ldr	w0, [x19]
	bl	_MLC_TIME_REG
	mov	x1, x0
	mov	x0, x20
	bl	_writel
Lloh11:
	adrp	x8, _MLCIRQ_CONTROLLER_READY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MLCIRQ_CONTROLLER_READY@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _MLCIRQ_NAND_READY@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MLCIRQ_NAND_READY@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w20, w9, w8
	ldr	w0, [x19]
	bl	_MLC_IRQ_MR
	mov	x1, x0
	mov	x0, x20
	bl	_writeb
Lloh17:
	adrp	x8, _MLCCEH_NORMAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MLCCEH_NORMAL@GOTPAGEOFF]
Lloh19:
	ldr	w20, [x8]
	ldr	w0, [x19]
	bl	_MLC_CEH
	mov	x1, x0
	mov	x0, x20
	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
	b	_writel
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MLCCMD_RESET,4,2               ; @MLCCMD_RESET
	.comm	_MLCLOCKPR_MAGIC,4,2            ; @MLCLOCKPR_MAGIC
	.comm	_MLCICR_LARGEBLOCK,4,2          ; @MLCICR_LARGEBLOCK
	.comm	_MLCICR_LONGADDR,4,2            ; @MLCICR_LONGADDR
	.comm	_MLCIRQ_CONTROLLER_READY,4,2    ; @MLCIRQ_CONTROLLER_READY
	.comm	_MLCIRQ_NAND_READY,4,2          ; @MLCIRQ_NAND_READY
	.comm	_MLCCEH_NORMAL,4,2              ; @MLCCEH_NORMAL
	.no_dead_strip	_lpc32xx_nand_setup
.subsections_via_symbols
