	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_enable_msi_x
_mthca_enable_msi_x:                    ## @mthca_enable_msi_x
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	movq	_PCI_IRQ_MSIX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$3, %esi
	movl	$3, %edx
	callq	_pci_alloc_irq_vectors
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	(%rbx), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_pci_irq_vector
	movq	8(%rbx), %rcx
	movq	_MTHCA_EQ_COMP@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movl	(%rbx), %edi
	movl	$1, %esi
	callq	_pci_irq_vector
	movq	8(%rbx), %rcx
	movq	_MTHCA_EQ_ASYNC@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movl	(%rbx), %edi
	movl	$2, %esi
	callq	_pci_irq_vector
	movq	8(%rbx), %rcx
	movq	_MTHCA_EQ_CMD@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	jmp	LBB0_3
LBB0_1:
	movl	%eax, %r14d
LBB0_3:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_IRQ_MSIX,4,2               ## @PCI_IRQ_MSIX
	.comm	_MTHCA_EQ_COMP,8,3              ## @MTHCA_EQ_COMP
	.comm	_MTHCA_EQ_ASYNC,8,3             ## @MTHCA_EQ_ASYNC
	.comm	_MTHCA_EQ_CMD,8,3               ## @MTHCA_EQ_CMD
	.no_dead_strip	_mthca_enable_msi_x
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_enable_msi_x
_mthca_enable_msi_x:                    ; @mthca_enable_msi_x
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _PCI_IRQ_MSIX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_IRQ_MSIX@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	w1, #3
	mov	w2, #3
	bl	_pci_alloc_irq_vectors
	tbnz	w0, #31, LBB0_2
; %bb.1:
	ldr	w0, [x19]
	mov	w1, #0
	bl	_pci_irq_vector
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _MTHCA_EQ_COMP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MTHCA_EQ_COMP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	str	x0, [x8, x9, lsl #3]
	ldr	w0, [x19]
	mov	w1, #1
	bl	_pci_irq_vector
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x9, _MTHCA_EQ_ASYNC@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MTHCA_EQ_ASYNC@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	str	x0, [x8, x9, lsl #3]
	ldr	w0, [x19]
	mov	w1, #2
	bl	_pci_irq_vector
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [x19, #8]
Lloh9:
	adrp	x10, _MTHCA_EQ_CMD@GOTPAGE
Lloh10:
	ldr	x10, [x10, _MTHCA_EQ_CMD@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	str	x8, [x9, x10, lsl #3]
LBB0_2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_IRQ_MSIX,4,2               ; @PCI_IRQ_MSIX
	.comm	_MTHCA_EQ_COMP,8,3              ; @MTHCA_EQ_COMP
	.comm	_MTHCA_EQ_ASYNC,8,3             ; @MTHCA_EQ_ASYNC
	.comm	_MTHCA_EQ_CMD,8,3               ; @MTHCA_EQ_CMD
	.no_dead_strip	_mthca_enable_msi_x
.subsections_via_symbols
