	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_msix_setup
_qib_msix_setup:                        ## @qib_msix_setup
	.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
	movq	%rcx, %r15
	movq	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %r13
	movl	(%rdx), %edi
	shll	$2, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_27
## %bb.1:
	cmpl	$0, (%r14)
	jle	LBB0_4
## %bb.2:
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%rax,4), %ecx
	movl	%ecx, (%rbx,%rax,4)
	incq	%rax
	movslq	(%r14), %rcx
	cmpq	%rcx, %rax
	jl	LBB0_3
LBB0_4:
	movl	(%r13), %edi
	movslq	%r12d, %rsi
	movq	_PCI_MSIX_FLAGS@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	leaq	-44(%rbp), %rdx
	callq	_pci_read_config_word
	movq	_PCI_MSIX_FLAGS_QSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-44(%rbp), %eax
	movq	%r13, %rdx
	leal	1(%rax), %r13d
	movl	(%r14), %ecx
	cmpl	%ecx, %eax
	cmovgel	%ecx, %r13d
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rdx), %edi
	movq	%rbx, %rsi
	movl	%r13d, %edx
	callq	_pci_enable_msix
	movl	%eax, %r12d
	testl	%eax, %eax
	jle	LBB0_5
## %bb.6:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	(%r13), %edi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_pci_enable_msix
	movl	%r12d, %edx
	movl	%eax, %r12d
	testl	%r12d, %r12d
	jne	LBB0_8
	jmp	LBB0_9
LBB0_27:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	testl	%r12d, %r12d
	je	LBB0_9
LBB0_8:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	%r12d, %ecx
	callq	_qib_dev_err
	movq	%rbx, %rdi
	callq	_kfree
	movl	$0, (%r14)
	movl	(%r13), %edi
	callq	_qib_enable_intx
	jmp	LBB0_26
LBB0_5:
	movl	%r13d, %edx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	testl	%r12d, %r12d
	jne	LBB0_8
LBB0_9:
	testl	%edx, %edx
	jle	LBB0_10
## %bb.11:
	movl	%edx, %r8d
	xorl	%ecx, %ecx
	movl	%edx, %r12d
	cmpl	$8, %edx
	jb	LBB0_21
## %bb.12:
	movq	%r15, %rax
	subq	%rbx, %rax
	cmpq	$32, %rax
	jb	LBB0_21
## %bb.13:
	movl	%r8d, %ecx
	andl	$-8, %ecx
	leaq	-8(%rcx), %rax
	movq	%rax, %rsi
	shrq	$3, %rsi
	incq	%rsi
	movl	%esi, %edx
	andl	$3, %edx
	cmpq	$24, %rax
	jae	LBB0_15
## %bb.14:
	xorl	%edi, %edi
	jmp	LBB0_17
LBB0_10:
	movq	%rbx, %rdi
	movl	%edx, %ebx
	callq	_kfree
	movl	%ebx, (%r14)
	jmp	LBB0_26
LBB0_15:
	andq	$-4, %rsi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movups	(%rbx,%rdi,4), %xmm0
	movups	16(%rbx,%rdi,4), %xmm1
	movups	%xmm0, (%r15,%rdi,4)
	movups	%xmm1, 16(%r15,%rdi,4)
	movups	32(%rbx,%rdi,4), %xmm0
	movups	48(%rbx,%rdi,4), %xmm1
	movups	%xmm0, 32(%r15,%rdi,4)
	movups	%xmm1, 48(%r15,%rdi,4)
	movups	64(%rbx,%rdi,4), %xmm0
	movups	80(%rbx,%rdi,4), %xmm1
	movups	%xmm0, 64(%r15,%rdi,4)
	movups	%xmm1, 80(%r15,%rdi,4)
	movups	96(%rbx,%rdi,4), %xmm0
	movups	112(%rbx,%rdi,4), %xmm1
	movups	%xmm0, 96(%r15,%rdi,4)
	movups	%xmm1, 112(%r15,%rdi,4)
	addq	$32, %rdi
	addq	$-4, %rsi
	jne	LBB0_16
LBB0_17:
	testq	%rdx, %rdx
	je	LBB0_20
## %bb.18:
	leaq	(%r15,%rdi,4), %rsi
	addq	$16, %rsi
	leaq	(%rbx,%rdi,4), %rdi
	addq	$16, %rdi
	shlq	$5, %rdx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movups	-16(%rdi,%rax), %xmm0
	movups	(%rdi,%rax), %xmm1
	movups	%xmm0, -16(%rsi,%rax)
	movups	%xmm1, (%rsi,%rax)
	addq	$32, %rax
	cmpq	%rax, %rdx
	jne	LBB0_19
LBB0_20:
	cmpq	%r8, %rcx
	je	LBB0_25
LBB0_21:
	movq	%rcx, %rdx
	notq	%rdx
	addq	%r8, %rdx
	movq	%r8, %rsi
	andq	$3, %rsi
	je	LBB0_23
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rcx,4), %eax
	movl	%eax, (%r15,%rcx,4)
	incq	%rcx
	decq	%rsi
	jne	LBB0_22
LBB0_23:
	cmpq	$3, %rdx
	jb	LBB0_25
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rcx,4), %eax
	movl	%eax, (%r15,%rcx,4)
	movl	4(%rbx,%rcx,4), %eax
	movl	%eax, 4(%r15,%rcx,4)
	movl	8(%rbx,%rcx,4), %eax
	movl	%eax, 8(%r15,%rcx,4)
	movl	12(%rbx,%rcx,4), %eax
	movl	%eax, 12(%r15,%rcx,4)
	addq	$4, %rcx
	cmpq	%rcx, %r8
	jne	LBB0_24
LBB0_25:
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r12d, (%r14)
LBB0_26:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PCI_MSIX_FLAGS,8,3             ## @PCI_MSIX_FLAGS
	.comm	_PCI_MSIX_FLAGS_QSIZE,4,2       ## @PCI_MSIX_FLAGS_QSIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pci_enable_msix %d vectors failed: %d, falling back to INTx\n"

	.no_dead_strip	_qib_msix_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_msix_setup
_qib_msix_setup:                        ; @qib_msix_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x3
	mov	x19, x2
	mov	x22, x1
	mov	x23, x0
	ldr	w8, [x2]
	lsl	w0, w8, #2
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_kmalloc
	mov	x20, x0
	cbz	x0, LBB0_8
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x8, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x9, x8, #2
	ldr	w10, [x21, x9]
	str	w10, [x20, x9]
	add	x8, x8, #1
	ldrsw	x9, [x19]
	cmp	x8, x9
	b.lt	LBB0_3
LBB0_4:
	ldr	w0, [x23]
Lloh3:
	adrp	x8, _PCI_MSIX_FLAGS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_MSIX_FLAGS@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x1, x8, w22, sxtw
	add	x2, sp, #12
	bl	_pci_read_config_word
	ldr	w8, [sp, #12]
Lloh6:
	adrp	x9, _PCI_MSIX_FLAGS_QSIZE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PCI_MSIX_FLAGS_QSIZE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w8, w9, w8
	ldr	w9, [x19]
	cmp	w8, w9
	csinc	w22, w9, w8, ge
	ldr	w0, [x23]
	mov	x1, x20
	mov	x2, x22
	bl	_pci_enable_msix
	mov	x24, x0
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.5:
	ldr	w0, [x23]
	mov	x1, x20
	mov	x2, x24
	bl	_pci_enable_msix
	mov	x22, x24
	mov	x24, x0
LBB0_6:
	cbz	w24, LBB0_9
LBB0_7:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	mov	x2, x22
	mov	x3, x24
	bl	_qib_dev_err
	mov	x0, x20
	bl	_kfree
	str	wzr, [x19]
	ldr	w0, [x23]
	bl	_qib_enable_intx
	b	LBB0_18
LBB0_8:
	mov	w22, #0
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w24, w8
	cbnz	w24, LBB0_7
LBB0_9:
	cmp	w22, #0
	b.le	LBB0_17
; %bb.10:
	mov	x9, #0
	mov	w8, w22
	cmp	w22, #16
	b.lo	LBB0_15
; %bb.11:
	sub	x10, x21, x20
	cmp	x10, #64
	b.lo	LBB0_15
; %bb.12:
	and	x9, x8, #0xfffffff0
	add	x10, x21, #32
	add	x11, x20, #32
	mov	x12, x9
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x11, #-32]
	ldp	q2, q3, [x11], #64
	stp	q0, q1, [x10, #-32]
	stp	q2, q3, [x10], #64
	subs	x12, x12, #16
	b.ne	LBB0_13
; %bb.14:
	cmp	x9, x8
	b.eq	LBB0_17
LBB0_15:
	lsl	x11, x9, #2
	add	x10, x20, x11
	add	x11, x21, x11
	sub	x8, x8, x9
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x10], #4
	str	w9, [x11], #4
	subs	x8, x8, #1
	b.ne	LBB0_16
LBB0_17:
	mov	x0, x20
	bl	_kfree
	str	w22, [x19]
LBB0_18:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PCI_MSIX_FLAGS,8,3             ; @PCI_MSIX_FLAGS
	.comm	_PCI_MSIX_FLAGS_QSIZE,4,2       ; @PCI_MSIX_FLAGS_QSIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pci_enable_msix %d vectors failed: %d, falling back to INTx\n"

	.no_dead_strip	_qib_msix_setup
.subsections_via_symbols
