	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nand_command
_nand_command:                          ## @nand_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r13
	callq	_nand_to_mtd
	movq	_NAND_CTRL_CLE@GOTPCREL(%rip), %rcx
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	cmpl	$135, %r15d
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	je	LBB0_10
## %bb.1:
	orl	(%rcx), %ebx
	cmpl	$130, %r15d
	jne	LBB0_2
## %bb.3:
	movl	(%rax), %eax
	movl	%r14d, %ecx
	cmpl	%r14d, %eax
	jle	LBB0_4
## %bb.5:
	movl	$133, %esi
	cmpl	$256, %ecx                      ## imm = 0x100
	jl	LBB0_8
## %bb.6:
	addl	$-256, %ecx
	movl	%ecx, %r14d
	movq	_NAND_CMD_READ1@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_2:
	movq	%rdx, %r12
	jmp	LBB0_9
LBB0_4:
	subl	%eax, %ecx
	movl	%ecx, %r14d
	movq	_NAND_CMD_READOOB@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %esi
LBB0_8:
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	*16(%r13)
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	notl	%eax
	andl	%eax, %ebx
LBB0_9:
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	*16(%r13)
	movl	(%r12), %ebx
	movq	%r12, %rdx
LBB0_10:
	movq	_NAND_CTRL_ALE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	cmpl	$-1, %r14d
	je	LBB0_11
## %bb.12:
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r13)
	je	LBB0_13
## %bb.14:
	movq	%rdx, %r12
	movl	%r15d, %edi
	callq	_nand_opcode_8bits
	movl	%r14d, %esi
	testl	%eax, %eax
	sete	%cl
	sarl	%cl, %esi
	jmp	LBB0_15
LBB0_11:
	movl	$-1, -44(%rbp)                  ## 4-byte Folded Spill
	jmp	LBB0_16
LBB0_13:
	movl	%r14d, %esi
	movq	%rdx, %r12
LBB0_15:
	movq	%r13, %rdi
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edx
	callq	*16(%r13)
	movl	(%r12), %eax
	notl	%eax
	andl	%eax, %ebx
LBB0_16:
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	cmpl	$-1, %r12d
	je	LBB0_19
## %bb.17:
	movq	%r13, %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	callq	*16(%r13)
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	notl	%r14d
	andl	%ebx, %r14d
	movl	%r12d, %esi
	sarl	$8, %esi
	movq	%r13, %rdi
	movl	%r14d, %edx
	callq	*16(%r13)
	movq	_NAND_ROW_ADDR_3@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r13)
	je	LBB0_19
## %bb.18:
	sarl	$16, %r12d
	movq	%r13, %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	callq	*16(%r13)
LBB0_19:
	movq	_NAND_NCE@GOTPCREL(%rip), %r14
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	orl	(%r14), %edx
	movq	%r13, %rdi
	movl	$135, %esi
	callq	*16(%r13)
	addl	$-128, %r15d
	cmpl	$9, %r15d
	ja	LBB0_25
## %bb.20:
	movl	$983, %eax                      ## imm = 0x3D7
	btl	%r15d, %eax
	jae	LBB0_21
LBB0_27:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	cmpl	$3, %r15d
	jne	LBB0_24
## %bb.22:
	cmpl	$0, 12(%r13)
	jne	LBB0_26
## %bb.23:
	movl	8(%r13), %edi
	callq	_udelay
	movl	(%rbx), %edx
	movq	_NAND_CTRL_CLE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r13, %rdi
	movl	$128, %esi
	callq	*16(%r13)
	movl	(%rbx), %edx
	orl	(%r14), %edx
	movq	%r13, %rdi
	movl	$135, %esi
	callq	*16(%r13)
	movq	%r13, %rdi
	movl	$250, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nand_wait_status_ready         ## TAILCALL
LBB0_24:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	andl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	cmpl	$-1, %eax
	je	LBB0_27
LBB0_25:
	cmpl	$0, 12(%r13)
	je	LBB0_28
LBB0_26:
	movl	$100, %edi
	callq	_ndelay
	movq	%r13, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nand_wait_ready                ## TAILCALL
LBB0_28:
	movl	8(%r13), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_udelay                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_CTRL_CLE,4,2              ## @NAND_CTRL_CLE
	.comm	_NAND_CTRL_CHANGE,4,2           ## @NAND_CTRL_CHANGE
	.comm	_NAND_CMD_READOOB,4,2           ## @NAND_CMD_READOOB
	.comm	_NAND_CMD_READ1,4,2             ## @NAND_CMD_READ1
	.comm	_NAND_CTRL_ALE,4,2              ## @NAND_CTRL_ALE
	.comm	_NAND_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
	.comm	_NAND_ROW_ADDR_3,4,2            ## @NAND_ROW_ADDR_3
	.comm	_NAND_NCE,4,2                   ## @NAND_NCE
	.no_dead_strip	_nand_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nand_command
_nand_command:                          ; @nand_command
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	bl	_nand_to_mtd
Lloh0:
	adrp	x25, _NAND_CTRL_CLE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _NAND_CTRL_CLE@GOTPAGEOFF]
Lloh2:
	adrp	x24, _NAND_CTRL_CHANGE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _NAND_CTRL_CHANGE@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w22, #135
	b.eq	LBB0_9
; %bb.1:
	ldr	w9, [x25]
	orr	w23, w8, w9
	cmp	w22, #130
	b.ne	LBB0_8
; %bb.2:
	ldr	w8, [x0]
	cmp	w8, w21
	b.le	LBB0_5
; %bb.3:
	subs	w8, w21, #256
	b.ge	LBB0_6
; %bb.4:
	mov	w1, #133
	b	LBB0_7
LBB0_5:
	sub	w21, w21, w8
Lloh4:
	adrp	x8, _NAND_CMD_READOOB@GOTPAGE
Lloh5:
	ldr	x8, [x8, _NAND_CMD_READOOB@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	b	LBB0_7
LBB0_6:
Lloh7:
	adrp	x9, _NAND_CMD_READ1@GOTPAGE
Lloh8:
	ldr	x9, [x9, _NAND_CMD_READ1@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x9]
	mov	x21, x8
LBB0_7:
	ldr	x8, [x19, #16]
	mov	x0, x19
	mov	x2, x23
	blr	x8
	ldr	w8, [x24]
	bic	w23, w23, w8
LBB0_8:
	ldr	x8, [x19, #16]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	blr	x8
	ldr	w8, [x24]
LBB0_9:
Lloh10:
	adrp	x9, _NAND_CTRL_ALE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _NAND_CTRL_ALE@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w23, w8, w9
	cmn	w21, #1
	b.eq	LBB0_13
; %bb.10:
	ldr	w8, [x19]
Lloh13:
	adrp	x9, _NAND_BUSWIDTH_16@GOTPAGE
Lloh14:
	ldr	x9, [x9, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
	mov	x0, x22
	bl	_nand_opcode_8bits
	cmp	w0, #0
	cset	w8, eq
	asr	w21, w21, w8
LBB0_12:
	ldr	x8, [x19, #16]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	blr	x8
	ldr	w8, [x24]
	bic	w23, w23, w8
LBB0_13:
	cmn	w20, #1
	b.eq	LBB0_16
; %bb.14:
	ldr	x8, [x19, #16]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	blr	x8
	ldr	w8, [x24]
	bic	w23, w23, w8
	ldr	x8, [x19, #16]
	asr	w1, w20, #8
	mov	x0, x19
	mov	x2, x23
	blr	x8
	ldr	w8, [x19]
Lloh16:
	adrp	x9, _NAND_ROW_ADDR_3@GOTPAGE
Lloh17:
	ldr	x9, [x9, _NAND_ROW_ADDR_3@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.15:
	ldr	x8, [x19, #16]
	asr	w1, w20, #16
	mov	x0, x19
	mov	x2, x23
	blr	x8
LBB0_16:
	ldr	x8, [x19, #16]
Lloh19:
	adrp	x23, _NAND_NCE@GOTPAGE
Lloh20:
	ldr	x23, [x23, _NAND_NCE@GOTPAGEOFF]
	ldr	w9, [x23]
	ldr	w10, [x24]
	orr	w2, w10, w9
	mov	x0, x19
	mov	w1, #135
	blr	x8
	sub	w8, w22, #128
	cmp	w8, #9
	b.hi	LBB0_23
; %bb.17:
	mov	w9, #1
	lsl	w9, w9, w8
	mov	w10, #983
	tst	w9, w10
	b.eq	LBB0_19
LBB0_18:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_19:
	cmp	w8, #3
	b.ne	LBB0_22
; %bb.20:
	ldr	w8, [x19, #12]
	cbnz	w8, LBB0_24
; %bb.21:
	ldr	w0, [x19, #8]
	bl	_udelay
	ldr	x8, [x19, #16]
	ldr	w9, [x25]
	ldr	w10, [x24]
	orr	w2, w10, w9
	mov	x0, x19
	mov	w1, #128
	blr	x8
	ldr	x8, [x19, #16]
	ldr	w9, [x23]
	ldr	w10, [x24]
	orr	w2, w10, w9
	mov	x0, x19
	mov	w1, #135
	blr	x8
	mov	x0, x19
	mov	w1, #250
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_nand_wait_status_ready
LBB0_22:
	and	w8, w21, w20
	cmn	w8, #1
	b.eq	LBB0_18
LBB0_23:
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_25
LBB0_24:
	mov	w0, #100
	bl	_ndelay
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_nand_wait_ready
LBB0_25:
	ldr	w0, [x19, #8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_udelay
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_CTRL_CLE,4,2              ; @NAND_CTRL_CLE
	.comm	_NAND_CTRL_CHANGE,4,2           ; @NAND_CTRL_CHANGE
	.comm	_NAND_CMD_READOOB,4,2           ; @NAND_CMD_READOOB
	.comm	_NAND_CMD_READ1,4,2             ; @NAND_CMD_READ1
	.comm	_NAND_CTRL_ALE,4,2              ; @NAND_CTRL_ALE
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
	.comm	_NAND_ROW_ADDR_3,4,2            ; @NAND_ROW_ADDR_3
	.comm	_NAND_NCE,4,2                   ; @NAND_NCE
	.no_dead_strip	_nand_command
.subsections_via_symbols
