	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apic_idt_to_irq
_apic_idt_to_irq:                       ## @apic_idt_to_irq
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_APIC_IO_INTS@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	cmpq	%rsi, %rax
	setle	%cl
	movq	_IDT_SYSCALL@GOTPCREL(%rip), %rdx
	cmpq	%rsi, (%rdx)
	setne	%dl
	andb	%cl, %dl
	movq	_APIC_NUM_IOINTS@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	cmpq	%rsi, %rax
	setge	%al
	andb	%dl, %al
	movzbl	%al, %edi
	callq	_KASSERT
	movq	_lapics@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r14,8), %rax
	subq	(%r15), %rbx
	movl	(%rax,%rbx,4), %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	cmovgl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_APIC_IO_INTS,8,3               ## @APIC_IO_INTS
	.comm	_IDT_SYSCALL,8,3                ## @IDT_SYSCALL
	.comm	_APIC_NUM_IOINTS,8,3            ## @APIC_NUM_IOINTS
	.comm	_lapics,8,3                     ## @lapics
	.comm	_IDT_DTRACE_RET,8,3             ## @IDT_DTRACE_RET
	.no_dead_strip	_apic_idt_to_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apic_idt_to_irq
_apic_idt_to_irq:                       ; @apic_idt_to_irq
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x21, _APIC_IO_INTS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _APIC_IO_INTS@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x8, x1
Lloh2:
	adrp	x9, _IDT_SYSCALL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _IDT_SYSCALL@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	ccmp	x9, x1, #4, le
Lloh5:
	adrp	x9, _APIC_NUM_IOINTS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _APIC_NUM_IOINTS@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x8, x9, x8
	ccmp	x8, x1, #8, ne
	cset	w0, ge
	bl	_KASSERT
Lloh8:
	adrp	x8, _lapics@GOTPAGE
Lloh9:
	ldr	x8, [x8, _lapics@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldr	x8, [x8, x20, lsl #3]
	ldr	x9, [x21]
	sub	x9, x19, x9
	ldr	w8, [x8, x9, lsl #2]
	cmp	w8, #0
	csel	w0, w8, wzr, gt
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_APIC_IO_INTS,8,3               ; @APIC_IO_INTS
	.comm	_IDT_SYSCALL,8,3                ; @IDT_SYSCALL
	.comm	_APIC_NUM_IOINTS,8,3            ; @APIC_NUM_IOINTS
	.comm	_lapics,8,3                     ; @lapics
	.comm	_IDT_DTRACE_RET,8,3             ; @IDT_DTRACE_RET
	.no_dead_strip	_apic_idt_to_irq
.subsections_via_symbols
