	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rb91x_nand_cmd_ctrl
_rb91x_nand_cmd_ctrl:                   ## @rb91x_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %r14d
	callq	_mtd_to_rbinfo
	movq	%rax, %r15
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_2
## %bb.1:
	movl	8(%r15), %edi
	movq	_NAND_CLE@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	movl	(%rax), %eax
	andl	%ebx, %eax
	setne	%sil
	callq	_gpio_set_value_cansleep
	movl	4(%r15), %edi
	movq	_NAND_ALE@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	movl	(%rax), %eax
	andl	%ebx, %eax
	setne	%sil
	callq	_gpio_set_value_cansleep
	movl	(%r15), %edi
	movq	_NAND_NCE@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	andl	(%rax), %ebx
	sete	%sil
	callq	_gpio_set_value_cansleep
LBB0_2:
	movq	_NAND_CMD_NONE@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	je	LBB0_4
## %bb.3:
	movl	%r14d, -28(%rbp)
	leaq	-28(%rbp), %rsi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_rb91x_nand_write
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_CTRL_CHANGE,4,2           ## @NAND_CTRL_CHANGE
	.comm	_NAND_CLE,4,2                   ## @NAND_CLE
	.comm	_NAND_ALE,4,2                   ## @NAND_ALE
	.comm	_NAND_NCE,4,2                   ## @NAND_NCE
	.comm	_NAND_CMD_NONE,4,2              ## @NAND_CMD_NONE
	.no_dead_strip	_rb91x_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 rb91x_nand_cmd_ctrl
_rb91x_nand_cmd_ctrl:                   ; @rb91x_nand_cmd_ctrl
	.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	x21, x2
	mov	x19, x1
	bl	_mtd_to_rbinfo
	mov	x20, x0
Lloh0:
	adrp	x8, _NAND_CTRL_CHANGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_CTRL_CHANGE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x20, #8]
Lloh3:
	adrp	x8, _NAND_CLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_CLE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w21
	cset	w1, ne
	bl	_gpio_set_value_cansleep
	ldr	w0, [x20, #4]
Lloh6:
	adrp	x8, _NAND_ALE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NAND_ALE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w21
	cset	w1, ne
	bl	_gpio_set_value_cansleep
	ldr	w0, [x20]
Lloh9:
	adrp	x8, _NAND_NCE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NAND_NCE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w21
	cset	w1, eq
	bl	_gpio_set_value_cansleep
LBB0_2:
Lloh12:
	adrp	x8, _NAND_CMD_NONE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NAND_CMD_NONE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w8, w19
	b.eq	LBB0_4
; %bb.3:
	str	w19, [sp, #12]
	add	x1, sp, #12
	mov	x0, x20
	mov	w2, #1
	bl	_rb91x_nand_write
LBB0_4:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_CTRL_CHANGE,4,2           ; @NAND_CTRL_CHANGE
	.comm	_NAND_CLE,4,2                   ; @NAND_CLE
	.comm	_NAND_ALE,4,2                   ; @NAND_ALE
	.comm	_NAND_NCE,4,2                   ; @NAND_NCE
	.comm	_NAND_CMD_NONE,4,2              ; @NAND_CMD_NONE
	.no_dead_strip	_rb91x_nand_cmd_ctrl
.subsections_via_symbols
