	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nand_write_page_hwecc
_nand_write_page_hwecc:                 ## @nand_write_page_hwecc
	.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	%ecx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_nand_to_mtd
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movslq	8(%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movslq	12(%r15), %r14
	movl	16(%r15), %r13d
	movq	40(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movl	%r12d, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nand_prog_page_begin_op
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	testl	%r13d, %r13d
	je	LBB0_5
## %bb.2:
	shlq	$2, %r14
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(,%rax,4), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_NAND_ECC_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	*32(%r15)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%ecx, %ecx
	callq	_nand_write_data_op
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	*24(%r15)
	addq	%r14, %r12
	addq	-72(%rbp), %rbx                 ## 8-byte Folded Reload
	decl	%r13d
	jne	LBB0_3
LBB0_5:
	movq	(%r15), %rdx
	movl	20(%r15), %r8d
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	xorl	%ecx, %ecx
	callq	_mtd_ooblayout_set_eccbytes
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	(%r15), %rsi
	movl	(%rbx), %edx
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	callq	_nand_write_data_op
	testl	%eax, %eax
	je	LBB0_8
LBB0_7:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r15, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nand_prog_page_end_op          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_ECC_WRITE,4,2             ## @NAND_ECC_WRITE
	.no_dead_strip	_nand_write_page_hwecc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nand_write_page_hwecc
_nand_write_page_hwecc:                 ; @nand_write_page_hwecc
	.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	x24, x3
	mov	x21, x1
	mov	x19, x0
	bl	_nand_to_mtd
	mov	x20, x0
	ldpsw	x23, x26, [x19, #8]
	ldr	w25, [x19, #16]
	ldr	x22, [x19, #40]
	mov	x0, x19
	mov	x1, x24
	mov	w2, #0
	mov	x3, #0
	mov	w4, #0
	bl	_nand_prog_page_begin_op
	cbnz	w0, LBB0_7
; %bb.1:
	cbz	w25, LBB0_5
; %bb.2:
	lsl	x26, x26, #2
	lsl	x27, x23, #2
Lloh0:
	adrp	x28, _NAND_ECC_WRITE@GOTPAGE
Lloh1:
	ldr	x28, [x28, _NAND_ECC_WRITE@GOTPAGEOFF]
	mov	x24, x22
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	w1, [x28]
	mov	x0, x19
	blr	x8
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	mov	w3, #0
	bl	_nand_write_data_op
	cbnz	w0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #24]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x24
	blr	x8
	add	x24, x24, x26
	add	x21, x21, x27
	subs	w25, w25, #1
	b.ne	LBB0_3
LBB0_5:
	ldr	x2, [x19]
	ldr	w4, [x19, #20]
	mov	x0, x20
	mov	x1, x22
	mov	w3, #0
	bl	_mtd_ooblayout_set_eccbytes
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	x1, [x19]
	ldr	w2, [x20]
	mov	x0, x19
	mov	w3, #0
	bl	_nand_write_data_op
	cbz	w0, LBB0_8
LBB0_7:
	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
	ret
LBB0_8:
	mov	x0, x19
	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	_nand_prog_page_end_op
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_ECC_WRITE,4,2             ; @NAND_ECC_WRITE
	.no_dead_strip	_nand_write_page_hwecc
.subsections_via_symbols
