	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_ioctl
_do_ioctl:                              ## @do_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	movq	(%rdi), %r14
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_check_apm_user
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_2:
	cmpl	$0, 28(%r14)
	je	LBB0_4
## %bb.3:
	cmpl	$0, 24(%r14)
	je	LBB0_4
## %bb.5:
	cmpl	$128, %ebx
	je	LBB0_13
## %bb.6:
	cmpl	$129, %ebx
	jne	LBB0_20
## %bb.7:
	xorl	%eax, %eax
	callq	_lock_kernel
	movl	20(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_9
## %bb.8:
	decl	%eax
	movl	%eax, 20(%r14)
	decl	16(%r14)
	movq	_standbys_pending@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	decl	%eax
	movl	%eax, (%rcx)
	testl	%eax, %eax
	jg	LBB0_12
LBB0_11:
	xorl	%eax, %eax
	callq	_standby
LBB0_12:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_unlock_kernel
	jmp	LBB0_22
LBB0_4:
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_21:
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
LBB0_22:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_13:
	xorl	%eax, %eax
	callq	_lock_kernel
	movl	12(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_15
## %bb.14:
	decl	%eax
	movl	%eax, 12(%r14)
	decl	8(%r14)
	movq	_suspends_pending@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	decl	%eax
	movl	%eax, (%rcx)
	testl	%eax, %eax
	jle	LBB0_17
LBB0_18:
	movl	$1, (%r14)
	movq	_apm_suspend_waitqueue@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_wait_event_interruptible
	movl	4(%r14), %ebx
	jmp	LBB0_19
LBB0_20:
	movq	_ENOTTY@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_9:
	movq	_APM_USER_STANDBY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_queue_event
	movq	_standbys_pending@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jg	LBB0_12
	jmp	LBB0_11
LBB0_15:
	movq	_APM_USER_SUSPEND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_queue_event
	movq	_suspends_pending@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jg	LBB0_18
LBB0_17:
	movl	$1, %edi
	callq	_suspend
	movl	%eax, %ebx
LBB0_19:
	xorl	%eax, %eax
	callq	_unlock_kernel
	movslq	%ebx, %rbx
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ioctl"

	.comm	_EIO,8,3                        ## @EIO
	.comm	_EPERM,8,3                      ## @EPERM
	.comm	_standbys_pending,4,2           ## @standbys_pending
	.comm	_APM_USER_STANDBY,4,2           ## @APM_USER_STANDBY
	.comm	_suspends_pending,4,2           ## @suspends_pending
	.comm	_APM_USER_SUSPEND,4,2           ## @APM_USER_SUSPEND
	.comm	_apm_suspend_waitqueue,4,2      ## @apm_suspend_waitqueue
	.comm	_ENOTTY,8,3                     ## @ENOTTY
	.no_dead_strip	_do_ioctl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_ioctl
_do_ioctl:                              ; @do_ioctl
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	ldr	x19, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_check_apm_user
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_11
LBB0_2:
	ldr	w8, [x19, #28]
	cbz	w8, LBB0_10
; %bb.3:
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_10
; %bb.4:
	cmp	w20, #128
	b.eq	LBB0_13
; %bb.5:
	cmp	w20, #129
	b.ne	LBB0_16
; %bb.6:
	bl	_lock_kernel
	ldr	w8, [x19, #20]
	subs	w8, w8, #1
	b.lt	LBB0_17
; %bb.7:
	ldr	w9, [x19, #16]
	sub	w9, w9, #1
	stp	w9, w8, [x19, #16]
Lloh4:
	adrp	x9, _standbys_pending@GOTPAGE
Lloh5:
	ldr	x9, [x9, _standbys_pending@GOTPAGEOFF]
	ldr	w8, [x9]
	sub	w8, w8, #1
	str	w8, [x9]
	cmp	w8, #0
	b.gt	LBB0_9
LBB0_8:
	bl	_standby
LBB0_9:
	bl	_unlock_kernel
	mov	x0, #0
	b	LBB0_12
LBB0_10:
Lloh6:
	adrp	x8, _EPERM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_11:
	ldr	x8, [x8]
	neg	x0, x8
LBB0_12:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_13:
	bl	_lock_kernel
	ldr	w8, [x19, #12]
	subs	w8, w8, #1
	b.lt	LBB0_18
; %bb.14:
	ldr	w9, [x19, #8]
	sub	w9, w9, #1
	stp	w9, w8, [x19, #8]
Lloh8:
	adrp	x9, _suspends_pending@GOTPAGE
Lloh9:
	ldr	x9, [x9, _suspends_pending@GOTPAGEOFF]
	ldr	w8, [x9]
	sub	w8, w8, #1
	str	w8, [x9]
	cmp	w8, #0
	b.le	LBB0_19
LBB0_15:
	mov	w8, #1
	str	w8, [x19]
Lloh10:
	adrp	x8, _apm_suspend_waitqueue@GOTPAGE
Lloh11:
	ldr	x8, [x8, _apm_suspend_waitqueue@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_wait_event_interruptible
	ldr	w19, [x19, #4]
	b	LBB0_20
LBB0_16:
Lloh13:
	adrp	x8, _ENOTTY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOTTY@GOTPAGEOFF]
	b	LBB0_11
LBB0_17:
Lloh15:
	adrp	x8, _APM_USER_STANDBY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _APM_USER_STANDBY@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_queue_event
Lloh18:
	adrp	x8, _standbys_pending@GOTPAGE
Lloh19:
	ldr	x8, [x8, _standbys_pending@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w8, #0
	b.gt	LBB0_9
	b	LBB0_8
LBB0_18:
Lloh21:
	adrp	x8, _APM_USER_SUSPEND@GOTPAGE
Lloh22:
	ldr	x8, [x8, _APM_USER_SUSPEND@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_queue_event
Lloh24:
	adrp	x8, _suspends_pending@GOTPAGE
Lloh25:
	ldr	x8, [x8, _suspends_pending@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cmp	w8, #0
	b.gt	LBB0_15
LBB0_19:
	mov	w0, #1
	bl	_suspend
	mov	x19, x0
LBB0_20:
	bl	_unlock_kernel
	sxtw	x0, w19
	b	LBB0_12
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ioctl"

	.comm	_EIO,8,3                        ; @EIO
	.comm	_EPERM,8,3                      ; @EPERM
	.comm	_standbys_pending,4,2           ; @standbys_pending
	.comm	_APM_USER_STANDBY,4,2           ; @APM_USER_STANDBY
	.comm	_suspends_pending,4,2           ; @suspends_pending
	.comm	_APM_USER_SUSPEND,4,2           ; @APM_USER_SUSPEND
	.comm	_apm_suspend_waitqueue,4,2      ; @apm_suspend_waitqueue
	.comm	_ENOTTY,8,3                     ; @ENOTTY
	.no_dead_strip	_do_ioctl
.subsections_via_symbols
