	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_nand_ecc_init
_atmel_nand_ecc_init:                   ## @atmel_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	20(%rdi), %edi
	callq	_to_nand_controller
	movq	%rax, %rcx
	movl	(%rbx), %edx
	xorl	%eax, %eax
	leal	-128(%rdx), %esi
	cmpl	$2, %esi
	jb	LBB0_5
## %bb.1:
	cmpl	$130, %edx
	jne	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	callq	_atmel_nand_pmecc_init
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:
	movq	_atmel_nand_pmecc_read_page@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	_atmel_nand_pmecc_write_page@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movq	_atmel_nand_pmecc_read_page_raw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_atmel_nand_pmecc_write_page_raw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_4:
	movl	(%rcx), %edi
	leaq	L_.str(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_dev_err
	movq	_ENOTSUPP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_atmel_nand_pmecc_read_page,4,2 ## @atmel_nand_pmecc_read_page
	.comm	_atmel_nand_pmecc_write_page,4,2 ## @atmel_nand_pmecc_write_page
	.comm	_atmel_nand_pmecc_read_page_raw,4,2 ## @atmel_nand_pmecc_read_page_raw
	.comm	_atmel_nand_pmecc_write_page_raw,4,2 ## @atmel_nand_pmecc_write_page_raw
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported ECC mode: %d\n"

	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.no_dead_strip	_atmel_nand_ecc_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_nand_ecc_init
_atmel_nand_ecc_init:                   ; @atmel_nand_ecc_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w0, [x0, #20]
	bl	_to_nand_controller
	ldr	w2, [x19]
	sub	w8, w2, #128
	cmp	w8, #2
	b.hs	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_6
LBB0_2:
	cmp	w2, #130
	b.ne	LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_atmel_nand_pmecc_init
	cbnz	w0, LBB0_6
; %bb.4:
Lloh0:
	adrp	x8, _atmel_nand_pmecc_read_page@GOTPAGE
Lloh1:
	ldr	x8, [x8, _atmel_nand_pmecc_read_page@GOTPAGEOFF]
Lloh2:
	adrp	x9, _atmel_nand_pmecc_write_page@GOTPAGE
Lloh3:
	ldr	x9, [x9, _atmel_nand_pmecc_write_page@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #12]
Lloh6:
	adrp	x8, _atmel_nand_pmecc_read_page_raw@GOTPAGE
Lloh7:
	ldr	x8, [x8, _atmel_nand_pmecc_read_page_raw@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _atmel_nand_pmecc_write_page_raw@GOTPAGE
Lloh10:
	ldr	x9, [x9, _atmel_nand_pmecc_write_page_raw@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #4]
	b	LBB0_6
LBB0_5:
	ldr	w0, [x0]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh14:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_atmel_nand_pmecc_read_page,4,2 ; @atmel_nand_pmecc_read_page
	.comm	_atmel_nand_pmecc_write_page,4,2 ; @atmel_nand_pmecc_write_page
	.comm	_atmel_nand_pmecc_read_page_raw,4,2 ; @atmel_nand_pmecc_read_page_raw
	.comm	_atmel_nand_pmecc_write_page_raw,4,2 ; @atmel_nand_pmecc_write_page_raw
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported ECC mode: %d\n"

	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.no_dead_strip	_atmel_nand_ecc_init
.subsections_via_symbols
