	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xen_intr_release_isrc
_xen_intr_release_isrc:                 ## @xen_intr_release_isrc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_xen_intr_isrc_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_lock
	xorl	%edi, %edi
	cmpq	$0, 40(%rbx)
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	(%rbx), %rdi
	callq	_evtchn_mask_port
	movq	(%rbx), %rdi
	callq	_evtchn_clear_port
	movq	(%rbx), %rsi
	movq	32(%rbx), %rdi
	callq	_evtchn_cpu_mask_port
	movq	(%rbx), %rsi
	xorl	%edi, %edi
	callq	_evtchn_cpu_unmask_port
	cmpq	$0, 8(%rbx)
	je	LBB0_4
## %bb.1:
	movq	(%rbx), %rdi
	callq	_is_valid_evtchn
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	(%rbx), %rax
	movq	%rax, -16(%rbp)
	movq	_EVTCHNOP_close@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-16(%rbp), %rsi
	callq	_HYPERVISOR_event_channel_op
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_panic
LBB0_4:
	movq	_xen_intr_port_to_isrc@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rbx), %rcx
	movq	$0, (%rax,%rcx,8)
	movq	$0, 32(%rbx)
	movq	_EVTCHN_TYPE_UNBOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	$0, (%rbx)
	movq	$0, 16(%rbx)
	movq	_xen_intr_isrc_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_xen_intr_isrc_lock,4,2         ## @xen_intr_isrc_lock
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Release called, but xenisrc still in use"

	.comm	_EVTCHNOP_close,4,2             ## @EVTCHNOP_close
L_.str.1:                               ## @.str.1
	.asciz	"EVTCHNOP_close failed"

	.comm	_xen_intr_port_to_isrc,8,3      ## @xen_intr_port_to_isrc
	.comm	_EVTCHN_TYPE_UNBOUND,4,2        ## @EVTCHN_TYPE_UNBOUND
	.no_dead_strip	_xen_intr_release_isrc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xen_intr_release_isrc
_xen_intr_release_isrc:                 ; @xen_intr_release_isrc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x0, _xen_intr_isrc_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _xen_intr_isrc_lock@GOTPAGEOFF]
	bl	_mtx_lock
	ldr	x8, [x19, #40]
	cmp	x8, #0
	cset	w0, eq
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	x0, [x19]
	bl	_evtchn_mask_port
	ldr	x0, [x19]
	bl	_evtchn_clear_port
	ldr	x0, [x19, #32]
	ldr	x1, [x19]
	bl	_evtchn_cpu_mask_port
	ldr	x1, [x19]
	mov	w0, #0
	bl	_evtchn_cpu_unmask_port
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x0, [x19]
	bl	_is_valid_evtchn
	cbz	x0, LBB0_4
; %bb.2:
	ldr	x8, [x19]
	str	x8, [sp, #8]
Lloh4:
	adrp	x8, _EVTCHNOP_close@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EVTCHNOP_close@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	add	x1, sp, #8
	bl	_HYPERVISOR_event_channel_op
	cbz	x0, LBB0_4
; %bb.3:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_panic
LBB0_4:
Lloh9:
	adrp	x8, _xen_intr_port_to_isrc@GOTPAGE
Lloh10:
	ldr	x8, [x8, _xen_intr_port_to_isrc@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	ldr	x9, [x19]
	str	xzr, [x8, x9, lsl #3]
	str	xzr, [x19, #32]
Lloh12:
	adrp	x8, _EVTCHN_TYPE_UNBOUND@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EVTCHN_TYPE_UNBOUND@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x19, #24]
	str	xzr, [x19]
	str	xzr, [x19, #16]
Lloh15:
	adrp	x0, _xen_intr_isrc_lock@GOTPAGE
Lloh16:
	ldr	x0, [x0, _xen_intr_isrc_lock@GOTPAGEOFF]
	bl	_mtx_unlock
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_xen_intr_isrc_lock,4,2         ; @xen_intr_isrc_lock
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Release called, but xenisrc still in use"

	.comm	_EVTCHNOP_close,4,2             ; @EVTCHNOP_close
l_.str.1:                               ; @.str.1
	.asciz	"EVTCHNOP_close failed"

	.comm	_xen_intr_port_to_isrc,8,3      ; @xen_intr_port_to_isrc
	.comm	_EVTCHN_TYPE_UNBOUND,4,2        ; @EVTCHN_TYPE_UNBOUND
	.no_dead_strip	_xen_intr_release_isrc
.subsections_via_symbols
