	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_set_msi                    ## -- Begin function kvm_set_msi
	.p2align	4, 0x90
_kvm_set_msi:                           ## @kvm_set_msi
	.cfi_startproc
## %bb.0:
	testl	%ecx, %ecx
	je	LBB0_1
## %bb.2:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	movl	4(%rbx), %esi
	callq	_trace_kvm_msi_set_irq
	movl	(%rbx), %eax
	movq	_MSI_ADDR_DEST_ID_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%eax, %edx
	movq	_MSI_ADDR_DEST_ID_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %edx
	movl	%edx, -48(%rbp)
	movl	4(%rbx), %edx
	movq	_MSI_DATA_VECTOR_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	%edx, %esi
	movq	_MSI_DATA_VECTOR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %esi
	movq	_MSI_ADDR_DEST_MODE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %edi
	shll	%cl, %edi
	movl	%esi, -44(%rbp)
	movq	_MSI_DATA_TRIGGER_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %esi
	shll	%cl, %esi
	andl	%eax, %edi
	movl	%edi, -40(%rbp)
	andl	%edx, %esi
	movl	%esi, -36(%rbp)
	andl	$1792, %edx                     ## imm = 0x700
	movl	%edx, -32(%rbp)
	movl	$1, -28(%rbp)
	movq	$0, -24(%rbp)
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_kvm_irq_delivery_to_apic
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movl	$-1, %eax
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSI_ADDR_DEST_ID_MASK,4,2      ## @MSI_ADDR_DEST_ID_MASK
	.comm	_MSI_ADDR_DEST_ID_SHIFT,4,2     ## @MSI_ADDR_DEST_ID_SHIFT
	.comm	_MSI_DATA_VECTOR_MASK,4,2       ## @MSI_DATA_VECTOR_MASK
	.comm	_MSI_DATA_VECTOR_SHIFT,4,2      ## @MSI_DATA_VECTOR_SHIFT
	.comm	_MSI_ADDR_DEST_MODE_SHIFT,4,2   ## @MSI_ADDR_DEST_MODE_SHIFT
	.comm	_MSI_DATA_TRIGGER_SHIFT,4,2     ## @MSI_DATA_TRIGGER_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_set_msi                    ; -- Begin function kvm_set_msi
	.p2align	2
_kvm_set_msi:                           ; @kvm_set_msi
	.cfi_startproc
; %bb.0:
	cbz	w3, LBB0_2
; %bb.1:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0]
	ldr	w1, [x20, #4]
	bl	_trace_kvm_msi_set_irq
Lloh0:
	adrp	x8, _MSI_ADDR_DEST_ID_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSI_ADDR_DEST_ID_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldp	w9, w10, [x20]
	and	w8, w8, w9
Lloh3:
	adrp	x11, _MSI_ADDR_DEST_ID_SHIFT@GOTPAGE
Lloh4:
	ldr	x11, [x11, _MSI_ADDR_DEST_ID_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	asr	w8, w8, w11
Lloh6:
	adrp	x11, _MSI_DATA_VECTOR_MASK@GOTPAGE
Lloh7:
	ldr	x11, [x11, _MSI_DATA_VECTOR_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	and	w11, w11, w10
Lloh9:
	adrp	x12, _MSI_DATA_VECTOR_SHIFT@GOTPAGE
Lloh10:
	ldr	x12, [x12, _MSI_DATA_VECTOR_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w12, [x12]
	asr	w11, w11, w12
	stp	w8, w11, [sp]
Lloh12:
	adrp	x8, _MSI_ADDR_DEST_MODE_SHIFT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MSI_ADDR_DEST_MODE_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	mov	w11, #1
	lsl	w8, w11, w8
	and	w8, w8, w9
Lloh15:
	adrp	x9, _MSI_DATA_TRIGGER_SHIFT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MSI_DATA_TRIGGER_SHIFT@GOTPAGEOFF]
	str	w8, [sp, #8]
Lloh17:
	ldr	w8, [x9]
	lsl	w8, w11, w8
	movi.2s	v0, #7, lsl #8
	mov.s	v0[0], w8
	dup.2s	v1, w10
	and.8b	v0, v0, v1
	stur	d0, [sp, #12]
	str	w11, [sp, #20]
	str	xzr, [sp, #24]
	mov	x2, sp
	mov	x0, x19
	mov	x1, #0
	bl	_kvm_irq_delivery_to_apic
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_2:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	mov	w0, #-1
	ret
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MSI_ADDR_DEST_ID_MASK,4,2      ; @MSI_ADDR_DEST_ID_MASK
	.comm	_MSI_ADDR_DEST_ID_SHIFT,4,2     ; @MSI_ADDR_DEST_ID_SHIFT
	.comm	_MSI_DATA_VECTOR_MASK,4,2       ; @MSI_DATA_VECTOR_MASK
	.comm	_MSI_DATA_VECTOR_SHIFT,4,2      ; @MSI_DATA_VECTOR_SHIFT
	.comm	_MSI_ADDR_DEST_MODE_SHIFT,4,2   ; @MSI_ADDR_DEST_MODE_SHIFT
	.comm	_MSI_DATA_TRIGGER_SHIFT,4,2     ; @MSI_DATA_TRIGGER_SHIFT
.subsections_via_symbols
