	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iflib_msix_init
_iflib_msix_init:                       ## @iflib_msix_init
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	72(%rdi), %r14d
	movq	64(%rdi), %r12
	movl	(%rdi), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	4(%rdi), %r15d
	movq	_bootverbose@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	je	LBB0_2
## %bb.1:
	movl	32(%rbx), %edi
	movl	36(%rbx), %esi
	callq	_imax
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_device_printf
LBB0_2:
	cmpq	$0, 56(%rbx)
	je	LBB0_3
LBB0_23:
	movl	%r14d, %edi
	callq	_pci_msi_count
	movl	%eax, -44(%rbp)
	movabsq	$4294967297, %rcx               ## imm = 0x100000001
	movq	%rcx, 32(%rbx)
	movl	%eax, 44(%rbx)
	cmpl	$1, %eax
	jne	LBB0_26
## %bb.24:
	leaq	-44(%rbp), %rsi
	movl	%r14d, %edi
	callq	_pci_alloc_msi
	testq	%rax, %rax
	je	LBB0_25
LBB0_26:
	movl	$1, 44(%rbx)
	leaq	L_.str.10(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	_IFLIB_INTR_LEGACY@GOTPCREL(%rip), %rax
LBB0_27:
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movl	-44(%rbp), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	%r14d, %edi
	callq	_pci_msix_count
	testl	%eax, %eax
	je	LBB0_4
## %bb.7:
	movl	%eax, %edx
	movl	40(%rbx), %eax
	movl	%eax, -48(%rbp)
	cmpl	$-1, %eax
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	je	LBB0_10
## %bb.8:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_9
LBB0_10:
	movl	(%r12), %eax
	movl	%edx, %r12d
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	subl	%eax, %r12d
	leaq	24(%rbx), %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_CPU_COUNT
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_imin
	cmpq	$0, (%r13)
	je	LBB0_12
## %bb.11:
	movl	%eax, %r13d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_CPU_COUNT
	leaq	L_.str.3(%rip), %rsi
	movl	%r14d, %edi
	movl	%eax, %edx
	movl	%r12d, %ecx
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_device_printf
	movl	%r13d, %eax
LBB0_12:
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	subl	%esi, %r12d
	cmpl	%r12d, %r15d
	movl	%eax, %r13d
	cmovll	%r15d, %r13d
	testl	%r15d, %r15d
	cmovlel	%eax, %r13d
	movl	32(%rbx), %edi
	movl	36(%rbx), %ecx
	cmpl	%ecx, %r13d
	cmovgel	%ecx, %r13d
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	cmpl	%eax, %edx
	movq	_mp_ncpus@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %r12d
	cmovll	%edx, %r12d
	testl	%edx, %edx
	cmovlel	%ecx, %r12d
	cmpl	%edi, %r12d
	cmovgel	%edi, %r12d
	cmpq	$0, 8(%rbx)
	movl	%esi, %ecx
	jne	LBB0_14
## %bb.13:
	movl	%r13d, %edi
	movl	%r12d, %esi
	movl	%ecx, %r15d
	callq	_min
	movl	%eax, %r12d
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_min
	movl	%r15d, %ecx
	movl	%eax, %r13d
LBB0_14:
	addl	%r13d, %ecx
	movl	%ecx, -44(%rbp)
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	cmpl	%ecx, %edx
	jge	LBB0_16
## %bb.15:
	leaq	L_.str.4(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_23
LBB0_25:
	leaq	L_.str.9(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	_IFLIB_INTR_MSI@GOTPCREL(%rip), %rax
	jmp	LBB0_27
LBB0_4:
	cmpq	$0, (%r13)
	je	LBB0_23
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_6
LBB0_16:
	movl	%ecx, %r15d
	leaq	L_.str.5(%rip), %rsi
	movl	%r14d, %edi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_device_printf
	leaq	-44(%rbp), %rsi
	movl	%r14d, %edi
	callq	_pci_alloc_msix
	movl	-44(%rbp), %edx
	testl	%eax, %eax
	je	LBB0_17
## %bb.20:
	leaq	L_.str.8(%rip), %rsi
	movl	%r14d, %edi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_21
LBB0_9:
	leaq	L_.str.2(%rip), %rsi
LBB0_6:
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_23
LBB0_17:
	movl	%r15d, %ecx
	cmpl	%r15d, %edx
	jne	LBB0_18
## %bb.19:
	leaq	L_.str.7(%rip), %rsi
	movl	%r14d, %edi
	movl	%ecx, %edx
	xorl	%eax, %eax
	callq	_device_printf
	movl	-44(%rbp), %eax
	movl	%eax, 44(%rbx)
	movl	%r13d, 36(%rbx)
	movl	%r12d, 32(%rbx)
	movq	_IFLIB_INTR_MSIX@GOTPCREL(%rip), %rax
	jmp	LBB0_27
LBB0_18:
	leaq	L_.str.6(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movl	%r14d, %edi
	callq	_pci_release_msi
LBB0_21:
	movl	-48(%rbp), %edx
	cmpl	$-1, %edx
	je	LBB0_23
## %bb.22:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	16(%rbx), %rcx
	movl	%r14d, %edi
	callq	_bus_release_resource
	movq	$0, 16(%rbx)
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_bootverbose,8,3                ## @bootverbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"msix_init qsets capped at %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"MSI-X not supported or disabled\n"

	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
L_.str.2:                               ## @.str.2
	.asciz	"Unable to map MSI-X table\n"

L_.str.3:                               ## @.str.3
	.asciz	"intr CPUs: %d queue msgs: %d admincnt: %d\n"

	.comm	_mp_ncpus,4,2                   ## @mp_ncpus
L_.str.4:                               ## @.str.4
	.asciz	"insufficient number of MSI-X vectors (supported %d, need %d)\n"

L_.str.5:                               ## @.str.5
	.asciz	"Using %d RX queues %d TX queues\n"

L_.str.6:                               ## @.str.6
	.asciz	"Unable to allocate sufficient MSI-X vectors (got %d, need %d)\n"

L_.str.7:                               ## @.str.7
	.asciz	"Using MSI-X interrupts with %d vectors\n"

	.comm	_IFLIB_INTR_MSIX,4,2            ## @IFLIB_INTR_MSIX
L_.str.8:                               ## @.str.8
	.asciz	"failed to allocate %d MSI-X vectors, err: %d\n"

L_.str.9:                               ## @.str.9
	.asciz	"Using an MSI interrupt\n"

	.comm	_IFLIB_INTR_MSI,4,2             ## @IFLIB_INTR_MSI
L_.str.10:                              ## @.str.10
	.asciz	"Using a Legacy interrupt\n"

	.comm	_IFLIB_INTR_LEGACY,4,2          ## @IFLIB_INTR_LEGACY
	.no_dead_strip	_iflib_msix_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iflib_msix_init
_iflib_msix_init:                       ; @iflib_msix_init
	.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
	mov	x19, x0
	ldr	w20, [x0, #72]
	ldr	x22, [x0, #64]
	ldp	w25, w26, [x0]
Lloh0:
	adrp	x28, _bootverbose@GOTPAGE
Lloh1:
	ldr	x28, [x28, _bootverbose@GOTPAGEOFF]
	ldr	x8, [x28]
	cbz	x8, LBB0_2
; %bb.1:
	ldp	w0, w1, [x19, #32]
	bl	_imax
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_device_printf
LBB0_2:
	ldr	x8, [x19, #56]
	cbnz	x8, LBB0_18
; %bb.3:
	mov	x0, x20
	bl	_pci_msix_count
	cbz	w0, LBB0_12
; %bb.4:
	mov	x21, x0
	ldr	w8, [x19, #40]
	str	w8, [sp, #28]
	cmn	w8, #1
	b.eq	LBB0_6
; %bb.5:
Lloh4:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	add	x2, sp, #28
	mov	x0, x20
	bl	_bus_alloc_resource_any
	str	x0, [x19, #16]
	cbz	x0, LBB0_16
LBB0_6:
	ldr	w27, [x22]
	sub	w22, w21, w27
	add	x24, x19, #24
	mov	x0, x24
	bl	_CPU_COUNT
	mov	x1, x22
	bl	_imin
	mov	x23, x0
	ldr	x8, [x28]
	cbz	x8, LBB0_8
; %bb.7:
	mov	x0, x24
	bl	_CPU_COUNT
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x22, x27, [sp, #8]
	str	x0, [sp]
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_device_printf
LBB0_8:
	sub	w8, w22, w27
	cmp	w26, w8
	ccmp	w26, #0, #4, lt
	csel	w8, w26, w23, gt
	ldp	w10, w9, [x19, #32]
	cmp	w8, w9
	csel	w22, w8, w9, lt
	cmp	w25, w23
Lloh12:
	adrp	x8, _mp_ncpus@GOTPAGE
Lloh13:
	ldr	x8, [x8, _mp_ncpus@GOTPAGEOFF]
	ccmp	w25, #0, #4, lt
Lloh14:
	ldr	w8, [x8]
	csel	w8, w25, w8, gt
	cmp	w8, w10
	csel	w23, w8, w10, lt
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_10
; %bb.9:
	mov	x0, x22
	mov	x1, x23
	bl	_min
	mov	x23, x0
	mov	x0, x22
	mov	x1, x23
	bl	_min
	mov	x22, x0
LBB0_10:
	add	w24, w22, w27
	cmp	w21, w24
	str	w24, [sp, #24]
	b.ge	LBB0_14
; %bb.11:
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	stp	x21, x24, [sp]
Lloh15:
	adrp	x1, l_.str.4@PAGE
Lloh16:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_12:
	ldr	x8, [x28]
	cbz	x8, LBB0_18
; %bb.13:
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_14:
	stp	x22, x23, [sp]
Lloh19:
	adrp	x1, l_.str.5@PAGE
Lloh20:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_device_printf
	add	x1, sp, #24
	mov	x0, x20
	bl	_pci_alloc_msix
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [sp, #24]
	cbz	w0, LBB0_23
; %bb.15:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	stp	x8, x0, [sp]
Lloh21:
	adrp	x1, l_.str.8@PAGE
Lloh22:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x20
	bl	_device_printf
	b	LBB0_26
LBB0_16:
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_17:
	mov	x0, x20
	bl	_device_printf
LBB0_18:
	mov	x0, x20
	bl	_pci_msi_count
	str	w0, [sp, #24]
	movi.2s	v0, #1
	str	d0, [x19, #32]
	str	w0, [x19, #44]
	cmp	w0, #1
	b.ne	LBB0_20
; %bb.19:
	add	x1, sp, #24
	mov	x0, x20
	bl	_pci_alloc_msi
	cbz	x0, LBB0_22
LBB0_20:
	mov	w8, #1
	str	w8, [x19, #44]
Lloh25:
	adrp	x1, l_.str.10@PAGE
Lloh26:
	add	x1, x1, l_.str.10@PAGEOFF
	mov	x0, x20
	bl	_device_printf
Lloh27:
	adrp	x8, _IFLIB_INTR_LEGACY@GOTPAGE
Lloh28:
	ldr	x8, [x8, _IFLIB_INTR_LEGACY@GOTPAGEOFF]
LBB0_21:
	ldr	w8, [x8]
	str	w8, [x19, #48]
	ldr	w0, [sp, #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_22:
Lloh29:
	adrp	x1, l_.str.9@PAGE
Lloh30:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x0, x20
	bl	_device_printf
Lloh31:
	adrp	x8, _IFLIB_INTR_MSI@GOTPAGE
Lloh32:
	ldr	x8, [x8, _IFLIB_INTR_MSI@GOTPAGEOFF]
	b	LBB0_21
LBB0_23:
	cmp	w8, w24
	b.ne	LBB0_25
; %bb.24:
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	str	x24, [sp]
Lloh33:
	adrp	x1, l_.str.7@PAGE
Lloh34:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x20
	bl	_device_printf
	ldr	w8, [sp, #24]
	str	w8, [x19, #44]
	stp	w23, w22, [x19, #32]
Lloh35:
	adrp	x8, _IFLIB_INTR_MSIX@GOTPAGE
Lloh36:
	ldr	x8, [x8, _IFLIB_INTR_MSIX@GOTPAGEOFF]
	b	LBB0_21
LBB0_25:
	stp	x8, x24, [sp]
Lloh37:
	adrp	x1, l_.str.6@PAGE
Lloh38:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_device_printf
	mov	x0, x20
	bl	_pci_release_msi
LBB0_26:
	ldr	w2, [sp, #28]
	cmn	w2, #1
	b.eq	LBB0_18
; %bb.27:
Lloh39:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh40:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	ldr	x3, [x19, #16]
	mov	x0, x20
	bl	_bus_release_resource
	str	xzr, [x19, #16]
	b	LBB0_18
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_bootverbose,8,3                ; @bootverbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"msix_init qsets capped at %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"MSI-X not supported or disabled\n"

	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
l_.str.2:                               ; @.str.2
	.asciz	"Unable to map MSI-X table\n"

l_.str.3:                               ; @.str.3
	.asciz	"intr CPUs: %d queue msgs: %d admincnt: %d\n"

	.comm	_mp_ncpus,4,2                   ; @mp_ncpus
l_.str.4:                               ; @.str.4
	.asciz	"insufficient number of MSI-X vectors (supported %d, need %d)\n"

l_.str.5:                               ; @.str.5
	.asciz	"Using %d RX queues %d TX queues\n"

l_.str.6:                               ; @.str.6
	.asciz	"Unable to allocate sufficient MSI-X vectors (got %d, need %d)\n"

l_.str.7:                               ; @.str.7
	.asciz	"Using MSI-X interrupts with %d vectors\n"

	.comm	_IFLIB_INTR_MSIX,4,2            ; @IFLIB_INTR_MSIX
l_.str.8:                               ; @.str.8
	.asciz	"failed to allocate %d MSI-X vectors, err: %d\n"

l_.str.9:                               ; @.str.9
	.asciz	"Using an MSI interrupt\n"

	.comm	_IFLIB_INTR_MSI,4,2             ; @IFLIB_INTR_MSI
l_.str.10:                              ; @.str.10
	.asciz	"Using a Legacy interrupt\n"

	.comm	_IFLIB_INTR_LEGACY,4,2          ; @IFLIB_INTR_LEGACY
	.no_dead_strip	_iflib_msix_init
.subsections_via_symbols
