	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsl_msi_attach
_fsl_msi_attach:                        ## @fsl_msi_attach
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	callq	_device_get_softc
	movq	%rax, %r12
	movq	%rax, %r15
	movq	_msi_vmem@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	jne	LBB0_2
## %bb.1:
	movq	_M_BESTFIT@GOTPCREL(%rip), %rax
	movq	_M_WAITOK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	orl	(%rax), %r9d
	leaq	L_.str(%rip), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	movl	$1, %r8d
	callq	_vmem_create
	movq	%rax, (%r14)
LBB0_2:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	%ebx, %edi
	xorl	%edx, %edx
	callq	_bus_get_resource_start
	movq	%rax, (%r15)
	movl	(%r14), %esi
	movl	%ebx, %r14d
	movl	%ebx, %edi
	movl	$1, %edx
	callq	_bus_get_resource_start
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	_FSL_MSI_TARGET@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	(%r15), %rax
	movq	%rax, 8(%r15)
LBB0_4:
	addq	$8, %r12
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	_FSL_NUM_IRQS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movl	%r14d, %ebx
	jle	LBB0_7
## %bb.5:
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	24(%rax), %r15
	movl	%r12d, (%r15,%r14)
	movl	%r13d, %eax
	andl	$-16, %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addq	(%rcx), %rax
	leaq	(%r15,%r14), %rdx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, 8(%r15,%r14)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ebx, %edi
	callq	_bus_alloc_resource_any
	movl	%eax, 20(%r15,%r14)
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_INTR_TYPE_MISC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	_fsl_msi_intr_filter@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leaq	(%r15,%r14), %rsi
	addq	$16, %rsi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%rsi, (%rsp)
	movl	%ebx, %edi
	movl	%eax, %esi
	xorl	%r8d, %r8d
	movq	-64(%rbp), %r9                  ## 8-byte Reload
	callq	_bus_setup_intr
	movq	_FSL_NUM_IRQS@GOTPCREL(%rip), %rax
	incq	%r12
	movslq	(%rax), %rax
	addq	$16, %r13
	addq	$24, %r14
	cmpq	%rax, %r12
	jl	LBB0_6
LBB0_7:
	movl	%ebx, %edi
	callq	_ofw_bus_get_node
	movq	_FSL_NUM_MSIS@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movl	%ebx, %edi
	movl	%eax, %esi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_powerpc_register_pic
	movl	%eax, 16(%r15)
	movq	_msi_vmem@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	movl	(%r14), %edx
	movq	_M_WAITOK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%eax, %esi
	callq	_vmem_add
	movq	_slist@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_fsl_msis@GOTPCREL(%rip), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_SLIST_INSERT_HEAD
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_msi_vmem,8,3                   ## @msi_vmem
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MPIC MSI"

	.comm	_M_BESTFIT,4,2                  ## @M_BESTFIT
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_FSL_MSI_TARGET,8,3             ## @FSL_MSI_TARGET
	.comm	_FSL_NUM_IRQS,4,2               ## @FSL_NUM_IRQS
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.comm	_INTR_TYPE_MISC,4,2             ## @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_fsl_msi_intr_filter,4,2        ## @fsl_msi_intr_filter
	.comm	_FSL_NUM_MSIS,4,2               ## @FSL_NUM_MSIS
	.comm	_fsl_msis,4,2                   ## @fsl_msis
	.comm	_slist,4,2                      ## @slist
	.no_dead_strip	_fsl_msi_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fsl_msi_attach
_fsl_msi_attach:                        ; @fsl_msi_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	bl	_device_get_softc
	mov	x19, x0
Lloh0:
	adrp	x21, _msi_vmem@GOTPAGE
Lloh1:
	ldr	x21, [x21, _msi_vmem@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh2:
	adrp	x9, _M_WAITOK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _M_WAITOK@GOTPAGEOFF]
	cbnz	x8, LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, _M_BESTFIT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _M_BESTFIT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w9, [x9]
	orr	w5, w9, w8
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #0
	mov	w2, #0
	mov	w3, #1
	mov	w4, #1
	bl	_vmem_create
	str	x0, [x21]
LBB0_2:
Lloh9:
	adrp	x21, _SYS_RES_MEMORY@GOTPAGE
Lloh10:
	ldr	x21, [x21, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	mov	w2, #0
	bl	_bus_get_resource_start
	str	x0, [x19]
	ldr	w1, [x21]
	mov	x0, x20
	mov	w2, #1
	bl	_bus_get_resource_start
	mov	x8, x19
	str	x0, [x8, #8]!
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	cbnz	x0, LBB0_4
; %bb.3:
	ldr	x8, [x19]
Lloh11:
	adrp	x9, _FSL_MSI_TARGET@GOTPAGE
Lloh12:
	ldr	x9, [x9, _FSL_MSI_TARGET@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x8, x9, x8
	str	x8, [x19, #8]
LBB0_4:
Lloh14:
	adrp	x23, _FSL_NUM_IRQS@GOTPAGE
Lloh15:
	ldr	x23, [x23, _FSL_NUM_IRQS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x26, #0
	mov	x27, #0
	mov	x28, #0
Lloh16:
	adrp	x21, _INTR_TYPE_MISC@GOTPAGE
Lloh17:
	ldr	x21, [x21, _INTR_TYPE_MISC@GOTPAGEOFF]
Lloh18:
	adrp	x25, _INTR_MPSAFE@GOTPAGE
Lloh19:
	ldr	x25, [x25, _INTR_MPSAFE@GOTPAGEOFF]
Lloh20:
	adrp	x24, _fsl_msi_intr_filter@GOTPAGE
Lloh21:
	ldr	x24, [x24, _fsl_msi_intr_filter@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	add	x22, x8, x26
	str	w28, [x22]
	ldr	x8, [x19]
	and	x9, x27, #0xfffffff0
	add	x8, x8, x9
	str	x8, [x22, #8]
Lloh22:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh27:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x2, x22
	bl	_bus_alloc_resource_any
	mov	x1, x0
	str	w0, [x22, #20]
	ldr	w8, [x21]
	ldr	w9, [x25]
	orr	w2, w9, w8
	ldr	w3, [x24]
	add	x6, x22, #16
	mov	x0, x20
	mov	x4, #0
	mov	x5, x22
	bl	_bus_setup_intr
	add	x28, x28, #1
	ldrsw	x8, [x23]
	add	x27, x27, #16
	add	x26, x26, #24
	cmp	x28, x8
	b.lt	LBB0_6
LBB0_7:
	mov	x0, x20
	bl	_ofw_bus_get_node
	mov	x1, x0
Lloh28:
	adrp	x21, _FSL_NUM_MSIS@GOTPAGE
Lloh29:
	ldr	x21, [x21, _FSL_NUM_MSIS@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x20
	mov	w3, #0
	mov	w4, #0
	bl	_powerpc_register_pic
	mov	x1, x0
	str	w0, [x19, #16]
Lloh30:
	adrp	x8, _msi_vmem@GOTPAGE
Lloh31:
	ldr	x8, [x8, _msi_vmem@GOTPAGEOFF]
Lloh32:
	ldr	x0, [x8]
	ldr	w2, [x21]
Lloh33:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh34:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
Lloh35:
	ldr	w3, [x8]
	bl	_vmem_add
Lloh36:
	adrp	x8, _slist@GOTPAGE
Lloh37:
	ldr	x8, [x8, _slist@GOTPAGEOFF]
Lloh38:
	ldr	w2, [x8]
Lloh39:
	adrp	x0, _fsl_msis@GOTPAGE
Lloh40:
	ldr	x0, [x0, _fsl_msis@GOTPAGEOFF]
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	bl	_SLIST_INSERT_HEAD
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_msi_vmem,8,3                   ; @msi_vmem
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MPIC MSI"

	.comm	_M_BESTFIT,4,2                  ; @M_BESTFIT
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_FSL_MSI_TARGET,8,3             ; @FSL_MSI_TARGET
	.comm	_FSL_NUM_IRQS,4,2               ; @FSL_NUM_IRQS
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.comm	_INTR_TYPE_MISC,4,2             ; @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_fsl_msi_intr_filter,4,2        ; @fsl_msi_intr_filter
	.comm	_FSL_NUM_MSIS,4,2               ; @FSL_NUM_MSIS
	.comm	_fsl_msis,4,2                   ; @fsl_msis
	.comm	_slist,4,2                      ; @slist
	.no_dead_strip	_fsl_msi_attach
.subsections_via_symbols
