	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elm_error_correction
_elm_error_correction:                  ## @elm_error_correction
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %eax
	testl	%eax, %eax
	jle	LBB0_10
## %bb.1:
	movq	%rsi, %r15
	xorl	%ebx, %ebx
	movq	_ERROR_LOCATION_SIZE@GOTPCREL(%rip), %r13
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, 16(%r15,%r12)
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_ELM_IRQSTATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, %edi
	callq	_BIT
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_elm_write_reg
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_elm_configure_page_mode
	movl	(%r14), %eax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	_ERROR_LOCATION_SIZE@GOTPCREL(%rip), %r13
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_10
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	%rbx, %r12
	shlq	$5, %r12
	cmpq	$0, 24(%r15,%r12)
	je	LBB0_9
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r13), %esi
	imull	%ebx, %esi
	movq	_ELM_LOCATION_STATUS@GOTPCREL(%rip), %rax
	addl	(%rax), %esi
	movq	%rdi, %r14
	callq	_elm_read_reg
	movq	_ECC_CORRECTABLE_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_ELM_ERROR_LOCATION_0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	(%r13), %ebx
	movq	_ECC_NB_ERRORS_MASK@GOTPCREL(%rip), %rdx
	andl	(%rdx), %eax
	movl	%eax, (%r15,%r12)
	jle	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r12), %r13
	imull	-56(%rbp), %ebx                 ## 4-byte Folded Reload
	addl	%ecx, %ebx
	addq	%rax, %r12
	addq	$8, %r12
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_elm_read_reg
	movq	_ECC_ERROR_LOCATION_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	(%r12), %rcx
	movl	%eax, (%rcx,%r15,4)
	addl	$4, %ebx
	incq	%r15
	movslq	(%r13), %rax
	cmpq	%rax, %r15
	jl	LBB0_6
	jmp	LBB0_8
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ELM_LOCATION_STATUS,4,2        ## @ELM_LOCATION_STATUS
	.comm	_ERROR_LOCATION_SIZE,4,2        ## @ERROR_LOCATION_SIZE
	.comm	_ECC_CORRECTABLE_MASK,4,2       ## @ECC_CORRECTABLE_MASK
	.comm	_ELM_ERROR_LOCATION_0,4,2       ## @ELM_ERROR_LOCATION_0
	.comm	_ECC_NB_ERRORS_MASK,4,2         ## @ECC_NB_ERRORS_MASK
	.comm	_ECC_ERROR_LOCATION_MASK,4,2    ## @ECC_ERROR_LOCATION_MASK
	.comm	_ELM_IRQSTATUS,4,2              ## @ELM_IRQSTATUS
	.no_dead_strip	_elm_error_correction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function elm_error_correction
_elm_error_correction:                  ; @elm_error_correction
	.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
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	mov	x21, #0
Lloh0:
	adrp	x24, _ERROR_LOCATION_SIZE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ERROR_LOCATION_SIZE@GOTPAGEOFF]
Lloh2:
	adrp	x27, _ELM_IRQSTATUS@GOTPAGE
Lloh3:
	ldr	x27, [x27, _ELM_IRQSTATUS@GOTPAGEOFF]
Lloh4:
	adrp	x28, _ECC_ERROR_LOCATION_MASK@GOTPAGE
Lloh5:
	ldr	x28, [x28, _ECC_ERROR_LOCATION_MASK@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x8, x19, x21, lsl #5
	mov	w9, #1
	str	w9, [x8, #16]
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w22, [x27]
	mov	x0, x21
	bl	_BIT
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	bl	_elm_write_reg
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	bl	_elm_configure_page_mode
	ldr	w8, [x20]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x21, x21, #1
	cmp	x21, w8, sxtw
	b.ge	LBB0_10
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	add	x9, x19, x21, lsl #5
	ldr	x9, [x9, #24]
	cbz	x9, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh6:
	adrp	x8, _ELM_LOCATION_STATUS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ELM_LOCATION_STATUS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x24]
	madd	w1, w9, w21, w8
	mov	x0, x20
	bl	_elm_read_reg
Lloh9:
	adrp	x8, _ECC_CORRECTABLE_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ECC_CORRECTABLE_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh12:
	adrp	x8, _ELM_ERROR_LOCATION_0@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ELM_ERROR_LOCATION_0@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	w9, [x24]
Lloh15:
	adrp	x10, _ECC_NB_ERRORS_MASK@GOTPAGE
Lloh16:
	ldr	x10, [x10, _ECC_NB_ERRORS_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	and	w10, w10, w0
	add	x26, x19, x21, lsl #5
	str	w10, [x26]
	cmp	w10, #1
	b.lt	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, #0
	madd	w22, w9, w21, w8
	add	x25, x26, #8
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	mov	x1, x22
	bl	_elm_read_reg
	ldr	w8, [x28]
	and	w8, w8, w0
	ldr	x9, [x25]
	str	w8, [x9, x23, lsl #2]
	add	w22, w22, #4
	add	x23, x23, #1
	ldrsw	x8, [x26]
	cmp	x23, x8
	b.lt	LBB0_9
	b	LBB0_3
LBB0_10:
	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 AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ELM_LOCATION_STATUS,4,2        ; @ELM_LOCATION_STATUS
	.comm	_ERROR_LOCATION_SIZE,4,2        ; @ERROR_LOCATION_SIZE
	.comm	_ECC_CORRECTABLE_MASK,4,2       ; @ECC_CORRECTABLE_MASK
	.comm	_ELM_ERROR_LOCATION_0,4,2       ; @ELM_ERROR_LOCATION_0
	.comm	_ECC_NB_ERRORS_MASK,4,2         ; @ECC_NB_ERRORS_MASK
	.comm	_ECC_ERROR_LOCATION_MASK,4,2    ; @ECC_ERROR_LOCATION_MASK
	.comm	_ELM_IRQSTATUS,4,2              ; @ELM_IRQSTATUS
	.no_dead_strip	_elm_error_correction
.subsections_via_symbols
