	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function allocate_signal_page
_allocate_signal_page:                  ## @allocate_signal_page
	.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	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	movl	(%r15), %r15d
	movq	_KFD_SIGNAL_EVENT_LIMIT@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	shll	$3, %edi
	callq	_get_order
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	___get_free_pages
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rax, %r15
	movq	_UNSIGNALED_EVENT_SLOT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	shll	$3, %edx
	movq	%r15, %rdi
	callq	_memset
	movq	%r15, 8(%rbx)
	movl	$1, (%rbx)
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_pr_debug
	jmp	LBB0_5
LBB0_3:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_4:
	xorl	%ebx, %ebx
LBB0_5:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_KFD_SIGNAL_EVENT_LIMIT,4,2     ## @KFD_SIGNAL_EVENT_LIMIT
	.comm	_UNSIGNALED_EVENT_SLOT,8,3      ## @UNSIGNALED_EVENT_SLOT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Allocated new event signal page at %p, for process %p\n"

	.no_dead_strip	_allocate_signal_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function allocate_signal_page
_allocate_signal_page:                  ; @allocate_signal_page
	.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, x0
Lloh0:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w0, #16
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w21, [x21]
Lloh2:
	adrp	x22, _KFD_SIGNAL_EVENT_LIMIT@GOTPAGE
Lloh3:
	ldr	x22, [x22, _KFD_SIGNAL_EVENT_LIMIT@GOTPAGEOFF]
	ldr	w8, [x22]
	lsl	w0, w8, #3
	bl	_get_order
	mov	x1, x0
	mov	x0, x21
	bl	___get_free_pages
	cbz	x0, LBB0_3
; %bb.2:
	mov	x21, x0
Lloh4:
	adrp	x8, _UNSIGNALED_EVENT_SLOT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _UNSIGNALED_EVENT_SLOT@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	w8, [x22]
	lsl	w2, w8, #3
	bl	_memset
	str	x21, [x19, #8]
	mov	w8, #1
	str	w8, [x19]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x2, x20
	bl	_pr_debug
	b	LBB0_4
LBB0_3:
	mov	x0, x19
	bl	_kfree
	mov	x19, #0
LBB0_4:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_KFD_SIGNAL_EVENT_LIMIT,4,2     ; @KFD_SIGNAL_EVENT_LIMIT
	.comm	_UNSIGNALED_EVENT_SLOT,8,3      ; @UNSIGNALED_EVENT_SLOT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Allocated new event signal page at %p, for process %p\n"

	.no_dead_strip	_allocate_signal_page
.subsections_via_symbols
