	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ks_pcie_config_legacy_irq
_ks_pcie_config_legacy_irq:             ## @ks_pcie_config_legacy_irq
	.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
	movq	%rdi, %r13
	movq	24(%rdi), %rdi
	movq	32(%r13), %rax
	movq	(%rax), %r15
	leaq	L_.str(%rip), %rsi
	callq	_of_get_child_by_name
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_of_irq_count
	testl	%eax, %eax
	je	LBB0_10
## %bb.4:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_8
## %bb.5:
	movl	%eax, %r15d
	xorl	%ebx, %ebx
	movq	_ks_pcie_legacy_irq_handler@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_irq_of_parse_and_map
	testl	%eax, %eax
	je	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r13), %rcx
	movl	%eax, (%rcx,%rbx,4)
	movl	(%r12), %esi
	movl	%eax, %edi
	movq	%r13, %rdx
	callq	_irq_set_chained_handler_and_data
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_6
LBB0_8:
	movq	_PCI_NUM_INTX@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_ks_pcie_legacy_irq_domain_ops@GOTPCREL(%rip), %rdx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	callq	_irq_domain_add_linear
	testq	%rax, %rax
	je	LBB0_9
## %bb.13:
	movq	%rax, 8(%r13)
	cmpl	$0, (%r12)
	jle	LBB0_17
## %bb.14:
	movq	_INTx_EN@GOTPCREL(%rip), %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_IRQ_ENABLE_SET
	movl	(%r15), %edx
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_ks_pcie_app_writel
	incl	%ebx
	cmpl	(%r12), %ebx
	jl	LBB0_15
## %bb.16:
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_1:
	xorl	%ebx, %ebx
	cmpq	$0, 16(%r13)
	jne	LBB0_18
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_warn
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_10:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	jmp	LBB0_11
LBB0_9:
	leaq	L_.str.3(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_11:
	callq	_dev_err
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_17:
	movq	%r14, %rdi
	callq	_of_node_put
LBB0_18:
	movl	%ebx, %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	"legacy-interrupt-controller"

L_.str.1:                               ## @.str.1
	.asciz	"legacy-interrupt-controller node is absent\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"No IRQ entries in legacy-interrupt-controller\n"

	.comm	_ks_pcie_legacy_irq_handler,4,2 ## @ks_pcie_legacy_irq_handler
	.comm	_PCI_NUM_INTX,4,2               ## @PCI_NUM_INTX
	.comm	_ks_pcie_legacy_irq_domain_ops,4,2 ## @ks_pcie_legacy_irq_domain_ops
L_.str.3:                               ## @.str.3
	.asciz	"Failed to add irq domain for legacy irqs\n"

	.comm	_INTx_EN,4,2                    ## @INTx_EN
	.no_dead_strip	_ks_pcie_config_legacy_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ks_pcie_config_legacy_irq
_ks_pcie_config_legacy_irq:             ; @ks_pcie_config_legacy_irq
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x0
	ldp	x0, x8, [x0, #24]
	ldr	x21, [x8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_of_get_child_by_name
	cbz	x0, LBB0_11
; %bb.1:
	mov	x19, x0
	bl	_of_irq_count
	cbz	w0, LBB0_13
; %bb.2:
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x22, #0
	mov	w23, w0
Lloh2:
	adrp	x24, _ks_pcie_legacy_irq_handler@GOTPAGE
Lloh3:
	ldr	x24, [x24, _ks_pcie_legacy_irq_handler@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	_irq_of_parse_and_map
	cbz	w0, LBB0_17
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20]
	str	w0, [x8, x22, lsl #2]
	ldr	w1, [x24]
	mov	x2, x20
	bl	_irq_set_chained_handler_and_data
	add	x22, x22, #1
	cmp	x23, x22
	b.ne	LBB0_4
LBB0_6:
Lloh4:
	adrp	x22, _PCI_NUM_INTX@GOTPAGE
Lloh5:
	ldr	x22, [x22, _PCI_NUM_INTX@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh6:
	adrp	x2, _ks_pcie_legacy_irq_domain_ops@GOTPAGE
Lloh7:
	ldr	x2, [x2, _ks_pcie_legacy_irq_domain_ops@GOTPAGEOFF]
	mov	x0, x19
	mov	x3, #0
	bl	_irq_domain_add_linear
	cbz	x0, LBB0_15
; %bb.7:
	str	x0, [x20, #8]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.8:
	mov	w21, #0
Lloh8:
	adrp	x23, _INTx_EN@GOTPAGE
Lloh9:
	ldr	x23, [x23, _INTx_EN@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_IRQ_ENABLE_SET
	mov	x1, x0
	ldr	w2, [x23]
	mov	x0, x20
	bl	_ks_pcie_app_writel
	add	w21, w21, #1
	ldr	w8, [x22]
	cmp	w21, w8
	b.lt	LBB0_9
LBB0_10:
	mov	w20, #0
	b	LBB0_18
LBB0_11:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_14
; %bb.12:
	mov	w20, #0
	b	LBB0_19
LBB0_13:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_16
LBB0_14:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_warn
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_19
LBB0_15:
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_16:
	mov	x0, x21
	bl	_dev_err
LBB0_17:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_18:
	mov	x0, x19
	bl	_of_node_put
LBB0_19:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"legacy-interrupt-controller"

l_.str.1:                               ; @.str.1
	.asciz	"legacy-interrupt-controller node is absent\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"No IRQ entries in legacy-interrupt-controller\n"

	.comm	_ks_pcie_legacy_irq_handler,4,2 ; @ks_pcie_legacy_irq_handler
	.comm	_PCI_NUM_INTX,4,2               ; @PCI_NUM_INTX
	.comm	_ks_pcie_legacy_irq_domain_ops,4,2 ; @ks_pcie_legacy_irq_domain_ops
l_.str.3:                               ; @.str.3
	.asciz	"Failed to add irq domain for legacy irqs\n"

	.comm	_INTx_EN,4,2                    ; @INTx_EN
	.no_dead_strip	_ks_pcie_config_legacy_irq
.subsections_via_symbols
