	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvram_open
_nvram_open:                            ## @nvram_open
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rsi, %rbx
	xorl	%eax, %eax
	callq	_lock_kernel
	movq	_nvram_state_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock
	movq	_nvram_open_cnt@GOTPCREL(%rip), %r9
	movq	(%r9), %rcx
	testq	%rcx, %rcx
	je	LBB0_2
## %bb.1:
	movq	_O_EXCL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rbx)
	jne	LBB0_5
LBB0_2:
	movq	_nvram_open_mode@GOTPCREL(%rip), %r8
	movl	(%r8), %esi
	movq	_NVRAM_EXCL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%esi, %edx
	je	LBB0_3
LBB0_5:
	movq	_nvram_state_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_unlock_kernel
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_3:
	movq	_FMODE_WRITE@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	andl	4(%rbx), %edi
	je	LBB0_6
## %bb.4:
	movq	_NVRAM_WRITE@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	jne	LBB0_5
LBB0_6:
	movq	_O_EXCL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_8
## %bb.7:
	orl	%edx, %esi
	movl	%esi, (%r8)
LBB0_8:
	testl	%edi, %edi
	je	LBB0_10
## %bb.9:
	movq	_NVRAM_WRITE@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	%esi, (%r8)
LBB0_10:
	incq	%rcx
	movq	%rcx, (%r9)
	movq	_nvram_state_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_unlock_kernel
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_nvram_state_lock,4,2           ## @nvram_state_lock
	.comm	_nvram_open_cnt,8,3             ## @nvram_open_cnt
	.comm	_O_EXCL,4,2                     ## @O_EXCL
	.comm	_nvram_open_mode,4,2            ## @nvram_open_mode
	.comm	_NVRAM_EXCL,4,2                 ## @NVRAM_EXCL
	.comm	_FMODE_WRITE,4,2                ## @FMODE_WRITE
	.comm	_NVRAM_WRITE,4,2                ## @NVRAM_WRITE
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_nvram_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvram_open
_nvram_open:                            ; @nvram_open
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	bl	_lock_kernel
Lloh0:
	adrp	x0, _nvram_state_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _nvram_state_lock@GOTPAGEOFF]
	bl	_spin_lock
Lloh2:
	adrp	x8, _nvram_open_cnt@GOTPAGE
Lloh3:
	ldr	x8, [x8, _nvram_open_cnt@GOTPAGEOFF]
	ldr	x9, [x8]
	cbz	x9, LBB0_2
; %bb.1:
	ldr	w10, [x19]
Lloh4:
	adrp	x11, _O_EXCL@GOTPAGE
Lloh5:
	ldr	x11, [x11, _O_EXCL@GOTPAGEOFF]
Lloh6:
	ldr	w11, [x11]
	tst	w11, w10
	b.ne	LBB0_3
LBB0_2:
Lloh7:
	adrp	x10, _nvram_open_mode@GOTPAGE
Lloh8:
	ldr	x10, [x10, _nvram_open_mode@GOTPAGEOFF]
	ldr	w11, [x10]
Lloh9:
	adrp	x12, _NVRAM_EXCL@GOTPAGE
Lloh10:
	ldr	x12, [x12, _NVRAM_EXCL@GOTPAGEOFF]
Lloh11:
	ldr	w14, [x12]
	tst	w14, w11
	b.eq	LBB0_5
LBB0_3:
Lloh12:
	adrp	x0, _nvram_state_lock@GOTPAGE
Lloh13:
	ldr	x0, [x0, _nvram_state_lock@GOTPAGEOFF]
	bl	_spin_unlock
	bl	_unlock_kernel
Lloh14:
	adrp	x8, _EBUSY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	w13, [x19, #4]
Lloh17:
	adrp	x12, _FMODE_WRITE@GOTPAGE
Lloh18:
	ldr	x12, [x12, _FMODE_WRITE@GOTPAGEOFF]
Lloh19:
	ldr	w15, [x12]
Lloh20:
	adrp	x12, _NVRAM_WRITE@GOTPAGE
Lloh21:
	ldr	x12, [x12, _NVRAM_WRITE@GOTPAGEOFF]
	ands	w13, w15, w13
	b.eq	LBB0_7
; %bb.6:
	ldr	w15, [x12]
	tst	w15, w11
	b.ne	LBB0_3
LBB0_7:
	ldr	w15, [x19]
Lloh22:
	adrp	x16, _O_EXCL@GOTPAGE
Lloh23:
	ldr	x16, [x16, _O_EXCL@GOTPAGEOFF]
Lloh24:
	ldr	w16, [x16]
	tst	w16, w15
	b.eq	LBB0_9
; %bb.8:
	orr	w11, w14, w11
	str	w11, [x10]
LBB0_9:
	cbz	w13, LBB0_11
; %bb.10:
	ldr	w12, [x12]
	orr	w11, w11, w12
	str	w11, [x10]
LBB0_11:
	add	x9, x9, #1
	str	x9, [x8]
Lloh25:
	adrp	x0, _nvram_state_lock@GOTPAGE
Lloh26:
	ldr	x0, [x0, _nvram_state_lock@GOTPAGEOFF]
	bl	_spin_unlock
	bl	_unlock_kernel
	mov	w0, #0
	b	LBB0_4
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_nvram_state_lock,4,2           ; @nvram_state_lock
	.comm	_nvram_open_cnt,8,3             ; @nvram_open_cnt
	.comm	_O_EXCL,4,2                     ; @O_EXCL
	.comm	_nvram_open_mode,4,2            ; @nvram_open_mode
	.comm	_NVRAM_EXCL,4,2                 ; @NVRAM_EXCL
	.comm	_FMODE_WRITE,4,2                ; @FMODE_WRITE
	.comm	_NVRAM_WRITE,4,2                ; @NVRAM_WRITE
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_nvram_open
.subsections_via_symbols
