	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function marvell_nand_ecc_init
_marvell_nand_ecc_init:                 ## @marvell_nand_ecc_init
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	callq	_mtd_to_nand
	movq	%rax, %rbx
	movl	8(%rax), %edi
	callq	_to_marvell_nfc
	movq	%rax, %r15
	movl	(%r12), %eax
	cmpl	$130, %eax
	je	LBB0_11
## %bb.1:
	cmpl	$0, 4(%r12)
	je	LBB0_3
## %bb.2:
	cmpl	$0, 8(%r12)
	jne	LBB0_7
LBB0_3:
	movl	(%rbx), %ecx
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.4:
	movl	4(%rbx), %edx
	testl	%edx, %edx
	je	LBB0_6
## %bb.5:
	movl	%ecx, 4(%r12)
	movl	%edx, 8(%r12)
	jmp	LBB0_7
LBB0_6:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movabsq	$4294967808, %rax               ## imm = 0x100000200
	movq	%rax, 4(%r12)
	movl	(%r12), %eax
LBB0_7:
	leal	-128(%rax), %ecx
	cmpl	$3, %ecx
	jae	LBB0_8
LBB0_11:
	movq	8(%r15), %rax
	cmpl	$0, (%rax)
	je	LBB0_12
LBB0_10:
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_12:
	movl	(%r14), %edx
	movq	_SZ_512@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	je	LBB0_10
## %bb.13:
	movq	_SZ_2K@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	je	LBB0_10
## %bb.14:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_15
LBB0_8:
	cmpl	$131, %eax
	jne	LBB0_15
## %bb.9:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_marvell_nand_hw_ecc_ctrl_init
	testl	%eax, %eax
	jne	LBB0_16
	jmp	LBB0_10
LBB0_15:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_16:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No minimum ECC strength, using 1b/512B\n"

	.comm	_SZ_512,4,2                     ## @SZ_512
	.comm	_SZ_2K,4,2                      ## @SZ_2K
L_.str.1:                               ## @.str.1
	.asciz	"NFCv1 cannot write %d bytes pages\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_marvell_nand_ecc_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function marvell_nand_ecc_init
lCPI0_0:
	.long	512                             ; 0x200
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_marvell_nand_ecc_init:                 ; @marvell_nand_ecc_init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x1
	mov	x19, x0
	bl	_mtd_to_nand
	mov	x22, x0
	ldr	w0, [x0, #8]
	bl	_to_marvell_nfc
	mov	x21, x0
	ldr	w8, [x20]
	cmp	w8, #130
	b.eq	LBB0_8
; %bb.1:
	ldr	w9, [x20, #4]
	cbz	w9, LBB0_3
; %bb.2:
	ldr	w9, [x20, #8]
	cbnz	w9, LBB0_7
LBB0_3:
	ldr	w9, [x22]
	cbz	w9, LBB0_6
; %bb.4:
	ldr	w10, [x22, #4]
	cbz	w10, LBB0_6
; %bb.5:
	stp	w9, w10, [x20, #4]
	b	LBB0_7
LBB0_6:
	ldr	w0, [x21]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
Lloh2:
	adrp	x8, lCPI0_0@PAGE
Lloh3:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [x20, #4]
	ldr	w8, [x20]
LBB0_7:
	sub	w9, w8, #128
	cmp	w9, #3
	b.hs	LBB0_11
LBB0_8:
	ldr	x8, [x21, #8]
	ldr	w8, [x8]
	cbnz	w8, LBB0_10
; %bb.9:
	ldr	w2, [x19]
Lloh4:
	adrp	x8, _SZ_512@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SZ_512@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _SZ_2K@GOTPAGE
Lloh8:
	ldr	x9, [x9, _SZ_2K@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w2, w8
	ccmp	w2, w9, #4, ne
	b.ne	LBB0_13
LBB0_10:
	mov	w0, #0
	b	LBB0_15
LBB0_11:
	cmp	w8, #131
	b.ne	LBB0_14
; %bb.12:
	mov	x0, x19
	mov	x1, x20
	bl	_marvell_nand_hw_ecc_ctrl_init
	cbnz	w0, LBB0_15
	b	LBB0_10
LBB0_13:
	ldr	w0, [x21]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_14:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdr	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No minimum ECC strength, using 1b/512B\n"

	.comm	_SZ_512,4,2                     ; @SZ_512
	.comm	_SZ_2K,4,2                      ; @SZ_2K
l_.str.1:                               ; @.str.1
	.asciz	"NFCv1 cannot write %d bytes pages\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_marvell_nand_ecc_init
.subsections_via_symbols
