	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apm_ioctl
_apm_ioctl:                             ## @apm_ioctl
	.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	(%rsi), %r15
	xorl	%ebx, %ebx
	cmpl	$0, 12(%r15)
	je	LBB0_2
## %bb.1:
	cmpl	$0, 8(%r15)
	je	LBB0_2
## %bb.3:
	cmpl	$130, %edx
	jne	LBB0_4
## %bb.5:
	movq	_state_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_EINTR@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	xorl	%eax, %eax
	movl	%ecx, (%r15)
	movl	4(%r15), %ecx
	cmpl	$129, %ecx
	je	LBB0_8
## %bb.6:
	cmpl	$128, %ecx
	jne	LBB0_9
## %bb.7:
	movq	_SUSPEND_ACKED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movq	_suspend_acks_pending@GOTPCREL(%rip), %rdi
	callq	_atomic_dec
	movq	_state_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	_apm_suspend_waitqueue@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_wake_up
	xorl	%eax, %eax
	callq	_freezer_do_not_count
	movl	(%rbx), %edi
	movl	4(%r15), %eax
	movq	_SUSPEND_DONE@GOTPCREL(%rip), %rcx
	xorl	%esi, %esi
	cmpl	(%rcx), %eax
	sete	%sil
	callq	_wait_event
	xorl	%eax, %eax
	callq	_freezer_count
	jmp	LBB0_10
LBB0_2:
	movq	_EPERM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_8:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movl	%eax, (%r15)
	movq	_state_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	jmp	LBB0_10
LBB0_9:
	movq	_SUSPEND_WAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movq	_state_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	_PM_SUSPEND_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_pm_suspend
	movl	%eax, (%r15)
LBB0_10:
	movq	_state_lock@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r15), %ebx
	movq	_SUSPEND_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_state_lock,4,2                 ## @state_lock
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_SUSPEND_ACKED,4,2              ## @SUSPEND_ACKED
	.comm	_suspend_acks_pending,4,2       ## @suspend_acks_pending
	.comm	_apm_suspend_waitqueue,4,2      ## @apm_suspend_waitqueue
	.comm	_SUSPEND_DONE,4,2               ## @SUSPEND_DONE
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_SUSPEND_WAIT,4,2               ## @SUSPEND_WAIT
	.comm	_PM_SUSPEND_MEM,4,2             ## @PM_SUSPEND_MEM
	.comm	_SUSPEND_NONE,4,2               ## @SUSPEND_NONE
	.no_dead_strip	_apm_ioctl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apm_ioctl
_apm_ioctl:                             ; @apm_ioctl
	.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
	ldr	x21, [x1]
	ldr	w8, [x21, #12]
	cbz	w8, LBB0_6
; %bb.1:
	ldr	w8, [x21, #8]
	cbz	w8, LBB0_6
; %bb.2:
	cmp	w2, #130
	b.ne	LBB0_7
; %bb.3:
Lloh0:
	adrp	x0, _state_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _state_lock@GOTPAGEOFF]
	bl	_mutex_lock
Lloh2:
	adrp	x8, _EINTR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x21]
	ldr	w8, [x21, #4]
	cmp	w8, #129
	b.eq	LBB0_9
; %bb.4:
	cmp	w8, #128
	b.ne	LBB0_10
; %bb.5:
Lloh5:
	adrp	x8, _SUSPEND_ACKED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SUSPEND_ACKED@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x21, #4]
Lloh8:
	adrp	x0, _suspend_acks_pending@GOTPAGE
Lloh9:
	ldr	x0, [x0, _suspend_acks_pending@GOTPAGEOFF]
	bl	_atomic_dec
Lloh10:
	adrp	x0, _state_lock@GOTPAGE
Lloh11:
	ldr	x0, [x0, _state_lock@GOTPAGEOFF]
	bl	_mutex_unlock
Lloh12:
	adrp	x19, _apm_suspend_waitqueue@GOTPAGE
Lloh13:
	ldr	x19, [x19, _apm_suspend_waitqueue@GOTPAGEOFF]
	mov	x0, x19
	bl	_wake_up
	bl	_freezer_do_not_count
	ldr	w0, [x19]
	ldr	w8, [x21, #4]
Lloh14:
	adrp	x9, _SUSPEND_DONE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SUSPEND_DONE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w1, eq
	bl	_wait_event
	bl	_freezer_count
	b	LBB0_11
LBB0_6:
Lloh17:
	adrp	x8, _EPERM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_12
LBB0_9:
Lloh21:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x21]
Lloh24:
	adrp	x0, _state_lock@GOTPAGE
Lloh25:
	ldr	x0, [x0, _state_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	b	LBB0_11
LBB0_10:
Lloh26:
	adrp	x8, _SUSPEND_WAIT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SUSPEND_WAIT@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	str	w8, [x21, #4]
Lloh29:
	adrp	x0, _state_lock@GOTPAGE
Lloh30:
	ldr	x0, [x0, _state_lock@GOTPAGEOFF]
	bl	_mutex_unlock
Lloh31:
	adrp	x8, _PM_SUSPEND_MEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _PM_SUSPEND_MEM@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	bl	_pm_suspend
	str	w0, [x21]
LBB0_11:
Lloh34:
	adrp	x20, _state_lock@GOTPAGE
Lloh35:
	ldr	x20, [x20, _state_lock@GOTPAGEOFF]
	mov	x0, x20
	bl	_mutex_lock
	ldr	w19, [x21]
Lloh36:
	adrp	x8, _SUSPEND_NONE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _SUSPEND_NONE@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	str	w8, [x21, #4]
	mov	x0, x20
	bl	_mutex_unlock
LBB0_12:
	mov	x0, x19
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_state_lock,4,2                 ; @state_lock
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_SUSPEND_ACKED,4,2              ; @SUSPEND_ACKED
	.comm	_suspend_acks_pending,4,2       ; @suspend_acks_pending
	.comm	_apm_suspend_waitqueue,4,2      ; @apm_suspend_waitqueue
	.comm	_SUSPEND_DONE,4,2               ; @SUSPEND_DONE
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_SUSPEND_WAIT,4,2               ; @SUSPEND_WAIT
	.comm	_PM_SUSPEND_MEM,4,2             ; @PM_SUSPEND_MEM
	.comm	_SUSPEND_NONE,4,2               ; @SUSPEND_NONE
	.no_dead_strip	_apm_ioctl
.subsections_via_symbols
