	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smmu_pmu_setup_msi
_smmu_pmu_setup_msi:                    ## @smmu_pmu_setup_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	movq	_SMMU_PMCG_IRQ_CFG0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rdi), %rsi
	xorl	%edi, %edi
	callq	_writeq_relaxed
	movq	_SMMU_PMCG_CFGR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movq	_SMMU_PMCG_CFGR_MSI@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.1:
	movq	_smmu_pmu_write_msi_msg@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_platform_msi_domain_alloc_irqs
	testl	%eax, %eax
	je	LBB0_2
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_dev_warn                       ## TAILCALL
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_2:
	movq	%r14, %rdi
	callq	_first_msi_entry
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	(%rax), %eax
	movl	%eax, (%rbx)
LBB0_4:
	movq	_smmu_pmu_free_msis@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%r14, %rdx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_devm_add_action                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SMMU_PMCG_IRQ_CFG0,8,3         ## @SMMU_PMCG_IRQ_CFG0
	.comm	_SMMU_PMCG_CFGR,8,3             ## @SMMU_PMCG_CFGR
	.comm	_SMMU_PMCG_CFGR_MSI,4,2         ## @SMMU_PMCG_CFGR_MSI
	.comm	_smmu_pmu_write_msi_msg,4,2     ## @smmu_pmu_write_msi_msg
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate MSIs\n"

	.comm	_smmu_pmu_free_msis,4,2         ## @smmu_pmu_free_msis
	.no_dead_strip	_smmu_pmu_setup_msi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smmu_pmu_setup_msi
_smmu_pmu_setup_msi:                    ; @smmu_pmu_setup_msi
	.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	x20, x0
	ldp	x8, x19, [x0, #8]
Lloh0:
	adrp	x9, _SMMU_PMCG_IRQ_CFG0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SMMU_PMCG_IRQ_CFG0@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writeq_relaxed
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _SMMU_PMCG_CFGR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SMMU_PMCG_CFGR@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh6:
	adrp	x8, _SMMU_PMCG_CFGR_MSI@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SMMU_PMCG_CFGR_MSI@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.1:
Lloh9:
	adrp	x8, _smmu_pmu_write_msi_msg@GOTPAGE
Lloh10:
	ldr	x8, [x8, _smmu_pmu_write_msi_msg@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #1
	bl	_platform_msi_domain_alloc_irqs
	cbz	w0, LBB0_4
; %bb.2:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dev_warn
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x0, x19
	bl	_first_msi_entry
	cbz	x0, LBB0_6
; %bb.5:
	ldr	w8, [x0]
	str	w8, [x20]
LBB0_6:
Lloh14:
	adrp	x8, _smmu_pmu_free_msis@GOTPAGE
Lloh15:
	ldr	x8, [x8, _smmu_pmu_free_msis@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_devm_add_action
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_SMMU_PMCG_IRQ_CFG0,8,3         ; @SMMU_PMCG_IRQ_CFG0
	.comm	_SMMU_PMCG_CFGR,8,3             ; @SMMU_PMCG_CFGR
	.comm	_SMMU_PMCG_CFGR_MSI,4,2         ; @SMMU_PMCG_CFGR_MSI
	.comm	_smmu_pmu_write_msi_msg,4,2     ; @smmu_pmu_write_msi_msg
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate MSIs\n"

	.comm	_smmu_pmu_free_msis,4,2         ; @smmu_pmu_free_msis
	.no_dead_strip	_smmu_pmu_setup_msi
.subsections_via_symbols
