	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omap_write_subpage_bch
_omap_write_subpage_bch:                ## @omap_write_subpage_bch
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r12
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_nand_to_mtd
	movq	%rax, %r13
	movq	32(%r14), %rbx
	movslq	16(%r14), %rcx
	movslq	20(%r14), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	24(%r14), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	%r15d, %eax
	decl	%eax
	cltd
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	idivl	%ecx
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nand_prog_page_begin_op
	movq	_NAND_ECC_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	*40(%r14)
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movl	4(%r13), %edx
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	callq	*8(%r14)
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	jle	LBB0_7
## %bb.1:
	movl	%eax, %r13d
	shlq	$2, -56(%rbp)                   ## 8-byte Folded Spill
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	leaq	(,%rax,4), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movl	$255, %esi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memset
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%r15d
	addq	-56(%rbp), %r12                 ## 8-byte Folded Reload
	addq	%r14, %rbx
	cmpl	%r15d, %r13d
	je	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	-68(%rbp), %r15d                ## 4-byte Folded Reload
	jl	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	-64(%rbp), %r15d                ## 4-byte Folded Reload
	jg	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movl	%r15d, %ecx
	callq	__omap_calculate_ecc_bch
	testl	%eax, %eax
	je	LBB0_6
	jmp	LBB0_8
LBB0_7:
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	32(%rbx), %rsi
	movq	(%rbx), %rdx
	movl	28(%rbx), %r8d
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	callq	_mtd_ooblayout_set_eccbytes
	testl	%eax, %eax
	je	LBB0_9
LBB0_8:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	(%rbx), %rsi
	movl	(%r14), %edx
	movq	%rbx, %rdi
	callq	*8(%rbx)
	movq	%rbx, %rdi
	addq	$56, %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	_omap_write_subpage_bch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omap_write_subpage_bch
_omap_write_subpage_bch:                ; @omap_write_subpage_bch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x5
	mov	x21, x3
	mov	x25, x2
	mov	x26, x1
	mov	x19, x0
	bl	_nand_to_mtd
	mov	x28, x0
	ldr	x22, [x19, #32]
	ldpsw	x20, x8, [x19, #16]
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	ldr	w27, [x19, #24]
	mov	x0, x19
	mov	x1, x24
	mov	w2, #0
	mov	x3, #0
	mov	w4, #0
	bl	_nand_prog_page_begin_op
	ldr	x8, [x19, #40]
Lloh0:
	adrp	x9, _NAND_ECC_WRITE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NAND_ECC_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19, #8]
	mov	x23, x28
	ldr	w2, [x28, #4]
	mov	x0, x19
	mov	x1, x21
	blr	x8
	cmp	w27, #1
	b.lt	LBB0_7
; %bb.1:
	mov	w24, #0
	sdiv	w28, w26, w20
	add	w8, w26, w25
	sub	w8, w8, #1
	lsl	x25, x20, #2
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	lsl	x26, x9, #2
	sdiv	w20, w8, w20
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x22
	mov	w1, #255
	ldr	x2, [sp, #8]                    ; 8-byte Folded Reload
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memset
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w24, w24, #1
	add	x21, x21, x25
	add	x22, x22, x26
	cmp	w27, w24
	b.eq	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w24, w28
	b.lt	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w24, w20
	b.gt	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x23
	mov	x1, x21
	mov	x2, x22
	mov	x3, x24
	bl	__omap_calculate_ecc_bch
	cbz	w0, LBB0_3
	b	LBB0_8
LBB0_7:
	ldr	x1, [x19, #32]
	ldr	x2, [x19]
	ldr	w4, [x19, #28]
	mov	x0, x23
	mov	w3, #0
	bl	_mtd_ooblayout_set_eccbytes
	cbz	w0, LBB0_9
LBB0_8:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_9:
	ldp	x1, x8, [x19]
	ldr	w2, [x23]
	mov	x0, x19
	blr	x8
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_nand_prog_page_end_op
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_ECC_WRITE,4,2             ; @NAND_ECC_WRITE
	.no_dead_strip	_omap_write_subpage_bch
.subsections_via_symbols
