	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_pcie_init_irq_domain
_mtk_pcie_init_irq_domain:              ## @mtk_pcie_init_irq_domain
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movq	(%rax), %r14
	xorl	%r12d, %r12d
	movq	%rsi, %rdi
	xorl	%esi, %esi
	callq	_of_get_next_child
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %rbx
	movq	_PCI_NUM_INTX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_intx_domain_ops@GOTPCREL(%rip), %rdx
	movq	%rbx, %rdi
	movq	%r15, %rcx
	callq	_irq_domain_add_linear
	movl	%eax, (%r15)
	movq	%rbx, %rdi
	callq	_of_node_put
	cmpl	$0, (%r15)
	je	LBB0_6
## %bb.2:
	movq	_CONFIG_PCI_MSI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_IS_ENABLED
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	callq	_mtk_pcie_allocate_msi_domains
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_8
LBB0_4:
	xorl	%r12d, %r12d
	jmp	LBB0_8
LBB0_5:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
LBB0_7:
	subl	(%rax), %r12d
LBB0_8:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no PCIe Intc node found\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_PCI_NUM_INTX,4,2               ## @PCI_NUM_INTX
	.comm	_intx_domain_ops,4,2            ## @intx_domain_ops
L_.str.1:                               ## @.str.1
	.asciz	"failed to get INTx IRQ domain\n"

	.comm	_CONFIG_PCI_MSI,4,2             ## @CONFIG_PCI_MSI
	.no_dead_strip	_mtk_pcie_init_irq_domain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_pcie_init_irq_domain
_mtk_pcie_init_irq_domain:              ; @mtk_pcie_init_irq_domain
	.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, x0
	ldr	x8, [x0, #8]
	ldr	x20, [x8]
	mov	x0, x1
	mov	x1, #0
	bl	_of_get_next_child
	cbz	x0, LBB0_5
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x8, _PCI_NUM_INTX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_NUM_INTX@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, _intx_domain_ops@GOTPAGE
Lloh4:
	ldr	x2, [x2, _intx_domain_ops@GOTPAGEOFF]
	mov	x3, x19
	bl	_irq_domain_add_linear
	str	w0, [x19]
	mov	x0, x21
	bl	_of_node_put
	ldr	w8, [x19]
	cbz	w8, LBB0_6
; %bb.2:
Lloh5:
	adrp	x8, _CONFIG_PCI_MSI@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CONFIG_PCI_MSI@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_IS_ENABLED
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_mtk_pcie_allocate_msi_domains
	cbnz	w0, LBB0_8
LBB0_4:
	mov	w0, #0
	b	LBB0_8
LBB0_5:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	x0, x20
	bl	_dev_err
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no PCIe Intc node found\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_PCI_NUM_INTX,4,2               ; @PCI_NUM_INTX
	.comm	_intx_domain_ops,4,2            ; @intx_domain_ops
l_.str.1:                               ; @.str.1
	.asciz	"failed to get INTx IRQ domain\n"

	.comm	_CONFIG_PCI_MSI,4,2             ; @CONFIG_PCI_MSI
	.no_dead_strip	_mtk_pcie_init_irq_domain
.subsections_via_symbols
