	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spinand_read_from_cache_op
_spinand_read_from_cache_op:            ## @spinand_read_from_cache_op
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_spinand_to_nand
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_nanddev_to_mtd
	xorl	%r13d, %r13d
	cmpq	$0, 32(%r12)
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movq	8(%rbx), %rbx
	movq	%r14, %rdi
	callq	_nanddev_page_size
	movq	%rax, %r15
	jmp	LBB0_3
LBB0_1:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
LBB0_3:
	cmpq	$0, 16(%r12)
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_6
## %bb.4:
	movq	%r14, %rdi
	callq	_nanddev_per_page_oobsize
	addl	%eax, %r15d
	testq	%rbx, %rbx
	je	LBB0_5
LBB0_6:
	testl	%r15d, %r15d
	je	LBB0_12
LBB0_7:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	48(%rcx), %rcx
	movq	(%rax,%rcx,8), %r12
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%r15d, %edx
	movq	%rbx, %rcx
	callq	_spi_mem_dirmap_read
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	leal	-1(%r14), %eax
	cmpl	%r15d, %eax
	jae	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	addl	%r14d, %r13d
	movl	%r14d, %eax
	addq	%rax, %rbx
	subl	%r14d, %r15d
	jne	LBB0_8
	jmp	LBB0_12
LBB0_5:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rbx
	movq	%r14, %rdi
	callq	_nanddev_page_size
	movq	%rax, %r13
	testl	%r15d, %r15d
	jne	LBB0_7
LBB0_12:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	32(%rbx), %rdx
	testq	%rdx, %rdx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_14
## %bb.13:
	movl	40(%rbx), %edi
	movslq	(%rbx), %rsi
	addq	8(%r15), %rsi
	callq	_memcpy
LBB0_14:
	movq	16(%rbx), %r8
	xorl	%r14d, %r14d
	testq	%r8, %r8
	je	LBB0_18
## %bb.15:
	movq	8(%rbx), %rax
	movq	_MTD_OPS_AUTO_OOB@GOTPCREL(%rip), %rdi
	movl	28(%rbx), %esi
	movq	(%r15), %rdx
	movslq	24(%rbx), %rcx
	cmpq	(%rdi), %rax
	jne	LBB0_17
## %bb.16:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_mtd_ooblayout_get_databytes
	jmp	LBB0_18
LBB0_10:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_18
LBB0_17:
	addq	%rcx, %rdx
	movl	%esi, %edi
	movq	%rdx, %rsi
	movq	%r8, %rdx
	callq	_memcpy
LBB0_18:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_MTD_OPS_AUTO_OOB,8,3           ## @MTD_OPS_AUTO_OOB
	.no_dead_strip	_spinand_read_from_cache_op
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spinand_read_from_cache_op
_spinand_read_from_cache_op:            ; @spinand_read_from_cache_op
	.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	x19, x1
	mov	x20, x0
	bl	_spinand_to_nand
	mov	x24, x0
	bl	_nanddev_to_mtd
	mov	x21, x0
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x22, [x20, #8]
	mov	x0, x24
	bl	_nanddev_page_size
	mov	x23, x0
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_3
	b	LBB0_4
LBB0_2:
	mov	w23, #0
	mov	x22, #0
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_4
LBB0_3:
	mov	x0, x24
	bl	_nanddev_per_page_oobsize
	add	w23, w23, w0
	cbz	x22, LBB0_5
LBB0_4:
	mov	w24, #0
	cbnz	w23, LBB0_6
	b	LBB0_10
LBB0_5:
	ldr	x22, [x20]
	mov	x0, x24
	bl	_nanddev_page_size
	mov	x24, x0
	cbz	w23, LBB0_10
LBB0_6:
	ldr	x8, [x20, #16]
	ldr	x9, [x19, #48]
	ldr	x25, [x8, x9, lsl #3]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	mov	x1, x24
	mov	x2, x23
	mov	x3, x22
	bl	_spi_mem_dirmap_read
	tbnz	w0, #31, LBB0_18
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	sub	w8, w0, #1
	cmp	w8, w23
	b.hs	LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	add	w24, w0, w24
	add	x22, x22, w0, uxtw
	subs	w23, w23, w0
	b.ne	LBB0_7
LBB0_10:
	ldr	x2, [x19, #32]
	cbz	x2, LBB0_12
; %bb.11:
	ldr	w0, [x19, #40]
	ldr	x8, [x20, #8]
	ldrsw	x9, [x19]
	add	x1, x8, x9
	bl	_memcpy
LBB0_12:
	ldr	x4, [x19, #16]
	cbz	x4, LBB0_17
; %bb.13:
Lloh0:
	adrp	x8, _MTD_OPS_AUTO_OOB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTD_OPS_AUTO_OOB@GOTPAGEOFF]
	ldr	x9, [x19, #8]
Lloh2:
	ldr	x10, [x8]
	ldr	x2, [x20]
	ldp	w3, w8, [x19, #24]
                                        ; kill: def $w3 killed $w3 def $x3
	sxtw	x3, w3
	cmp	x9, x10
	b.ne	LBB0_16
; %bb.14:
	mov	x0, x21
	mov	x1, x8
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_mtd_ooblayout_get_databytes
	b	LBB0_17
LBB0_15:
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_18
LBB0_16:
	add	x1, x2, x3
	mov	x0, x8
	mov	x2, x4
	bl	_memcpy
LBB0_17:
	mov	w0, #0
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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_MTD_OPS_AUTO_OOB,8,3           ; @MTD_OPS_AUTO_OOB
	.no_dead_strip	_spinand_read_from_cache_op
.subsections_via_symbols
