	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_apei_osc_setup                 ## -- Begin function apei_osc_setup
	.p2align	4, 0x90
_apei_osc_setup:                        ## @apei_osc_setup
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	leaq	_apei_osc_setup.whea_uuid_str(%rip), %rax
	movq	%rax, -64(%rbp)
	movq	$1, -56(%rbp)
	movl	$12, -48(%rbp)
	leaq	-28(%rbp), %rax
	movq	%rax, -40(%rbp)
	movq	_OSC_QUERY_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_OSC_QUERY_TYPE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, -28(%rbp,%rcx,4)
	movq	_OSC_SUPPORT_TYPE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$1, -28(%rbp,%rax,4)
	movq	_OSC_CONTROL_TYPE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$0, -28(%rbp,%rax,4)
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	leaq	-32(%rbp), %rdx
	xorl	%edi, %edi
	callq	_acpi_get_handle
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movl	-32(%rbp), %edi
	leaq	-64(%rbp), %rsi
	callq	_acpi_run_osc
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	je	LBB0_3
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-16(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_3:
	movl	-52(%rbp), %edi
	callq	_kfree
	xorl	%ebx, %ebx
	jmp	LBB0_4
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.p2align	4                               ## @apei_osc_setup.whea_uuid_str
_apei_osc_setup.whea_uuid_str:
	.asciz	"ed855e0c-6c90-47bf-a62a-26de0fc5ad5c"

	.comm	_OSC_QUERY_ENABLE,4,2           ## @OSC_QUERY_ENABLE
	.comm	_OSC_QUERY_TYPE,8,3             ## @OSC_QUERY_TYPE
	.comm	_OSC_SUPPORT_TYPE,8,3           ## @OSC_SUPPORT_TYPE
	.comm	_OSC_CONTROL_TYPE,8,3           ## @OSC_CONTROL_TYPE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\\_SB"

	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function apei_osc_setup
lCPI0_0:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_apei_osc_setup
	.p2align	2
_apei_osc_setup:                        ; @apei_osc_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-8]
Lloh3:
	adrp	x8, _apei_osc_setup.whea_uuid_str@PAGE
Lloh4:
	add	x8, x8, _apei_osc_setup.whea_uuid_str@PAGEOFF
	str	x8, [sp, #8]
Lloh5:
	adrp	x8, lCPI0_0@PAGE
Lloh6:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #16]
	mov	w8, #12
	str	w8, [sp, #24]
	sub	x8, x29, #20
Lloh7:
	adrp	x9, _OSC_QUERY_ENABLE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _OSC_QUERY_ENABLE@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _OSC_QUERY_TYPE@GOTPAGE
Lloh11:
	ldr	x10, [x10, _OSC_QUERY_TYPE@GOTPAGEOFF]
Lloh12:
	ldr	x10, [x10]
	str	w9, [x8, x10, lsl #2]
Lloh13:
	adrp	x9, _OSC_SUPPORT_TYPE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _OSC_SUPPORT_TYPE@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	mov	w10, #1
	str	w10, [x8, x9, lsl #2]
	str	x8, [sp, #32]
Lloh16:
	adrp	x9, _OSC_CONTROL_TYPE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _OSC_CONTROL_TYPE@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	str	wzr, [x8, x9, lsl #2]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	sub	x2, x29, #24
	mov	x0, #0
	bl	_acpi_get_handle
	bl	_ACPI_FAILURE
	cbnz	x0, LBB0_2
; %bb.1:
	ldur	w0, [x29, #-24]
	add	x1, sp, #8
	bl	_acpi_run_osc
	bl	_ACPI_FAILURE
	cbz	x0, LBB0_5
LBB0_2:
Lloh21:
	adrp	x8, _EIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldur	x8, [x29, #-8]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.4:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	ldr	w0, [sp, #20]
	bl	_kfree
	mov	w0, #0
	b	LBB0_3
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdr	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
_apei_osc_setup.whea_uuid_str:          ; @apei_osc_setup.whea_uuid_str
	.asciz	"ed855e0c-6c90-47bf-a62a-26de0fc5ad5c"

	.comm	_OSC_QUERY_ENABLE,4,2           ; @OSC_QUERY_ENABLE
	.comm	_OSC_QUERY_TYPE,8,3             ; @OSC_QUERY_TYPE
	.comm	_OSC_SUPPORT_TYPE,8,3           ; @OSC_SUPPORT_TYPE
	.comm	_OSC_CONTROL_TYPE,8,3           ; @OSC_CONTROL_TYPE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\\_SB"

	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
