	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function allocate_event_notification_slot
_allocate_event_notification_slot:      ## @allocate_event_notification_slot
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	cmpq	$0, 8(%rdi)
	je	LBB0_2
## %bb.1:
	movl	(%r12), %eax
	leal	7(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$3, %ecx
	jmp	LBB0_5
LBB0_2:
	movq	%r12, %rdi
	callq	_allocate_signal_page
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	$2048, (%r12)                   ## imm = 0x800
	movl	$256, %ecx                      ## imm = 0x100
LBB0_5:
	leaq	16(%r12), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%r15d, %r15d
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_idr_alloc
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movl	%ebx, (%r14)
	movq	_UNSIGNALED_EVENT_SLOT@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	8(%r12), %rdi
	callq	_page_slots
	movl	%ebx, %ecx
	movl	%r14d, (%rax,%rcx,4)
	jmp	LBB0_8
LBB0_6:
	movl	%ebx, %r15d
	jmp	LBB0_8
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_8:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_UNSIGNALED_EVENT_SLOT,4,2      ## @UNSIGNALED_EVENT_SLOT
	.no_dead_strip	_allocate_event_notification_slot
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function allocate_event_notification_slot
_allocate_event_notification_slot:      ; @allocate_event_notification_slot
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w8, [x19]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w3, w8, #3
	b	LBB0_4
LBB0_2:
	mov	x0, x19
	bl	_allocate_signal_page
	str	x0, [x19, #8]
	cbz	x0, LBB0_6
; %bb.3:
	mov	w8, #2048
	str	w8, [x19]
	mov	w3, #256
LBB0_4:
	add	x0, x19, #16
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w4, [x8]
	mov	x1, x20
	mov	w2, #0
	bl	_idr_alloc
	mov	x21, x0
	tbnz	w0, #31, LBB0_7
; %bb.5:
	str	w21, [x20]
Lloh3:
	adrp	x8, _UNSIGNALED_EVENT_SLOT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UNSIGNALED_EVENT_SLOT@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x8]
	ldr	x0, [x19, #8]
	bl	_page_slots
	str	w20, [x0, w21, uxtw #2]
	mov	w21, #0
	b	LBB0_7
LBB0_6:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_7:
	mov	x0, x21
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_UNSIGNALED_EVENT_SLOT,4,2      ; @UNSIGNALED_EVENT_SLOT
	.no_dead_strip	_allocate_event_notification_slot
.subsections_via_symbols
