	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lapic_intr_msi                 ## -- Begin function lapic_intr_msi
	.p2align	4, 0x90
_lapic_intr_msi:                        ## @lapic_intr_msi
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	movl	%r15d, %ecx
	callq	_VM_CTR2
	movq	_MSI_X86_ADDR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	movq	_MSI_X86_ADDR_BASE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_1
## %bb.2:
	movl	%ebx, %eax
	shrl	$12, %eax
	movzbl	%al, %r8d
	movq	_MSI_X86_ADDR_RH@GOTPCREL(%rip), %rax
	movq	_MSI_X86_ADDR_LOG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ebx
	movq	_APIC_DELMODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	andl	%r15d, %r13d
	xorl	%r12d, %r12d
	testl	%ebx, %ecx
	setne	%r12b
	movzbl	%r15b, %r15d
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.4(%rip), %rdx
	cmovneq	%rax, %rdx
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%r8d, %ebx
	movl	%r8d, %ecx
	movl	%r15d, %r8d
	callq	_VM_CTR3
	movq	_LAPIC_TRIG_EDGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	movl	%r12d, %ecx
	movl	%r13d, %r8d
	movl	%r15d, %r9d
	callq	_vlapic_deliver_intr
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_VM_CTR1
	movl	$-1, %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"lapic MSI addr: %#lx msg: %#lx"

	.comm	_MSI_X86_ADDR_MASK,4,2          ## @MSI_X86_ADDR_MASK
	.comm	_MSI_X86_ADDR_BASE,4,2          ## @MSI_X86_ADDR_BASE
L_.str.1:                               ## @.str.1
	.asciz	"lapic MSI invalid addr %#lx"

	.comm	_MSI_X86_ADDR_RH,4,2            ## @MSI_X86_ADDR_RH
	.comm	_MSI_X86_ADDR_LOG,4,2           ## @MSI_X86_ADDR_LOG
	.comm	_APIC_DELMODE_MASK,4,2          ## @APIC_DELMODE_MASK
L_.str.2:                               ## @.str.2
	.asciz	"lapic MSI %s dest %#x, vec %d"

L_.str.3:                               ## @.str.3
	.asciz	"physical"

L_.str.4:                               ## @.str.4
	.asciz	"logical"

	.comm	_LAPIC_TRIG_EDGE,4,2            ## @LAPIC_TRIG_EDGE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lapic_intr_msi                 ; -- Begin function lapic_intr_msi
	.p2align	2
_lapic_intr_msi:                        ; @lapic_intr_msi
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x20
	bl	_VM_CTR2
Lloh2:
	adrp	x8, _MSI_X86_ADDR_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MSI_X86_ADDR_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	and	w8, w8, w21
Lloh5:
	adrp	x9, _MSI_X86_ADDR_BASE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MSI_X86_ADDR_BASE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	ubfx	w22, w21, #12, #8
Lloh8:
	adrp	x8, _MSI_X86_ADDR_RH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MSI_X86_ADDR_RH@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _MSI_X86_ADDR_LOG@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MSI_X86_ADDR_LOG@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
	and	w9, w8, w21
	cmp	w9, w8
	cset	w21, ne
Lloh14:
	adrp	x8, _APIC_DELMODE_MASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _APIC_DELMODE_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	and	w23, w8, w20
	and	w20, w20, #0xff
Lloh17:
	adrp	x8, l_.str.4@PAGE
Lloh18:
	add	x8, x8, l_.str.4@PAGEOFF
Lloh19:
	adrp	x9, l_.str.3@PAGE
Lloh20:
	add	x9, x9, l_.str.3@PAGEOFF
	csel	x2, x9, x8, ne
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x3, x22
	mov	x4, x20
	bl	_VM_CTR3
Lloh23:
	adrp	x8, _LAPIC_TRIG_EDGE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _LAPIC_TRIG_EDGE@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	mov	x3, x21
	mov	x4, x23
	mov	x5, x20
	bl	_vlapic_deliver_intr
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_VM_CTR1
	mov	w0, #-1
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"lapic MSI addr: %#lx msg: %#lx"

	.comm	_MSI_X86_ADDR_MASK,4,2          ; @MSI_X86_ADDR_MASK
	.comm	_MSI_X86_ADDR_BASE,4,2          ; @MSI_X86_ADDR_BASE
l_.str.1:                               ; @.str.1
	.asciz	"lapic MSI invalid addr %#lx"

	.comm	_MSI_X86_ADDR_RH,4,2            ; @MSI_X86_ADDR_RH
	.comm	_MSI_X86_ADDR_LOG,4,2           ; @MSI_X86_ADDR_LOG
	.comm	_APIC_DELMODE_MASK,4,2          ; @APIC_DELMODE_MASK
l_.str.2:                               ; @.str.2
	.asciz	"lapic MSI %s dest %#x, vec %d"

l_.str.3:                               ; @.str.3
	.asciz	"physical"

l_.str.4:                               ; @.str.4
	.asciz	"logical"

	.comm	_LAPIC_TRIG_EDGE,4,2            ; @LAPIC_TRIG_EDGE
.subsections_via_symbols
