	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function native_apic_alloc_vectors
_native_apic_alloc_vectors:             ## @native_apic_alloc_vectors
	.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	%rcx, %r12
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	%rdx, %rdi
	callq	_powerof2
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_KASSERT
	movq	%r12, %rdi
	callq	_powerof2
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	callq	_KASSERT
	xorl	%edi, %edi
	cmpq	%r14, %r12
	setae	%dil
	leaq	L_.str.2(%rip), %rsi
	callq	_KASSERT
	movq	_icu_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_lock_spin
	movq	_APIC_NUM_IOINTS@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_11
## %bb.1:
	movq	_lapics@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rbx,8), %rax
	movq	_IRQ_FREE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	decq	%r12
	xorl	%esi, %esi
	xorl	%edi, %edi
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%ebx, %ebx
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%edi, %edi
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rsi
	cmpq	%rsi, %rcx
	je	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rdx, (%rax,%rsi,8)
	jne	LBB0_2
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %r13
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rdi
	cmpq	%r14, %rdi
	jae	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rbx
	jmp	LBB0_4
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%rsi, %r13
	testq	%r12, %rsi
	jne	LBB0_3
	jmp	LBB0_8
LBB0_11:
	movq	_icu_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock_spin
	leaq	L_.str.3(%rip), %rdi
	movq	%r14, %rsi
	callq	_printf
	xorl	%r13d, %r13d
LBB0_12:
	movq	%r13, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	testq	%r14, %r14
	je	LBB0_32
## %bb.14:
	cmpq	$4, %r14
	jb	LBB0_15
## %bb.16:
	leaq	(%rax,%r13,8), %rcx
	subq	%r15, %rcx
	cmpq	$32, %rcx
	jae	LBB0_18
LBB0_15:
	xorl	%ecx, %ecx
LBB0_26:
	movq	%rcx, %rdx
	notq	%rdx
	addq	%r14, %rdx
	movq	%r14, %rsi
	andq	$3, %rsi
	je	LBB0_29
## %bb.27:
	leaq	(%rax,%r13,8), %rdi
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15,%rcx,8), %rbx
	movq	%rbx, (%rdi,%rcx,8)
	incq	%rcx
	decq	%rsi
	jne	LBB0_28
LBB0_29:
	cmpq	$3, %rdx
	jb	LBB0_32
## %bb.30:
	leaq	(%rax,%r13,8), %rax
	addq	$24, %rax
	.p2align	4, 0x90
LBB0_31:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15,%rcx,8), %rdx
	movq	%rdx, -24(%rax,%rcx,8)
	movq	8(%r15,%rcx,8), %rdx
	movq	%rdx, -16(%rax,%rcx,8)
	movq	16(%r15,%rcx,8), %rdx
	movq	%rdx, -8(%rax,%rcx,8)
	movq	24(%r15,%rcx,8), %rdx
	movq	%rdx, (%rax,%rcx,8)
	addq	$4, %rcx
	cmpq	%rcx, %r14
	jne	LBB0_31
	jmp	LBB0_32
LBB0_18:
	movq	%r14, %rcx
	andq	$-4, %rcx
	leaq	-4(%rcx), %rdi
	movq	%rdi, %rsi
	shrq	$2, %rsi
	incq	%rsi
	movl	%esi, %edx
	andl	$3, %edx
	cmpq	$12, %rdi
	jae	LBB0_20
## %bb.19:
	xorl	%edi, %edi
	jmp	LBB0_22
LBB0_20:
	andq	$-4, %rsi
	leaq	(%rax,%r13,8), %rbx
	addq	$112, %rbx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movups	(%r15,%rdi,8), %xmm0
	movups	16(%r15,%rdi,8), %xmm1
	movups	%xmm0, -112(%rbx,%rdi,8)
	movups	%xmm1, -96(%rbx,%rdi,8)
	movups	32(%r15,%rdi,8), %xmm0
	movups	48(%r15,%rdi,8), %xmm1
	movups	%xmm0, -80(%rbx,%rdi,8)
	movups	%xmm1, -64(%rbx,%rdi,8)
	movups	64(%r15,%rdi,8), %xmm0
	movups	80(%r15,%rdi,8), %xmm1
	movups	%xmm0, -48(%rbx,%rdi,8)
	movups	%xmm1, -32(%rbx,%rdi,8)
	movups	96(%r15,%rdi,8), %xmm0
	movups	112(%r15,%rdi,8), %xmm1
	movups	%xmm0, -16(%rbx,%rdi,8)
	movups	%xmm1, (%rbx,%rdi,8)
	addq	$16, %rdi
	addq	$-4, %rsi
	jne	LBB0_21
LBB0_22:
	testq	%rdx, %rdx
	je	LBB0_25
## %bb.23:
	leaq	(%rdi,%r13), %rsi
	leaq	(%rax,%rsi,8), %rsi
	addq	$16, %rsi
	leaq	(%r15,%rdi,8), %rdi
	addq	$16, %rdi
	shlq	$5, %rdx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movups	-16(%rdi,%rbx), %xmm0
	movups	(%rdi,%rbx), %xmm1
	movups	%xmm0, -16(%rsi,%rbx)
	movups	%xmm1, (%rsi,%rbx)
	addq	$32, %rbx
	cmpq	%rbx, %rdx
	jne	LBB0_24
LBB0_25:
	cmpq	%r14, %rcx
	jne	LBB0_26
LBB0_32:
	movq	_icu_lock@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock_spin
	movq	_APIC_IO_INTS@GOTPCREL(%rip), %rax
	addq	(%rax), %r13
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad count"

L_.str.1:                               ## @.str.1
	.asciz	"bad align"

L_.str.2:                               ## @.str.2
	.asciz	"align < count"

	.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
L_.str.3:                               ## @.str.3
	.asciz	"APIC: Couldn't find APIC vectors for %u IRQs\n"

	.comm	_num_io_irqs,8,3                ## @num_io_irqs
	.no_dead_strip	_native_apic_alloc_vectors
.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_vectors
_native_apic_alloc_vectors:             ; @native_apic_alloc_vectors
	.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	x21, x3
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
	mov	x0, x2
	bl	_powerof2
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	mov	x0, x21
	bl	_powerof2
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	cmp	x21, x19
	cset	w0, hs
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_KASSERT
Lloh6:
	adrp	x0, _icu_lock@GOTPAGE
Lloh7:
	ldr	x0, [x0, _icu_lock@GOTPAGEOFF]
	bl	_mtx_lock_spin
Lloh8:
	adrp	x8, _APIC_NUM_IOINTS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _APIC_NUM_IOINTS@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x8]
	cbz	x9, LBB0_11
; %bb.1:
	mov	x10, #0
	mov	x13, #0
	mov	x0, #0
Lloh11:
	adrp	x8, _lapics@GOTPAGE
Lloh12:
	ldr	x8, [x8, _lapics@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	ldr	x8, [x8, x22, lsl #3]
Lloh14:
	adrp	x11, _IRQ_FREE@GOTPAGE
Lloh15:
	ldr	x11, [x11, _IRQ_FREE@GOTPAGEOFF]
Lloh16:
	ldr	x11, [x11]
	sub	x12, x21, #1
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, #0
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x13, #0
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x10, x10, #1
	cmp	x9, x10
	b.eq	LBB0_11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x14, [x8, x10, lsl #3]
	cmp	x14, x11
	b.ne	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cbz	x13, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x0
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x13, x13, #1
	cmp	x13, x19
	b.hs	LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	b	LBB0_4
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x10
	tst	x10, x12
	b.ne	LBB0_3
	b	LBB0_8
LBB0_11:
Lloh17:
	adrp	x0, _icu_lock@GOTPAGE
Lloh18:
	ldr	x0, [x0, _icu_lock@GOTPAGEOFF]
	bl	_mtx_unlock_spin
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_printf
	mov	x0, #0
LBB0_12:
	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
LBB0_13:
	cbz	x19, LBB0_19
; %bb.14:
	cmp	x19, #8
	b.lo	LBB0_16
; %bb.15:
	add	x11, x8, x21, lsl #3
	sub	x9, x11, x20
	cmp	x9, #64
	b.hs	LBB0_20
LBB0_16:
	mov	x9, #0
LBB0_17:
	sub	x10, x19, x9
	add	x11, x9, x21
	add	x8, x8, x11, lsl #3
	add	x9, x20, x9, lsl #3
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9], #8
	str	x11, [x8], #8
	subs	x10, x10, #1
	b.ne	LBB0_18
LBB0_19:
Lloh21:
	adrp	x0, _icu_lock@GOTPAGE
Lloh22:
	ldr	x0, [x0, _icu_lock@GOTPAGEOFF]
	bl	_mtx_unlock_spin
Lloh23:
	adrp	x8, _APIC_IO_INTS@GOTPAGE
Lloh24:
	ldr	x8, [x8, _APIC_IO_INTS@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	add	x0, x8, x21
	b	LBB0_12
LBB0_20:
	and	x9, x19, #0xfffffffffffffff8
	add	x10, x20, #32
	add	x11, x11, #32
	mov	x12, x9
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x10, #-32]
	ldp	q2, q3, [x10], #64
	stp	q0, q1, [x11, #-32]
	stp	q2, q3, [x11], #64
	subs	x12, x12, #8
	b.ne	LBB0_21
; %bb.22:
	cmp	x9, x19
	b.eq	LBB0_19
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad count"

l_.str.1:                               ; @.str.1
	.asciz	"bad align"

l_.str.2:                               ; @.str.2
	.asciz	"align < count"

	.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
l_.str.3:                               ; @.str.3
	.asciz	"APIC: Couldn't find APIC vectors for %u IRQs\n"

	.comm	_num_io_irqs,8,3                ; @num_io_irqs
	.no_dead_strip	_native_apic_alloc_vectors
.subsections_via_symbols
