	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mv_mpic_attach
_mv_mpic_attach:                        ## @mv_mpic_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	_mv_mpic_sc@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	jne	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, (%r13)
	movl	%r14d, 72(%rax)
	leaq	68(%rax), %rdi
	movq	_MTX_SPIN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%edx, %edx
	callq	_mtx_init
	movq	_mv_mpic_spec@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	(%rbx), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resources
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	callq	_device_printf
	jmp	LBB0_1
LBB0_4:
	movq	(%rbx), %rax
	movq	24(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.6:
	movq	_INTR_TYPE_CLK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_mpic_intr@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rax
	addq	$64, %rax
	movq	%rax, (%rsp)
	movl	%r14d, %edi
	xorl	%r8d, %r8d
	movq	%rbx, %r9
	callq	_bus_setup_intr
	jmp	LBB0_7
LBB0_5:
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
	callq	_device_printf
LBB0_7:
	movq	(%rbx), %rax
	movq	(%rax), %rdi
	callq	_rman_get_bustag
	movq	%rax, 56(%rbx)
	movq	(%rbx), %rax
	movq	(%rax), %rdi
	callq	_rman_get_bushandle
	movq	%rax, 48(%rbx)
	movq	(%rbx), %rax
	movq	8(%rax), %rdi
	callq	_rman_get_bustag
	movq	%rax, 40(%rbx)
	movq	(%rbx), %rax
	movq	8(%rax), %rdi
	callq	_rman_get_bushandle
	movq	%rax, 32(%rbx)
	movq	(%rbx), %rax
	movq	16(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:
	callq	_rman_get_bustag
	movq	%rax, 24(%rbx)
	movq	(%rbx), %rax
	movq	16(%rax), %rdi
	callq	_rman_get_bushandle
	movq	%rax, 16(%rbx)
LBB0_9:
	movq	(%r13), %rdi
	movq	_MPIC_CTRL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	$1, %edx
	callq	_MPIC_WRITE
	movq	(%r13), %rdi
	movq	_MPIC_CTP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	xorl	%edx, %edx
	callq	_MPIC_CPU_WRITE
	movq	(%r13), %rdi
	movl	(%r12), %esi
	callq	_MPIC_READ
	movl	%eax, %edi
	callq	_MPIC_CTRL_NIRQS
	movl	%eax, 8(%rbx)
	movq	%rbx, %rdi
	callq	_mv_mpic_register_isrcs
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	leaq	L_.str.3(%rip), %rsi
LBB0_11:
	movl	%r14d, %edi
	callq	_device_printf
	movl	(%r15), %esi
	movq	(%rbx), %rdx
	movl	%r14d, %edi
	callq	_bus_release_resources
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	%r14d, %edi
	callq	_ofw_bus_get_node
	movl	%eax, %edi
	callq	_OF_xref_from_node
	movl	%eax, %edi
	movl	%r14d, %esi
	callq	_OF_device_register_xref
	movl	%r14d, %edi
	callq	_OF_xref_from_device
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_intr_pic_register
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mpic_unmask_msi
	movq	_mp_ncpus@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_18
## %bb.15:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%ebx, %edi
	callq	_MPIC_CPU
	movq	%rax, %r12
	movq	_MPIC_LOCAL_MASK@GOTPCREL(%rip), %r15
	addq	(%r15), %r12
	movq	(%r13), %r14
	movl	%ebx, %edi
	callq	_MPIC_CPU
	addq	(%r15), %rax
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_MPIC_CPU_READ
	btsl	%ebx, %eax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_MPIC_CPU_WRITE
	movq	_mp_ncpus@GOTPCREL(%rip), %rax
	incl	%ebx
	cmpl	(%rax), %ebx
	jl	LBB0_16
## %bb.17:
	xorl	%ebx, %ebx
	jmp	LBB0_18
LBB0_13:
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_mv_mpic_sc,8,3                 ## @mv_mpic_sc
	.comm	_ENXIO,4,2                      ## @ENXIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MPIC lock"

	.comm	_MTX_SPIN,4,2                   ## @MTX_SPIN
	.comm	_mv_mpic_spec,4,2               ## @mv_mpic_spec
L_.str.1:                               ## @.str.1
	.asciz	"could not allocate resources\n"

L_.str.2:                               ## @.str.2
	.asciz	"No interrupt to use.\n"

	.comm	_INTR_TYPE_CLK,4,2              ## @INTR_TYPE_CLK
	.comm	_mpic_intr,4,2                  ## @mpic_intr
	.comm	_MPIC_CTRL,4,2                  ## @MPIC_CTRL
	.comm	_MPIC_CTP,8,3                   ## @MPIC_CTP
L_.str.3:                               ## @.str.3
	.asciz	"could not register PIC ISRCs\n"

L_.str.4:                               ## @.str.4
	.asciz	"could not register PIC\n"

	.comm	_mp_ncpus,4,2                   ## @mp_ncpus
	.comm	_MPIC_LOCAL_MASK,8,3            ## @MPIC_LOCAL_MASK
	.no_dead_strip	_mv_mpic_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mv_mpic_attach
_mv_mpic_attach:                        ; @mv_mpic_attach
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	bl	_device_get_softc
Lloh0:
	adrp	x23, _mv_mpic_sc@GOTPAGE
Lloh1:
	ldr	x23, [x23, _mv_mpic_sc@GOTPAGEOFF]
	ldr	x8, [x23]
	cbnz	x8, LBB0_11
; %bb.1:
	mov	x20, x0
	str	x0, [x23]
	str	w19, [x0, #72]
	add	x0, x0, #68
Lloh2:
	adrp	x8, _MTX_SPIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MTX_SPIN@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, #0
	bl	_mtx_init
Lloh7:
	adrp	x21, _mv_mpic_spec@GOTPAGE
Lloh8:
	ldr	x21, [x21, _mv_mpic_spec@GOTPAGEOFF]
	ldr	w1, [x21]
	ldr	x2, [x20]
	mov	x0, x19
	bl	_bus_alloc_resources
	cbz	w0, LBB0_3
; %bb.2:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	b	LBB0_11
LBB0_3:
	ldr	x8, [x20]
	ldr	x1, [x8, #24]
	cbz	x1, LBB0_5
; %bb.4:
Lloh11:
	adrp	x8, _INTR_TYPE_CLK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _INTR_TYPE_CLK@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x8, _mpic_intr@GOTPAGE
Lloh15:
	ldr	x8, [x8, _mpic_intr@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
	add	x6, x20, #64
	mov	x0, x19
	mov	x4, #0
	mov	x5, x20
	bl	_bus_setup_intr
	b	LBB0_6
LBB0_5:
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_6:
	ldr	x8, [x20]
	ldr	x0, [x8]
	bl	_rman_get_bustag
	str	x0, [x20, #56]
	ldr	x8, [x20]
	ldr	x0, [x8]
	bl	_rman_get_bushandle
	str	x0, [x20, #48]
	ldr	x8, [x20]
	ldr	x0, [x8, #8]
	bl	_rman_get_bustag
	str	x0, [x20, #40]
	ldr	x8, [x20]
	ldr	x0, [x8, #8]
	bl	_rman_get_bushandle
	str	x0, [x20, #32]
	ldr	x8, [x20]
	ldr	x0, [x8, #16]
	cbz	x0, LBB0_8
; %bb.7:
	bl	_rman_get_bustag
	str	x0, [x20, #24]
	ldr	x8, [x20]
	ldr	x0, [x8, #16]
	bl	_rman_get_bushandle
	str	x0, [x20, #16]
LBB0_8:
	ldr	x0, [x23]
Lloh19:
	adrp	x22, _MPIC_CTRL@GOTPAGE
Lloh20:
	ldr	x22, [x22, _MPIC_CTRL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w2, #1
	bl	_MPIC_WRITE
	ldr	x0, [x23]
Lloh21:
	adrp	x8, _MPIC_CTP@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MPIC_CTP@GOTPAGEOFF]
Lloh23:
	ldr	x1, [x8]
	mov	w2, #0
	bl	_MPIC_CPU_WRITE
	ldr	x0, [x23]
	ldr	w1, [x22]
	bl	_MPIC_READ
	bl	_MPIC_CTRL_NIRQS
	str	w0, [x20, #8]
	mov	x0, x20
	bl	_mv_mpic_register_isrcs
	cbz	x0, LBB0_13
; %bb.9:
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_10:
	mov	x0, x19
	bl	_device_printf
	ldr	w1, [x21]
	ldr	x2, [x20]
	mov	x0, x19
	bl	_bus_release_resources
LBB0_11:
Lloh26:
	adrp	x8, _ENXIO@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_13:
	mov	x0, x19
	bl	_ofw_bus_get_node
	bl	_OF_xref_from_node
	mov	x1, x19
	bl	_OF_device_register_xref
	mov	x0, x19
	bl	_OF_xref_from_device
	mov	x1, x0
	mov	x0, x19
	bl	_intr_pic_register
	cbz	x0, LBB0_17
; %bb.14:
	bl	_mpic_unmask_msi
Lloh29:
	adrp	x24, _mp_ncpus@GOTPAGE
Lloh30:
	ldr	x24, [x24, _mp_ncpus@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.15:
	mov	w19, #0
Lloh31:
	adrp	x25, _MPIC_LOCAL_MASK@GOTPAGE
Lloh32:
	ldr	x25, [x25, _MPIC_LOCAL_MASK@GOTPAGEOFF]
	mov	w26, #1
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	x20, [x23]
	mov	x0, x19
	bl	_MPIC_CPU
	ldr	x8, [x25]
	add	x21, x8, x0
	lsl	w27, w26, w19
	ldr	x22, [x23]
	mov	x0, x19
	bl	_MPIC_CPU
	ldr	x8, [x25]
	add	x1, x8, x0
	mov	x0, x22
	bl	_MPIC_CPU_READ
	orr	w2, w0, w27
	mov	x0, x20
	mov	x1, x21
	bl	_MPIC_CPU_WRITE
	mov	w0, #0
	add	w19, w19, #1
	ldr	w8, [x24]
	cmp	w19, w8
	b.lt	LBB0_16
	b	LBB0_12
LBB0_17:
Lloh33:
	adrp	x1, l_.str.4@PAGE
Lloh34:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_10
LBB0_18:
	mov	w0, #0
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_mv_mpic_sc,8,3                 ; @mv_mpic_sc
	.comm	_ENXIO,4,2                      ; @ENXIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MPIC lock"

	.comm	_MTX_SPIN,4,2                   ; @MTX_SPIN
	.comm	_mv_mpic_spec,4,2               ; @mv_mpic_spec
l_.str.1:                               ; @.str.1
	.asciz	"could not allocate resources\n"

l_.str.2:                               ; @.str.2
	.asciz	"No interrupt to use.\n"

	.comm	_INTR_TYPE_CLK,4,2              ; @INTR_TYPE_CLK
	.comm	_mpic_intr,4,2                  ; @mpic_intr
	.comm	_MPIC_CTRL,4,2                  ; @MPIC_CTRL
	.comm	_MPIC_CTP,8,3                   ; @MPIC_CTP
l_.str.3:                               ; @.str.3
	.asciz	"could not register PIC ISRCs\n"

l_.str.4:                               ; @.str.4
	.asciz	"could not register PIC\n"

	.comm	_mp_ncpus,4,2                   ; @mp_ncpus
	.comm	_MPIC_LOCAL_MASK,8,3            ; @MPIC_LOCAL_MASK
	.no_dead_strip	_mv_mpic_attach
.subsections_via_symbols
