	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gpio_nand_cmd_ctrl
_gpio_nand_cmd_ctrl:                    ## @gpio_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, %r15d
	movl	%esi, %r14d
	callq	_nand_to_mtd
	movl	%eax, %edi
	callq	_gpio_nand_getpriv
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_gpio_nand_dosync
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_4
## %bb.1:
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.2:
	movq	_NAND_NCE@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	movl	(%rax), %eax
	andl	%r15d, %eax
	sete	%sil
	callq	_gpiod_set_value
LBB0_3:
	movq	16(%rbx), %rdi
	movq	_NAND_CLE@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	movl	(%rax), %eax
	andl	%r15d, %eax
	setne	%sil
	callq	_gpiod_set_value
	movq	8(%rbx), %rdi
	movq	_NAND_ALE@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	andl	(%rax), %r15d
	setne	%sil
	callq	_gpiod_set_value
	movq	%rbx, %rdi
	callq	_gpio_nand_dosync
LBB0_4:
	movq	_NAND_CMD_NONE@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_6
## %bb.5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	(%rbx), %esi
	movl	%r14d, %edi
	callq	_writeb
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gpio_nand_dosync               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_CTRL_CHANGE,4,2           ## @NAND_CTRL_CHANGE
	.comm	_NAND_NCE,4,2                   ## @NAND_NCE
	.comm	_NAND_CLE,4,2                   ## @NAND_CLE
	.comm	_NAND_ALE,4,2                   ## @NAND_ALE
	.comm	_NAND_CMD_NONE,4,2              ## @NAND_CMD_NONE
	.no_dead_strip	_gpio_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 gpio_nand_cmd_ctrl
_gpio_nand_cmd_ctrl:                    ; @gpio_nand_cmd_ctrl
	.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	x21, x2
	mov	x19, x1
	bl	_nand_to_mtd
	bl	_gpio_nand_getpriv
	mov	x20, x0
	bl	_gpio_nand_dosync
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_4
; %bb.1:
	ldr	x0, [x20, #24]
	cbz	x0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _NAND_NCE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_NCE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w21
	cset	w1, eq
	bl	_gpiod_set_value
LBB0_3:
	ldr	x0, [x20, #16]
Lloh6:
	adrp	x8, _NAND_CLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NAND_CLE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w21
	cset	w1, ne
	bl	_gpiod_set_value
	ldr	x0, [x20, #8]
Lloh9:
	adrp	x8, _NAND_ALE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NAND_ALE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w21
	cset	w1, ne
	bl	_gpiod_set_value
	mov	x0, x20
	bl	_gpio_nand_dosync
LBB0_4:
Lloh12:
	adrp	x8, _NAND_CMD_NONE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NAND_CMD_NONE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_6
; %bb.5:
	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
LBB0_6:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_writeb
	mov	x0, x20
	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
	b	_gpio_nand_dosync
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_CTRL_CHANGE,4,2           ; @NAND_CTRL_CHANGE
	.comm	_NAND_NCE,4,2                   ; @NAND_NCE
	.comm	_NAND_CLE,4,2                   ; @NAND_CLE
	.comm	_NAND_ALE,4,2                   ; @NAND_ALE
	.comm	_NAND_CMD_NONE,4,2              ; @NAND_CMD_NONE
	.no_dead_strip	_gpio_nand_cmd_ctrl
.subsections_via_symbols
