	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omap_enable_hwecc
_omap_enable_hwecc:                     ## @omap_enable_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_nand_to_mtd
	movl	%eax, %edi
	callq	_mtd_to_omap
	movq	%rax, %r15
	movl	(%rbx), %r12d
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ECCCLEAR@GOTPCREL(%rip), %r13
	movq	_ECC1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	(%r13), %edi
	movl	8(%r15), %esi
	callq	_writel
	movl	24(%r15), %edi
	sarl	%edi
	decl	%edi
	movq	_ECCSIZE1_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edi
	movl	12(%r15), %esi
	movq	_ECC1RESULTSIZE@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	callq	_writel
	cmpl	$130, %r14d
	je	LBB0_3
## %bb.1:
	cmpl	$129, %r14d
	je	LBB0_4
## %bb.2:
	cmpl	$128, %r14d
	jne	LBB0_6
LBB0_3:
	movq	_ECC1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	(%r13), %edi
	jmp	LBB0_5
LBB0_4:
	movl	(%r13), %edi
LBB0_5:
	movl	8(%r15), %esi
	callq	_writel
	jmp	LBB0_7
LBB0_6:
	movq	16(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_info
LBB0_7:
	xorl	%edi, %edi
	testl	%r12d, %ebx
	setne	%dil
	movl	(%r15), %eax
	movl	4(%r15), %esi
	addl	%eax, %eax
	shll	$7, %edi
	orl	%eax, %edi
	orl	$1, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
	.comm	_ECCCLEAR,4,2                   ## @ECCCLEAR
	.comm	_ECC1,4,2                       ## @ECC1
	.comm	_ECCSIZE1_SHIFT,4,2             ## @ECCSIZE1_SHIFT
	.comm	_ECC1RESULTSIZE,4,2             ## @ECC1RESULTSIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error: unrecognized Mode[%d]!\n"

	.no_dead_strip	_omap_enable_hwecc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omap_enable_hwecc
_omap_enable_hwecc:                     ; @omap_enable_hwecc
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x21, x0
	bl	_nand_to_mtd
	bl	_mtd_to_omap
	mov	x19, x0
	ldr	w21, [x21]
Lloh0:
	adrp	x8, _NAND_BUSWIDTH_16@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
Lloh3:
	adrp	x23, _ECCCLEAR@GOTPAGE
Lloh4:
	ldr	x23, [x23, _ECCCLEAR@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh5:
	adrp	x24, _ECC1@GOTPAGE
Lloh6:
	ldr	x24, [x24, _ECC1@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w0, w9, w8
	ldr	w1, [x19, #8]
	bl	_writel
	ldr	w8, [x19, #24]
	asr	w8, w8, #1
	sub	w8, w8, #1
Lloh7:
	adrp	x9, _ECCSIZE1_SHIFT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ECCSIZE1_SHIFT@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	lsl	w8, w8, w9
Lloh10:
	adrp	x9, _ECC1RESULTSIZE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ECC1RESULTSIZE@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldr	w1, [x19, #12]
	bl	_writel
	cmp	w20, #130
	b.eq	LBB0_3
; %bb.1:
	cmp	w20, #129
	b.eq	LBB0_4
; %bb.2:
	cmp	w20, #128
	b.ne	LBB0_6
LBB0_3:
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w0, w9, w8
	b	LBB0_5
LBB0_4:
	ldr	w0, [x23]
LBB0_5:
	ldr	w1, [x19, #8]
	bl	_writel
	b	LBB0_7
LBB0_6:
	ldr	x0, [x19, #16]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_info
LBB0_7:
	tst	w22, w21
	mov	w8, #129
	csinc	w8, w8, wzr, ne
	ldp	w9, w1, [x19]
	orr	w0, w8, w9, lsl #1
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_writel
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
	.comm	_ECCCLEAR,4,2                   ; @ECCCLEAR
	.comm	_ECC1,4,2                       ; @ECC1
	.comm	_ECCSIZE1_SHIFT,4,2             ; @ECCSIZE1_SHIFT
	.comm	_ECC1RESULTSIZE,4,2             ; @ECC1RESULTSIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error: unrecognized Mode[%d]!\n"

	.no_dead_strip	_omap_enable_hwecc
.subsections_via_symbols
