	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_opal_check                     ## -- Begin function opal_check
	.p2align	4, 0x90
_opal_check:                            ## @opal_check
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_opal_initialized@GOTPCREL(%rip), %r15
	xorl	%ebx, %ebx
	cmpl	$0, (%r15)
	jne	LBB0_6
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_OF_finddevice
	cmpl	$-1, %eax
	je	LBB0_2
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	callq	_OF_hasprop
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edi
	callq	_OF_hasprop
	testl	%eax, %eax
	je	LBB0_2
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	leaq	-40(%rbp), %r14
	movl	%ebx, %edi
	movq	%r14, %rdx
	movl	$8, %ecx
	callq	_OF_getencprop
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edi
	movq	%r14, %rdx
	movl	$8, %ecx
	callq	_OF_getencprop
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mfmsr
	movq	_PSL_EE@GOTPCREL(%rip), %rcx
	movq	_PSL_IR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_PSL_DR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	_PSL_SE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	_opal_msr@GOTPCREL(%rip), %rax
	movl	%edx, (%rax)
	movl	$1, (%r15)
	jmp	LBB0_6
LBB0_2:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_opal_initialized,4,2           ## @opal_initialized
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/ibm,opal"

	.comm	_ENOENT,4,2                     ## @ENOENT
L_.str.1:                               ## @.str.1
	.asciz	"opal-base-address"

L_.str.2:                               ## @.str.2
	.asciz	"opal-entry-address"

	.comm	_opal_data,4,2                  ## @opal_data
	.comm	_opal_entrypoint,4,2            ## @opal_entrypoint
	.comm	_PSL_EE,4,2                     ## @PSL_EE
	.comm	_PSL_IR,4,2                     ## @PSL_IR
	.comm	_PSL_DR,4,2                     ## @PSL_DR
	.comm	_PSL_SE,4,2                     ## @PSL_SE
	.comm	_opal_msr,4,2                   ## @opal_msr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_opal_check                     ; -- Begin function opal_check
	.p2align	2
_opal_check:                            ; @opal_check
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
Lloh3:
	adrp	x20, _opal_initialized@GOTPAGE
Lloh4:
	ldr	x20, [x20, _opal_initialized@GOTPAGEOFF]
	ldr	w8, [x20]
	cbz	w8, LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_7
LBB0_2:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_OF_finddevice
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.3:
	mov	x19, x0
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_OF_hasprop
	cbz	w0, LBB0_6
; %bb.4:
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_OF_hasprop
	cbz	w0, LBB0_6
; %bb.5:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, sp
	mov	x0, x19
	mov	w3, #8
	bl	_OF_getencprop
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, sp
	mov	x0, x19
	mov	w3, #8
	bl	_OF_getencprop
	bl	_mfmsr
	mov	x8, x0
	mov	w0, #0
Lloh15:
	adrp	x9, _PSL_EE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PSL_EE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, _PSL_IR@GOTPAGE
Lloh19:
	ldr	x10, [x10, _PSL_IR@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh21:
	adrp	x10, _PSL_DR@GOTPAGE
Lloh22:
	ldr	x10, [x10, _PSL_DR@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	orr	w9, w9, w10
Lloh24:
	adrp	x10, _PSL_SE@GOTPAGE
Lloh25:
	ldr	x10, [x10, _PSL_SE@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	orr	w9, w9, w10
	bic	w8, w8, w9
Lloh27:
	adrp	x9, _opal_msr@GOTPAGE
Lloh28:
	ldr	x9, [x9, _opal_msr@GOTPAGEOFF]
Lloh29:
	str	w8, [x9]
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_7
LBB0_6:
Lloh30:
	adrp	x8, _ENOENT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
LBB0_7:
	ldr	x8, [sp, #8]
Lloh33:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh34:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_opal_initialized,4,2           ; @opal_initialized
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/ibm,opal"

	.comm	_ENOENT,4,2                     ; @ENOENT
l_.str.1:                               ; @.str.1
	.asciz	"opal-base-address"

l_.str.2:                               ; @.str.2
	.asciz	"opal-entry-address"

	.comm	_opal_data,4,2                  ; @opal_data
	.comm	_opal_entrypoint,4,2            ; @opal_entrypoint
	.comm	_PSL_EE,4,2                     ; @PSL_EE
	.comm	_PSL_IR,4,2                     ; @PSL_IR
	.comm	_PSL_DR,4,2                     ; @PSL_DR
	.comm	_PSL_SE,4,2                     ; @PSL_SE
	.comm	_opal_msr,4,2                   ; @opal_msr
.subsections_via_symbols
