	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apmioctl
_apmioctl:                              ## @apmioctl
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r13d
	movq	%rdx, %r14
	movl	%esi, %ebx
	leaq	-48(%rbp), %rdi
	callq	_devfs_get_cdevpriv
	addl	$-128, %ebx
	cmpl	$11, %ebx
	ja	LBB0_6
## %bb.1:
	movq	-48(%rbp), %rdi
	movq	8(%rdi), %r15
	xorl	%r12d, %r12d
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rbx,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_2:
	movq	_FWRITE@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_29
## %bb.3:
	cmpl	$0, (%r15)
	jne	LBB0_9
## %bb.4:
	movl	8(%r15), %esi
	movq	_ACPI_STATE_S5@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jne	LBB0_36
## %bb.5:
	leaq	L_str.5(%rip), %rdi
	jmp	LBB0_35
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_30
LBB0_7:
	movq	_FWRITE@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_29
## %bb.8:
	cmpl	$0, (%r15)
	je	LBB0_33
LBB0_9:
	xorl	%esi, %esi
	callq	_acpi_AckSleepState
	movl	%eax, %r12d
	jmp	LBB0_31
LBB0_10:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movq	_acpi@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_ACPI_LOCK
	movl	(%r15), %ecx
	testl	%ecx, %ecx
	je	LBB0_32
## %bb.11:
	movq	-48(%rbp), %rax
	movl	(%rax), %edx
	movq	_APM_EV_NONE@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	jne	LBB0_32
## %bb.12:
	movq	_ACPI_STATE_S3@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jle	LBB0_37
## %bb.13:
	movq	_PMEV_SUSPENDREQ@GOTPCREL(%rip), %rcx
	jmp	LBB0_38
LBB0_14:
	movl	%r14d, %edi
	callq	_acpi_capm_get_pwstatus
	jmp	LBB0_19
LBB0_15:
	leaq	-80(%rbp), %rdi
	callq	_acpi_capm_get_info
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_17:
	movl	-60(%rbp), %eax
	movl	%eax, 20(%r14)
	movl	-64(%rbp), %eax
	movl	%eax, 16(%r14)
	movaps	-80(%rbp), %xmm0
	movups	%xmm0, (%r14)
	jmp	LBB0_31
LBB0_18:
	movq	%r14, %rdi
	callq	_acpi_capm_get_info
LBB0_19:
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_31
## %bb.20:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_30
LBB0_21:
	movq	_FWRITE@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_29
## %bb.22:
	movq	_apm_active@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	jmp	LBB0_31
LBB0_23:
	movq	_FWRITE@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	testl	%r13d, (%rax)
	jne	LBB0_31
	jmp	LBB0_29
LBB0_25:
	movq	_FWRITE@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_29
## %bb.26:
	movq	_apm_active@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	jmp	LBB0_31
LBB0_27:
	movq	_FWRITE@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_29
## %bb.28:
	movq	%r14, %rdi
	movl	$4, %esi
	callq	_bzero
	jmp	LBB0_31
LBB0_29:
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_30:
	movl	(%rax), %r12d
LBB0_31:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_32:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_39
LBB0_33:
	movl	4(%r15), %esi
	movq	_ACPI_STATE_S5@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jne	LBB0_36
## %bb.34:
	leaq	L_str.4(%rip), %rdi
LBB0_35:
	callq	_puts
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_30
LBB0_36:
	movq	%r15, %rdi
	callq	_acpi_ReqSleepState
	movl	%eax, %r12d
	jmp	LBB0_31
LBB0_37:
	movq	_PMEV_STANDBYREQ@GOTPCREL(%rip), %rcx
LBB0_38:
	movl	(%rcx), %esi
	movl	%esi, (%r14)
	movl	$0, 4(%r14)
	movq	_APM_EV_NOTIFIED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
	leaq	L_.str.3(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_printf
LBB0_39:
	movl	(%rbx), %edi
	callq	_ACPI_UNLOCK
	jmp	LBB0_31
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_31, LBB0_31-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_15, LBB0_15-LJTI0_0
.set L0_0_set_18, LBB0_18-LJTI0_0
.set L0_0_set_21, LBB0_21-LJTI0_0
.set L0_0_set_23, LBB0_23-LJTI0_0
.set L0_0_set_25, LBB0_25-LJTI0_0
.set L0_0_set_27, LBB0_27-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_7
	.long	L0_0_set_31
	.long	L0_0_set_10
	.long	L0_0_set_31
	.long	L0_0_set_14
	.long	L0_0_set_15
	.long	L0_0_set_18
	.long	L0_0_set_21
	.long	L0_0_set_23
	.long	L0_0_set_25
	.long	L0_0_set_27
	.end_data_region
                                        ## -- End function
	.comm	_FWRITE,4,2                     ## @FWRITE
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_ACPI_STATE_S5,4,2              ## @ACPI_STATE_S5
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_acpi,4,2                       ## @acpi
	.comm	_APM_EV_NONE,4,2                ## @APM_EV_NONE
	.comm	_ACPI_STATE_S3,4,2              ## @ACPI_STATE_S3
	.comm	_PMEV_STANDBYREQ,4,2            ## @PMEV_STANDBYREQ
	.comm	_PMEV_SUSPENDREQ,4,2            ## @PMEV_SUSPENDREQ
	.comm	_APM_EV_NOTIFIED,4,2            ## @APM_EV_NOTIFIED
	.section	__TEXT,__cstring,cstring_literals
L_.str.3:                               ## @.str.3
	.asciz	"apm event returning %d\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_apm_active,4,2                 ## @apm_active
	.comm	_EINVAL,4,2                     ## @EINVAL
L_str:                                  ## @str
	.asciz	"apm nextevent start"

L_str.4:                                ## @str.4
	.asciz	"power off via apm standby not supported"

L_str.5:                                ## @str.5
	.asciz	"power off via apm suspend not supported"

	.no_dead_strip	_apmioctl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apmioctl
_apmioctl:                              ; @apmioctl
	.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	x22, x3
	mov	x20, x2
	mov	x19, x1
	add	x0, sp, #40
	bl	_devfs_get_cdevpriv
	sub	w8, w19, #128
	cmp	w8, #11
	b.hi	LBB0_6
; %bb.1:
	mov	w19, #0
	ldr	x0, [sp, #40]
	ldr	x21, [x0, #8]
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
Lloh2:
	adrp	x8, _FWRITE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FWRITE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_24
; %bb.3:
	ldr	w8, [x21]
	cbnz	w8, LBB0_9
; %bb.4:
	ldr	w1, [x21, #8]
Lloh5:
	adrp	x8, _ACPI_STATE_S5@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ACPI_STATE_S5@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w1, w8
	b.ne	LBB0_32
; %bb.5:
Lloh8:
	adrp	x0, l_str.5@PAGE
Lloh9:
	add	x0, x0, l_str.5@PAGEOFF
	b	LBB0_31
LBB0_6:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_25
LBB0_7:
Lloh12:
	adrp	x8, _FWRITE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FWRITE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_24
; %bb.8:
	ldr	w8, [x21]
	cbz	w8, LBB0_29
LBB0_9:
	mov	w1, #0
	bl	_acpi_AckSleepState
	mov	x19, x0
	b	LBB0_28
LBB0_10:
Lloh15:
	adrp	x0, l_str@PAGE
Lloh16:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
Lloh17:
	adrp	x22, _acpi@GOTPAGE
Lloh18:
	ldr	x22, [x22, _acpi@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_ACPI_LOCK
	ldr	w9, [x21]
	cbz	w9, LBB0_26
; %bb.11:
	ldr	x8, [sp, #40]
	ldr	w10, [x8]
Lloh19:
	adrp	x11, _APM_EV_NONE@GOTPAGE
Lloh20:
	ldr	x11, [x11, _APM_EV_NONE@GOTPAGEOFF]
Lloh21:
	ldr	w11, [x11]
	cmp	w10, w11
	b.ne	LBB0_26
; %bb.12:
Lloh22:
	adrp	x10, _ACPI_STATE_S3@GOTPAGE
Lloh23:
	ldr	x10, [x10, _ACPI_STATE_S3@GOTPAGEOFF]
Lloh24:
	adrp	x11, _PMEV_SUSPENDREQ@GOTPAGE
Lloh25:
	ldr	x11, [x11, _PMEV_SUSPENDREQ@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
Lloh27:
	adrp	x12, _PMEV_STANDBYREQ@GOTPAGE
Lloh28:
	ldr	x12, [x12, _PMEV_STANDBYREQ@GOTPAGEOFF]
	cmp	w9, w10
	csel	x9, x11, x12, gt
	ldr	w9, [x9]
	stp	w9, wzr, [x20]
Lloh29:
	adrp	x10, _APM_EV_NOTIFIED@GOTPAGE
Lloh30:
	ldr	x10, [x10, _APM_EV_NOTIFIED@GOTPAGEOFF]
Lloh31:
	ldr	w10, [x10]
	str	w10, [x8]
	str	x9, [sp]
Lloh32:
	adrp	x0, l_.str.3@PAGE
Lloh33:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
	mov	w19, #0
	b	LBB0_27
LBB0_13:
	mov	x0, x20
	bl	_acpi_capm_get_pwstatus
	b	LBB0_16
LBB0_14:
	add	x0, sp, #16
	bl	_acpi_capm_get_info
Lloh34:
	adrp	x8, _ENXIO@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w19, wzr, w8, eq
	ldr	d0, [sp, #32]
	str	d0, [x20, #16]
	ldr	q0, [sp, #16]
	str	q0, [x20]
	b	LBB0_28
LBB0_15:
	mov	x0, x20
	bl	_acpi_capm_get_info
LBB0_16:
Lloh37:
	adrp	x8, _ENXIO@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w19, wzr, w8, eq
	b	LBB0_28
LBB0_17:
Lloh40:
	adrp	x8, _FWRITE@GOTPAGE
Lloh41:
	ldr	x8, [x8, _FWRITE@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_24
; %bb.18:
	mov	w19, #0
Lloh43:
	adrp	x8, _apm_active@GOTPAGE
Lloh44:
	ldr	x8, [x8, _apm_active@GOTPAGEOFF]
	mov	w9, #1
Lloh45:
	str	w9, [x8]
	b	LBB0_28
LBB0_19:
Lloh46:
	adrp	x8, _FWRITE@GOTPAGE
Lloh47:
	ldr	x8, [x8, _FWRITE@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
Lloh49:
	adrp	x9, _EPERM@GOTPAGE
Lloh50:
	ldr	x9, [x9, _EPERM@GOTPAGEOFF]
Lloh51:
	ldr	w9, [x9]
	tst	w8, w22
	csel	w19, w9, wzr, eq
	b	LBB0_28
LBB0_20:
Lloh52:
	adrp	x8, _FWRITE@GOTPAGE
Lloh53:
	ldr	x8, [x8, _FWRITE@GOTPAGEOFF]
Lloh54:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_24
; %bb.21:
	mov	w19, #0
Lloh55:
	adrp	x8, _apm_active@GOTPAGE
Lloh56:
	ldr	x8, [x8, _apm_active@GOTPAGEOFF]
Lloh57:
	str	wzr, [x8]
	b	LBB0_28
LBB0_22:
Lloh58:
	adrp	x8, _FWRITE@GOTPAGE
Lloh59:
	ldr	x8, [x8, _FWRITE@GOTPAGEOFF]
Lloh60:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_24
; %bb.23:
	mov	x0, x20
	mov	w1, #4
	bl	_bzero
	mov	w19, #0
	b	LBB0_28
LBB0_24:
Lloh61:
	adrp	x8, _EPERM@GOTPAGE
Lloh62:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_25:
	ldr	w19, [x8]
	b	LBB0_28
LBB0_26:
Lloh63:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh64:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh65:
	ldr	w19, [x8]
LBB0_27:
	ldr	w0, [x22]
	bl	_ACPI_UNLOCK
LBB0_28:
	mov	x0, x19
	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_29:
	ldr	w1, [x21, #4]
Lloh66:
	adrp	x8, _ACPI_STATE_S5@GOTPAGE
Lloh67:
	ldr	x8, [x8, _ACPI_STATE_S5@GOTPAGEOFF]
Lloh68:
	ldr	w8, [x8]
	cmp	w1, w8
	b.ne	LBB0_32
; %bb.30:
Lloh69:
	adrp	x0, l_str.4@PAGE
Lloh70:
	add	x0, x0, l_str.4@PAGEOFF
LBB0_31:
	bl	_puts
Lloh71:
	adrp	x8, _ENXIO@GOTPAGE
Lloh72:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_25
LBB0_32:
	mov	x0, x21
	bl	_acpi_ReqSleepState
	mov	x19, x0
	b	LBB0_28
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh26
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotStr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotStr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGot	Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpAdd	Lloh69, Lloh70
	.loh AdrpLdrGot	Lloh71, Lloh72
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_28-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_28-LBB0_2)>>2
	.byte	(LBB0_13-LBB0_2)>>2
	.byte	(LBB0_14-LBB0_2)>>2
	.byte	(LBB0_15-LBB0_2)>>2
	.byte	(LBB0_17-LBB0_2)>>2
	.byte	(LBB0_19-LBB0_2)>>2
	.byte	(LBB0_20-LBB0_2)>>2
	.byte	(LBB0_22-LBB0_2)>>2
                                        ; -- End function
	.comm	_FWRITE,4,2                     ; @FWRITE
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_ACPI_STATE_S5,4,2              ; @ACPI_STATE_S5
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_acpi,4,2                       ; @acpi
	.comm	_APM_EV_NONE,4,2                ; @APM_EV_NONE
	.comm	_ACPI_STATE_S3,4,2              ; @ACPI_STATE_S3
	.comm	_PMEV_STANDBYREQ,4,2            ; @PMEV_STANDBYREQ
	.comm	_PMEV_SUSPENDREQ,4,2            ; @PMEV_SUSPENDREQ
	.comm	_APM_EV_NOTIFIED,4,2            ; @APM_EV_NOTIFIED
	.section	__TEXT,__cstring,cstring_literals
l_.str.3:                               ; @.str.3
	.asciz	"apm event returning %d\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_apm_active,4,2                 ; @apm_active
	.comm	_EINVAL,4,2                     ; @EINVAL
l_str:                                  ; @str
	.asciz	"apm nextevent start"

l_str.4:                                ; @str.4
	.asciz	"power off via apm standby not supported"

l_str.5:                                ; @str.5
	.asciz	"power off via apm suspend not supported"

	.no_dead_strip	_apmioctl
.subsections_via_symbols
