	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ingenic_nand_cmd_ctrl
_ingenic_nand_cmd_ctrl:                 ## @ingenic_nand_cmd_ctrl
	.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
	movl	%edx, %r15d
	movl	%esi, %r14d
	callq	_nand_to_mtd
	movl	%eax, %edi
	callq	_to_ingenic_nand
	movl	(%rax), %edi
	callq	_to_ingenic_nfc
	movq	%rax, %rbx
	xorl	%edi, %edi
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_7
## %bb.1:
	movq	24(%rbx), %r12
	movq	(%rbx), %r13
	movl	16(%rbx), %edi
	shlq	$4, %r13
	movl	8(%r12,%r13), %esi
	movq	_NAND_NCE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%r15d, %edx
	callq	_jz4780_nemc_assert
	movq	_NAND_CMD_NONE@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_2
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_NAND_ALE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_4
## %bb.3:
	movq	8(%rbx), %rax
	addq	$8, %rax
	jmp	LBB0_6
LBB0_4:
	movq	_NAND_CLE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_7
## %bb.5:
	movq	8(%rbx), %rax
LBB0_6:
	movq	(%rax), %rsi
	addq	(%r12,%r13), %rsi
	movl	%r14d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writeb                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_NCE,4,2                   ## @NAND_NCE
	.comm	_NAND_CMD_NONE,4,2              ## @NAND_CMD_NONE
	.comm	_NAND_ALE,4,2                   ## @NAND_ALE
	.comm	_NAND_CLE,4,2                   ## @NAND_CLE
	.no_dead_strip	_ingenic_nand_cmd_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ingenic_nand_cmd_ctrl
_ingenic_nand_cmd_ctrl:                 ; @ingenic_nand_cmd_ctrl
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x19, x1
	bl	_nand_to_mtd
	bl	_to_ingenic_nand
	ldr	w0, [x0]
	bl	_to_ingenic_nfc
	mov	x21, x0
	mov	w0, #0
	bl	_WARN_ON
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	x22, [x21, #24]
	ldr	x23, [x21]
	ldr	w0, [x21, #16]
	add	x8, x22, x23, lsl #4
	ldr	w1, [x8, #8]
Lloh0:
	adrp	x8, _NAND_NCE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_NCE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w2, w8, w20
	bl	_jz4780_nemc_assert
Lloh3:
	adrp	x8, _NAND_CMD_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_CMD_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_3
LBB0_2:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_3:
Lloh6:
	adrp	x8, _NAND_ALE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NAND_ALE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_5
; %bb.4:
	ldr	x8, [x21, #8]
	add	x8, x8, #8
	b	LBB0_7
LBB0_5:
Lloh9:
	adrp	x8, _NAND_CLE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NAND_CLE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_2
; %bb.6:
	ldr	x8, [x21, #8]
LBB0_7:
	lsl	x9, x23, #4
	ldr	x9, [x22, x9]
	ldr	x8, [x8]
	add	x1, x8, x9
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_writeb
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_NCE,4,2                   ; @NAND_NCE
	.comm	_NAND_CMD_NONE,4,2              ; @NAND_CMD_NONE
	.comm	_NAND_ALE,4,2                   ; @NAND_ALE
	.comm	_NAND_CLE,4,2                   ; @NAND_CLE
	.no_dead_strip	_ingenic_nand_cmd_ctrl
.subsections_via_symbols
