	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function applespi_save_bl_level
_applespi_save_bl_level:                ## @applespi_save_bl_level
	.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	%rdi, %rbx
	movq	_EFI_BL_LEVEL_GUID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%esi, %ecx
	movq	%rcx, -16(%rbp)
	movq	_EFI_VARIABLE_NON_VOLATILE@GOTPCREL(%rip), %rcx
	movq	_EFI_VARIABLE_BOOTSERVICE_ACCESS@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_EFI_VARIABLE_RUNTIME_ACCESS@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	_EFI_BL_LEVEL_NAME@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	leaq	-16(%rbp), %r9
	movl	$8, %r8d
	movl	%eax, %esi
	movl	$1, %ecx
	callq	_efivar_entry_set_safe
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EFI_BL_LEVEL_GUID,4,2          ## @EFI_BL_LEVEL_GUID
	.comm	_EFI_VARIABLE_NON_VOLATILE,4,2  ## @EFI_VARIABLE_NON_VOLATILE
	.comm	_EFI_VARIABLE_BOOTSERVICE_ACCESS,4,2 ## @EFI_VARIABLE_BOOTSERVICE_ACCESS
	.comm	_EFI_VARIABLE_RUNTIME_ACCESS,4,2 ## @EFI_VARIABLE_RUNTIME_ACCESS
	.comm	_EFI_BL_LEVEL_NAME,8,3          ## @EFI_BL_LEVEL_NAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error saving backlight level to EFI vars: %d\n"

	.no_dead_strip	_applespi_save_bl_level
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function applespi_save_bl_level
_applespi_save_bl_level:                ; @applespi_save_bl_level
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _EFI_BL_LEVEL_GUID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EFI_BL_LEVEL_GUID@GOTPAGEOFF]
	mov	w9, w1
	str	x9, [sp, #8]
Lloh2:
	adrp	x9, _EFI_VARIABLE_NON_VOLATILE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _EFI_VARIABLE_NON_VOLATILE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _EFI_VARIABLE_BOOTSERVICE_ACCESS@GOTPAGE
Lloh6:
	ldr	x10, [x10, _EFI_VARIABLE_BOOTSERVICE_ACCESS@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh8:
	adrp	x10, _EFI_VARIABLE_RUNTIME_ACCESS@GOTPAGE
Lloh9:
	ldr	x10, [x10, _EFI_VARIABLE_RUNTIME_ACCESS@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	ldr	w8, [x10]
	orr	w2, w9, w8
Lloh12:
	adrp	x8, _EFI_BL_LEVEL_NAME@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EFI_BL_LEVEL_NAME@GOTPAGEOFF]
Lloh14:
	ldr	x0, [x8]
	add	x5, sp, #8
	mov	w3, #1
	mov	w4, #8
	bl	_efivar_entry_set_safe
	cbz	w0, LBB0_2
; %bb.1:
	mov	x2, x0
	ldr	x0, [x19]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh10
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EFI_BL_LEVEL_GUID,4,2          ; @EFI_BL_LEVEL_GUID
	.comm	_EFI_VARIABLE_NON_VOLATILE,4,2  ; @EFI_VARIABLE_NON_VOLATILE
	.comm	_EFI_VARIABLE_BOOTSERVICE_ACCESS,4,2 ; @EFI_VARIABLE_BOOTSERVICE_ACCESS
	.comm	_EFI_VARIABLE_RUNTIME_ACCESS,4,2 ; @EFI_VARIABLE_RUNTIME_ACCESS
	.comm	_EFI_BL_LEVEL_NAME,8,3          ; @EFI_BL_LEVEL_NAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error saving backlight level to EFI vars: %d\n"

	.no_dead_strip	_applespi_save_bl_level
.subsections_via_symbols
