	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_atmel_pmecc_enable             ## -- Begin function atmel_pmecc_enable
	.p2align	4, 0x90
_atmel_pmecc_enable:                    ## @atmel_pmecc_enable
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	16(%rdi), %r15
	movq	_NAND_ECC_READ@GOTPCREL(%rip), %rax
	movq	_NAND_ECC_WRITE@GOTPCREL(%rip), %r12
	cmpl	%esi, (%rax)
	je	LBB0_3
## %bb.1:
	cmpl	%ebx, (%r12)
	je	LBB0_3
## %bb.2:
	movl	12(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_3:
	leaq	8(%r15), %rdi
	callq	_mutex_lock
	cmpl	%ebx, (%r12)
	jne	LBB0_4
## %bb.5:
	movq	_PMECC_CFG_WRITE_OP@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_PMECC_CFG_AUTO_ENABLE@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %edi
	orl	12(%r14), %edi
	movq	_ATMEL_PMECC_CFG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	callq	_writel
	movl	8(%r14), %edi
	movq	_ATMEL_PMECC_SAREA@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	callq	_writel
	movl	4(%r14), %edi
	movq	_ATMEL_PMECC_SADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	callq	_writel
	movl	(%r14), %edi
	movq	_ATMEL_PMECC_EADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	callq	_writel
	movq	_PMECC_CTRL_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ATMEL_PMECC_CTRL@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	addq	(%r15), %rsi
	callq	_writel
	movq	_PMECC_CTRL_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rsi
	addq	(%r15), %rsi
	callq	_writel
	xorl	%eax, %eax
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_ECC_READ,4,2              ## @NAND_ECC_READ
	.comm	_NAND_ECC_WRITE,4,2             ## @NAND_ECC_WRITE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bad ECC operation!"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PMECC_CFG_WRITE_OP,4,2         ## @PMECC_CFG_WRITE_OP
	.comm	_PMECC_CFG_AUTO_ENABLE,4,2      ## @PMECC_CFG_AUTO_ENABLE
	.comm	_ATMEL_PMECC_CFG,8,3            ## @ATMEL_PMECC_CFG
	.comm	_ATMEL_PMECC_SAREA,8,3          ## @ATMEL_PMECC_SAREA
	.comm	_ATMEL_PMECC_SADDR,8,3          ## @ATMEL_PMECC_SADDR
	.comm	_ATMEL_PMECC_EADDR,8,3          ## @ATMEL_PMECC_EADDR
	.comm	_PMECC_CTRL_ENABLE,4,2          ## @PMECC_CTRL_ENABLE
	.comm	_ATMEL_PMECC_CTRL,8,3           ## @ATMEL_PMECC_CTRL
	.comm	_PMECC_CTRL_DATA,4,2            ## @PMECC_CTRL_DATA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_atmel_pmecc_enable             ; -- Begin function atmel_pmecc_enable
	.p2align	2
_atmel_pmecc_enable:                    ; @atmel_pmecc_enable
	.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
	ldr	x21, [x0, #16]
Lloh0:
	adrp	x8, _NAND_ECC_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_ECC_READ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x22, _NAND_ECC_WRITE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _NAND_ECC_WRITE@GOTPAGEOFF]
	ldr	w9, [x22]
	cmp	w8, w1
	ccmp	w9, w1, #4, ne
	b.ne	LBB0_2
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	add	x0, x21, #8
	bl	_mutex_lock
	ldr	w8, [x19, #12]
Lloh5:
	adrp	x9, _PMECC_CFG_WRITE_OP@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PMECC_CFG_WRITE_OP@GOTPAGEOFF]
	ldr	w10, [x22]
Lloh7:
	adrp	x11, _PMECC_CFG_AUTO_ENABLE@GOTPAGE
Lloh8:
	ldr	x11, [x11, _PMECC_CFG_AUTO_ENABLE@GOTPAGEOFF]
	cmp	w10, w20
	csel	x9, x9, x11, eq
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	x8, [x21]
Lloh9:
	adrp	x9, _ATMEL_PMECC_CFG@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ATMEL_PMECC_CFG@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	w0, [x19, #8]
	ldr	x8, [x21]
Lloh12:
	adrp	x9, _ATMEL_PMECC_SAREA@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ATMEL_PMECC_SAREA@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	w0, [x19, #4]
	ldr	x8, [x21]
Lloh15:
	adrp	x9, _ATMEL_PMECC_SADDR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ATMEL_PMECC_SADDR@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	w0, [x19]
	ldr	x8, [x21]
Lloh18:
	adrp	x9, _ATMEL_PMECC_EADDR@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ATMEL_PMECC_EADDR@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
Lloh21:
	adrp	x8, _PMECC_CTRL_ENABLE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PMECC_CTRL_ENABLE@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	x8, [x21]
Lloh24:
	adrp	x19, _ATMEL_PMECC_CTRL@GOTPAGE
Lloh25:
	ldr	x19, [x19, _ATMEL_PMECC_CTRL@GOTPAGEOFF]
	ldr	x9, [x19]
	add	x1, x9, x8
	bl	_writel
Lloh26:
	adrp	x8, _PMECC_CTRL_DATA@GOTPAGE
Lloh27:
	ldr	x8, [x8, _PMECC_CTRL_DATA@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	ldr	x8, [x21]
	ldr	x9, [x19]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	ldr	w0, [x21, #12]
Lloh29:
	adrp	x1, l_.str@PAGE
Lloh30:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh31:
	adrp	x8, _EINVAL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_ECC_READ,4,2              ; @NAND_ECC_READ
	.comm	_NAND_ECC_WRITE,4,2             ; @NAND_ECC_WRITE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bad ECC operation!"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PMECC_CFG_WRITE_OP,4,2         ; @PMECC_CFG_WRITE_OP
	.comm	_PMECC_CFG_AUTO_ENABLE,4,2      ; @PMECC_CFG_AUTO_ENABLE
	.comm	_ATMEL_PMECC_CFG,8,3            ; @ATMEL_PMECC_CFG
	.comm	_ATMEL_PMECC_SAREA,8,3          ; @ATMEL_PMECC_SAREA
	.comm	_ATMEL_PMECC_SADDR,8,3          ; @ATMEL_PMECC_SADDR
	.comm	_ATMEL_PMECC_EADDR,8,3          ; @ATMEL_PMECC_EADDR
	.comm	_PMECC_CTRL_ENABLE,4,2          ; @PMECC_CTRL_ENABLE
	.comm	_ATMEL_PMECC_CTRL,8,3           ; @ATMEL_PMECC_CTRL
	.comm	_PMECC_CTRL_DATA,4,2            ; @PMECC_CTRL_DATA
.subsections_via_symbols
