	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_map_msi_intr             ## -- Begin function iommu_map_msi_intr
	.p2align	4, 0x90
_iommu_map_msi_intr:                    ## @iommu_map_msi_intr
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r12
	movq	%r8, %rbx
	movl	%ecx, %r14d
	movl	%edx, %r13d
	movl	%esi, %r15d
	leaq	-52(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	callq	_dmar_ir_find
	cmpl	$0, -48(%rbp)
	je	LBB0_3
## %bb.1:
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movl	%r13d, (%r12)
	movq	_MSI_INTEL_ADDR_BASE@GOTPCREL(%rip), %rax
	movzbl	%r15b, %ecx
	shll	$12, %ecx
	orl	(%rax), %ecx
	movl	%ecx, (%rbx)
	movq	_x2apic_mode@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpq	$0, (%rax)
	jne	LBB0_12
## %bb.2:
	xorl	%edi, %edi
	cmpl	$256, %r15d                     ## imm = 0x100
	setl	%dil
	movslq	%r15d, %rsi
	callq	_KASSERT
	jmp	LBB0_12
LBB0_3:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	cmpl	$-1, %r14d
	je	LBB0_6
## %bb.5:
	cmpl	$0, (%rax)
	je	LBB0_6
## %bb.7:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_DMAR_X2APIC
	movl	%r15d, %edi
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	callq	_DMAR_IRTE1_DST_x2APIC
	jmp	LBB0_10
LBB0_6:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_12
LBB0_9:
	callq	_DMAR_IRTE1_DST_xAPIC
LBB0_10:
	movl	%eax, %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_DMAR_IRTE1_V
	orl	%eax, %ebx
	movq	_DMAR_IRTE1_DLM_FM@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_DMAR_IRTE1_TM_EDGE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_DMAR_IRTE1_RH_DIRECT@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_DMAR_IRTE1_DM_PHYSICAL@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_DMAR_IRTE1_P@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	-52(%rbp), %ecx
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_dmar_ir_program_irte
	xorl	%ebx, %ebx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.11:
	movq	_MSI_INTEL_ADDR_BASE@GOTPCREL(%rip), %rax
	movl	%r14d, %ecx
	shll	$5, %ecx
	andl	$1048544, %ecx                  ## imm = 0xFFFE0
	shll	$2, %r14d
	andl	$131072, %r14d                  ## imm = 0x20000
	orl	%ecx, %r14d
	orl	(%rax), %r14d
	orl	$24, %r14d
	movl	%r14d, (%rdx)
	movl	$0, (%r12)
LBB0_12:
	movl	%ebx, %eax
	addq	$24, %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	"DMAR cannot translate itself"

	.comm	_MSI_INTEL_ADDR_BASE,4,2        ## @MSI_INTEL_ADDR_BASE
	.comm	_x2apic_mode,8,3                ## @x2apic_mode
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_DMAR_IRTE1_DLM_FM,4,2          ## @DMAR_IRTE1_DLM_FM
	.comm	_DMAR_IRTE1_TM_EDGE,4,2         ## @DMAR_IRTE1_TM_EDGE
	.comm	_DMAR_IRTE1_RH_DIRECT,4,2       ## @DMAR_IRTE1_RH_DIRECT
	.comm	_DMAR_IRTE1_DM_PHYSICAL,4,2     ## @DMAR_IRTE1_DM_PHYSICAL
	.comm	_DMAR_IRTE1_P,4,2               ## @DMAR_IRTE1_P
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iommu_map_msi_intr             ; -- Begin function iommu_map_msi_intr
	.p2align	2
_iommu_map_msi_intr:                    ; @iommu_map_msi_intr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x5
	mov	x19, x4
	mov	x21, x3
	mov	x23, x2
	mov	x24, x1
	add	x1, sp, #12
	add	x2, sp, #8
	bl	_dmar_ir_find
	mov	x22, x0
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_3
; %bb.1:
	cmp	x22, #0
	cset	w0, eq
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	str	w23, [x20]
Lloh2:
	adrp	x8, _MSI_INTEL_ADDR_BASE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MSI_INTEL_ADDR_BASE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ubfiz	w9, w24, #12, #8
	orr	w8, w8, w9
	str	w8, [x19]
Lloh5:
	adrp	x8, _x2apic_mode@GOTPAGE
Lloh6:
	ldr	x8, [x8, _x2apic_mode@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cbz	x8, LBB0_9
; %bb.2:
	mov	w0, #0
	b	LBB0_13
LBB0_3:
	cbz	x22, LBB0_8
; %bb.4:
	cmn	w21, #1
	b.eq	LBB0_8
; %bb.5:
	ldr	w8, [x22]
	cbz	w8, LBB0_8
; %bb.6:
	mov	x0, x22
	bl	_DMAR_X2APIC
	cbz	x0, LBB0_10
; %bb.7:
	mov	x0, x24
	bl	_DMAR_IRTE1_DST_x2APIC
	b	LBB0_11
LBB0_8:
Lloh8:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	b	LBB0_13
LBB0_9:
	cmp	w24, #256
	cset	w0, lt
	sxtw	x1, w24
	bl	_KASSERT
	mov	w0, #0
	b	LBB0_13
LBB0_10:
	mov	x0, x24
	bl	_DMAR_IRTE1_DST_xAPIC
LBB0_11:
	mov	x24, x0
	mov	x0, x23
	bl	_DMAR_IRTE1_V
	orr	w8, w0, w24
Lloh11:
	adrp	x9, _DMAR_IRTE1_DLM_FM@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DMAR_IRTE1_DLM_FM@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh14:
	adrp	x9, _DMAR_IRTE1_TM_EDGE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _DMAR_IRTE1_TM_EDGE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _DMAR_IRTE1_RH_DIRECT@GOTPAGE
Lloh18:
	ldr	x10, [x10, _DMAR_IRTE1_RH_DIRECT@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh19:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh20:
	adrp	x9, _DMAR_IRTE1_DM_PHYSICAL@GOTPAGE
Lloh21:
	ldr	x9, [x9, _DMAR_IRTE1_DM_PHYSICAL@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh23:
	adrp	x9, _DMAR_IRTE1_P@GOTPAGE
Lloh24:
	ldr	x9, [x9, _DMAR_IRTE1_P@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w2, w8, w9
	ldr	w3, [sp, #12]
	mov	x0, x22
	mov	x1, x21
	bl	_dmar_ir_program_irte
	mov	w0, #0
	cbz	x19, LBB0_13
; %bb.12:
Lloh26:
	adrp	x8, _MSI_INTEL_ADDR_BASE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MSI_INTEL_ADDR_BASE@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	ubfiz	w9, w21, #5, #15
	lsl	w10, w21, #2
	and	w10, w10, #0x20000
	orr	w9, w9, w10
	orr	w8, w9, w8
	orr	w8, w8, #0x18
	str	w8, [x19]
	str	wzr, [x20]
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMAR cannot translate itself"

	.comm	_MSI_INTEL_ADDR_BASE,4,2        ; @MSI_INTEL_ADDR_BASE
	.comm	_x2apic_mode,8,3                ; @x2apic_mode
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_DMAR_IRTE1_DLM_FM,4,2          ; @DMAR_IRTE1_DLM_FM
	.comm	_DMAR_IRTE1_TM_EDGE,4,2         ; @DMAR_IRTE1_TM_EDGE
	.comm	_DMAR_IRTE1_RH_DIRECT,4,2       ; @DMAR_IRTE1_RH_DIRECT
	.comm	_DMAR_IRTE1_DM_PHYSICAL,4,2     ; @DMAR_IRTE1_DM_PHYSICAL
	.comm	_DMAR_IRTE1_P,4,2               ; @DMAR_IRTE1_P
.subsections_via_symbols
