	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smi_cmd_handler
_smi_cmd_handler:                       ## @smi_cmd_handler
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movl	%r8d, %ebx
	movq	%rdi, %r14
	xorl	%edi, %edi
	testl	%edx, %edx
	sete	%dil
	callq	_assert
	movl	$-1, %eax
	cmpl	$1, %ebx
	jne	LBB0_8
## %bb.1:
	movq	_pm_lock@GOTPCREL(%rip), %rdi
	callq	_pthread_mutex_lock
	movl	(%r15), %eax
	cmpl	$129, %eax
	je	LBB0_5
## %bb.2:
	cmpl	$128, %eax
	jne	LBB0_7
## %bb.3:
	movq	_PM1_SCI_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_pm1_control@GOTPCREL(%rip), %rcx
	orl	%eax, (%rcx)
	movq	_power_button@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	jne	LBB0_7
## %bb.4:
	movq	_SIGTERM@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_EVF_SIGNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_power_button_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rcx
	callq	_mevent_add
	movq	%rax, (%rbx)
	movl	(%r15), %edi
	movq	_SIG_IGN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_signal
	movq	_old_power_handler@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_7
LBB0_5:
	movq	_PM1_SCI_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movq	_pm1_control@GOTPCREL(%rip), %rcx
	andl	%eax, (%rcx)
	movq	_power_button@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	callq	_mevent_delete
	movq	$0, (%rbx)
	movq	_SIGTERM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_old_power_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_signal
LBB0_7:
	movq	_pm_lock@GOTPCREL(%rip), %rdi
	callq	_pthread_mutex_unlock
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pm_lock,4,2                    ## @pm_lock
	.comm	_PM1_SCI_EN,4,2                 ## @PM1_SCI_EN
	.comm	_pm1_control,4,2                ## @pm1_control
	.comm	_power_button,8,3               ## @power_button
	.comm	_SIGTERM,4,2                    ## @SIGTERM
	.comm	_EVF_SIGNAL,4,2                 ## @EVF_SIGNAL
	.comm	_power_button_handler,4,2       ## @power_button_handler
	.comm	_SIG_IGN,4,2                    ## @SIG_IGN
	.comm	_old_power_handler,4,2          ## @old_power_handler
	.no_dead_strip	_smi_cmd_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smi_cmd_handler
_smi_cmd_handler:                       ; @smi_cmd_handler
	.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
	mov	x20, x5
	mov	x21, x4
	mov	x19, x0
	cmp	w2, #0
	cset	w0, eq
	bl	_assert
	cmp	w21, #1
	b.ne	LBB0_5
; %bb.1:
Lloh0:
	adrp	x0, _pm_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _pm_lock@GOTPAGEOFF]
	bl	_pthread_mutex_lock
	ldr	w8, [x20]
	cmp	w8, #129
	b.eq	LBB0_6
; %bb.2:
	cmp	w8, #128
	b.ne	LBB0_8
; %bb.3:
Lloh2:
	adrp	x8, _PM1_SCI_EN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PM1_SCI_EN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _pm1_control@GOTPAGE
Lloh6:
	ldr	x9, [x9, _pm1_control@GOTPAGEOFF]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
Lloh7:
	adrp	x20, _power_button@GOTPAGE
Lloh8:
	ldr	x20, [x20, _power_button@GOTPAGEOFF]
	ldr	x8, [x20]
	cbnz	x8, LBB0_8
; %bb.4:
Lloh9:
	adrp	x21, _SIGTERM@GOTPAGE
Lloh10:
	ldr	x21, [x21, _SIGTERM@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh11:
	adrp	x8, _EVF_SIGNAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EVF_SIGNAL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _power_button_handler@GOTPAGE
Lloh15:
	ldr	x8, [x8, _power_button_handler@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x3, x19
	bl	_mevent_add
	str	x0, [x20]
	ldr	w0, [x21]
Lloh17:
	adrp	x8, _SIG_IGN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SIG_IGN@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_signal
Lloh20:
	adrp	x8, _old_power_handler@GOTPAGE
Lloh21:
	ldr	x8, [x8, _old_power_handler@GOTPAGEOFF]
Lloh22:
	str	w0, [x8]
	b	LBB0_8
LBB0_5:
	mov	w0, #-1
	b	LBB0_9
LBB0_6:
Lloh23:
	adrp	x8, _PM1_SCI_EN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _PM1_SCI_EN@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _pm1_control@GOTPAGE
Lloh27:
	ldr	x9, [x9, _pm1_control@GOTPAGEOFF]
	ldr	w10, [x9]
	bic	w8, w10, w8
	str	w8, [x9]
Lloh28:
	adrp	x19, _power_button@GOTPAGE
Lloh29:
	ldr	x19, [x19, _power_button@GOTPAGEOFF]
	ldr	x0, [x19]
	cbz	x0, LBB0_8
; %bb.7:
	bl	_mevent_delete
	str	xzr, [x19]
Lloh30:
	adrp	x8, _SIGTERM@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SIGTERM@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
Lloh33:
	adrp	x8, _old_power_handler@GOTPAGE
Lloh34:
	ldr	x8, [x8, _old_power_handler@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	bl	_signal
LBB0_8:
Lloh36:
	adrp	x0, _pm_lock@GOTPAGE
Lloh37:
	ldr	x0, [x0, _pm_lock@GOTPAGEOFF]
	bl	_pthread_mutex_unlock
	mov	w0, #0
LBB0_9:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_pm_lock,4,2                    ; @pm_lock
	.comm	_PM1_SCI_EN,4,2                 ; @PM1_SCI_EN
	.comm	_pm1_control,4,2                ; @pm1_control
	.comm	_power_button,8,3               ; @power_button
	.comm	_SIGTERM,4,2                    ; @SIGTERM
	.comm	_EVF_SIGNAL,4,2                 ; @EVF_SIGNAL
	.comm	_power_button_handler,4,2       ; @power_button_handler
	.comm	_SIG_IGN,4,2                    ; @SIG_IGN
	.comm	_old_power_handler,4,2          ; @old_power_handler
	.no_dead_strip	_smi_cmd_handler
.subsections_via_symbols
