	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function native_apic_alloc_vector
_native_apic_alloc_vector:              ## @native_apic_alloc_vector
	.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
	movq	_num_io_irqs@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	%rsi, (%rax)
	setg	%dil
	callq	_KASSERT
	movq	_icu_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_lock_spin
	movq	_APIC_NUM_IOINTS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jle	LBB0_5
## %bb.1:
	movq	_lapics@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%rbx,8), %rcx
	movq	_IRQ_FREE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rdx, (%rcx,%rbx,8)
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	cmpq	%rbx, %rax
	jne	LBB0_2
LBB0_5:
	movq	_icu_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock_spin
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_3:
	movq	%r14, (%rcx,%rbx,8)
	movq	_icu_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock_spin
	movq	_APIC_IO_INTS@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
LBB0_6:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_num_io_irqs,8,3                ## @num_io_irqs
	.comm	_icu_lock,4,2                   ## @icu_lock
	.comm	_APIC_NUM_IOINTS,8,3            ## @APIC_NUM_IOINTS
	.comm	_lapics,8,3                     ## @lapics
	.comm	_IRQ_FREE,8,3                   ## @IRQ_FREE
	.comm	_APIC_IO_INTS,8,3               ## @APIC_IO_INTS
	.no_dead_strip	_native_apic_alloc_vector
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function native_apic_alloc_vector
_native_apic_alloc_vector:              ; @native_apic_alloc_vector
	.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	x8, _num_io_irqs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _num_io_irqs@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x1
	cset	w0, gt
	bl	_KASSERT
Lloh3:
	adrp	x0, _icu_lock@GOTPAGE
Lloh4:
	ldr	x0, [x0, _icu_lock@GOTPAGEOFF]
	bl	_mtx_lock_spin
Lloh5:
	adrp	x8, _APIC_NUM_IOINTS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _APIC_NUM_IOINTS@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x21, #0
Lloh8:
	adrp	x9, _lapics@GOTPAGE
Lloh9:
	ldr	x9, [x9, _lapics@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	ldr	x9, [x9, x20, lsl #3]
Lloh11:
	adrp	x10, _IRQ_FREE@GOTPAGE
Lloh12:
	ldr	x10, [x10, _IRQ_FREE@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9, x21, lsl #3]
	cmp	x11, x10
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x21, x21, #1
	cmp	x8, x21
	b.ne	LBB0_2
LBB0_4:
Lloh14:
	adrp	x0, _icu_lock@GOTPAGE
Lloh15:
	ldr	x0, [x0, _icu_lock@GOTPAGEOFF]
	bl	_mtx_unlock_spin
	mov	x0, #0
	b	LBB0_6
LBB0_5:
	str	x19, [x9, x21, lsl #3]
Lloh16:
	adrp	x0, _icu_lock@GOTPAGE
Lloh17:
	ldr	x0, [x0, _icu_lock@GOTPAGEOFF]
	bl	_mtx_unlock_spin
Lloh18:
	adrp	x8, _APIC_IO_INTS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _APIC_IO_INTS@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	add	x0, x8, x21
LBB0_6:
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_num_io_irqs,8,3                ; @num_io_irqs
	.comm	_icu_lock,4,2                   ; @icu_lock
	.comm	_APIC_NUM_IOINTS,8,3            ; @APIC_NUM_IOINTS
	.comm	_lapics,8,3                     ; @lapics
	.comm	_IRQ_FREE,8,3                   ; @IRQ_FREE
	.comm	_APIC_IO_INTS,8,3               ; @APIC_IO_INTS
	.no_dead_strip	_native_apic_alloc_vector
.subsections_via_symbols
