	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdhci_pci_o2_enable_msi
_sdhci_pci_o2_enable_msi:               ## @sdhci_pci_o2_enable_msi
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	movq	_PCI_CAP_ID_MSI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pci_find_capability
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	(%rbx), %edi
	movq	_PCI_IRQ_MSI@GOTPCREL(%rip), %rax
	movq	_PCI_IRQ_MSIX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	$1, %esi
	movl	$1, %edx
	callq	_pci_alloc_irq_vectors
	testl	%eax, %eax
	js	LBB0_4
## %bb.2:
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_pci_irq_vector
	movl	%eax, (%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	4(%r14), %edi
	callq	_mmc_hostname
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_info                        ## TAILCALL
LBB0_4:
	movl	%eax, %r15d
	movl	4(%r14), %edi
	callq	_mmc_hostname
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	movl	%r15d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_err                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_CAP_ID_MSI,4,2             ## @PCI_CAP_ID_MSI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: unsupport msi, use INTx irq\n"

	.comm	_PCI_IRQ_MSI,4,2                ## @PCI_IRQ_MSI
	.comm	_PCI_IRQ_MSIX,4,2               ## @PCI_IRQ_MSIX
L_.str.1:                               ## @.str.1
	.asciz	"%s: enable PCI MSI failed, err=%d\n"

	.no_dead_strip	_sdhci_pci_o2_enable_msi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdhci_pci_o2_enable_msi
_sdhci_pci_o2_enable_msi:               ; @sdhci_pci_o2_enable_msi
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _PCI_CAP_ID_MSI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_CAP_ID_MSI@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_pci_find_capability
	cbz	w0, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _PCI_IRQ_MSI@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_IRQ_MSI@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _PCI_IRQ_MSIX@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PCI_IRQ_MSIX@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	w1, #1
	mov	w2, #1
	bl	_pci_alloc_irq_vectors
	tbnz	w0, #31, LBB0_4
; %bb.2:
	ldr	w0, [x20]
	mov	w1, #0
	bl	_pci_irq_vector
	str	w0, [x19]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_3:
	ldr	w0, [x19, #4]
	bl	_mmc_hostname
	mov	x1, x0
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_pr_info
LBB0_4:
	mov	x21, x0
	ldr	w0, [x19, #4]
	bl	_mmc_hostname
	mov	x1, x0
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_pr_err
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_CAP_ID_MSI,4,2             ; @PCI_CAP_ID_MSI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: unsupport msi, use INTx irq\n"

	.comm	_PCI_IRQ_MSI,4,2                ; @PCI_IRQ_MSI
	.comm	_PCI_IRQ_MSIX,4,2               ; @PCI_IRQ_MSIX
l_.str.1:                               ; @.str.1
	.asciz	"%s: enable PCI MSI failed, err=%d\n"

	.no_dead_strip	_sdhci_pci_o2_enable_msi
.subsections_via_symbols
