	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function erst_reader
_erst_reader:                           ## @erst_reader
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -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_30
LBB0_2:
	movq	%rcx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	_erst_info@GOTPCREL(%rip), %rax
	movslq	(%rax), %r13
	addq	$20, %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_kmalloc
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_10
## %bb.3:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	_reader_pos@GOTPCREL(%rip), %rdi
	leaq	-48(%rbp), %rsi
	callq	_erst_get_record_id_next
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	jmp	LBB0_13
LBB0_5:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rdi
	movq	_APEI_ERST_INVALID_RECORD_ID@GOTPCREL(%rip), %r15
	xorl	%r12d, %r12d
	movl	$0, %ebx
	cmpq	(%r15), %rdi
	je	LBB0_12
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rsi
	movq	%r13, %rdx
	callq	_erst_read
	movl	%eax, %ebx
	movq	_ENOENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_8
## %bb.15:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$19, %ebx
	jbe	LBB0_16
## %bb.18:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	8(%r14), %edi
	movq	_CPER_CREATOR_PSTORE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_uuid_le_cmp
	testq	%rax, %rax
	je	LBB0_19
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	_reader_pos@GOTPCREL(%rip), %rdi
	leaq	-48(%rbp), %rsi
	callq	_erst_get_record_id_next
	testl	%eax, %eax
	jne	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-48(%rbp), %rdi
	cmpq	(%r15), %rdi
	jne	LBB0_7
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_13:
	subl	(%rax), %r12d
LBB0_14:
	movq	%r14, %rdi
	callq	_kfree
	addl	$-20, %ebx
	testl	%r12d, %r12d
	cmovsl	%r12d, %ebx
LBB0_30:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	%eax, %r12d
	jmp	LBB0_14
LBB0_16:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	jmp	LBB0_13
LBB0_19:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_kmalloc
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_20
## %bb.21:
	movl	16(%r14), %esi
	addl	$-20, %ebx
	movq	%rax, %rdi
	movl	%ebx, %edx
	callq	_memcpy
	movq	-48(%rbp), %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movl	12(%r14), %edi
	movq	_CPER_SECTION_TYPE_DMESG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_uuid_le_cmp
	testq	%rax, %rax
	je	LBB0_22
## %bb.23:
	movl	12(%r14), %edi
	movq	_CPER_SECTION_TYPE_MCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_uuid_le_cmp
	testq	%rax, %rax
	jne	LBB0_24
## %bb.25:
	movq	_PSTORE_TYPE_MCE@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_20:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	jmp	LBB0_13
LBB0_22:
	movq	_PSTORE_TYPE_DMESG@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_24:
	movq	_PSTORE_TYPE_UNKNOWN@GOTPCREL(%rip), %rax
LBB0_26:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movq	_CPER_VALID_TIMESTAMP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_27
## %bb.28:
	movl	4(%r14), %eax
	jmp	LBB0_29
LBB0_27:
	xorl	%eax, %eax
LBB0_29:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 8(%rcx)
	movq	$0, (%rcx)
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
	.comm	_erst_info,4,2                  ## @erst_info
	.comm	_erst_disable,8,3               ## @erst_disable
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_reader_pos,4,2                 ## @reader_pos
	.comm	_APEI_ERST_INVALID_RECORD_ID,8,3 ## @APEI_ERST_INVALID_RECORD_ID
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_EIO,4,2                        ## @EIO
	.comm	_CPER_CREATOR_PSTORE,4,2        ## @CPER_CREATOR_PSTORE
	.comm	_CPER_SECTION_TYPE_DMESG,4,2    ## @CPER_SECTION_TYPE_DMESG
	.comm	_PSTORE_TYPE_DMESG,4,2          ## @PSTORE_TYPE_DMESG
	.comm	_CPER_SECTION_TYPE_MCE,4,2      ## @CPER_SECTION_TYPE_MCE
	.comm	_PSTORE_TYPE_MCE,4,2            ## @PSTORE_TYPE_MCE
	.comm	_PSTORE_TYPE_UNKNOWN,4,2        ## @PSTORE_TYPE_UNKNOWN
	.comm	_CPER_VALID_TIMESTAMP,4,2       ## @CPER_VALID_TIMESTAMP
	.no_dead_strip	_erst_reader
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function erst_reader
_erst_reader:                           ; @erst_reader
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
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	w23, w8
	b	LBB0_17
LBB0_2:
	mov	x24, x4
	mov	x20, x3
	mov	x21, x1
	mov	x22, x0
Lloh6:
	adrp	x8, _erst_info@GOTPAGE
Lloh7:
	ldr	x8, [x8, _erst_info@GOTPAGEOFF]
Lloh8:
	ldrsw	x8, [x8]
	add	x25, x8, #20
Lloh9:
	adrp	x28, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x28, [x28, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x28]
	mov	x0, x25
	bl	_kmalloc
	mov	x19, x0
	cbz	x0, LBB0_5
; %bb.3:
Lloh11:
	adrp	x0, _reader_pos@GOTPAGE
Lloh12:
	ldr	x0, [x0, _reader_pos@GOTPAGEOFF]
	add	x1, sp, #8
	bl	_erst_get_record_id_next
	cbz	w0, LBB0_7
; %bb.4:
	mov	x27, x0
	mov	w23, #0
	b	LBB0_16
LBB0_5:
	mov	w23, #0
LBB0_6:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_15
LBB0_7:
	ldr	x0, [sp, #8]
Lloh15:
	adrp	x26, _APEI_ERST_INVALID_RECORD_ID@GOTPAGE
Lloh16:
	ldr	x26, [x26, _APEI_ERST_INVALID_RECORD_ID@GOTPAGEOFF]
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.8:
	mov	w23, #0
	b	LBB0_14
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x1, x19
	mov	x2, x25
	bl	_erst_read
	mov	x23, x0
Lloh17:
	adrp	x8, _ENOENT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w23, #19
	b.ls	LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x19, #8]
Lloh20:
	adrp	x8, _CPER_CREATOR_PSTORE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CPER_CREATOR_PSTORE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	bl	_uuid_le_cmp
	cbz	x0, LBB0_20
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=1
	add	x1, sp, #8
Lloh23:
	adrp	x0, _reader_pos@GOTPAGE
Lloh24:
	ldr	x0, [x0, _reader_pos@GOTPAGEOFF]
	bl	_erst_get_record_id_next
	cbnz	w0, LBB0_18
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x0, [sp, #8]
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_9
LBB0_14:
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w27, w8
LBB0_16:
	mov	x0, x19
	bl	_kfree
	sub	w8, w23, #20
	cmp	w27, #0
	csel	w23, w27, w8, lt
LBB0_17:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_18:
	mov	x27, x0
	b	LBB0_16
LBB0_19:
Lloh27:
	adrp	x8, _EIO@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_15
LBB0_20:
	ldr	w1, [x28]
	mov	x0, x23
	bl	_kmalloc
	str	x0, [x24]
	cbz	x0, LBB0_6
; %bb.21:
	ldr	w1, [x19, #16]
	sub	w23, w23, #20
	mov	x2, x23
	bl	_memcpy
	ldr	x8, [sp, #8]
	str	x8, [x22]
	ldr	w0, [x19, #12]
Lloh29:
	adrp	x8, _CPER_SECTION_TYPE_DMESG@GOTPAGE
Lloh30:
	ldr	x8, [x8, _CPER_SECTION_TYPE_DMESG@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	bl	_uuid_le_cmp
	cbz	x0, LBB0_23
; %bb.22:
	ldr	w0, [x19, #12]
Lloh32:
	adrp	x8, _CPER_SECTION_TYPE_MCE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _CPER_SECTION_TYPE_MCE@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	bl	_uuid_le_cmp
Lloh35:
	adrp	x8, _PSTORE_TYPE_UNKNOWN@GOTPAGE
Lloh36:
	ldr	x8, [x8, _PSTORE_TYPE_UNKNOWN@GOTPAGEOFF]
Lloh37:
	adrp	x9, _PSTORE_TYPE_MCE@GOTPAGE
Lloh38:
	ldr	x9, [x9, _PSTORE_TYPE_MCE@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
	b	LBB0_24
LBB0_23:
Lloh39:
	adrp	x8, _PSTORE_TYPE_DMESG@GOTPAGE
Lloh40:
	ldr	x8, [x8, _PSTORE_TYPE_DMESG@GOTPAGEOFF]
LBB0_24:
	ldr	w8, [x8]
	str	w8, [x21]
	ldr	w8, [x19]
Lloh41:
	adrp	x9, _CPER_VALID_TIMESTAMP@GOTPAGE
Lloh42:
	ldr	x9, [x9, _CPER_VALID_TIMESTAMP@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_26
; %bb.25:
	ldr	w8, [x19, #4]
	b	LBB0_27
LBB0_26:
	mov	w8, #0
LBB0_27:
	str	w8, [x20, #8]
	str	xzr, [x20]
	mov	x0, x19
	bl	_kfree
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_erst_info,4,2                  ; @erst_info
	.comm	_erst_disable,8,3               ; @erst_disable
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_reader_pos,4,2                 ; @reader_pos
	.comm	_APEI_ERST_INVALID_RECORD_ID,8,3 ; @APEI_ERST_INVALID_RECORD_ID
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_EIO,4,2                        ; @EIO
	.comm	_CPER_CREATOR_PSTORE,4,2        ; @CPER_CREATOR_PSTORE
	.comm	_CPER_SECTION_TYPE_DMESG,4,2    ; @CPER_SECTION_TYPE_DMESG
	.comm	_PSTORE_TYPE_DMESG,4,2          ; @PSTORE_TYPE_DMESG
	.comm	_CPER_SECTION_TYPE_MCE,4,2      ; @CPER_SECTION_TYPE_MCE
	.comm	_PSTORE_TYPE_MCE,4,2            ; @PSTORE_TYPE_MCE
	.comm	_PSTORE_TYPE_UNKNOWN,4,2        ; @PSTORE_TYPE_UNKNOWN
	.comm	_CPER_VALID_TIMESTAMP,4,2       ; @CPER_VALID_TIMESTAMP
	.no_dead_strip	_erst_reader
.subsections_via_symbols
