	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_pcie_allocate_msi_domains
_mtk_pcie_allocate_msi_domains:         ## @mtk_pcie_allocate_msi_domains
	.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	8(%rdi), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_of_node_to_fwnode
	movq	%rax, %r14
	leaq	20(%rbx), %rdi
	callq	_mutex_init
	movq	_MTK_MSI_IRQS_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_msi_domain_ops@GOTPCREL(%rip), %rdx
	movq	%r14, %rdi
	movq	%rbx, %rcx
	callq	_irq_domain_create_linear
	movl	%eax, (%rbx)
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_mtk_msi_domain_info@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_pci_msi_create_irq_domain
	movl	%eax, %ecx
	movl	%eax, 16(%rbx)
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_5
## %bb.3:
	movq	8(%rbx), %rax
	movq	(%rax), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movl	(%rbx), %edi
	callq	_irq_domain_remove
	jmp	LBB0_4
LBB0_1:
	movq	8(%rbx), %rax
	movq	(%rax), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_MSI_IRQS_NUM,4,2           ## @MTK_MSI_IRQS_NUM
	.comm	_msi_domain_ops,4,2             ## @msi_domain_ops
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to create IRQ domain\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_mtk_msi_domain_info,4,2        ## @mtk_msi_domain_info
L_.str.1:                               ## @.str.1
	.asciz	"failed to create MSI domain\n"

	.no_dead_strip	_mtk_pcie_allocate_msi_domains
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_pcie_allocate_msi_domains
_mtk_pcie_allocate_msi_domains:         ; @mtk_pcie_allocate_msi_domains
	.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	x8, [x0, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_of_node_to_fwnode
	mov	x20, x0
	add	x0, x19, #20
	bl	_mutex_init
Lloh0:
	adrp	x8, _MTK_MSI_IRQS_NUM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTK_MSI_IRQS_NUM@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, _msi_domain_ops@GOTPAGE
Lloh4:
	ldr	x2, [x2, _msi_domain_ops@GOTPAGEOFF]
	mov	x0, x20
	mov	x3, x19
	bl	_irq_domain_create_linear
	str	w0, [x19]
	cbz	w0, LBB0_3
; %bb.1:
	mov	x2, x0
Lloh5:
	adrp	x1, _mtk_msi_domain_info@GOTPAGE
Lloh6:
	ldr	x1, [x1, _mtk_msi_domain_info@GOTPAGEOFF]
	mov	x0, x20
	bl	_pci_msi_create_irq_domain
	str	w0, [x19, #16]
	cbz	w0, LBB0_4
; %bb.2:
	mov	w0, #0
	b	LBB0_6
LBB0_3:
	ldr	x8, [x19, #8]
	ldr	x0, [x8]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_5
LBB0_4:
	ldr	x8, [x19, #8]
	ldr	x0, [x8]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	ldr	w0, [x19]
	bl	_irq_domain_remove
LBB0_5:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_MSI_IRQS_NUM,4,2           ; @MTK_MSI_IRQS_NUM
	.comm	_msi_domain_ops,4,2             ; @msi_domain_ops
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to create IRQ domain\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_mtk_msi_domain_info,4,2        ; @mtk_msi_domain_info
l_.str.1:                               ; @.str.1
	.asciz	"failed to create MSI domain\n"

	.no_dead_strip	_mtk_pcie_allocate_msi_domains
.subsections_via_symbols
