	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apm_engage_power_management
_apm_engage_power_management:           ## @apm_engage_power_management
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	_APM_DEVICE_ALL@GOTPCREL(%rip), %r12
	testl	%esi, %esi
	jne	LBB0_4
## %bb.1:
	cmpq	%rbx, (%r12)
	jne	LBB0_4
## %bb.2:
	movq	_apm_info@GOTPCREL(%rip), %rax
	movq	_APM_BIOS_DISABLED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_APM_DISABLED@GOTPCREL(%rip), %r14
	jmp	LBB0_10
LBB0_4:
	movq	_APM_FUNC_ENGAGE_PM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-40(%rbp), %rcx
	leaq	-36(%rbp), %r14
	movq	%rbx, %rsi
	movl	%r15d, %edx
	movq	%r14, %r8
	callq	_apm_bios_call_simple
	testq	%rax, %rax
	jne	LBB0_10
## %bb.5:
	movq	_APM_SUCCESS@GOTPCREL(%rip), %r14
	cmpq	%rbx, (%r12)
	jne	LBB0_10
## %bb.6:
	movq	_APM_BIOS_DISENGAGED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.7:
	notl	%eax
	movq	_apm_info@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	jmp	LBB0_9
LBB0_8:
	movq	_apm_info@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
LBB0_9:
	movq	_apm_info@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_10:
	movl	(%r14), %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_APM_DEVICE_ALL,8,3             ## @APM_DEVICE_ALL
	.comm	_apm_info,4,2                   ## @apm_info
	.comm	_APM_BIOS_DISABLED,4,2          ## @APM_BIOS_DISABLED
	.comm	_APM_DISABLED,4,2               ## @APM_DISABLED
	.comm	_APM_FUNC_ENGAGE_PM,4,2         ## @APM_FUNC_ENGAGE_PM
	.comm	_APM_BIOS_DISENGAGED,4,2        ## @APM_BIOS_DISENGAGED
	.comm	_APM_SUCCESS,4,2                ## @APM_SUCCESS
	.no_dead_strip	_apm_engage_power_management
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apm_engage_power_management
_apm_engage_power_management:           ; @apm_engage_power_management
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x21, _APM_DEVICE_ALL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _APM_DEVICE_ALL@GOTPAGEOFF]
	cbnz	w1, LBB0_4
; %bb.1:
	ldr	x8, [x21]
	cmp	x8, x20
	b.ne	LBB0_4
; %bb.2:
Lloh2:
	adrp	x8, _apm_info@GOTPAGE
Lloh3:
	ldr	x8, [x8, _apm_info@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _APM_BIOS_DISABLED@GOTPAGE
Lloh6:
	ldr	x9, [x9, _APM_BIOS_DISABLED@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh8:
	adrp	x22, _APM_DISABLED@GOTPAGE
Lloh9:
	ldr	x22, [x22, _APM_DISABLED@GOTPAGEOFF]
	b	LBB0_11
LBB0_4:
Lloh10:
	adrp	x8, _APM_FUNC_ENGAGE_PM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _APM_FUNC_ENGAGE_PM@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	add	x22, sp, #8
	add	x3, sp, #12
	add	x4, sp, #8
	mov	x1, x20
	mov	x2, x19
	bl	_apm_bios_call_simple
	cbnz	x0, LBB0_11
; %bb.5:
	ldr	x8, [x21]
	cmp	x8, x20
	b.ne	LBB0_10
; %bb.6:
Lloh13:
	adrp	x8, _APM_BIOS_DISENGAGED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _APM_BIOS_DISENGAGED@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x8]
Lloh16:
	adrp	x8, _apm_info@GOTPAGE
Lloh17:
	ldr	x8, [x8, _apm_info@GOTPAGEOFF]
	cbz	w19, LBB0_8
; %bb.7:
	ldr	w10, [x8]
	bic	w9, w10, w9
	b	LBB0_9
LBB0_8:
	ldr	w10, [x8]
	orr	w9, w10, w9
LBB0_9:
	str	w9, [x8]
LBB0_10:
Lloh18:
	adrp	x22, _APM_SUCCESS@GOTPAGE
Lloh19:
	ldr	x22, [x22, _APM_SUCCESS@GOTPAGEOFF]
LBB0_11:
	ldr	w0, [x22]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_APM_DEVICE_ALL,8,3             ; @APM_DEVICE_ALL
	.comm	_apm_info,4,2                   ; @apm_info
	.comm	_APM_BIOS_DISABLED,4,2          ; @APM_BIOS_DISABLED
	.comm	_APM_DISABLED,4,2               ; @APM_DISABLED
	.comm	_APM_FUNC_ENGAGE_PM,4,2         ; @APM_FUNC_ENGAGE_PM
	.comm	_APM_BIOS_DISENGAGED,4,2        ; @APM_BIOS_DISENGAGED
	.comm	_APM_SUCCESS,4,2                ; @APM_SUCCESS
	.no_dead_strip	_apm_engage_power_management
.subsections_via_symbols
