	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function execmd_read_page_sector
_execmd_read_page_sector:               ## @execmd_read_page_sector
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_mtd_to_flctl
	movq	%rax, %r12
	xorl	%eax, %eax
	cmpq	$0, 16(%r12)
	setne	%al
	leal	(%rax,%rax,2), %r13d
	incl	%r13d
	movq	_NAND_CMD_READ0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NAND_CMD_READSTART@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	shll	$8, %edx
	orl	%esi, %edx
	movq	%r14, %rdi
	callq	_set_cmd_regs
	movq	%r12, %rdi
	callq	_FLCMNCR
	movl	%eax, %edi
	callq	_readl
	movl	%eax, %ebx
	movq	_ACM_SACCES_MODE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	__4ECCCORRECT@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_FLCMNCR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writel
	movq	%r12, %rdi
	callq	_FLCMDCR
	movl	%eax, %edi
	callq	_readl
	movl	%eax, %ebx
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	orl	%r13d, %ebx
	movq	%r12, %rdi
	callq	_FLCMDCR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writel
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	leal	(,%r15,4), %ebx
	movq	%r12, %rdi
	callq	_FLADR
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_writel
	movq	%r12, %rdi
	callq	_empty_fifo
	movq	%r12, %rdi
	callq	_start_translation
	leaq	4(%r14), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %r15
	leaq	8(%r14), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r12), %rdi
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_dev_warn
	movq	-72(%rbp), %rax                 ## 8-byte Reload
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	incl	(%rax)
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	incl	%r13d
	addl	$16, %r14d
	addl	$512, %ebx                      ## imm = 0x200
	cmpl	%r13d, -44(%rbp)                ## 4-byte Folded Reload
	je	LBB0_7
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$512, %esi                      ## imm = 0x200
	movl	%ebx, %edx
	callq	_read_fiforeg
	movl	(%r15), %eax
	addl	%r14d, %eax
	movslq	%eax, %rsi
	shlq	$2, %rsi
	addq	8(%r12), %rsi
	movq	%r12, %rdi
	movl	%r13d, %edx
	callq	_read_ecfiforeg
	cmpl	$129, %eax
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$128, %eax
	jne	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_dev_info
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_5
LBB0_7:
	movq	%r12, %rdi
	callq	_wait_completion
	movq	%r12, %rdi
	callq	_FLCMNCR
	movl	%eax, %edi
	callq	_readl
	movq	__4ECCCORRECT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movq	_ACM_SACCES_MODE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movq	%r12, %rdi
	callq	_FLCMNCR
	movl	%ebx, %edi
	movl	%eax, %esi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_CMD_READ0,4,2             ## @NAND_CMD_READ0
	.comm	_NAND_CMD_READSTART,4,2         ## @NAND_CMD_READSTART
	.comm	_ACM_SACCES_MODE,4,2            ## @ACM_SACCES_MODE
	.comm	__4ECCCORRECT,4,2               ## @_4ECCCORRECT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"applied ecc on page 0x%x"

L_.str.1:                               ## @.str.1
	.asciz	"page 0x%x contains corrupted data\n"

	.no_dead_strip	_execmd_read_page_sector
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function execmd_read_page_sector
_execmd_read_page_sector:               ; @execmd_read_page_sector
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x1
	mov	x21, x0
	bl	_mtd_to_flctl
	mov	x19, x0
	ldr	x8, [x0, #16]
	cmp	x8, #0
	mov	w8, #4
Lloh0:
	adrp	x9, _NAND_CMD_READ0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NAND_CMD_READ0@GOTPAGEOFF]
	csinc	w26, w8, wzr, ne
Lloh2:
	ldr	w1, [x9]
Lloh3:
	adrp	x8, _NAND_CMD_READSTART@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_CMD_READSTART@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	orr	w2, w1, w8, lsl #8
	mov	x0, x21
	bl	_set_cmd_regs
	mov	x0, x19
	bl	_FLCMNCR
	bl	_readl
Lloh6:
	adrp	x8, _ACM_SACCES_MODE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ACM_SACCES_MODE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh9:
	adrp	x9, __4ECCCORRECT@GOTPAGE
Lloh10:
	ldr	x9, [x9, __4ECCCORRECT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w22, w8, w9
	mov	x0, x19
	bl	_FLCMNCR
	mov	x1, x0
	mov	x0, x22
	bl	_writel
	mov	x0, x19
	bl	_FLCMDCR
	bl	_readl
	orr	w22, w0, w26
	mov	x0, x19
	bl	_FLCMDCR
	mov	x1, x0
	mov	x0, x22
	bl	_writel
	lsl	w22, w20, #2
	mov	x0, x19
	bl	_FLADR
	mov	x1, x0
	mov	x0, x22
	bl	_writel
	mov	x0, x19
	bl	_empty_fifo
	mov	x0, x19
	bl	_start_translation
	mov	w22, #0
	mov	w27, #0
	mov	w23, #0
	add	x28, x21, #4
	add	x24, x21, #8
Lloh12:
	adrp	x25, l_.str@PAGE
Lloh13:
	add	x25, x25, l_.str@PAGEOFF
	b	LBB0_4
LBB0_1:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x19]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_warn
	mov	x8, x28
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w23, w23, #1
	add	w27, w27, #16
	add	w22, w22, #512
	cmp	w26, w23
	b.eq	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #512
	mov	x2, x22
	bl	_read_fiforeg
	ldr	x8, [x19, #8]
	ldr	w9, [x21]
	add	w9, w27, w9
	add	x1, x8, w9, sxtw #2
	mov	x0, x19
	mov	x2, x23
	bl	_read_ecfiforeg
	cmp	w0, #129
	b.eq	LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w0, #128
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x19]
	mov	x1, x25
	mov	x2, x20
	bl	_dev_info
	mov	x8, x24
	b	LBB0_2
LBB0_7:
	mov	x0, x19
	bl	_wait_completion
	mov	x0, x19
	bl	_FLCMNCR
	bl	_readl
Lloh16:
	adrp	x8, _ACM_SACCES_MODE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ACM_SACCES_MODE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, __4ECCCORRECT@GOTPAGE
Lloh20:
	ldr	x9, [x9, __4ECCCORRECT@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w20, w0, w8
	mov	x0, x19
	bl	_FLCMNCR
	mov	x1, x0
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_writel
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_CMD_READ0,4,2             ; @NAND_CMD_READ0
	.comm	_NAND_CMD_READSTART,4,2         ; @NAND_CMD_READSTART
	.comm	_ACM_SACCES_MODE,4,2            ; @ACM_SACCES_MODE
	.comm	__4ECCCORRECT,4,2               ; @_4ECCCORRECT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"applied ecc on page 0x%x"

l_.str.1:                               ; @.str.1
	.asciz	"page 0x%x contains corrupted data\n"

	.no_dead_strip	_execmd_read_page_sector
.subsections_via_symbols
