	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xen_intr_get_evtchn_from_port  ## -- Begin function xen_intr_get_evtchn_from_port
	.p2align	4, 0x90
_xen_intr_get_evtchn_from_port:         ## @xen_intr_get_evtchn_from_port
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_is_valid_evtchn
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	_NR_EVENT_CHANNELS@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jbe	LBB0_2
## %bb.3:
	testq	%r14, %r14
	je	LBB0_2
## %bb.4:
	movq	_xen_intr_isrc_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_lock
	movq	_xen_intr_port_to_isrc@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.6:
	addq	$4, %rdi
	callq	_refcount_acquire
	movq	_xen_intr_isrc_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
	movq	(%r15), %rax
	movq	(%rax,%rbx,8), %rax
	movq	%rax, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_5:
	movq	_xen_intr_isrc_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NR_EVENT_CHANNELS,8,3          ## @NR_EVENT_CHANNELS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_xen_intr_isrc_lock,4,2         ## @xen_intr_isrc_lock
	.comm	_xen_intr_port_to_isrc,8,3      ## @xen_intr_port_to_isrc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xen_intr_get_evtchn_from_port  ; -- Begin function xen_intr_get_evtchn_from_port
	.p2align	2
_xen_intr_get_evtchn_from_port:         ; @xen_intr_get_evtchn_from_port
	.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	x19, x1
	mov	x20, x0
	bl	_is_valid_evtchn
	cbz	w0, LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _NR_EVENT_CHANNELS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NR_EVENT_CHANNELS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x20
	b.ls	LBB0_6
; %bb.2:
	cbz	x19, LBB0_6
; %bb.3:
Lloh3:
	adrp	x0, _xen_intr_isrc_lock@GOTPAGE
Lloh4:
	ldr	x0, [x0, _xen_intr_isrc_lock@GOTPAGEOFF]
	bl	_mtx_lock
Lloh5:
	adrp	x21, _xen_intr_port_to_isrc@GOTPAGE
Lloh6:
	ldr	x21, [x21, _xen_intr_port_to_isrc@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x8, [x8, x20, lsl #3]
	cbz	x8, LBB0_5
; %bb.4:
	add	x0, x8, #4
	bl	_refcount_acquire
Lloh7:
	adrp	x0, _xen_intr_isrc_lock@GOTPAGE
Lloh8:
	ldr	x0, [x0, _xen_intr_isrc_lock@GOTPAGEOFF]
	bl	_mtx_unlock
	mov	w0, #0
	ldr	x8, [x21]
	ldr	x8, [x8, x20, lsl #3]
	str	x8, [x19]
	b	LBB0_7
LBB0_5:
Lloh9:
	adrp	x0, _xen_intr_isrc_lock@GOTPAGE
Lloh10:
	ldr	x0, [x0, _xen_intr_isrc_lock@GOTPAGEOFF]
	bl	_mtx_unlock
LBB0_6:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
LBB0_7:
	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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_NR_EVENT_CHANNELS,8,3          ; @NR_EVENT_CHANNELS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_xen_intr_isrc_lock,4,2         ; @xen_intr_isrc_lock
	.comm	_xen_intr_port_to_isrc,8,3      ; @xen_intr_port_to_isrc
.subsections_via_symbols
