	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msi_assign_cpu
_msi_assign_cpu:                        ## @msi_assign_cpu
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	%rdi, 64(%rdi)
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_27:
	movl	(%rax), %eax
	jmp	LBB0_28
LBB0_2:
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	16(%rdi), %rbx
	xorl	%eax, %eax
	cmpq	%rsi, %rbx
	je	LBB0_28
## %bb.3:
	movl	8(%r12), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	cmpl	$2, 24(%r12)
	jl	LBB0_5
## %bb.4:
	xorl	%edi, %edi
	cmpq	$0, (%r12)
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	32(%r12), %rsi
	movl	24(%r12), %edx
	movl	60(%r12), %ecx
	movq	%r13, %rdi
	callq	_apic_alloc_vectors
	jmp	LBB0_6
LBB0_5:
	movl	40(%r12), %esi
	movq	%r13, %rdi
	callq	_apic_alloc_vector
LBB0_6:
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_26
## %bb.7:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, 16(%r12)
	movl	%r14d, 8(%r12)
	cmpq	$0, 48(%r12)
	jle	LBB0_9
## %bb.8:
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_apic_enable_vector
LBB0_9:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_11
## %bb.10:
	cmpq	$0, (%r12)
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %rsi
	cmoveq	%rax, %rsi
	movl	40(%r12), %edx
	movq	16(%r12), %rcx
	movl	8(%r12), %r8d
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
LBB0_11:
	cmpl	$2, 24(%r12)
	jl	LBB0_18
## %bb.12:
	movl	%r14d, %ebx
	movl	$1, %r15d
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%r15
	movslq	24(%r12), %rax
	cmpq	%rax, %r15
	jge	LBB0_18
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %rax
	movl	(%rax,%r15,4), %edi
	callq	_intr_lookup_source
	movq	%rax, %r14
	movq	%r13, 16(%rax)
	leaq	(%rbx,%r15), %rsi
	movl	%esi, 8(%rax)
	cmpq	$0, 48(%rax)
	jle	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%r13, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_apic_enable_vector
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	40(%r14), %esi
	movq	16(%r14), %rdx
	movl	8(%r14), %ecx
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_13
LBB0_18:
	movl	56(%r12), %edi
	callq	_device_get_parent
	movl	40(%r12), %edx
	movl	56(%r12), %esi
	movl	%eax, %edi
	callq	_BUS_REMAP_INTR
	cmpq	$0, 48(%r12)
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jle	LBB0_20
## %bb.19:
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_apic_disable_vector
LBB0_20:
	movl	40(%r12), %edx
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_apic_free_vector
	cmpl	$2, 24(%r12)
	jl	LBB0_25
## %bb.21:
	movl	$1, %ebx
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_23 Depth=1
	movq	32(%r12), %rax
	movl	(%rax,%rbx,4), %edx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_apic_free_vector
	incq	%rbx
	movslq	24(%r12), %rax
	cmpq	%rax, %rbx
	jge	LBB0_25
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_intr_lookup_source
	leaq	(%rbx,%r13), %r14
	cmpq	$0, 48(%rax)
	jle	LBB0_22
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_apic_disable_vector
	jmp	LBB0_22
LBB0_25:
	xorl	%eax, %eax
LBB0_28:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MSI-X message group"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_bootverbose,8,3                ## @bootverbose
L_.str.1:                               ## @.str.1
	.asciz	"msi: Assigning %s IRQ %d to local APIC %u vector %u\n"

L_.str.2:                               ## @.str.2
	.asciz	"MSI-X"

L_.str.3:                               ## @.str.3
	.asciz	"MSI"

L_.str.4:                               ## @.str.4
	.asciz	"msi: Assigning MSI IRQ %d to local APIC %u vector %u\n"

	.comm	_msix_disable_migration,8,3     ## @msix_disable_migration
	.no_dead_strip	_msi_assign_cpu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msi_assign_cpu
_msi_assign_cpu:                        ; @msi_assign_cpu
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	ldr	x8, [x0, #64]
	cmp	x8, x0
	b.eq	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_24
LBB0_2:
	mov	x22, x1
	mov	x19, x0
	ldr	x20, [x0, #16]
	cmp	x20, x1
	b.eq	LBB0_23
; %bb.3:
	ldr	w21, [x19, #8]
	ldr	w8, [x19, #24]
	cmp	w8, #2
	b.lt	LBB0_25
; %bb.4:
	ldr	x8, [x19]
	cmp	x8, #0
	cset	w0, eq
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	x1, [x19, #32]
	ldr	w2, [x19, #24]
	ldr	w3, [x19, #60]
	mov	x0, x22
	bl	_apic_alloc_vectors
	mov	x23, x0
	cbz	w0, LBB0_26
LBB0_5:
	str	x22, [x19, #16]
	str	w23, [x19, #8]
	ldr	x8, [x19, #48]
	cmp	x8, #1
	b.lt	LBB0_7
; %bb.6:
	mov	x0, x22
	mov	x1, x23
	bl	_apic_enable_vector
LBB0_7:
Lloh5:
	adrp	x25, _bootverbose@GOTPAGE
Lloh6:
	ldr	x25, [x25, _bootverbose@GOTPAGEOFF]
	ldr	x8, [x25]
	cbz	x8, LBB0_9
; %bb.8:
Lloh7:
	adrp	x8, l_.str.2@PAGE
Lloh8:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh9:
	adrp	x9, l_.str.3@PAGE
Lloh10:
	add	x9, x9, l_.str.3@PAGEOFF
	ldr	x10, [x19]
	cmp	x10, #0
	csel	x8, x9, x8, eq
	ldr	x9, [x19, #16]
	ldr	w10, [x19, #40]
	ldr	w11, [x19, #8]
	stp	x9, x11, [sp, #16]
	stp	x8, x10, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
LBB0_9:
	ldr	w8, [x19, #24]
	cmp	w8, #2
	b.lt	LBB0_16
; %bb.10:
	mov	w26, w23
	mov	w27, #1
Lloh13:
	adrp	x23, l_.str.4@PAGE
Lloh14:
	add	x23, x23, l_.str.4@PAGEOFF
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x27, x27, #1
	ldrsw	x8, [x19, #24]
	cmp	x27, x8
	b.ge	LBB0_16
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x27, lsl #2]
	bl	_intr_lookup_source
	mov	x24, x0
	str	x22, [x0, #16]
	add	x1, x26, x27
	str	w1, [x0, #8]
	ldr	x8, [x0, #48]
	cmp	x8, #1
	b.lt	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x22
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_apic_enable_vector
LBB0_14:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x25]
	cbz	x8, LBB0_11
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x24, #16]
	ldr	w9, [x24, #40]
	ldr	w10, [x24, #8]
	stp	x8, x10, [sp, #8]
	str	x9, [sp]
	mov	x0, x23
	bl	_printf
	b	LBB0_11
LBB0_16:
	ldr	w0, [x19, #56]
	bl	_device_get_parent
	ldr	w1, [x19, #56]
	ldr	w2, [x19, #40]
	bl	_BUS_REMAP_INTR
	ldr	x8, [x19, #48]
	cmp	x8, #1
	b.lt	LBB0_18
; %bb.17:
	mov	x0, x20
	mov	x1, x21
	bl	_apic_disable_vector
LBB0_18:
	ldr	w2, [x19, #40]
	mov	x0, x20
	mov	x1, x21
	bl	_apic_free_vector
	ldr	w8, [x19, #24]
	cmp	w8, #2
	b.lt	LBB0_23
; %bb.19:
	mov	w23, #1
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_21 Depth=1
	ldr	x8, [x19, #32]
	ldr	w2, [x8, x23, lsl #2]
	mov	x0, x20
	mov	x1, x22
	bl	_apic_free_vector
	add	x23, x23, #1
	ldrsw	x8, [x19, #24]
	cmp	x23, x8
	b.ge	LBB0_23
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x23, lsl #2]
	bl	_intr_lookup_source
	ldr	x8, [x0, #48]
	add	x22, x21, x23
	cmp	x8, #1
	b.lt	LBB0_20
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_apic_disable_vector
	b	LBB0_20
LBB0_23:
	mov	w0, #0
LBB0_24:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_25:
	ldr	w1, [x19, #40]
	mov	x0, x22
	bl	_apic_alloc_vector
	mov	x23, x0
	cbnz	w0, LBB0_5
LBB0_26:
Lloh15:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	b	LBB0_24
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MSI-X message group"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_bootverbose,8,3                ; @bootverbose
l_.str.1:                               ; @.str.1
	.asciz	"msi: Assigning %s IRQ %d to local APIC %u vector %u\n"

l_.str.2:                               ; @.str.2
	.asciz	"MSI-X"

l_.str.3:                               ; @.str.3
	.asciz	"MSI"

l_.str.4:                               ; @.str.4
	.asciz	"msi: Assigning MSI IRQ %d to local APIC %u vector %u\n"

	.comm	_msix_disable_migration,8,3     ; @msix_disable_migration
	.no_dead_strip	_msi_assign_cpu
.subsections_via_symbols
