	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function denali_read_page
_denali_read_page:                      ## @denali_read_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_to_denali_controller
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_nand_to_mtd
	movq	$0, -40(%rbp)
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r15d, %ecx
	xorl	%r8d, %r8d
	callq	_denali_page_xfer
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	_EBADMSG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%eax, %ecx
	jne	LBB0_13
LBB0_2:
	movq	_DENALI_CAP_HW_ECC_FIXUP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%r12)
	je	LBB0_4
## %bb.3:
	leaq	-40(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_denali_hw_ecc_fixup
	jmp	LBB0_6
LBB0_4:
	movq	_EBADMSG@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	movl	(%rcx), %ecx
	addl	%eax, %ecx
	jne	LBB0_7
## %bb.5:
	leaq	-40(%rbp), %rsi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_denali_sw_ecc_fixup
LBB0_6:
	movl	%eax, %r12d
LBB0_7:
	testl	%r12d, %r12d
	js	LBB0_12
## %bb.8:
	cmpq	$0, -40(%rbp)
	je	LBB0_12
## %bb.9:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_denali_read_oob
	testl	%eax, %eax
	jne	LBB0_13
## %bb.10:
	movq	-40(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r12d, %ecx
	callq	_denali_check_erased_page
	jmp	LBB0_13
LBB0_12:
	movl	%r12d, %eax
LBB0_13:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBADMSG,4,2                    ## @EBADMSG
	.comm	_DENALI_CAP_HW_ECC_FIXUP,4,2    ## @DENALI_CAP_HW_ECC_FIXUP
	.no_dead_strip	_denali_read_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function denali_read_page
_denali_read_page:                      ; @denali_read_page
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x3
	mov	x19, x1
	mov	x20, x0
	bl	_to_denali_controller
	mov	x22, x0
	mov	x0, x20
	bl	_nand_to_mtd
	str	xzr, [sp, #8]
	ldr	w2, [x0]
	mov	x0, x20
	mov	x1, x19
	mov	x3, x21
	mov	w4, #0
	bl	_denali_page_xfer
	cbz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_11
LBB0_2:
	ldr	w8, [x22]
Lloh3:
	adrp	x9, _DENALI_CAP_HW_ECC_FIXUP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DENALI_CAP_HW_ECC_FIXUP@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	add	x1, sp, #8
	mov	x0, x20
	bl	_denali_hw_ecc_fixup
	mov	x22, x0
	tbz	w22, #31, LBB0_7
	b	LBB0_10
LBB0_4:
Lloh6:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_6
; %bb.5:
	add	x1, sp, #8
	mov	x0, x20
	mov	x2, x19
	bl	_denali_sw_ecc_fixup
	mov	x22, x0
	tbz	w22, #31, LBB0_7
	b	LBB0_10
LBB0_6:
	mov	w22, #0
	tbnz	w22, #31, LBB0_10
LBB0_7:
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_10
; %bb.8:
	mov	x0, x20
	mov	x1, x21
	bl	_denali_read_oob
	cbnz	w0, LBB0_11
; %bb.9:
	ldr	x2, [sp, #8]
	mov	x0, x20
	mov	x1, x19
	mov	x3, x22
	bl	_denali_check_erased_page
	b	LBB0_11
LBB0_10:
	mov	x0, x22
LBB0_11:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EBADMSG,4,2                    ; @EBADMSG
	.comm	_DENALI_CAP_HW_ECC_FIXUP,4,2    ; @DENALI_CAP_HW_ECC_FIXUP
	.no_dead_strip	_denali_read_page
.subsections_via_symbols
