	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xen_intr_handle_upcall         ## -- Begin function xen_intr_handle_upcall
	.p2align	4, 0x90
_xen_intr_handle_upcall:                ## @xen_intr_handle_upcall
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_critical_enter
	movq	_cpuid@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PCPU_GET
	movq	%rax, %r14
	movq	_xen_intr_pcpu@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_DPCPU_PTR
	movq	%rax, %r15
	movq	_HYPERVISOR_shared_info@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_vcpu_info@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_DPCPU_GET
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_xen_hvm_domain
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_xen_vector_callback_enabled@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_3
## %bb.2:
	xorl	%edi, %edi
	testq	%r14, %r14
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
LBB0_3:
	movq	$0, 8(%rbx)
	movq	%rbx, %rdi
	callq	_atomic_readandclear_long
	movq	%rax, %rdi
	movq	(%r15), %rbx
	movq	8(%r15), %r12
	movq	16(%r15), %rax
	incl	(%rax)
	testq	%rdi, %rdi
	je	LBB0_22
## %bb.4:
	movq	_LONG_BIT@GOTPCREL(%rip), %r14
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=1
	decq	%rbx
	movq	%rbx, %r12
	movq	%r13, %rbx
LBB0_21:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_xen_intr_active_ports
	movq	$-2, %rdx
	movl	%ebx, %ecx
	rolq	%cl, %rdx
	negq	%rax
	movl	$0, %eax
	sbbq	%rax, %rax
	orq	%rdx, %rax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	andq	%rax, %rdi
	je	LBB0_22
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
                                        ##     Child Loop BB0_13 Depth 2
	movq	(%r14), %rsi
	incq	%rbx
	movq	%rbx, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rax
	cqto
	idivq	%rsi
	movq	%rdx, %rcx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%esi
	movl	%edx, %ecx
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%rdi, %rax
	shrq	%cl, %rax
                                        ## kill: def $cl killed $cl killed $rcx
	shlq	%cl, %rax
	testq	%rax, %rax
	jne	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	decq	%rsi
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%rsi, %r12
	movq	%rdi, %rax
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	bsfq	%rax, %rbx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_13 Depth=2
	movq	(%r14), %rax
	decq	%rax
	cmpq	%rax, %r12
	movq	%r13, %rbx
	je	LBB0_21
LBB0_13:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %r13
	movq	%rbx, %rdx
	callq	_xen_intr_active_ports
	movq	%rax, %rsi
	incq	%r12
	movq	(%r14), %rbx
	movq	%r12, %rax
	orq	%rbx, %rax
	shrq	$32, %rax
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=2
	movq	%r12, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rcx
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_13 Depth=2
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ebx
	movl	%edx, %ecx
LBB0_16:                                ##   in Loop: Header=BB0_13 Depth=2
	shrq	%cl, %rsi
                                        ## kill: def $cl killed $cl killed $rcx
	shlq	%cl, %rsi
	testq	%rsi, %rsi
	je	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_13 Depth=2
	bsfq	%rsi, %r12
	imulq	%r13, %rbx
	addq	%r12, %rbx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_synch_clear_bit
	movq	_xen_intr_port_to_isrc@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rbx,8), %rbx
	xorl	%edi, %edi
	testq	%rbx, %rbx
	sete	%dil
	callq	___predict_false
	testq	%rax, %rax
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_13 Depth=2
	movq	(%rbx), %r14
	movq	_cpuid@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PCPU_GET
	xorl	%r15d, %r15d
	cmpq	%rax, %r14
	movq	_LONG_BIT@GOTPCREL(%rip), %r14
	sete	%r15b
	movq	_cpuid@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PCPU_GET
	movq	(%rbx), %rsi
	movl	%r15d, %edi
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	callq	_KASSERT
	addq	$8, %rbx
	movq	%rbx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_intr_execute_handlers
	movq	%r13, (%r15)
	movq	%r12, 8(%r15)
	jmp	LBB0_20
LBB0_22:
	movq	_xen_evtchn_needs_ack@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_24
## %bb.23:
	xorl	%eax, %eax
	callq	_lapic_eoi
LBB0_24:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_critical_exit                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_cpuid,4,2                      ## @cpuid
	.comm	_xen_intr_pcpu,4,2              ## @xen_intr_pcpu
	.comm	_HYPERVISOR_shared_info,8,3     ## @HYPERVISOR_shared_info
	.comm	_vcpu_info,4,2                  ## @vcpu_info
	.comm	_xen_vector_callback_enabled,4,2 ## @xen_vector_callback_enabled
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Fired PCI event callback on wrong CPU"

	.comm	_LONG_BIT,8,3                   ## @LONG_BIT
	.comm	_xen_intr_port_to_isrc,8,3      ## @xen_intr_port_to_isrc
	.comm	_xen_evtchn_needs_ack,8,3       ## @xen_evtchn_needs_ack
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_xen_intr_handle_upcall         ; -- Begin function xen_intr_handle_upcall
	.p2align	2
_xen_intr_handle_upcall:                ; @xen_intr_handle_upcall
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	bl	_critical_enter
Lloh0:
	adrp	x8, _cpuid@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cpuid@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_PCPU_GET
	mov	x22, x0
Lloh3:
	adrp	x8, _xen_intr_pcpu@GOTPAGE
Lloh4:
	ldr	x8, [x8, _xen_intr_pcpu@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_DPCPU_PTR
	mov	x20, x0
Lloh6:
	adrp	x8, _HYPERVISOR_shared_info@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HYPERVISOR_shared_info@GOTPAGEOFF]
Lloh8:
	ldr	x21, [x8]
Lloh9:
	adrp	x8, _vcpu_info@GOTPAGE
Lloh10:
	ldr	x8, [x8, _vcpu_info@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_DPCPU_GET
	mov	x23, x0
	bl	_xen_hvm_domain
	cbz	x0, LBB0_3
; %bb.1:
Lloh12:
	adrp	x8, _xen_vector_callback_enabled@GOTPAGE
Lloh13:
	ldr	x8, [x8, _xen_vector_callback_enabled@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cbnz	w8, LBB0_3
; %bb.2:
	cmp	x22, #0
	cset	w0, eq
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
LBB0_3:
	str	xzr, [x23, #8]
	mov	x0, x23
	bl	_atomic_readandclear_long
	ldp	x23, x28, [x20]
	ldr	x8, [x20, #16]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	cbz	x0, LBB0_16
; %bb.4:
	mov	x22, x0
Lloh17:
	adrp	x27, _LONG_BIT@GOTPAGE
Lloh18:
	ldr	x27, [x27, _LONG_BIT@GOTPAGEOFF]
	mov	x19, #-1
Lloh19:
	adrp	x25, _xen_intr_port_to_isrc@GOTPAGE
Lloh20:
	ldr	x25, [x25, _xen_intr_port_to_isrc@GOTPAGEOFF]
Lloh21:
	adrp	x26, _cpuid@GOTPAGE
Lloh22:
	ldr	x26, [x26, _cpuid@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	sub	x28, x8, #1
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_xen_intr_active_ports
	mov	w8, #1
	lsl	x8, x8, x23
	cmp	x0, #0
	csinv	x8, x19, x8, ne
	ands	x22, x8, x22
	b.eq	LBB0_16
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
                                        ;     Child Loop BB0_13 Depth 2
	ldr	x9, [x27]
	add	x8, x23, #1
	sdiv	x10, x8, x9
	msub	x8, x10, x9, x8
	lsl	x8, x19, x8
	ands	x8, x8, x22
	b.ne	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	sub	x28, x9, #1
LBB0_9:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cbz	x22, LBB0_9
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x8, x22
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	rbit	x8, x8
	clz	x23, x8
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=2
	ldr	x8, [x27]
	sub	x8, x8, #1
	cmp	x28, x8
	b.eq	LBB0_6
LBB0_13:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_xen_intr_active_ports
	add	x9, x28, #1
	ldr	x8, [x27]
	sdiv	x10, x9, x8
	msub	x9, x10, x8, x9
	lsl	x9, x19, x9
	ands	x9, x9, x0
	b.eq	LBB0_5
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=2
	rbit	x9, x9
	clz	x28, x9
	madd	x24, x8, x23, x28
	ldr	x1, [x21]
	mov	x0, x24
	bl	_synch_clear_bit
	ldr	x8, [x25]
	ldr	x24, [x8, x24, lsl #3]
	cmp	x24, #0
	cset	w0, eq
	bl	___predict_false
	cbnz	x0, LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=2
	mov	x19, x25
	ldr	x25, [x24]
	ldr	w0, [x26]
	bl	_PCPU_GET
	cmp	x25, x0
	cset	w25, eq
	ldr	w0, [x26]
	bl	_PCPU_GET
	ldr	x1, [x24], #8
	mov	x0, x25
	mov	x25, x19
	mov	x19, #-1
	bl	_KASSERT
	mov	x0, x24
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	bl	_intr_execute_handlers
	stp	x23, x28, [x20]
	b	LBB0_12
LBB0_16:
Lloh23:
	adrp	x8, _xen_evtchn_needs_ack@GOTPAGE
Lloh24:
	ldr	x8, [x8, _xen_evtchn_needs_ack@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	cbz	x8, LBB0_18
; %bb.17:
	bl	_lapic_eoi
LBB0_18:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_critical_exit
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_cpuid,4,2                      ; @cpuid
	.comm	_xen_intr_pcpu,4,2              ; @xen_intr_pcpu
	.comm	_HYPERVISOR_shared_info,8,3     ; @HYPERVISOR_shared_info
	.comm	_vcpu_info,4,2                  ; @vcpu_info
	.comm	_xen_vector_callback_enabled,4,2 ; @xen_vector_callback_enabled
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Fired PCI event callback on wrong CPU"

	.comm	_LONG_BIT,8,3                   ; @LONG_BIT
	.comm	_xen_intr_port_to_isrc,8,3      ; @xen_intr_port_to_isrc
	.comm	_xen_evtchn_needs_ack,8,3       ; @xen_evtchn_needs_ack
.subsections_via_symbols
