	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_arm_gic_intr                   ## -- Begin function arm_gic_intr
	.p2align	4, 0x90
_arm_gic_intr:                          ## @arm_gic_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_GICC_IAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_gic_c_read_4
	movl	%eax, %ebx
	andl	$1023, %ebx                     ## imm = 0x3FF
	cmpl	(%r15), %ebx
	jge	LBB0_1
## %bb.3:
	movl	%eax, %r12d
	movq	_curthread@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	16(%r15), %edi
	movl	%ebx, %edx
	movq	_GIC_FIRST_SGI@GOTPCREL(%rip), %rax
	subl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_device_printf
	movq	_GICC_EOIR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_gic_c_write_4
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %edi
	callq	_arm_irq_memory_barrier
	movq	_GICC_IAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_gic_c_read_4
	movl	%eax, %r12d
	movl	%eax, %ebx
	andl	$1023, %ebx                     ## imm = 0x3FF
	cmpl	(%r15), %ebx
	jge	LBB0_15
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GIC_LAST_SGI@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jle	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	24(%r15), %r13
	movq	_gic_debug_spurious@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r15), %r14
	movq	_cpuid@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PCPU_GET
	movl	%ebx, (%r14,%rax,4)
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %r14d
	shlq	$4, %r14
	movl	8(%r13,%r14), %eax
	notl	%eax
	movq	_GI_FLAG_EARLY_EOI@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_GICC_EOIR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_gic_c_write_4
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	leaq	(%r14,%r13), %rdi
	addq	$12, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_intr_isrc_dispatch
	testq	%rax, %rax
	je	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	addq	%r13, %r14
	addq	$8, %r14
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_gic_irq_mask
	movl	(%r14), %eax
	notl	%eax
	movq	_GI_FLAG_EARLY_EOI@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	_GICC_EOIR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_gic_c_write_4
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	16(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_14
LBB0_1:
	movq	_gic_debug_spurious@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.2:
	movl	16(%r15), %r14d
	movq	8(%r15), %rbx
	movq	_cpuid@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_PCPU_GET
	movl	(%rbx,%rax,4), %ebx
	movl	(%r15), %edi
	callq	_PCPU_GET
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movl	%ebx, %edx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_device_printf
LBB0_15:
	movq	_FILTER_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GICC_IAR,4,2                   ## @GICC_IAR
	.comm	_gic_debug_spurious,8,3         ## @gic_debug_spurious
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Spurious interrupt detected: last irq: %d on CPU%d\n"

	.comm	_cpuid,4,2                      ## @cpuid
	.comm	_FILTER_HANDLED,4,2             ## @FILTER_HANDLED
	.comm	_curthread,8,3                  ## @curthread
	.comm	_GIC_LAST_SGI,4,2               ## @GIC_LAST_SGI
L_.str.1:                               ## @.str.1
	.asciz	"SGI %u on UP system detected\n"

	.comm	_GIC_FIRST_SGI,4,2              ## @GIC_FIRST_SGI
	.comm	_GICC_EOIR,4,2                  ## @GICC_EOIR
	.comm	_GI_FLAG_EARLY_EOI,4,2          ## @GI_FLAG_EARLY_EOI
L_.str.2:                               ## @.str.2
	.asciz	"Stray irq %u disabled\n"

	.comm	_sgi_to_ipi,8,3                 ## @sgi_to_ipi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_arm_gic_intr                   ; -- Begin function arm_gic_intr
	.p2align	2
_arm_gic_intr:                          ; @arm_gic_intr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x0
Lloh0:
	adrp	x25, _GICC_IAR@GOTPAGE
Lloh1:
	ldr	x25, [x25, _GICC_IAR@GOTPAGEOFF]
	ldr	w1, [x25]
	bl	_gic_c_read_4
	and	w21, w0, #0x3ff
	ldr	w8, [x19]
	cmp	w21, w8
	b.ge	LBB0_13
; %bb.1:
	mov	x24, x0
Lloh2:
	adrp	x8, _curthread@GOTPAGE
Lloh3:
	ldr	x8, [x8, _curthread@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	x20, [x8]
Lloh5:
	adrp	x26, _GIC_LAST_SGI@GOTPAGE
Lloh6:
	ldr	x26, [x26, _GIC_LAST_SGI@GOTPAGEOFF]
Lloh7:
	adrp	x28, _GI_FLAG_EARLY_EOI@GOTPAGE
Lloh8:
	ldr	x28, [x28, _GI_FLAG_EARLY_EOI@GOTPAGEOFF]
Lloh9:
	adrp	x22, _GICC_EOIR@GOTPAGE
Lloh10:
	ldr	x22, [x22, _GICC_EOIR@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19, #16]
Lloh11:
	adrp	x8, _GIC_FIRST_SGI@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GIC_FIRST_SGI@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	sub	w2, w21, w8
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_device_printf
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x24
	bl	_gic_c_write_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_arm_irq_memory_barrier
	ldr	w1, [x25]
	mov	x0, x19
	bl	_gic_c_read_4
	mov	x24, x0
	and	w21, w0, #0x3ff
	ldr	w8, [x19]
	cmp	w21, w8
	b.ge	LBB0_15
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x26]
	cmp	w21, w8
	b.le	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x27, [x19, #24]
Lloh16:
	adrp	x8, _gic_debug_spurious@GOTPAGE
Lloh17:
	ldr	x8, [x8, _gic_debug_spurious@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x23, [x19, #8]
Lloh19:
	adrp	x8, _cpuid@GOTPAGE
Lloh20:
	ldr	x8, [x8, _cpuid@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_PCPU_GET
	str	w21, [x23, x0, lsl #2]
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w8, w21
	add	x27, x27, x8, lsl #4
	mov	x23, x27
	ldr	w8, [x23, #8]!
	ldr	w9, [x28]
	bics	wzr, w9, w8
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x24
	bl	_gic_c_write_4
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x0, x27, #12
	mov	x1, x20
	bl	_intr_isrc_dispatch
	cbz	x0, LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_gic_irq_mask
	ldr	w8, [x23]
	ldr	w9, [x28]
	bics	wzr, w9, w8
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x24
	bl	_gic_c_write_4
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19, #16]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x21
	bl	_device_printf
	b	LBB0_3
LBB0_13:
Lloh24:
	adrp	x8, _gic_debug_spurious@GOTPAGE
Lloh25:
	ldr	x8, [x8, _gic_debug_spurious@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.14:
	ldr	w20, [x19, #16]
	ldr	x19, [x19, #8]
Lloh27:
	adrp	x21, _cpuid@GOTPAGE
Lloh28:
	ldr	x21, [x21, _cpuid@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_PCPU_GET
	ldr	w19, [x19, x0, lsl #2]
	ldr	w0, [x21]
	bl	_PCPU_GET
	str	x0, [sp]
Lloh29:
	adrp	x1, l_.str@PAGE
Lloh30:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_device_printf
LBB0_15:
Lloh31:
	adrp	x8, _FILTER_HANDLED@GOTPAGE
Lloh32:
	ldr	x8, [x8, _FILTER_HANDLED@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_GICC_IAR,4,2                   ; @GICC_IAR
	.comm	_gic_debug_spurious,8,3         ; @gic_debug_spurious
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Spurious interrupt detected: last irq: %d on CPU%d\n"

	.comm	_cpuid,4,2                      ; @cpuid
	.comm	_FILTER_HANDLED,4,2             ; @FILTER_HANDLED
	.comm	_curthread,8,3                  ; @curthread
	.comm	_GIC_LAST_SGI,4,2               ; @GIC_LAST_SGI
l_.str.1:                               ; @.str.1
	.asciz	"SGI %u on UP system detected\n"

	.comm	_GIC_FIRST_SGI,4,2              ; @GIC_FIRST_SGI
	.comm	_GICC_EOIR,4,2                  ; @GICC_EOIR
	.comm	_GI_FLAG_EARLY_EOI,4,2          ; @GI_FLAG_EARLY_EOI
l_.str.2:                               ; @.str.2
	.asciz	"Stray irq %u disabled\n"

	.comm	_sgi_to_ipi,8,3                 ; @sgi_to_ipi
.subsections_via_symbols
