	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lpc32xx_waitfunc_controller
_lpc32xx_waitfunc_controller:           ## @lpc32xx_waitfunc_controller
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_nand_to_mtd
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_nand_get_controller_data
	movq	%rax, %rbx
	movl	(%rax), %edi
	callq	_MLC_ISR
	movl	%eax, %edi
	callq	_readb
	movq	_MLCISR_CONTROLLER_READY@GOTPCREL(%rip), %r12
	testl	%eax, (%r12)
	jne	LBB0_4
## %bb.1:
	movq	%rbx, %rdi
	addq	$4, %rdi
	callq	_wait_for_completion
	movl	(%rbx), %edi
	callq	_MLC_ISR
	movl	%eax, %edi
	callq	_readb
	testl	%eax, (%r12)
	jne	LBB0_4
## %bb.2:
	leaq	L_.str(%rip), %r15
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_dev_dbg
	xorl	%eax, %eax
	callq	_cpu_relax
	movl	(%rbx), %edi
	callq	_MLC_ISR
	movl	%eax, %edi
	callq	_readb
	testl	%eax, (%r12)
	je	LBB0_3
LBB0_4:
	movq	_NAND_STATUS_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLCISR_CONTROLLER_READY,4,2    ## @MLCISR_CONTROLLER_READY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Warning: Controller not ready.\n"

	.comm	_NAND_STATUS_READY,4,2          ## @NAND_STATUS_READY
	.no_dead_strip	_lpc32xx_waitfunc_controller
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lpc32xx_waitfunc_controller
_lpc32xx_waitfunc_controller:           ; @lpc32xx_waitfunc_controller
	.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	x20, x0
	bl	_nand_to_mtd
	mov	x19, x0
	mov	x0, x20
	bl	_nand_get_controller_data
	mov	x20, x0
	ldr	w0, [x0]
	bl	_MLC_ISR
	bl	_readb
Lloh0:
	adrp	x22, _MLCISR_CONTROLLER_READY@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MLCISR_CONTROLLER_READY@GOTPAGEOFF]
	ldr	w8, [x22]
	tst	w8, w0
	b.ne	LBB0_4
; %bb.1:
	add	x0, x20, #4
	bl	_wait_for_completion
	ldr	w0, [x20]
	bl	_MLC_ISR
	bl	_readb
	ldr	w8, [x22]
	tst	w8, w0
	b.ne	LBB0_4
; %bb.2:
Lloh2:
	adrp	x21, l_.str@PAGE
Lloh3:
	add	x21, x21, l_.str@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_dev_dbg
	bl	_cpu_relax
	ldr	w0, [x20]
	bl	_MLC_ISR
	bl	_readb
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_3
LBB0_4:
Lloh4:
	adrp	x8, _NAND_STATUS_READY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _NAND_STATUS_READY@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_MLCISR_CONTROLLER_READY,4,2    ; @MLCISR_CONTROLLER_READY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Warning: Controller not ready.\n"

	.comm	_NAND_STATUS_READY,4,2          ; @NAND_STATUS_READY
	.no_dead_strip	_lpc32xx_waitfunc_controller
.subsections_via_symbols
