	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_erst_get_record_id_next        ## -- Begin function erst_get_record_id_next
	.p2align	4, 0x90
_erst_get_record_id_next:               ## @erst_get_record_id_next
	.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
	pushq	%rax
	.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_11
LBB0_2:
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	_erst_record_id_cache@GOTPCREL(%rip), %r13
	xorl	%edi, %edi
	cmpl	$0, 20(%r13)
	sete	%dil
	callq	_BUG_ON
	movl	(%r12), %eax
	testl	%eax, %eax
	sets	%cl
	cmpl	(%r13), %eax
	setg	%al
	orb	%cl, %al
	movzbl	%al, %edi
	callq	_BUG_ON
	leaq	16(%r13), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movslq	(%r12), %rax
	cmpl	(%r13), %eax
	jge	LBB0_6
## %bb.3:
	movq	8(%r13), %rcx
	movq	_APEI_ERST_INVALID_RECORD_ID@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	movq	%rax, %rdx
	shlq	$32, %rdx
	leal	1(%rax), %esi
	movabsq	$4294967296, %r8                ## imm = 0x100000000
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rdi, (%rcx,%rax,8)
	jne	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rax
	movl	%esi, (%r12)
	movslq	(%r13), %rbx
	addq	%r8, %rdx
	incl	%esi
	cmpq	%rbx, %rax
	jl	LBB0_4
LBB0_6:
	xorl	%eax, %eax
	callq	___erst_record_id_cache_add_one
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_10
## %bb.7:
	cmpl	$1, %ebx
	jne	LBB0_9
## %bb.8:
	movq	8(%r13), %rax
	movslq	(%r12), %rcx
	movq	(%rax,%rcx,8), %rax
	movq	%rax, (%r14)
	leal	1(%rcx), %eax
	movl	%eax, (%r12)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_12:
	sarq	$29, %rdx
	movq	(%rcx,%rdx), %rax
	movq	%rax, (%r14)
	movl	%esi, (%r12)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_9:
	movl	$-1, (%r12)
	movq	_APEI_ERST_INVALID_RECORD_ID@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
LBB0_10:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_erst_disable,8,3               ## @erst_disable
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_erst_record_id_cache,24,3      ## @erst_record_id_cache
	.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_get_record_id_next        ; -- Begin function erst_get_record_id_next
	.p2align	2
_erst_get_record_id_next:               ; @erst_get_record_id_next
	.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	w21, w8
	b	LBB0_12
LBB0_2:
	mov	x19, x1
	mov	x20, x0
Lloh6:
	adrp	x22, _erst_record_id_cache@GOTPAGE
Lloh7:
	ldr	x22, [x22, _erst_record_id_cache@GOTPAGEOFF]
	ldr	w8, [x22, #20]
	cmp	w8, #0
	cset	w0, eq
	bl	_BUG_ON
	ldr	w8, [x20]
	cmp	w8, #0
	ldr	w9, [x22]
	ccmp	w8, w9, #0, ge
	cset	w0, gt
	bl	_BUG_ON
	add	x0, x22, #16
	bl	_mutex_lock
	ldrsw	x8, [x20]
	ldr	w9, [x22]
	cmp	w8, w9
	b.ge	LBB0_6
; %bb.3:
	ldr	x9, [x22, #8]
Lloh8:
	adrp	x10, _APEI_ERST_INVALID_RECORD_ID@GOTPAGE
Lloh9:
	ldr	x10, [x10, _APEI_ERST_INVALID_RECORD_ID@GOTPAGEOFF]
Lloh10:
	ldr	x12, [x10]
	lsl	x11, x8, #32
	add	w10, w8, #1
	mov	x13, #4294967296
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x14, [x9, x8, lsl #3]
	cmp	x14, x12
	b.ne	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, #1
	str	w10, [x20]
	ldrsw	x14, [x22]
	add	x11, x11, x13
	add	w10, w10, #1
	cmp	x8, x14
	b.lt	LBB0_4
LBB0_6:
	bl	___erst_record_id_cache_add_one
	mov	x21, x0
	tbnz	w0, #31, LBB0_11
; %bb.7:
	cmp	w21, #1
	b.ne	LBB0_10
; %bb.8:
	mov	w21, #0
	ldr	x8, [x22, #8]
	ldrsw	x9, [x20]
	ldr	x8, [x8, x9, lsl #3]
	str	x8, [x19]
	add	w8, w9, #1
	str	w8, [x20]
	b	LBB0_11
LBB0_9:
	mov	w21, #0
	asr	x8, x11, #29
	ldr	x8, [x9, x8]
	str	x8, [x19]
	str	w10, [x20]
	b	LBB0_11
LBB0_10:
	mov	w8, #-1
	str	w8, [x20]
Lloh11:
	adrp	x8, _APEI_ERST_INVALID_RECORD_ID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _APEI_ERST_INVALID_RECORD_ID@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	str	x8, [x19]
LBB0_11:
	add	x0, x22, #16
	bl	_mutex_unlock
LBB0_12:
	mov	x0, x21
	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	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_erst_disable,8,3               ; @erst_disable
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_erst_record_id_cache,24,3      ; @erst_record_id_cache
	.comm	_APEI_ERST_INVALID_RECORD_ID,8,3 ; @APEI_ERST_INVALID_RECORD_ID
.subsections_via_symbols
