	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intr_register_source           ## -- Begin function intr_register_source
	.p2align	4, 0x90
_intr_register_source:                  ## @intr_register_source
	.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	16(%rdi), %rdi
	callq	_intr_pic_registered
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_KASSERT
	movq	16(%r15), %rax
	movq	%r15, %rdi
	callq	*(%rax)
	movl	%eax, %ebx
	movq	_num_io_irqs@GOTPCREL(%rip), %rax
	movslq	(%rax), %rsi
	xorl	%edi, %edi
	cmpl	%esi, %ebx
	setl	%dil
	callq	_KASSERT
	movq	_interrupt_sources@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movslq	%ebx, %r13
	cmpq	$0, (%rax,%r13,8)
	je	LBB0_2
LBB0_1:
	movq	_EEXIST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_6
LBB0_2:
	leaq	8(%r15), %r14
	movq	_intr_disable_src@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	16(%r15), %rax
	movl	8(%rax), %r10d
	movl	16(%rax), %r9d
	movq	_intr_assign_cpu@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	L_.str.2(%rip), %r11
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	movl	%ebx, %ecx
	pushq	%rbx
	pushq	%r11
	pushq	%rax
	pushq	%r10
	callq	_intr_event_create
	addq	$32, %rsp
	testl	%eax, %eax
	je	LBB0_3
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_intrsrc_lock@GOTPCREL(%rip), %rdi
	callq	_sx_xlock
	movq	(%r12), %rax
	cmpq	$0, (%rax,%r13,8)
	je	LBB0_5
## %bb.4:
	movq	_intrsrc_lock@GOTPCREL(%rip), %rdi
	callq	_sx_xunlock
	movl	(%r14), %edi
	callq	_intr_event_destroy
	jmp	LBB0_1
LBB0_5:
	movq	%r15, %rdi
	callq	_intrcnt_register
	movq	(%r12), %rax
	movq	%r15, (%rax,%r13,8)
	movq	$0, (%r15)
	movq	_intrsrc_lock@GOTPCREL(%rip), %rdi
	callq	_sx_xunlock
	xorl	%eax, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unregistered PIC"

	.comm	_num_io_irqs,4,2                ## @num_io_irqs
	.comm	_interrupt_sources,8,3          ## @interrupt_sources
	.comm	_EEXIST,4,2                     ## @EEXIST
	.comm	_intr_disable_src,4,2           ## @intr_disable_src
	.comm	_intr_assign_cpu,4,2            ## @intr_assign_cpu
L_.str.2:                               ## @.str.2
	.asciz	"irq%d:"

	.comm	_intrsrc_lock,4,2               ## @intrsrc_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intr_register_source           ; -- Begin function intr_register_source
	.p2align	2
_intr_register_source:                  ; @intr_register_source
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
	ldr	x0, [x0, #16]
	bl	_intr_pic_registered
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	x20, x0
Lloh2:
	adrp	x8, _num_io_irqs@GOTPAGE
Lloh3:
	ldr	x8, [x8, _num_io_irqs@GOTPAGEOFF]
Lloh4:
	ldrsw	x1, [x8]
	cmp	w0, w1
	cset	w0, lt
	bl	_KASSERT
Lloh5:
	adrp	x22, _interrupt_sources@GOTPAGE
Lloh6:
	ldr	x22, [x22, _interrupt_sources@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x8, [x8, w20, sxtw #3]
	cbz	x8, LBB0_2
LBB0_1:
Lloh7:
	adrp	x8, _EEXIST@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	b	LBB0_3
LBB0_2:
	sxtw	x20, w20
	add	x21, x19, #8
Lloh10:
	adrp	x8, _intr_disable_src@GOTPAGE
Lloh11:
	ldr	x8, [x8, _intr_disable_src@GOTPAGEOFF]
Lloh12:
	ldr	w4, [x8]
	ldr	x8, [x19, #16]
	ldr	w5, [x8, #16]
	ldr	w6, [x8, #8]
Lloh13:
	adrp	x8, _intr_assign_cpu@GOTPAGE
Lloh14:
	ldr	x8, [x8, _intr_assign_cpu@GOTPAGEOFF]
Lloh15:
	ldr	w7, [x8]
	str	w20, [sp, #8]
Lloh16:
	adrp	x8, l_.str.2@PAGE
Lloh17:
	add	x8, x8, l_.str.2@PAGEOFF
	str	x8, [sp]
	mov	x0, x21
	mov	x1, x19
	mov	w2, #0
	mov	x3, x20
	bl	_intr_event_create
	cbz	w0, LBB0_4
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_4:
Lloh18:
	adrp	x0, _intrsrc_lock@GOTPAGE
Lloh19:
	ldr	x0, [x0, _intrsrc_lock@GOTPAGEOFF]
	bl	_sx_xlock
	ldr	x8, [x22]
	ldr	x8, [x8, x20, lsl #3]
	cbz	x8, LBB0_6
; %bb.5:
Lloh20:
	adrp	x0, _intrsrc_lock@GOTPAGE
Lloh21:
	ldr	x0, [x0, _intrsrc_lock@GOTPAGEOFF]
	bl	_sx_xunlock
	ldr	w0, [x21]
	bl	_intr_event_destroy
	b	LBB0_1
LBB0_6:
	mov	x0, x19
	bl	_intrcnt_register
	ldr	x8, [x22]
	str	x19, [x8, x20, lsl #3]
	str	xzr, [x19]
Lloh22:
	adrp	x0, _intrsrc_lock@GOTPAGE
Lloh23:
	ldr	x0, [x0, _intrsrc_lock@GOTPAGEOFF]
	bl	_sx_xunlock
	mov	w0, #0
	b	LBB0_3
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unregistered PIC"

	.comm	_num_io_irqs,4,2                ; @num_io_irqs
	.comm	_interrupt_sources,8,3          ; @interrupt_sources
	.comm	_EEXIST,4,2                     ; @EEXIST
	.comm	_intr_disable_src,4,2           ; @intr_disable_src
	.comm	_intr_assign_cpu,4,2            ; @intr_assign_cpu
l_.str.2:                               ; @.str.2
	.asciz	"irq%d:"

	.comm	_intrsrc_lock,4,2               ; @intrsrc_lock
.subsections_via_symbols
