	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setup_ioapic_entry             ## -- Begin function setup_ioapic_entry
	.p2align	4, 0x90
_setup_ioapic_entry:                    ## @setup_ioapic_entry
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r12d
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r14d
	movq	%rdx, %rbx
	movl	%esi, %r13d
	movl	%edi, %r15d
	movq	%rdx, %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movq	_intr_remapping_enabled@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.1:
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movl	%r12d, -56(%rbp)                ## 4-byte Spill
	movl	%r15d, %edi
	callq	_map_ioapic_to_ir
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_panic
LBB0_3:
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	$1, %edx
	callq	_alloc_irte
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movl	%eax, %r13d
	testl	%eax, %eax
	movl	16(%rbp), %r14d
	jns	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	callq	_panic
LBB0_5:
	leaq	-112(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movl	$1, -112(%rbp)
	movq	_apic@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %ecx
	movl	%ecx, -64(%rbp)
	movq	$0, -72(%rbp)
	movl	4(%rax), %eax
	movl	%eax, -76(%rbp)
	movl	%r14d, -108(%rbp)
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_IRTE_DEST
	movl	%eax, -80(%rbp)
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_set_ioapic_sid
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movq	%r12, %rsi
	callq	_modify_irte
	movl	%r13d, %eax
	shrl	$15, %eax
	andl	$1, %eax
	movl	%eax, (%rbx)
	movl	$1, 4(%rbx)
	andl	$32767, %r13d                   ## imm = 0x7FFF
	movl	%r13d, 8(%rbx)
	movl	-56(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_7
LBB0_6:
	movq	_apic@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	4(%rax), %ecx
	movl	%ecx, 28(%rbx)
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movl	%r14d, 8(%rbx)
	movl	16(%rbp), %eax
	movl	%eax, 4(%rbx)
LBB0_7:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	$0, 12(%rbx)
	movl	%eax, 16(%rbx)
	movl	%r12d, 20(%rbx)
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	$1, 12(%rbx)
LBB0_9:
	xorl	%eax, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_intr_remapping_enabled,8,3     ## @intr_remapping_enabled
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No mapping iommu for ioapic %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate IRTE for ioapic %d\n"

	.comm	_apic,8,3                       ## @apic
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setup_ioapic_entry             ; -- Begin function setup_ioapic_entry
	.p2align	2
_setup_ioapic_entry:                    ; @setup_ioapic_entry
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	mov	x23, x6
	mov	x21, x5
	mov	x20, x4
	mov	x24, x3
	mov	x19, x2
	mov	x22, x1
	mov	x25, x0
	mov	x0, x2
	mov	w1, #0
	mov	w2, #56
	bl	_memset
Lloh0:
	adrp	x8, _intr_remapping_enabled@GOTPAGE
Lloh1:
	ldr	x8, [x8, _intr_remapping_enabled@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.1:
	mov	x0, x25
	bl	_map_ioapic_to_ir
	mov	x26, x0
	cbnz	x0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x25
	bl	_panic
LBB0_3:
	mov	w27, #1
	mov	x0, x26
	mov	x1, x22
	mov	w2, #1
	bl	_alloc_irte
	mov	x26, x0
	tbz	w0, #31, LBB0_5
; %bb.4:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x25
	bl	_panic
LBB0_5:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #56
	bl	_memset
	str	w27, [sp, #8]
Lloh7:
	adrp	x8, _apic@GOTPAGE
Lloh8:
	ldr	x8, [x8, _apic@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	w9, [x8]
	str	w9, [sp, #56]
	str	xzr, [sp, #48]
	ldr	w8, [x8, #4]
	str	w8, [sp, #44]
	str	w23, [sp, #12]
	mov	x0, x24
	bl	_IRTE_DEST
	str	w0, [sp, #40]
	add	x0, sp, #8
	mov	x1, x25
	bl	_set_ioapic_sid
	add	x1, sp, #8
	mov	x0, x22
	bl	_modify_irte
	ubfx	w8, w26, #15, #1
	stp	w8, w27, [x19]
	and	w8, w26, #0x7fff
	str	w8, [x19, #8]
	b	LBB0_7
LBB0_6:
Lloh10:
	adrp	x8, _apic@GOTPAGE
Lloh11:
	ldr	x8, [x8, _apic@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	ldr	d0, [x8]
	str	d0, [x19, #24]
	stp	w23, w24, [x19, #4]
LBB0_7:
	stp	wzr, w20, [x19, #12]
	str	w21, [x19, #20]
	cbz	w20, LBB0_9
; %bb.8:
	mov	w8, #1
	str	w8, [x19, #12]
LBB0_9:
	mov	w0, #0
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_intr_remapping_enabled,8,3     ; @intr_remapping_enabled
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No mapping iommu for ioapic %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate IRTE for ioapic %d\n"

	.comm	_apic,8,3                       ; @apic
.subsections_via_symbols
