	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_nand_pmecc_generate_eccbytes
_atmel_nand_pmecc_generate_eccbytes:    ## @atmel_nand_pmecc_generate_eccbytes
	.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, %r12d
	movq	%rdi, %r13
	callq	_to_atmel_nand
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_nand_to_mtd
	movq	%rax, %rbx
	movl	16(%r13), %edi
	callq	_to_nand_controller
	xorl	%r15d, %r15d
	testl	%r12d, %r12d
	jne	LBB0_6
## %bb.1:
	movq	%rax, %r12
	movl	(%r14), %edi
	callq	_atmel_pmecc_wait_rdy
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %r15d
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_6
LBB0_3:
	xorl	%r15d, %r15d
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_mtd_ooblayout_ecc
	cmpl	$0, (%r13)
	jle	LBB0_6
## %bb.4:
	movslq	-48(%rbp), %r12
	addq	8(%r13), %r12
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	movl	%ebx, %esi
	movq	%r12, %rdx
	callq	_atmel_pmecc_get_generated_eccbytes
	movslq	4(%r13), %rax
	addq	%rax, %r12
	incl	%ebx
	cmpl	(%r13), %ebx
	jl	LBB0_5
LBB0_6:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to transfer NAND page data (err = %d)\n"

	.no_dead_strip	_atmel_nand_pmecc_generate_eccbytes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_nand_pmecc_generate_eccbytes
_atmel_nand_pmecc_generate_eccbytes:    ; @atmel_nand_pmecc_generate_eccbytes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x22, x1
	mov	x19, x0
	bl	_to_atmel_nand
	mov	x20, x0
	mov	x0, x19
	bl	_nand_to_mtd
	mov	x21, x0
	ldr	w0, [x19, #16]
	bl	_to_nand_controller
	cbz	w22, LBB0_2
LBB0_1:
	mov	w22, #0
	b	LBB0_4
LBB0_2:
	mov	x23, x0
	ldr	w0, [x20]
	bl	_atmel_pmecc_wait_rdy
	cbz	w0, LBB0_5
; %bb.3:
	mov	x22, x0
	ldr	w0, [x23]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_dev_err
LBB0_4:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	add	x2, sp, #8
	mov	x0, x21
	mov	w1, #0
	bl	_mtd_ooblayout_ecc
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_1
; %bb.6:
	mov	w21, #0
	ldr	x8, [x19, #8]
	ldrsw	x9, [sp, #8]
	add	x22, x8, x9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	mov	x1, x21
	mov	x2, x22
	bl	_atmel_pmecc_get_generated_eccbytes
	ldp	w9, w8, [x19]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	x22, x22, x8
	add	w21, w21, #1
	cmp	w21, w9
	b.lt	LBB0_7
	b	LBB0_1
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to transfer NAND page data (err = %d)\n"

	.no_dead_strip	_atmel_nand_pmecc_generate_eccbytes
.subsections_via_symbols
