	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function frontend_unix_powerstate_check_apm
_frontend_unix_powerstate_check_apm:    ## @frontend_unix_powerstate_check_apm
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	$0, -64(%rbp)
	movl	$0, -80(%rbp)
	movl	$0, -60(%rbp)
	movl	$0, -56(%rbp)
	movl	$0, -52(%rbp)
	movl	$0, -76(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -72(%rbp)
	movq	$0, -40(%rbp)
	movq	_proc_apm_path@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_filestream_exists
	testl	%eax, %eax
	je	LBB0_34
## %bb.1:
	movl	(%rbx), %edi
	leaq	-72(%rbp), %rsi
	leaq	-76(%rbp), %rdx
	callq	_filestream_read_file
	cmpl	$1, %eax
	jne	LBB0_34
## %bb.2:
	movq	-72(%rbp), %rax
	movq	%rax, -48(%rbp)
	leaq	-48(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	callq	_next_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.3:
	leaq	-48(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	callq	_next_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.4:
	leaq	-48(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	callq	_next_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.5:
	leaq	-48(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	callq	_next_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.6:
	movq	-40(%rbp), %rdi
	leaq	-64(%rbp), %rsi
	callq	_int_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.7:
	leaq	-48(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	callq	_next_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.8:
	movq	-40(%rbp), %rdi
	leaq	-80(%rbp), %rsi
	callq	_int_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.9:
	leaq	-48(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	callq	_next_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.10:
	movq	-40(%rbp), %rdi
	leaq	-60(%rbp), %rsi
	callq	_int_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.11:
	leaq	-48(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	callq	_next_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.12:
	movq	-40(%rbp), %rdi
	callq	_strlen
	cltq
	movq	-40(%rbp), %rdi
	cmpb	$37, -1(%rax,%rdi)
	jne	LBB0_14
## %bb.13:
	movb	$0, -1(%rdi,%rax)
	movq	-40(%rbp), %rdi
LBB0_14:
	leaq	-56(%rbp), %rsi
	callq	_int_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.15:
	leaq	-48(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	callq	_next_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.16:
	movq	-40(%rbp), %rdi
	leaq	-52(%rbp), %rsi
	callq	_int_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.17:
	leaq	-48(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	callq	_next_string
	testl	%eax, %eax
	je	LBB0_34
## %bb.18:
	movq	-40(%rbp), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_string_is_equal
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:
	imull	$60, -52(%rbp), %eax
	movl	%eax, -52(%rbp)
LBB0_20:
	movl	-60(%rbp), %eax
	cmpl	$255, %eax
	jne	LBB0_22
## %bb.21:
	movq	_FRONTEND_POWERSTATE_NONE@GOTPCREL(%rip), %rax
	jmp	LBB0_29
LBB0_34:
	movq	-72(%rbp), %rdi
	xorl	%ebx, %ebx
	testq	%rdi, %rdi
	je	LBB0_37
LBB0_36:
	callq	_free
LBB0_37:
	movl	%ebx, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	testb	$-128, %al
	jne	LBB0_23
## %bb.24:
	testb	$8, %al
	jne	LBB0_25
## %bb.26:
	cmpl	$1, -64(%rbp)
	jne	LBB0_27
## %bb.28:
	movq	_FRONTEND_POWERSTATE_CHARGED@GOTPCREL(%rip), %rax
	jmp	LBB0_29
LBB0_23:
	movq	_FRONTEND_POWERSTATE_NO_SOURCE@GOTPCREL(%rip), %rax
	jmp	LBB0_29
LBB0_25:
	movq	_FRONTEND_POWERSTATE_CHARGING@GOTPCREL(%rip), %rax
	jmp	LBB0_29
LBB0_27:
	movq	_FRONTEND_POWERSTATE_ON_POWER_SOURCE@GOTPCREL(%rip), %rax
LBB0_29:
	movl	(%rax), %eax
	movl	%eax, (%r12)
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	js	LBB0_31
## %bb.30:
	cmpl	$100, %eax
	movl	$100, %ecx
	cmovll	%eax, %ecx
	movl	%ecx, (%r15)
LBB0_31:
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	js	LBB0_33
## %bb.32:
	movl	%eax, (%r14)
LBB0_33:
	movq	-72(%rbp), %rdi
	movl	$1, %ebx
	testq	%rdi, %rdi
	jne	LBB0_36
	jmp	LBB0_37
	.cfi_endproc
                                        ## -- End function
	.comm	_proc_apm_path,4,2              ## @proc_apm_path
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"min"

	.comm	_FRONTEND_POWERSTATE_NONE,4,2   ## @FRONTEND_POWERSTATE_NONE
	.comm	_FRONTEND_POWERSTATE_NO_SOURCE,4,2 ## @FRONTEND_POWERSTATE_NO_SOURCE
	.comm	_FRONTEND_POWERSTATE_CHARGING,4,2 ## @FRONTEND_POWERSTATE_CHARGING
	.comm	_FRONTEND_POWERSTATE_CHARGED,4,2 ## @FRONTEND_POWERSTATE_CHARGED
	.comm	_FRONTEND_POWERSTATE_ON_POWER_SOURCE,4,2 ## @FRONTEND_POWERSTATE_ON_POWER_SOURCE
	.no_dead_strip	_frontend_unix_powerstate_check_apm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function frontend_unix_powerstate_check_apm
_frontend_unix_powerstate_check_apm:    ; @frontend_unix_powerstate_check_apm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x2
	mov	x19, x1
	mov	x21, x0
	stur	wzr, [x29, #-36]
	str	wzr, [sp, #40]
	stp	xzr, xzr, [sp, #24]
	stp	xzr, xzr, [sp, #8]
	str	xzr, [sp]
Lloh0:
	adrp	x22, _proc_apm_path@GOTPAGE
Lloh1:
	ldr	x22, [x22, _proc_apm_path@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_filestream_exists
	cbz	w0, LBB0_22
; %bb.1:
	ldr	w0, [x22]
	add	x1, sp, #8
	add	x2, sp, #24
	bl	_filestream_read_file
	cmp	w0, #1
	b.ne	LBB0_22
; %bb.2:
	ldr	x8, [sp, #8]
	str	x8, [sp, #16]
	add	x0, sp, #16
	mov	x1, sp
	bl	_next_string
	cbz	w0, LBB0_22
; %bb.3:
	add	x0, sp, #16
	mov	x1, sp
	bl	_next_string
	cbz	w0, LBB0_22
; %bb.4:
	add	x0, sp, #16
	mov	x1, sp
	bl	_next_string
	cbz	w0, LBB0_22
; %bb.5:
	add	x0, sp, #16
	mov	x1, sp
	bl	_next_string
	cbz	w0, LBB0_22
; %bb.6:
	ldr	x0, [sp]
	sub	x1, x29, #36
	bl	_int_string
	cbz	w0, LBB0_22
; %bb.7:
	add	x0, sp, #16
	mov	x1, sp
	bl	_next_string
	cbz	w0, LBB0_22
; %bb.8:
	ldr	x0, [sp]
	add	x1, sp, #40
	bl	_int_string
	cbz	w0, LBB0_22
; %bb.9:
	add	x0, sp, #16
	mov	x1, sp
	bl	_next_string
	cbz	w0, LBB0_22
; %bb.10:
	ldr	x0, [sp]
	add	x1, sp, #36
	bl	_int_string
	cbz	w0, LBB0_22
; %bb.11:
	add	x0, sp, #16
	mov	x1, sp
	bl	_next_string
	cbz	w0, LBB0_22
; %bb.12:
	ldr	x0, [sp]
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	sub	x8, x8, #1
	ldr	x0, [sp]
	ldrb	w9, [x0, x8]
	cmp	w9, #37
	b.ne	LBB0_14
; %bb.13:
	strb	wzr, [x0, x8]
	ldr	x0, [sp]
LBB0_14:
	add	x1, sp, #32
	bl	_int_string
	cbz	w0, LBB0_22
; %bb.15:
	add	x0, sp, #16
	mov	x1, sp
	bl	_next_string
	cbz	w0, LBB0_22
; %bb.16:
	ldr	x0, [sp]
	add	x1, sp, #28
	bl	_int_string
	cbz	w0, LBB0_22
; %bb.17:
	add	x0, sp, #16
	mov	x1, sp
	bl	_next_string
	cbz	w0, LBB0_22
; %bb.18:
	ldr	x0, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_string_is_equal
	cbz	x0, LBB0_20
; %bb.19:
	ldr	w8, [sp, #28]
	mov	w9, #60
	mul	w8, w8, w9
	str	w8, [sp, #28]
LBB0_20:
	ldr	w8, [sp, #36]
	cmp	w8, #255
	b.ne	LBB0_25
; %bb.21:
Lloh4:
	adrp	x8, _FRONTEND_POWERSTATE_NONE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_NONE@GOTPAGEOFF]
	b	LBB0_30
LBB0_22:
	mov	w19, #0
	mov	w8, #0
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_24
LBB0_23:
	bl	_free
	mov	x8, x19
LBB0_24:
	mov	x0, x8
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_25:
	tbnz	w8, #7, LBB0_28
; %bb.26:
	tbnz	w8, #3, LBB0_29
; %bb.27:
	ldur	w8, [x29, #-36]
Lloh6:
	adrp	x9, _FRONTEND_POWERSTATE_ON_POWER_SOURCE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FRONTEND_POWERSTATE_ON_POWER_SOURCE@GOTPAGEOFF]
Lloh8:
	adrp	x10, _FRONTEND_POWERSTATE_CHARGED@GOTPAGE
Lloh9:
	ldr	x10, [x10, _FRONTEND_POWERSTATE_CHARGED@GOTPAGEOFF]
	cmp	w8, #1
	csel	x8, x10, x9, eq
	b	LBB0_30
LBB0_28:
Lloh10:
	adrp	x8, _FRONTEND_POWERSTATE_NO_SOURCE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_NO_SOURCE@GOTPAGEOFF]
	b	LBB0_30
LBB0_29:
Lloh12:
	adrp	x8, _FRONTEND_POWERSTATE_CHARGING@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_CHARGING@GOTPAGEOFF]
LBB0_30:
	ldr	w8, [x8]
	str	w8, [x21]
	ldr	w8, [sp, #32]
	tbnz	w8, #31, LBB0_32
; %bb.31:
	mov	w9, #100
	cmp	w8, #100
	csel	w8, w8, w9, lt
	str	w8, [x20]
LBB0_32:
	ldr	w8, [sp, #28]
	tbnz	w8, #31, LBB0_34
; %bb.33:
	str	w8, [x19]
LBB0_34:
	ldr	x0, [sp, #8]
	mov	w19, #1
	mov	w8, #1
	cbnz	x0, LBB0_23
	b	LBB0_24
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_proc_apm_path,4,2              ; @proc_apm_path
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"min"

	.comm	_FRONTEND_POWERSTATE_NONE,4,2   ; @FRONTEND_POWERSTATE_NONE
	.comm	_FRONTEND_POWERSTATE_NO_SOURCE,4,2 ; @FRONTEND_POWERSTATE_NO_SOURCE
	.comm	_FRONTEND_POWERSTATE_CHARGING,4,2 ; @FRONTEND_POWERSTATE_CHARGING
	.comm	_FRONTEND_POWERSTATE_CHARGED,4,2 ; @FRONTEND_POWERSTATE_CHARGED
	.comm	_FRONTEND_POWERSTATE_ON_POWER_SOURCE,4,2 ; @FRONTEND_POWERSTATE_ON_POWER_SOURCE
	.no_dead_strip	_frontend_unix_powerstate_check_apm
.subsections_via_symbols
