	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_msi_setup
_qib_msi_setup:                         ## @qib_msi_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	16(%rdi), %r13
	movq	%r13, %rdi
	callq	_pci_enable_msi
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_qib_dev_err
LBB0_2:
	movslq	%r12d, %rbx
	movq	_PCI_MSI_ADDRESS_LO@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%rbx, %rsi
	leaq	8(%r14), %rdx
	movq	%r13, %rdi
	callq	_pci_read_config_dword
	movq	_PCI_MSI_ADDRESS_HI@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%rbx, %rsi
	leaq	4(%r14), %rdx
	movq	%r13, %rdi
	callq	_pci_read_config_dword
	movq	_PCI_MSI_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	%ebx, %esi
	leaq	-44(%rbp), %rdx
	movq	%r13, %rdi
	callq	_pci_read_config_word
	movq	_PCI_MSI_FLAGS_64BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	andl	-44(%rbp), %eax
	setne	%cl
	leal	(%rbx,%rcx,4), %esi
	addl	$8, %esi
	movq	%r13, %rdi
	movq	%r14, %rdx
	callq	_pci_read_config_word
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pci_enable_msi failed: %d, interrupts may not work\n"

	.comm	_PCI_MSI_ADDRESS_LO,8,3         ## @PCI_MSI_ADDRESS_LO
	.comm	_PCI_MSI_ADDRESS_HI,8,3         ## @PCI_MSI_ADDRESS_HI
	.comm	_PCI_MSI_FLAGS,4,2              ## @PCI_MSI_FLAGS
	.comm	_PCI_MSI_FLAGS_64BIT,4,2        ## @PCI_MSI_FLAGS_64BIT
	.no_dead_strip	_qib_msi_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_msi_setup
_qib_msi_setup:                         ; @qib_msi_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, x1
	mov	x19, x0
	ldr	x20, [x0, #16]
	mov	x0, x20
	bl	_pci_enable_msi
	mov	x22, x0
	cbz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x22
	bl	_qib_dev_err
LBB0_2:
	sxtw	x23, w21
Lloh2:
	adrp	x8, _PCI_MSI_ADDRESS_LO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_MSI_ADDRESS_LO@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	add	x1, x8, x23
	add	x2, x19, #8
	mov	x0, x20
	bl	_pci_read_config_dword
Lloh5:
	adrp	x8, _PCI_MSI_ADDRESS_HI@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PCI_MSI_ADDRESS_HI@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	add	x1, x8, x23
	add	x2, x19, #4
	mov	x0, x20
	bl	_pci_read_config_dword
Lloh8:
	adrp	x8, _PCI_MSI_FLAGS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PCI_MSI_FLAGS@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	add	w1, w8, w21
	add	x2, sp, #12
	mov	x0, x20
	bl	_pci_read_config_word
	ldr	w8, [sp, #12]
Lloh11:
	adrp	x9, _PCI_MSI_FLAGS_64BIT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PCI_MSI_FLAGS_64BIT@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w8, #12
	mov	w9, #8
	csel	w8, w9, w8, eq
	add	w1, w8, w21
	mov	x0, x20
	mov	x2, x19
	bl	_pci_read_config_word
	mov	x0, x22
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pci_enable_msi failed: %d, interrupts may not work\n"

	.comm	_PCI_MSI_ADDRESS_LO,8,3         ; @PCI_MSI_ADDRESS_LO
	.comm	_PCI_MSI_ADDRESS_HI,8,3         ; @PCI_MSI_ADDRESS_HI
	.comm	_PCI_MSI_FLAGS,4,2              ; @PCI_MSI_FLAGS
	.comm	_PCI_MSI_FLAGS_64BIT,4,2        ; @PCI_MSI_FLAGS_64BIT
	.no_dead_strip	_qib_msi_setup
.subsections_via_symbols
