	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_page_ecc
_read_page_ecc:                         ## @read_page_ecc
	.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
	movl	%ecx, -68(%rbp)                 ## 4-byte Spill
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	addq	$16, %rdi
	movq	%rdi, -112(%rbp)                ## 8-byte Spill
	callq	_get_qcom_nand_controller
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_config_nand_page_read
	movl	16(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_22
## %bb.1:
	leaq	4(%r12), %rcx
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	movslq	%r13d, %r14
	xorl	%eax, %eax
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_21:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	leaq	(%rcx,%r14,4), %rcx
	testb	%dl, %dl
	movl	$0, %esi
	cmoveq	%rcx, %rsi
	testq	%rax, %rax
	leaq	(%rax,%r13,4), %r15
	cmoveq	%rax, %r15
	incl	%ebx
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movl	(%rax), %eax
	cmpl	%eax, %ebx
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	jge	LBB0_22
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_19 Depth 2
	leal	-1(%rax), %ecx
	cmpl	%ecx, %ebx
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	20(%r12), %r13d
	leal	(,%rbx,4), %ecx
	subl	%ecx, %r13d
	shll	$2, %eax
	addl	(%r12), %eax
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r12), %eax
	movl	8(%r12), %r13d
	movq	%r12, %rcx
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movslq	(%rcx), %rcx
	movslq	%eax, %rdx
	addq	%rcx, %rdx
	movq	8(%r14), %rax
	cmpq	$0, (%rax)
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	testq	%rsi, %rsi
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	testq	%r15, %r15
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	%r13d, %ecx
	xorl	%r8d, %r8d
	callq	_nandc_set_read_loc
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%r13d, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_config_nand_cw_read
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	jne	LBB0_12
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	testq	%rsi, %rsi
	je	LBB0_24
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	%r13d, %ecx
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %r8d
	callq	_nandc_set_read_loc
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_config_nand_cw_read
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_FLASH_BUF_ACC@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%r14, %rdi
	movl	%r13d, %ecx
	xorl	%r8d, %r8d
	callq	_read_data_dma
	testq	%r15, %r15
	jne	LBB0_17
	jmp	LBB0_16
LBB0_24:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%esi, %esi
	movl	%r13d, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	$1, %r8d
	callq	_nandc_set_read_loc
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_config_nand_cw_read
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movb	$1, %al
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testq	%r15, %r15
	je	LBB0_16
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, 12(%r12)
	jle	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_19:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	$255, (%r15)
	addq	$4, %r15
	incl	%eax
	cmpl	12(%r12), %eax
	jl	LBB0_19
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	movslq	%r13d, %r14
	movq	_FLASH_BUF_ACC@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r14, %rsi
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rdx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	%r13d, %ecx
	xorl	%r8d, %r8d
	callq	_read_data_dma
	movq	%r15, %rax
	jmp	LBB0_21
LBB0_22:
	movq	%r14, %rdi
	callq	_submit_descs
	movq	%r14, %r15
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_free_descs
	testl	%r14d, %r14d
	je	LBB0_23
## %bb.25:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movl	%r14d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	movq	%r12, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_parse_read_errors              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FLASH_BUF_ACC,8,3              ## @FLASH_BUF_ACC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failure to read page/oob\n"

	.no_dead_strip	_read_page_ecc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_page_ecc
_read_page_ecc:                         ; @read_page_ecc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	str	w3, [sp, #4]                    ; 4-byte Folded Spill
	stp	x1, x2, [sp, #8]                ; 16-byte Folded Spill
	mov	x22, x0
	add	x24, x0, #16
	mov	x0, x24
	bl	_get_qcom_nand_controller
	mov	x23, x0
	bl	_config_nand_page_read
	ldr	w8, [x22, #16]
	cmp	w8, #1
	b.lt	LBB0_22
; %bb.1:
	mov	w19, #0
	add	x9, x22, #4
	str	x9, [sp, #24]                   ; 8-byte Folded Spill
	mov	w21, #255
	ldp	x26, x25, [sp, #8]              ; 16-byte Folded Reload
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
                                        ; kill: def $w28 killed $w28 killed $x28 def $x28
	sxtw	x28, w28
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x26, x28, lsl #2
	cmp	w20, #0
	csel	x26, xzr, x8, ne
	add	x8, x25, w27, sxtw #2
	cmp	x25, #0
	csel	x25, xzr, x8, eq
	add	w19, w19, #1
	ldr	w8, [x24]
	cmp	w19, w8
	b.ge	LBB0_22
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_19 Depth 2
	sub	w9, w8, #1
	cmp	w19, w9
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x22, #20]
	sub	w28, w9, w19, lsl #2
	ldr	w9, [x22]
	add	w8, w9, w8, lsl #2
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldp	w8, w28, [x22, #4]
	mov	x9, x22
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x9]
	add	w27, w8, w9
	ldr	x8, [x23, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	x26, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	x25, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x23
	mov	w1, #0
	mov	w2, #0
	mov	x3, x28
	mov	w4, #0
	bl	_nandc_set_read_loc
	mov	x0, x23
	mov	w1, #1
	mov	x2, x28
	mov	x3, x27
	b	LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w20, #1
	mov	x0, x23
	mov	w1, #1
	bl	_config_nand_cw_read
	cbnz	x26, LBB0_15
	b	LBB0_16
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	x26, LBB0_21
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x23
	mov	w1, #0
	mov	w2, #0
	mov	x3, x28
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w4, #1
	bl	_nandc_set_read_loc
	mov	x0, x23
	mov	w1, #1
	bl	_config_nand_cw_read
LBB0_15:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh0:
	adrp	x8, _FLASH_BUF_ACC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FLASH_BUF_ACC@GOTPAGEOFF]
Lloh2:
	ldr	x1, [x8]
	mov	x0, x23
	mov	x2, x26
	mov	x3, x28
	mov	w4, #0
	bl	_read_data_dma
	mov	w20, #0
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	x25, LBB0_2
LBB0_17:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22, #12]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w8, #0
LBB0_19:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	str	w21, [x25], #4
	add	w8, w8, #1
	ldr	w9, [x22, #12]
	cmp	w8, w9
	b.lt	LBB0_19
LBB0_20:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh3:
	adrp	x8, _FLASH_BUF_ACC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FLASH_BUF_ACC@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	sxtw	x28, w28
	add	x1, x8, x28
	mov	x0, x23
	mov	x2, x25
	mov	x3, x27
	mov	w4, #0
	bl	_read_data_dma
	b	LBB0_3
LBB0_21:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w20, #1
	mov	x0, x23
	mov	w1, #0
	mov	x2, x28
	mov	x3, x27
	mov	w4, #1
	bl	_nandc_set_read_loc
	mov	x0, x23
	mov	w1, #1
	bl	_config_nand_cw_read
	cbnz	x25, LBB0_17
	b	LBB0_2
LBB0_22:
	mov	x0, x23
	bl	_submit_descs
	mov	x24, x0
	mov	x0, x23
	bl	_free_descs
	cbz	w24, LBB0_24
; %bb.23:
	ldr	w0, [x23]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x0, x24
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_24:
	mov	x0, x22
	ldp	x1, x2, [sp, #8]                ; 16-byte Folded Reload
	ldr	w3, [sp, #4]                    ; 4-byte Folded Reload
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_parse_read_errors
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_FLASH_BUF_ACC,8,3              ; @FLASH_BUF_ACC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failure to read page/oob\n"

	.no_dead_strip	_read_page_ecc
.subsections_via_symbols
