	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gpmi_chain_command
_gpmi_chain_command:                    ## @gpmi_chain_command
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movl	%esi, -64(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_get_dma_chan
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	4(%r14), %r12d
	movq	_BV_GPMI_CTRL0_COMMAND_MODE__WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BF_GPMI_CTRL0_COMMAND_MODE
	movl	%eax, %r13d
	movq	_BM_GPMI_CTRL0_WORD_LENGTH@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
	movl	%r12d, %edi
	movq	%r14, %rsi
	callq	_BF_GPMI_CTRL0_CS
	movl	%eax, %r12d
	movq	_LOCK_CS_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_BF_GPMI_CTRL0_LOCK_CS
	movl	%eax, %ebx
	orl	%r12d, %ebx
	movq	_BV_GPMI_CTRL0_ADDRESS__NAND_CLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BF_GPMI_CTRL0_ADDRESS
	movl	%eax, %r15d
	orl	%ebx, %r15d
	orl	%r13d, %r15d
	movq	_BM_GPMI_CTRL0_ADDRESS_INCREMENT@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leal	1(%rax), %r12d
	movl	%r12d, %edi
	callq	_BF_GPMI_CTRL0_XFER_COUNT
	orl	%r15d, %eax
	movl	%eax, -60(%rbp)
	movq	$0, -56(%rbp)
	leaq	-60(%rbp), %r15
	movq	%r15, %rdi
	callq	_ARRAY_SIZE
	movq	_DMA_TRANS_NONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%ebx, %ebx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	%eax, %edx
	xorl	%r8d, %r8d
	callq	_mxs_dmaengine_prep_pio
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%r14, %rdi
	callq	_get_next_transfer
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r13
	movq	8(%rax), %rsi
	movl	-64(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rsi)
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	testl	%edx, %edx
	je	LBB0_5
## %bb.4:
	addq	$4, %rsi
	movq	%rsi, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movq	8(%r13), %rsi
LBB0_5:
	movq	%r13, %rdi
	movl	%r12d, %edx
	callq	_sg_init_one
	movl	(%r14), %edi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movq	%r13, %rsi
	movl	$1, %edx
	callq	_dma_map_sg
	movl	(%rbx), %eax
	movl	%eax, 4(%r13)
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_MXS_DMA_CTRL_WAIT4END@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	$1, %edx
	callq	_dmaengine_prep_slave_sg
	movq	%rax, %rbx
	jmp	LBB0_6
LBB0_2:
	xorl	%ebx, %ebx
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movq	%rbx, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BV_GPMI_CTRL0_COMMAND_MODE__WRITE,4,2 ## @BV_GPMI_CTRL0_COMMAND_MODE__WRITE
	.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_CLE,4,2 ## @BV_GPMI_CTRL0_ADDRESS__NAND_CLE
	.comm	_BM_GPMI_CTRL0_ADDRESS_INCREMENT,4,2 ## @BM_GPMI_CTRL0_ADDRESS_INCREMENT
	.comm	_DMA_TRANS_NONE,4,2             ## @DMA_TRANS_NONE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_MXS_DMA_CTRL_WAIT4END,4,2      ## @MXS_DMA_CTRL_WAIT4END
	.no_dead_strip	_gpmi_chain_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gpmi_chain_command
_gpmi_chain_command:                    ; @gpmi_chain_command
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_get_dma_chan
	mov	x19, x0
	ldr	w24, [x20, #4]
Lloh3:
	adrp	x8, _BV_GPMI_CTRL0_COMMAND_MODE__WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BV_GPMI_CTRL0_COMMAND_MODE__WRITE@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	w25, w8, w0
	mov	x0, x24
	mov	x1, x20
	bl	_BF_GPMI_CTRL0_CS
	orr	w24, w25, w0
Lloh9:
	adrp	x8, _LOCK_CS_ENABLE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LOCK_CS_ENABLE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_BF_GPMI_CTRL0_LOCK_CS
	orr	w24, w24, w0
Lloh12:
	adrp	x8, _BV_GPMI_CTRL0_ADDRESS__NAND_CLE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BV_GPMI_CTRL0_ADDRESS__NAND_CLE@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_BF_GPMI_CTRL0_ADDRESS
	orr	w8, w24, w0
Lloh15:
	adrp	x9, _BM_GPMI_CTRL0_ADDRESS_INCREMENT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _BM_GPMI_CTRL0_ADDRESS_INCREMENT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w25, w8, w9
	add	w24, w21, #1
	mov	x0, x24
	bl	_BF_GPMI_CTRL0_XFER_COUNT
	str	xzr, [sp, #16]
	orr	w8, w25, w0
	str	w8, [sp, #12]
	add	x0, sp, #12
	bl	_ARRAY_SIZE
	mov	x2, x0
Lloh18:
	adrp	x8, _DMA_TRANS_NONE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DMA_TRANS_NONE@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	add	x1, sp, #12
	mov	x0, x19
	mov	w4, #0
	bl	_mxs_dmaengine_prep_pio
	cbz	x0, LBB0_5
; %bb.1:
	mov	x0, x20
	bl	_get_next_transfer
	cbz	x0, LBB0_5
; %bb.2:
	mov	x25, x0
	ldr	x1, [x0, #8]
	str	w23, [x1]
	cbz	w21, LBB0_4
; %bb.3:
	add	x0, x1, #4
	mov	x1, x22
	mov	x2, x21
	bl	_memcpy
	ldr	x1, [x25, #8]
LBB0_4:
	mov	x0, x25
	mov	x2, x24
	bl	_sg_init_one
	ldr	w0, [x20]
Lloh21:
	adrp	x20, _DMA_TO_DEVICE@GOTPAGE
Lloh22:
	ldr	x20, [x20, _DMA_TO_DEVICE@GOTPAGEOFF]
	ldr	w3, [x20]
	mov	x1, x25
	mov	w2, #1
	bl	_dma_map_sg
	ldr	w8, [x20]
	str	w8, [x25, #4]
Lloh23:
	adrp	x8, _DMA_MEM_TO_DEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
Lloh26:
	adrp	x8, _MXS_DMA_CTRL_WAIT4END@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MXS_DMA_CTRL_WAIT4END@GOTPAGEOFF]
Lloh28:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x1, x25
	mov	w2, #1
	bl	_dmaengine_prep_slave_sg
LBB0_5:
	ldr	x8, [sp, #24]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.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
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_BV_GPMI_CTRL0_COMMAND_MODE__WRITE,4,2 ; @BV_GPMI_CTRL0_COMMAND_MODE__WRITE
	.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_CLE,4,2 ; @BV_GPMI_CTRL0_ADDRESS__NAND_CLE
	.comm	_BM_GPMI_CTRL0_ADDRESS_INCREMENT,4,2 ; @BM_GPMI_CTRL0_ADDRESS_INCREMENT
	.comm	_DMA_TRANS_NONE,4,2             ; @DMA_TRANS_NONE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_MXS_DMA_CTRL_WAIT4END,4,2      ; @MXS_DMA_CTRL_WAIT4END
	.no_dead_strip	_gpmi_chain_command
.subsections_via_symbols
