	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kfd_event_page_set             ## -- Begin function kfd_event_page_set
	.p2align	4, 0x90
_kfd_event_page_set:                    ## @kfd_event_page_set
	.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
	cmpq	$0, 8(%rdi)
	je	LBB0_3
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_3:
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r12
	movq	_UNSIGNALED_EVENT_SLOT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_KFD_SIGNAL_EVENT_LIMIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	shll	$3, %edx
	movq	%r15, %rdi
	callq	_memset
	movq	%r15, (%r12)
	movq	%r12, 8(%rbx)
	movl	%r14d, (%rbx)
	xorl	%eax, %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_UNSIGNALED_EVENT_SLOT,8,3      ## @UNSIGNALED_EVENT_SLOT
	.comm	_KFD_SIGNAL_EVENT_LIMIT,4,2     ## @KFD_SIGNAL_EVENT_LIMIT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kfd_event_page_set             ; -- Begin function kfd_event_page_set
	.p2align	2
_kfd_event_page_set:                    ; @kfd_event_page_set
	.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	x8, [x0, #8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_3:
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.4:
	mov	x22, x0
Lloh5:
	adrp	x8, _UNSIGNALED_EVENT_SLOT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _UNSIGNALED_EVENT_SLOT@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _KFD_SIGNAL_EVENT_LIMIT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _KFD_SIGNAL_EVENT_LIMIT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	lsl	w2, w8, #3
	mov	x0, x21
	bl	_memset
	mov	w0, #0
	str	x21, [x22]
	str	x22, [x20, #8]
	str	w19, [x20]
LBB0_5:
	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
LBB0_6:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_UNSIGNALED_EVENT_SLOT,8,3      ; @UNSIGNALED_EVENT_SLOT
	.comm	_KFD_SIGNAL_EVENT_LIMIT,4,2     ; @KFD_SIGNAL_EVENT_LIMIT
.subsections_via_symbols
