	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_pmecc_err_location
_atmel_pmecc_err_location:              ## @atmel_pmecc_err_location
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_get_sectorsize
	movl	%eax, %r15d
	xorl	%eax, %eax
	cmpl	$512, %r15d                     ## imm = 0x200
	sete	%al
	movl	$14, %ebx
	subl	%eax, %ebx
	movq	16(%r14), %r12
	movq	%r14, %rdi
	callq	_get_strength
	movl	%eax, %r13d
	movq	8(%r14), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_PMERRLOC_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ATMEL_PMERRLOC_ELDIS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	callq	_writel
	movslq	%r13d, %rax
	leaq	1(%rax), %rdx
	movq	(%r14), %rcx
	cmpl	$0, 4(%rcx,%rax,4)
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	js	LBB0_1
## %bb.2:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	leal	1(%r13,%r13), %eax
	imull	%edx, %eax
	cltq
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	movq	$-1, %rbx
	movq	%rdx, %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r14,%rbx,4), %r13d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %r15
	incq	%rbx
	movl	%ebx, %edi
	callq	_ATMEL_PMERRLOC_SIGMA
	addq	%rax, %r15
	movl	%r13d, %edi
	movq	%r15, %rsi
	callq	_writel_relaxed
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax,%r12,4), %eax
	sarl	%eax
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_3
## %bb.4:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_5
LBB0_1:
	movl	$-1, %ebx
LBB0_5:
	movl	%ebx, %eax
	shll	$16, %eax
	xorl	%r13d, %r13d
	cmpl	$1024, %r15d                    ## imm = 0x400
	sete	%r13b
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	orl	%eax, %r13d
	movq	_ATMEL_PMERRLOC_ELCFG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	movl	%r13d, %edi
	callq	_writel
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	imull	-88(%rbp), %eax                 ## 4-byte Folded Reload
	leal	(%rax,%r15,8), %edi
	movq	_ATMEL_PMERRLOC_ELEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	callq	_writel
	movq	_ATMEL_PMERRLOC_ELISR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r12), %rdi
	movq	_PMERRLOC_CALC_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%r13d, %edx
	movq	_PMECC_MAX_TIMEOUT_MS@GOTPCREL(%rip), %rax
	imull	$1000, (%rax), %r8d             ## imm = 0x3E8
	movl	%r13d, %esi
	xorl	%ecx, %ecx
	callq	_readl_relaxed_poll_timeout
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r15d
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movl	%r15d, %ebx
	jmp	LBB0_9
LBB0_7:
	movq	_PMERRLOC_ERR_NUM_MASK@GOTPCREL(%rip), %rax
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	andl	(%rax), %edx
	sarl	$8, %edx
	movq	(%r14), %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax,%rcx,4), %eax
	sarl	%eax
	cmpl	%eax, %edx
	je	LBB0_9
## %bb.8:
	movq	_EBADMSG@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PMERRLOC_DISABLE,4,2           ## @PMERRLOC_DISABLE
	.comm	_ATMEL_PMERRLOC_ELDIS,8,3       ## @ATMEL_PMERRLOC_ELDIS
	.comm	_ATMEL_PMERRLOC_ELCFG,8,3       ## @ATMEL_PMERRLOC_ELCFG
	.comm	_ATMEL_PMERRLOC_ELEN,8,3        ## @ATMEL_PMERRLOC_ELEN
	.comm	_ATMEL_PMERRLOC_ELISR,8,3       ## @ATMEL_PMERRLOC_ELISR
	.comm	_PMERRLOC_CALC_DONE,4,2         ## @PMERRLOC_CALC_DONE
	.comm	_PMECC_MAX_TIMEOUT_MS,4,2       ## @PMECC_MAX_TIMEOUT_MS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PMECC: Timeout to calculate error location.\n"

	.comm	_PMERRLOC_ERR_NUM_MASK,4,2      ## @PMERRLOC_ERR_NUM_MASK
	.comm	_EBADMSG,4,2                    ## @EBADMSG
	.no_dead_strip	_atmel_pmecc_err_location
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_pmecc_err_location
_atmel_pmecc_err_location:              ; @atmel_pmecc_err_location
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_get_sectorsize
	mov	x20, x0
	cmp	w0, #512
	mov	w8, #13
	cinc	w26, w8, ne
	ldr	x24, [x19, #16]
	mov	x0, x19
	bl	_get_strength
	mov	x21, x0
	ldr	x22, [x19, #8]
Lloh0:
	adrp	x8, _PMERRLOC_DISABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PMERRLOC_DISABLE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	x8, [x24, #8]
Lloh3:
	adrp	x9, _ATMEL_PMERRLOC_ELDIS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ATMEL_PMERRLOC_ELDIS@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	add	w8, w21, #1
	sxtw	x25, w8
	ldr	x9, [x19]
	ldr	w8, [x9, w8, sxtw #2]
	tbnz	w8, #31, LBB0_4
; %bb.1:
	mov	x8, #0
	mov	w9, #1
	bfi	w9, w21, #1, #31
	mul	w9, w9, w25
	add	x27, x22, w9, sxtw #2
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x22, x8
	ldr	w23, [x27, x8, lsl #2]
	ldr	x28, [x24, #8]
	mov	x0, x22
	bl	_ATMEL_PMERRLOC_SIGMA
	add	x1, x0, x28
	mov	x0, x23
	bl	_writel_relaxed
	add	x8, x22, #1
	ldr	x9, [x19]
	ldr	w9, [x9, x25, lsl #2]
	asr	w9, w9, #1
	cmp	x22, w9, sxtw
	b.lt	LBB0_2
; %bb.3:
	sub	w22, w8, #1
	b	LBB0_5
LBB0_4:
	mov	w22, #-1
LBB0_5:
	cmp	w20, #1024
	cset	w23, eq
	bfi	w23, w22, #16, #16
	ldr	x8, [x24, #8]
Lloh6:
	adrp	x9, _ATMEL_PMERRLOC_ELCFG@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ATMEL_PMERRLOC_ELCFG@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x23
	bl	_writel
	mul	w8, w26, w21
	add	w0, w8, w20, lsl #3
	ldr	x8, [x24, #8]
Lloh9:
	adrp	x9, _ATMEL_PMERRLOC_ELEN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ATMEL_PMERRLOC_ELEN@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
Lloh12:
	adrp	x8, _ATMEL_PMERRLOC_ELISR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ATMEL_PMERRLOC_ELISR@GOTPAGEOFF]
	ldr	x9, [x24, #8]
Lloh14:
	ldr	x8, [x8]
	add	x0, x8, x9
Lloh15:
	adrp	x8, _PMERRLOC_CALC_DONE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PMERRLOC_CALC_DONE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	and	w2, w8, w23
Lloh18:
	adrp	x8, _PMECC_MAX_TIMEOUT_MS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PMECC_MAX_TIMEOUT_MS@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	mov	w9, #1000
	mul	w4, w8, w9
	mov	x1, x23
	mov	w3, #0
	bl	_readl_relaxed_poll_timeout
	cbz	w0, LBB0_7
; %bb.6:
	mov	x20, x0
	ldr	w0, [x24]
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x22, x20
	b	LBB0_9
LBB0_7:
	lsl	w8, w22, #16
Lloh23:
	adrp	x9, _PMERRLOC_ERR_NUM_MASK@GOTPAGE
Lloh24:
	ldr	x9, [x9, _PMERRLOC_ERR_NUM_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	and	w8, w9, w8
	asr	w8, w8, #8
	ldr	x9, [x19]
	ldr	w9, [x9, x25, lsl #2]
	cmp	w8, w9, asr #1
	b.eq	LBB0_9
; %bb.8:
Lloh26:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_9:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_PMERRLOC_DISABLE,4,2           ; @PMERRLOC_DISABLE
	.comm	_ATMEL_PMERRLOC_ELDIS,8,3       ; @ATMEL_PMERRLOC_ELDIS
	.comm	_ATMEL_PMERRLOC_ELCFG,8,3       ; @ATMEL_PMERRLOC_ELCFG
	.comm	_ATMEL_PMERRLOC_ELEN,8,3        ; @ATMEL_PMERRLOC_ELEN
	.comm	_ATMEL_PMERRLOC_ELISR,8,3       ; @ATMEL_PMERRLOC_ELISR
	.comm	_PMERRLOC_CALC_DONE,4,2         ; @PMERRLOC_CALC_DONE
	.comm	_PMECC_MAX_TIMEOUT_MS,4,2       ; @PMECC_MAX_TIMEOUT_MS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PMECC: Timeout to calculate error location.\n"

	.comm	_PMERRLOC_ERR_NUM_MASK,4,2      ; @PMERRLOC_ERR_NUM_MASK
	.comm	_EBADMSG,4,2                    ; @EBADMSG
	.no_dead_strip	_atmel_pmecc_err_location
.subsections_via_symbols
