	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ns_nand_read_buf
_ns_nand_read_buf:                      ## @ns_nand_read_buf
	.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
	movq	(%rdi), %rax
	movq	8(%rax), %r15
	cmpl	$0, 72(%r15)
	je	LBB0_1
## %bb.3:
	cmpq	$0, 64(%r15)
	jne	LBB0_5
## %bb.4:
	cmpq	$0, 56(%r15)
	je	LBB0_6
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rdi
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_NS_ERR                         ## TAILCALL
LBB0_6:
	movq	%rdi, %r13
	movl	(%r15), %edi
	movq	_STATE_DATAOUT_MASK@GOTPCREL(%rip), %rax
	testl	%edi, (%rax)
	je	LBB0_20
## %bb.7:
	movl	%edx, %r12d
	movq	%rsi, %r14
	callq	_NS_STATE
	movq	_STATE_DATAOUT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.11:
	movq	16(%r15), %rsi
	movslq	%r12d, %rbx
	leaq	(%rsi,%rbx), %rax
	cmpq	24(%r15), %rax
	jle	LBB0_12
## %bb.21:
	leaq	L_.str.3(%rip), %rdi
	callq	_NS_ERR
	movq	%r15, %rdi
	callq	_NS_STATUS_FAILED
	movq	%r15, %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_switch_to_ready_state          ## TAILCALL
LBB0_20:
	callq	_get_state_name
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_NS_WARN                        ## TAILCALL
LBB0_8:
	testl	%r12d, %r12d
	jle	LBB0_19
## %bb.9:
	movl	%r12d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movq	%r13, %rdi
	callq	*(%rax)
	movl	%eax, (%r14,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_10
	jmp	LBB0_19
LBB0_12:
	movq	%rcx, %r13
	addq	48(%r15), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_memcpy
	addq	16(%r15), %rbx
	movq	%rbx, 16(%r15)
	cmpq	24(%r15), %rbx
	jne	LBB0_19
## %bb.13:
	movq	_OPT_AUTOINCR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r15)
	je	LBB0_18
## %bb.14:
	movl	(%r15), %edi
	callq	_NS_STATE
	cmpq	(%r13), %rax
	jne	LBB0_18
## %bb.15:
	movq	$0, 16(%r15)
	movq	32(%r15), %rsi
	leaq	1(%rsi), %rax
	cmpq	40(%r15), %rax
	jge	LBB0_17
## %bb.16:
	movq	%rax, 32(%r15)
	movq	%rax, %rsi
LBB0_17:
	leaq	L_.str.4(%rip), %rdi
	callq	_NS_DBG
	movq	_ACTION_CPY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_do_state_action                ## TAILCALL
LBB0_18:
	movl	8(%r15), %edi
	callq	_NS_STATE
	movq	_STATE_READY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.22:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_switch_state                   ## TAILCALL
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read_buf: chip is disabled\n"

L_.str.1:                               ## @.str.1
	.asciz	"read_buf: ALE or CLE pin is high\n"

	.comm	_STATE_DATAOUT_MASK,4,2         ## @STATE_DATAOUT_MASK
L_.str.2:                               ## @.str.2
	.asciz	"read_buf: unexpected data output cycle, current state is %s\n"

	.comm	_STATE_DATAOUT,8,3              ## @STATE_DATAOUT
L_.str.3:                               ## @.str.3
	.asciz	"read_buf: too many bytes to read\n"

	.comm	_OPT_AUTOINCR,4,2               ## @OPT_AUTOINCR
L_.str.4:                               ## @.str.4
	.asciz	"read_buf: switch to the next page (%#x)\n"

	.comm	_ACTION_CPY,4,2                 ## @ACTION_CPY
	.comm	_STATE_READY,8,3                ## @STATE_READY
	.no_dead_strip	_ns_nand_read_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ns_nand_read_buf
_ns_nand_read_buf:                      ; @ns_nand_read_buf
	.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
	ldr	x8, [x0]
	ldr	x19, [x8, #8]
	ldr	w8, [x19, #72]
	cbz	w8, LBB0_4
; %bb.1:
	ldr	x8, [x19, #64]
	cbnz	x8, LBB0_3
; %bb.2:
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_6
LBB0_3:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_4:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
LBB0_5:
	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	_NS_ERR
LBB0_6:
	mov	x21, x0
	ldr	w0, [x19]
Lloh4:
	adrp	x8, _STATE_DATAOUT_MASK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _STATE_DATAOUT_MASK@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_10
; %bb.7:
	mov	x22, x2
	mov	x20, x1
	bl	_NS_STATE
Lloh7:
	adrp	x23, _STATE_DATAOUT@GOTPAGE
Lloh8:
	ldr	x23, [x23, _STATE_DATAOUT@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.8:
	sxtw	x21, w22
	ldp	x8, x9, [x19, #16]
	add	x10, x8, x21
	cmp	x10, x9
	b.le	LBB0_14
; %bb.9:
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_NS_ERR
	mov	x0, x19
	bl	_NS_STATUS_FAILED
	mov	x1, x0
	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	_switch_to_ready_state
LBB0_10:
	bl	_get_state_name
	mov	x1, x0
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	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	_NS_WARN
LBB0_11:
	cmp	w22, #1
	b.lt	LBB0_22
; %bb.12:
	mov	w19, w22
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	x8, [x8]
	mov	x0, x21
	blr	x8
	str	w0, [x20], #4
	subs	x19, x19, #1
	b.ne	LBB0_13
	b	LBB0_22
LBB0_14:
	ldr	x9, [x19, #48]
	add	x1, x9, x8
	mov	x0, x20
	mov	x2, x22
	bl	_memcpy
	ldp	x8, x9, [x19, #16]
	add	x8, x8, x21
	cmp	x8, x9
	str	x8, [x19, #16]
	b.ne	LBB0_22
; %bb.15:
	ldr	w8, [x19, #4]
Lloh13:
	adrp	x9, _OPT_AUTOINCR@GOTPAGE
Lloh14:
	ldr	x9, [x9, _OPT_AUTOINCR@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.16:
	ldr	w0, [x19]
	bl	_NS_STATE
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_20
; %bb.17:
	str	xzr, [x19, #16]
	ldp	x1, x9, [x19, #32]
	add	x8, x1, #1
	cmp	x8, x9
	b.ge	LBB0_19
; %bb.18:
	str	x8, [x19, #32]
	mov	x1, x8
LBB0_19:
Lloh16:
	adrp	x0, l_.str.4@PAGE
Lloh17:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_NS_DBG
Lloh18:
	adrp	x8, _ACTION_CPY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ACTION_CPY@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	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	_do_state_action
LBB0_20:
	ldr	w0, [x19, #8]
	bl	_NS_STATE
Lloh21:
	adrp	x8, _STATE_READY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _STATE_READY@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_22
; %bb.21:
	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	_switch_state
LBB0_22:
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read_buf: chip is disabled\n"

l_.str.1:                               ; @.str.1
	.asciz	"read_buf: ALE or CLE pin is high\n"

	.comm	_STATE_DATAOUT_MASK,4,2         ; @STATE_DATAOUT_MASK
l_.str.2:                               ; @.str.2
	.asciz	"read_buf: unexpected data output cycle, current state is %s\n"

	.comm	_STATE_DATAOUT,8,3              ; @STATE_DATAOUT
l_.str.3:                               ; @.str.3
	.asciz	"read_buf: too many bytes to read\n"

	.comm	_OPT_AUTOINCR,4,2               ; @OPT_AUTOINCR
l_.str.4:                               ; @.str.4
	.asciz	"read_buf: switch to the next page (%#x)\n"

	.comm	_ACTION_CPY,4,2                 ; @ACTION_CPY
	.comm	_STATE_READY,8,3                ; @STATE_READY
	.no_dead_strip	_ns_nand_read_buf
.subsections_via_symbols
