	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pnv_php_enable_msix
_pnv_php_enable_msix:                   ## @pnv_php_enable_msix
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %r14
	movq	%r14, %rdi
	callq	_pci_msix_vec_count
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	movq	_PCI_EXP_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pcie_capability_read_word
	movq	_PCI_EXP_FLAGS_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-20(%rbp), %eax
	sarl	$9, %eax
	movl	%eax, -32(%rbp)
	cmpl	%ebx, %eax
	jge	LBB0_2
## %bb.3:
	leaq	-32(%rbp), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_pci_enable_msix_exact
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_pci_warn
	jmp	LBB0_6
LBB0_2:
	movq	_ERANGE@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_5:
	movl	-28(%rbp), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_EXP_FLAGS,4,2              ## @PCI_EXP_FLAGS
	.comm	_PCI_EXP_FLAGS_IRQ,4,2          ## @PCI_EXP_FLAGS_IRQ
	.comm	_ERANGE,4,2                     ## @ERANGE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error %d enabling MSIx\n"

	.no_dead_strip	_pnv_php_enable_msix
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pnv_php_enable_msix
_pnv_php_enable_msix:                   ; @pnv_php_enable_msix
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	ldr	x20, [x0]
	mov	x0, x20
	bl	_pci_msix_vec_count
	mov	x19, x0
	tbnz	w0, #31, LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _PCI_EXP_FLAGS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_EXP_FLAGS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #4
	mov	x0, x20
	bl	_pcie_capability_read_word
Lloh3:
	adrp	x8, _PCI_EXP_FLAGS_IRQ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_EXP_FLAGS_IRQ@GOTPAGEOFF]
	ldr	w9, [sp, #4]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w9
	asr	w8, w8, #9
	str	w8, [sp, #8]
	cmp	w8, w19
	b.ge	LBB0_4
; %bb.2:
	add	x1, sp, #8
	mov	x0, x20
	mov	w2, #1
	bl	_pci_enable_msix_exact
	cbz	w0, LBB0_5
; %bb.3:
	mov	x19, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_pci_warn
	b	LBB0_6
LBB0_4:
Lloh8:
	adrp	x8, _ERANGE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_6
LBB0_5:
	ldr	w19, [sp, #12]
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_EXP_FLAGS,4,2              ; @PCI_EXP_FLAGS
	.comm	_PCI_EXP_FLAGS_IRQ,4,2          ; @PCI_EXP_FLAGS_IRQ
	.comm	_ERANGE,4,2                     ; @ERANGE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error %d enabling MSIx\n"

	.no_dead_strip	_pnv_php_enable_msix
.subsections_via_symbols
