	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gpmi_chain_wait_ready
_gpmi_chain_wait_ready:                 ## @gpmi_chain_wait_ready
	.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
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_get_dma_chan
	movq	%rax, %r14
	movq	_BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BF_GPMI_CTRL0_COMMAND_MODE
	movl	%eax, %r15d
	movq	_BM_GPMI_CTRL0_WORD_LENGTH@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movl	(%rbx), %edi
	movq	%rbx, %rsi
	callq	_BF_GPMI_CTRL0_CS
	movl	%eax, %r12d
	movq	_LOCK_CS_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_BF_GPMI_CTRL0_LOCK_CS
	movl	%eax, %r13d
	orl	%r12d, %r13d
	movq	_BV_GPMI_CTRL0_ADDRESS__NAND_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BF_GPMI_CTRL0_ADDRESS
	movl	%eax, %ebx
	orl	%r13d, %ebx
	xorl	%edi, %edi
	callq	_BF_GPMI_CTRL0_XFER_COUNT
	orl	%ebx, %eax
	orl	%r15d, %eax
	movl	%eax, -56(%rbp)
	movl	$0, -52(%rbp)
	movq	_DMA_TRANS_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_MXS_DMA_CTRL_WAIT4END@GOTPCREL(%rip), %rax
	movq	_MXS_DMA_CTRL_WAIT4RDY@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	orl	(%rax), %r8d
	leaq	-56(%rbp), %rsi
	movq	%r14, %rdi
	movl	$2, %edx
	callq	_mxs_dmaengine_prep_pio
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_2
## %bb.1:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY,4,2 ## @BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY
	.comm	_BM_GPMI_CTRL0_WORD_LENGTH,4,2  ## @BM_GPMI_CTRL0_WORD_LENGTH
	.comm	_LOCK_CS_ENABLE,4,2             ## @LOCK_CS_ENABLE
	.comm	_BV_GPMI_CTRL0_ADDRESS__NAND_DATA,4,2 ## @BV_GPMI_CTRL0_ADDRESS__NAND_DATA
	.comm	_DMA_TRANS_NONE,4,2             ## @DMA_TRANS_NONE
	.comm	_MXS_DMA_CTRL_WAIT4END,4,2      ## @MXS_DMA_CTRL_WAIT4END
	.comm	_MXS_DMA_CTRL_WAIT4RDY,4,2      ## @MXS_DMA_CTRL_WAIT4RDY
	.no_dead_strip	_gpmi_chain_wait_ready
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gpmi_chain_wait_ready
_gpmi_chain_wait_ready:                 ; @gpmi_chain_wait_ready
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	bl	_get_dma_chan
	mov	x20, x0
Lloh3:
	adrp	x8, _BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_BF_GPMI_CTRL0_COMMAND_MODE
Lloh6:
	adrp	x8, _BM_GPMI_CTRL0_WORD_LENGTH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BM_GPMI_CTRL0_WORD_LENGTH@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	orr	w21, w8, w0
	ldr	w0, [x19]
	mov	x1, x19
	bl	_BF_GPMI_CTRL0_CS
	orr	w21, w21, w0
Lloh9:
	adrp	x8, _LOCK_CS_ENABLE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LOCK_CS_ENABLE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_BF_GPMI_CTRL0_LOCK_CS
	orr	w19, w21, w0
Lloh12:
	adrp	x8, _BV_GPMI_CTRL0_ADDRESS__NAND_DATA@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BV_GPMI_CTRL0_ADDRESS__NAND_DATA@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_BF_GPMI_CTRL0_ADDRESS
	orr	w19, w19, w0
	mov	w0, #0
	bl	_BF_GPMI_CTRL0_XFER_COUNT
	orr	w8, w19, w0
	stp	w8, wzr, [sp]
Lloh15:
	adrp	x8, _DMA_TRANS_NONE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DMA_TRANS_NONE@GOTPAGEOFF]
Lloh17:
	adrp	x9, _MXS_DMA_CTRL_WAIT4END@GOTPAGE
Lloh18:
	ldr	x9, [x9, _MXS_DMA_CTRL_WAIT4END@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
Lloh20:
	ldr	w8, [x9]
Lloh21:
	adrp	x9, _MXS_DMA_CTRL_WAIT4RDY@GOTPAGE
Lloh22:
	ldr	x9, [x9, _MXS_DMA_CTRL_WAIT4RDY@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w4, w9, w8
	mov	x1, sp
	mov	x0, x20
	mov	w2, #2
	bl	_mxs_dmaengine_prep_pio
	ldr	x8, [sp, #8]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_2:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY,4,2 ; @BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY
	.comm	_BM_GPMI_CTRL0_WORD_LENGTH,4,2  ; @BM_GPMI_CTRL0_WORD_LENGTH
	.comm	_LOCK_CS_ENABLE,4,2             ; @LOCK_CS_ENABLE
	.comm	_BV_GPMI_CTRL0_ADDRESS__NAND_DATA,4,2 ; @BV_GPMI_CTRL0_ADDRESS__NAND_DATA
	.comm	_DMA_TRANS_NONE,4,2             ; @DMA_TRANS_NONE
	.comm	_MXS_DMA_CTRL_WAIT4END,4,2      ; @MXS_DMA_CTRL_WAIT4END
	.comm	_MXS_DMA_CTRL_WAIT4RDY,4,2      ; @MXS_DMA_CTRL_WAIT4RDY
	.no_dead_strip	_gpmi_chain_wait_ready
.subsections_via_symbols
