	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_eraseblock_by_page
_read_eraseblock_by_page:               ## @read_eraseblock_by_page
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_pgcnt@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_1
## %bb.2:
	movl	%edi, %r14d
	movq	_iobuf1@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_iobuf@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	_mtd@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	imull	(%rax), %r14d
	movq	_pgsize@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_mtd@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addq	8(%rax), %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_pgsize@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rdx
	addl	%edx, %r14d
	addq	%rdx, %r13
	incl	%r15d
	movl	%ebx, %r12d
	movq	_pgcnt@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jge	LBB0_11
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	xorl	%esi, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	movq	%rcx, %rbx
	callq	_memset
	movq	_mtd@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	(%rbx), %edx
	movl	%r14d, %esi
	movq	%r13, %rcx
	callq	_mtdtest_read
	testl	%r12d, %r12d
	movl	%eax, %ebx
	cmovnel	%r12d, %ebx
	testl	%eax, %eax
	cmovel	%r12d, %ebx
	movq	_mtd@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_MTD_OPS_PLACE_OOB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -56(%rbp)
	leaq	-72(%rbp), %rcx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rcx)
	movq	%rax, -112(%rbp)
	movq	$0, -104(%rbp)
	movups	%xmm0, -16(%rcx)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, -96(%rbp)
	movl	%r14d, %esi
	leaq	-112(%rbp), %rdx
	callq	_mtd_read_oob
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r12d, %edi
	callq	_mtd_is_bitflip
	testl	%eax, %eax
	je	LBB0_7
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-104(%rbp), %rax
	movq	_mtd@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	8(%rcx), %rax
	je	LBB0_9
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movslq	%r14d, %rsi
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	testl	%ebx, %ebx
	cmovel	%r12d, %ebx
	testl	%ebx, %ebx
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ebx, %ebx
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_1:
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mtd,8,3                        ## @mtd
	.comm	_iobuf,8,3                      ## @iobuf
	.comm	_iobuf1,8,3                     ## @iobuf1
	.comm	_pgcnt,4,2                      ## @pgcnt
	.comm	_pgsize,4,2                     ## @pgsize
	.comm	_MTD_OPS_PLACE_OOB,4,2          ## @MTD_OPS_PLACE_OOB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error: read oob failed at %#llx\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_read_eraseblock_by_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_eraseblock_by_page
_read_eraseblock_by_page:               ; @read_eraseblock_by_page
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, _pgcnt@GOTPAGE
Lloh1:
	ldr	x8, [x8, _pgcnt@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.1:
	mov	w19, #0
	mov	w25, #0
Lloh3:
	adrp	x8, _iobuf1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _iobuf1@GOTPAGEOFF]
Lloh5:
	ldr	x26, [x8]
Lloh6:
	adrp	x8, _iobuf@GOTPAGE
Lloh7:
	ldr	x8, [x8, _iobuf@GOTPAGEOFF]
Lloh8:
	ldr	x20, [x8]
Lloh9:
	adrp	x27, _mtd@GOTPAGE
Lloh10:
	ldr	x27, [x27, _mtd@GOTPAGEOFF]
	ldr	x8, [x27]
	ldr	w8, [x8]
	mul	w21, w8, w0
	mov	x8, sp
	add	x28, x8, #40
	add	x22, x8, #24
Lloh11:
	adrp	x24, _pgsize@GOTPAGE
Lloh12:
	ldr	x24, [x24, _pgsize@GOTPAGEOFF]
	ldr	w2, [x24]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x27]
	ldr	x8, [x8, #8]
	add	x26, x26, x8
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldrsw	x2, [x24]
	add	w21, w2, w21
	add	x20, x20, x2
	add	w25, w25, #1
Lloh13:
	adrp	x8, _pgcnt@GOTPAGE
Lloh14:
	ldr	x8, [x8, _pgcnt@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w25, w8
	b.ge	LBB0_11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	w1, #0
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memset
	ldr	x0, [x27]
	ldr	w2, [x24]
	mov	x1, x21
	mov	x3, x20
	bl	_mtdtest_read
	cmp	w19, #0
	ccmp	w0, #0, #4, eq
	csel	w19, w19, w0, eq
	ldr	x0, [x27]
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh16:
	adrp	x9, _MTD_OPS_PLACE_OOB@GOTPAGE
Lloh17:
	ldr	x9, [x9, _MTD_OPS_PLACE_OOB@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	str	w9, [sp, #56]
	stp	xzr, xzr, [x28]
	stp	x8, xzr, [sp]
	stp	xzr, xzr, [x22]
	str	x26, [sp, #16]
	mov	x2, sp
	mov	x1, x21
	bl	_mtd_read_oob
	mov	x23, x0
	cbz	w0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x23
	bl	_mtd_is_bitflip
	cbz	w0, LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #8]
	ldr	x9, [x27]
	ldr	x9, [x9, #8]
	cmp	x8, x9
	b.eq	LBB0_2
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	sxtw	x1, w21
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	cmp	w19, #0
	csel	w19, w23, w19, eq
	cbnz	w19, LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_2
LBB0_10:
	mov	w19, #0
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_mtd,8,3                        ; @mtd
	.comm	_iobuf,8,3                      ; @iobuf
	.comm	_iobuf1,8,3                     ; @iobuf1
	.comm	_pgcnt,4,2                      ; @pgcnt
	.comm	_pgsize,4,2                     ; @pgsize
	.comm	_MTD_OPS_PLACE_OOB,4,2          ; @MTD_OPS_PLACE_OOB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error: read oob failed at %#llx\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_read_eraseblock_by_page
.subsections_via_symbols
