	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_erst_clear                     ## -- Begin function erst_clear
	.p2align	4, 0x90
_erst_clear:                            ## @erst_clear
	.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
	movq	_erst_disable@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_2:
	movq	%rdi, %r15
	movq	_erst_record_id_cache@GOTPCREL(%rip), %r12
	leaq	4(%r12), %r14
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_21
## %bb.3:
	movq	_erst_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	_erst_erange@GOTPCREL(%rip), %rax
	movq	_ERST_RANGE_NVRAM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	callq	___erst_clear_from_nvram
	jmp	LBB0_6
LBB0_5:
	movq	%r15, %rdi
	callq	___erst_clear_from_storage
LBB0_6:
	movl	%eax, %ebx
	movq	_erst_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	testl	%ebx, %ebx
	jne	LBB0_20
## %bb.7:
	movl	(%r12), %r8d
	testl	%r8d, %r8d
	jle	LBB0_19
## %bb.8:
	movq	8(%r12), %rax
	cmpl	$1, %r8d
	jne	LBB0_10
## %bb.9:
	xorl	%edx, %edx
LBB0_16:
	testb	$1, %r8b
	je	LBB0_19
## %bb.17:
	cmpq	%r15, (%rax,%rdx,8)
	jne	LBB0_19
## %bb.18:
	movq	_APEI_ERST_INVALID_RECORD_ID@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax,%rdx,8)
LBB0_19:
	xorl	%eax, %eax
	callq	___erst_record_id_cache_compact
LBB0_20:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_21:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	%r8d, %esi
	andl	$-2, %esi
	xorl	%edx, %edx
	movq	_APEI_ERST_INVALID_RECORD_ID@GOTPCREL(%rip), %rdi
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=1
	addq	$2, %rdx
	cmpq	%rdx, %rsi
	je	LBB0_16
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%r15, (%rax,%rdx,8)
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	(%rdi), %rcx
	movq	%rcx, (%rax,%rdx,8)
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	cmpq	%r15, 8(%rax,%rdx,8)
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	(%rdi), %rcx
	movq	%rcx, 8(%rax,%rdx,8)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_erst_disable,8,3               ## @erst_disable
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_erst_record_id_cache,16,3      ## @erst_record_id_cache
	.comm	_erst_lock,4,2                  ## @erst_lock
	.comm	_erst_erange,4,2                ## @erst_erange
	.comm	_ERST_RANGE_NVRAM,4,2           ## @ERST_RANGE_NVRAM
	.comm	_APEI_ERST_INVALID_RECORD_ID,8,3 ## @APEI_ERST_INVALID_RECORD_ID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_erst_clear                     ; -- Begin function erst_clear
	.p2align	2
_erst_clear:                            ; @erst_clear
	.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
Lloh0:
	adrp	x8, _erst_disable@GOTPAGE
Lloh1:
	ldr	x8, [x8, _erst_disable@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ENODEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_37
LBB0_2:
	mov	x19, x0
Lloh6:
	adrp	x21, _erst_record_id_cache@GOTPAGE
Lloh7:
	ldr	x21, [x21, _erst_record_id_cache@GOTPAGEOFF]
	add	x0, x21, #4
	bl	_mutex_lock_interruptible
	mov	x20, x0
	cbnz	w0, LBB0_37
; %bb.3:
Lloh8:
	adrp	x0, _erst_lock@GOTPAGE
Lloh9:
	ldr	x0, [x0, _erst_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
Lloh10:
	adrp	x8, _erst_erange@GOTPAGE
Lloh11:
	ldr	x8, [x8, _erst_erange@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _ERST_RANGE_NVRAM@GOTPAGE
Lloh14:
	ldr	x9, [x9, _ERST_RANGE_NVRAM@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	mov	x0, x19
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	bl	___erst_clear_from_nvram
	b	LBB0_6
LBB0_5:
	bl	___erst_clear_from_storage
LBB0_6:
	mov	x20, x0
Lloh16:
	adrp	x0, _erst_lock@GOTPAGE
Lloh17:
	ldr	x0, [x0, _erst_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	cbnz	w20, LBB0_36
; %bb.7:
	ldr	w9, [x21]
	cmp	w9, #1
	b.lt	LBB0_35
; %bb.8:
	ldr	x10, [x21, #8]
Lloh18:
	adrp	x8, _APEI_ERST_INVALID_RECORD_ID@GOTPAGE
Lloh19:
	ldr	x8, [x8, _APEI_ERST_INVALID_RECORD_ID@GOTPAGEOFF]
	cmp	w9, #8
	b.lo	LBB0_11
; %bb.9:
	add	x11, x8, #8
	cmp	x10, x11
	b.hs	LBB0_16
; %bb.10:
	add	x11, x10, x9, lsl #3
	cmp	x11, x8
	b.ls	LBB0_16
LBB0_11:
	mov	x11, #0
LBB0_12:
	add	x10, x10, x11, lsl #3
	sub	x9, x9, x11
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x10, x10, #8
	subs	x9, x9, #1
	b.eq	LBB0_35
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10]
	cmp	x11, x19
	b.ne	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x11, [x8]
	str	x11, [x10]
	b	LBB0_13
LBB0_16:
	and	x11, x9, #0xfffffff8
	dup.2d	v0, x19
	ldr	x12, [x8]
	add	x13, x10, #32
	mov	x14, x11
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	add	x13, x13, #64
	subs	x14, x14, #8
	b.eq	LBB0_34
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldur	q1, [x13, #-32]
	cmeq.2d	v1, v1, v0
	xtn.2s	v1, v1
	fmov	w15, s1
	tbz	w15, #0, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	stur	x12, [x13, #-32]
LBB0_20:                                ;   in Loop: Header=BB0_18 Depth=1
	mov.s	w15, v1[1]
	tbz	w15, #0, LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_18 Depth=1
	stur	x12, [x13, #-24]
LBB0_22:                                ;   in Loop: Header=BB0_18 Depth=1
	ldur	q1, [x13, #-16]
	cmeq.2d	v1, v1, v0
	xtn.2s	v1, v1
	fmov	w15, s1
	tbz	w15, #0, LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_18 Depth=1
	stur	x12, [x13, #-16]
LBB0_24:                                ;   in Loop: Header=BB0_18 Depth=1
	mov.s	w15, v1[1]
	tbz	w15, #0, LBB0_26
; %bb.25:                               ;   in Loop: Header=BB0_18 Depth=1
	stur	x12, [x13, #-8]
LBB0_26:                                ;   in Loop: Header=BB0_18 Depth=1
	ldr	q1, [x13]
	cmeq.2d	v1, v1, v0
	xtn.2s	v1, v1
	fmov	w15, s1
	tbz	w15, #0, LBB0_28
; %bb.27:                               ;   in Loop: Header=BB0_18 Depth=1
	str	x12, [x13]
LBB0_28:                                ;   in Loop: Header=BB0_18 Depth=1
	mov.s	w15, v1[1]
	tbz	w15, #0, LBB0_30
; %bb.29:                               ;   in Loop: Header=BB0_18 Depth=1
	str	x12, [x13, #8]
LBB0_30:                                ;   in Loop: Header=BB0_18 Depth=1
	ldr	q1, [x13, #16]
	cmeq.2d	v1, v1, v0
	xtn.2s	v1, v1
	fmov	w15, s1
	tbz	w15, #0, LBB0_32
; %bb.31:                               ;   in Loop: Header=BB0_18 Depth=1
	str	x12, [x13, #16]
LBB0_32:                                ;   in Loop: Header=BB0_18 Depth=1
	mov.s	w15, v1[1]
	tbz	w15, #0, LBB0_17
; %bb.33:                               ;   in Loop: Header=BB0_18 Depth=1
	str	x12, [x13, #24]
	b	LBB0_17
LBB0_34:
	cmp	x11, x9
	b.ne	LBB0_12
LBB0_35:
	bl	___erst_record_id_cache_compact
LBB0_36:
	add	x0, x21, #4
	bl	_mutex_unlock
LBB0_37:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_erst_disable,8,3               ; @erst_disable
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_erst_record_id_cache,16,3      ; @erst_record_id_cache
	.comm	_erst_lock,4,2                  ; @erst_lock
	.comm	_erst_erange,4,2                ; @erst_erange
	.comm	_ERST_RANGE_NVRAM,4,2           ; @ERST_RANGE_NVRAM
	.comm	_APEI_ERST_INVALID_RECORD_ID,8,3 ; @APEI_ERST_INVALID_RECORD_ID
.subsections_via_symbols
