	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function frontend_switch_get_powerstate
_frontend_switch_get_powerstate:        ## @frontend_switch_get_powerstate
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_psmInitialized@GOTPCREL(%rip), %rax
	movq	_FRONTEND_POWERSTATE_NONE@GOTPCREL(%rip), %rbx
	cmpl	$0, (%rax)
	je	LBB0_8
## %bb.1:
	movq	%rsi, %r14
	leaq	-32(%rbp), %rdi
	callq	_psmGetBatteryChargePercentage
	movl	%eax, %edi
	callq	_R_SUCCEEDED
	testl	%eax, %eax
	je	LBB0_8
## %bb.2:
	leaq	-20(%rbp), %rdi
	callq	_psmGetChargerType
	movl	%eax, %edi
	callq	_R_SUCCEEDED
	testl	%eax, %eax
	je	LBB0_8
## %bb.3:
	movl	-32(%rbp), %eax
	movl	%eax, (%r14)
	cmpl	$99, %eax
	jle	LBB0_5
## %bb.4:
	movq	_FRONTEND_POWERSTATE_CHARGED@GOTPCREL(%rip), %rbx
	jmp	LBB0_8
LBB0_5:
	movl	-20(%rbp), %eax
	andl	$-2, %eax
	cmpl	$128, %eax
	jne	LBB0_6
## %bb.7:
	movq	_FRONTEND_POWERSTATE_CHARGING@GOTPCREL(%rip), %rbx
	jmp	LBB0_8
LBB0_6:
	movq	_FRONTEND_POWERSTATE_NO_SOURCE@GOTPCREL(%rip), %rbx
LBB0_8:
	movl	(%rbx), %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_psmInitialized,4,2             ## @psmInitialized
	.comm	_FRONTEND_POWERSTATE_NONE,4,2   ## @FRONTEND_POWERSTATE_NONE
	.comm	_FRONTEND_POWERSTATE_CHARGED,4,2 ## @FRONTEND_POWERSTATE_CHARGED
	.comm	_FRONTEND_POWERSTATE_CHARGING,4,2 ## @FRONTEND_POWERSTATE_CHARGING
	.comm	_FRONTEND_POWERSTATE_NO_SOURCE,4,2 ## @FRONTEND_POWERSTATE_NO_SOURCE
	.no_dead_strip	_frontend_switch_get_powerstate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function frontend_switch_get_powerstate
_frontend_switch_get_powerstate:        ; @frontend_switch_get_powerstate
	.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, _psmInitialized@GOTPAGE
Lloh1:
	ldr	x8, [x8, _psmInitialized@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x19, x1
	add	x0, sp, #8
	bl	_psmGetBatteryChargePercentage
	bl	_R_SUCCEEDED
	cbz	w0, LBB0_5
; %bb.2:
	add	x0, sp, #4
	bl	_psmGetChargerType
	bl	_R_SUCCEEDED
	cbz	w0, LBB0_5
; %bb.3:
	ldr	w8, [sp, #8]
	str	w8, [x19]
	cmp	w8, #99
	b.le	LBB0_7
; %bb.4:
Lloh3:
	adrp	x8, _FRONTEND_POWERSTATE_CHARGED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_CHARGED@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh5:
	adrp	x8, _FRONTEND_POWERSTATE_NONE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_NONE@GOTPAGEOFF]
LBB0_6:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_7:
	ldr	w8, [sp, #4]
	and	w8, w8, #0xfffffffe
Lloh7:
	adrp	x9, _FRONTEND_POWERSTATE_NO_SOURCE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _FRONTEND_POWERSTATE_NO_SOURCE@GOTPAGEOFF]
Lloh9:
	adrp	x10, _FRONTEND_POWERSTATE_CHARGING@GOTPAGE
Lloh10:
	ldr	x10, [x10, _FRONTEND_POWERSTATE_CHARGING@GOTPAGEOFF]
	cmp	w8, #128
	csel	x8, x10, x9, eq
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_psmInitialized,4,2             ; @psmInitialized
	.comm	_FRONTEND_POWERSTATE_NONE,4,2   ; @FRONTEND_POWERSTATE_NONE
	.comm	_FRONTEND_POWERSTATE_CHARGED,4,2 ; @FRONTEND_POWERSTATE_CHARGED
	.comm	_FRONTEND_POWERSTATE_CHARGING,4,2 ; @FRONTEND_POWERSTATE_CHARGING
	.comm	_FRONTEND_POWERSTATE_NO_SOURCE,4,2 ; @FRONTEND_POWERSTATE_NO_SOURCE
	.no_dead_strip	_frontend_switch_get_powerstate
.subsections_via_symbols
