	.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, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r13d
	movq	%rdi, %r12
	movq	8(%rdi), %r15
	movq	_NAND_CTRL_CLE@GOTPCREL(%rip), %rax
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %r14
	movl	(%r14), %ebx
	orl	(%rax), %ebx
	cmpl	$129, %esi
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	jne	LBB0_5
## %bb.1:
	movl	(%r12), %eax
	cmpl	%r13d, %eax
	jle	LBB0_2
## %bb.3:
	leal	-256(%r13), %ecx
	cmpl	$256, %r13d                     ## imm = 0x100
	cmovll	%r13d, %ecx
	movq	_NAND_CMD_READ1@GOTPCREL(%rip), %rax
	cmovlq	_NAND_CMD_READ0@GOTPCREL(%rip), %rax
	movl	%ecx, %r13d
	jmp	LBB0_4
LBB0_2:
	subl	%eax, %r13d
	movq	_NAND_CMD_READOOB@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	*24(%r15)
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	notl	%eax
	andl	%eax, %ebx
	movl	-48(%rbp), %esi                 ## 4-byte Reload
LBB0_5:
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	*24(%r15)
	movq	_NAND_CTRL_ALE@GOTPCREL(%rip), %rax
	movl	(%r14), %ebx
	orl	(%rax), %ebx
	cmpl	$-1, %r13d
	je	LBB0_6
## %bb.7:
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r15), %eax
	setne	%cl
	sarl	%cl, %r13d
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	callq	*24(%r15)
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	notl	%eax
	andl	%eax, %ebx
	jmp	LBB0_8
LBB0_6:
	movq	%r14, %rcx
LBB0_8:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	cmpl	$-1, %r14d
	je	LBB0_11
## %bb.9:
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	*24(%r15)
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	notl	%r13d
	andl	%ebx, %r13d
	movl	%r14d, %esi
	sarl	$8, %esi
	movq	%r12, %rdi
	movl	%r13d, %edx
	callq	*24(%r15)
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %rcx
	cmpl	$33554433, 4(%r15)              ## imm = 0x2000001
	jl	LBB0_11
## %bb.10:
	sarl	$16, %r14d
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%r13d, %edx
	callq	*24(%r15)
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %rcx
LBB0_11:
	movq	_NAND_CMD_NONE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_NAND_NCE@GOTPCREL(%rip), %r13
	movl	(%rcx), %edx
	orl	(%r13), %edx
	movq	%r12, %rdi
	callq	*24(%r15)
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	addl	$-128, %eax
	cmpl	$5, %eax
	ja	LBB0_17
## %bb.12:
	cmpl	$2, %eax
	je	LBB0_13
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	cmpl	$0, 20(%r15)
	jne	LBB0_18
## %bb.19:
	movl	16(%r15), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_udelay                         ## TAILCALL
LBB0_13:
	cmpl	$0, 20(%r15)
	je	LBB0_14
LBB0_18:
	movl	$100, %edi
	callq	_ndelay
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nand_wait_ready                ## TAILCALL
LBB0_14:
	movl	16(%r15), %edi
	callq	_udelay
	movq	_NAND_CTRL_CHANGE@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	_NAND_CTRL_CLE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r12, %rdi
	movl	$128, %esi
	callq	*24(%r15)
	movl	(%rbx), %esi
	movl	(%r14), %edx
	orl	(%r13), %edx
	movq	%r12, %rdi
	callq	*24(%r15)
	movq	_NAND_STATUS_READY@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	*8(%r15)
	testl	%eax, (%rbx)
	je	LBB0_15
	jmp	LBB0_16
	.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_READ0,4,2             ## @NAND_CMD_READ0
	.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_CMD_NONE,4,2              ## @NAND_CMD_NONE
	.comm	_NAND_NCE,4,2                   ## @NAND_NCE
	.comm	_NAND_STATUS_READY,4,2          ## @NAND_STATUS_READY
	.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	x21, x3
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x24, [x0, #8]
Lloh0:
	adrp	x26, _NAND_CTRL_CLE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _NAND_CTRL_CLE@GOTPAGEOFF]
	ldr	w8, [x26]
Lloh2:
	adrp	x25, _NAND_CTRL_CHANGE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _NAND_CTRL_CHANGE@GOTPAGEOFF]
	ldr	w9, [x25]
	orr	w23, w9, w8
	cmp	w1, #129
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x19]
	subs	w9, w22, #256
Lloh4:
	adrp	x10, _NAND_CMD_READ1@GOTPAGE
Lloh5:
	ldr	x10, [x10, _NAND_CMD_READ1@GOTPAGEOFF]
	csel	w9, w22, w9, lt
Lloh6:
	adrp	x11, _NAND_CMD_READ0@GOTPAGE
Lloh7:
	ldr	x11, [x11, _NAND_CMD_READ0@GOTPAGEOFF]
	csel	x10, x11, x10, lt
Lloh8:
	adrp	x11, _NAND_CMD_READOOB@GOTPAGE
Lloh9:
	ldr	x11, [x11, _NAND_CMD_READOOB@GOTPAGEOFF]
	sub	w12, w22, w8
	cmp	w8, w22
	csel	w22, w9, w12, gt
	csel	x8, x10, x11, gt
	ldr	w1, [x8]
	ldr	x8, [x24, #24]
	mov	x0, x19
	mov	x2, x23
	blr	x8
	ldr	w8, [x25]
	bic	w23, w23, w8
LBB0_2:
	ldr	x8, [x24, #24]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	blr	x8
Lloh10:
	adrp	x8, _NAND_CTRL_ALE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _NAND_CTRL_ALE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [x25]
	orr	w23, w9, w8
	cmn	w22, #1
	b.eq	LBB0_4
; %bb.3:
Lloh13:
	adrp	x8, _NAND_BUSWIDTH_16@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NAND_BUSWIDTH_16@GOTPAGEOFF]
	ldr	w9, [x24]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w9
	cset	w8, ne
	asr	w1, w22, w8
	ldr	x8, [x24, #24]
	mov	x0, x19
	mov	x2, x23
	blr	x8
	ldr	w8, [x25]
	bic	w23, w23, w8
LBB0_4:
	cmn	w21, #1
	b.eq	LBB0_7
; %bb.5:
	ldr	x8, [x24, #24]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	blr	x8
	ldr	w8, [x25]
	bic	w22, w23, w8
	ldr	x8, [x24, #24]
	asr	w1, w21, #8
	mov	x0, x19
	mov	x2, x22
	blr	x8
	ldr	w8, [x24, #4]
	mov	w9, #1
	movk	w9, #512, lsl #16
	cmp	w8, w9
	b.lt	LBB0_7
; %bb.6:
	ldr	x8, [x24, #24]
	asr	w1, w21, #16
	mov	x0, x19
	mov	x2, x22
	blr	x8
LBB0_7:
	ldr	x8, [x24, #24]
Lloh16:
	adrp	x21, _NAND_CMD_NONE@GOTPAGE
Lloh17:
	ldr	x21, [x21, _NAND_CMD_NONE@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh18:
	adrp	x22, _NAND_NCE@GOTPAGE
Lloh19:
	ldr	x22, [x22, _NAND_NCE@GOTPAGEOFF]
	ldr	w9, [x22]
	ldr	w10, [x25]
	orr	w2, w10, w9
	mov	x0, x19
	blr	x8
	sub	w8, w20, #128
	cmp	w8, #5
	b.hi	LBB0_10
; %bb.8:
	cmp	w8, #2
	b.eq	LBB0_12
LBB0_9:
	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_10:
	ldr	w8, [x24, #20]
	cbnz	w8, LBB0_13
; %bb.11:
	ldr	w0, [x24, #16]
	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
LBB0_12:
	ldr	w8, [x24, #20]
	cbz	w8, LBB0_14
LBB0_13:
	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_14:
	ldr	w0, [x24, #16]
	bl	_udelay
	ldr	x8, [x24, #24]
	ldr	w9, [x26]
	ldr	w10, [x25]
	orr	w2, w10, w9
	mov	x0, x19
	mov	w1, #128
	blr	x8
	ldr	x8, [x24, #24]
	ldr	w1, [x21]
	ldr	w9, [x22]
	ldr	w10, [x25]
	orr	w2, w10, w9
	mov	x0, x19
	blr	x8
Lloh20:
	adrp	x20, _NAND_STATUS_READY@GOTPAGE
Lloh21:
	ldr	x20, [x20, _NAND_STATUS_READY@GOTPAGEOFF]
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24, #8]
	mov	x0, x19
	blr	x8
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_15
	b	LBB0_9
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.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_READ0,4,2             ; @NAND_CMD_READ0
	.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_CMD_NONE,4,2              ; @NAND_CMD_NONE
	.comm	_NAND_NCE,4,2                   ; @NAND_NCE
	.comm	_NAND_STATUS_READY,4,2          ; @NAND_STATUS_READY
	.no_dead_strip	_nand_command
.subsections_via_symbols
