	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dmar_ir_add
_dmar_ir_add:                           ## @dmar_ir_add
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_x2apic_enabled
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	8(%r14), %edi
	callq	_ecap_eim_support
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	movl	(%rbx), %edi
	movq	%r14, %rsi
	callq	_ir_parse_ioapic_hpet_scope
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movl	4(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_warn
	jmp	LBB0_5
LBB0_6:
	movq	%r14, %rdi
	callq	_intel_setup_irq_remapping
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movl	(%r14), %esi
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_err
	movq	%r14, %rdi
	callq	_intel_teardown_irq_remapping
	movq	%r14, %rdi
	callq	_ir_remove_ioapic_hpet_scope
	jmp	LBB0_9
LBB0_2:
	movl	4(%r14), %esi
	movl	8(%r14), %edx
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	movq	%r14, %rdi
	callq	_iommu_enable_irq_remapping
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DRHD %Lx: EIM not supported by DRHD, ecap %Lx\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"DRHD %Lx: failed to parse managed IOAPIC/HPET\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to setup irq remapping for %s\n"

	.no_dead_strip	_dmar_ir_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dmar_ir_add
_dmar_ir_add:                           ; @dmar_ir_add
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.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
	bl	_x2apic_enabled
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #8]
	bl	_ecap_eim_support
	cbz	w0, LBB0_6
LBB0_2:
	ldr	w0, [x20]
	mov	x1, x19
	bl	_ir_parse_ioapic_hpet_scope
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w1, [x19, #4]
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_warn
	b	LBB0_7
LBB0_4:
	mov	x0, x19
	bl	_intel_setup_irq_remapping
	mov	x20, x0
	cbz	w0, LBB0_9
; %bb.5:
	ldr	w1, [x19]
Lloh2:
	adrp	x0, l_.str.2@PAGE
Lloh3:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
	mov	x0, x19
	bl	_intel_teardown_irq_remapping
	mov	x0, x19
	bl	_ir_remove_ioapic_hpet_scope
	b	LBB0_8
LBB0_6:
	ldp	w1, w2, [x19, #4]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
LBB0_7:
Lloh6:
	adrp	x8, _ENODEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	x0, x19
	bl	_iommu_enable_irq_remapping
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DRHD %Lx: EIM not supported by DRHD, ecap %Lx\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"DRHD %Lx: failed to parse managed IOAPIC/HPET\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to setup irq remapping for %s\n"

	.no_dead_strip	_dmar_ir_add
.subsections_via_symbols
