	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xicp_attach
_xicp_attach:                           ## @xicp_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	%r14d, %edi
	callq	_ofw_bus_get_node
	movl	%eax, %r15d
	xorl	%eax, %eax
	callq	_rtas_exists
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_rtas_token_lookup
	movq	%rax, 64(%rbx)
	leaq	L_.str.1(%rip), %rdi
	callq	_rtas_token_lookup
	movq	%rax, 56(%rbx)
	leaq	L_.str.2(%rip), %rdi
	callq	_rtas_token_lookup
	movq	%rax, 48(%rbx)
	leaq	L_.str.3(%rip), %rdi
	callq	_rtas_token_lookup
	movq	%rax, 40(%rbx)
	leaq	L_.str.5(%rip), %rsi
	movl	%r15d, %edi
	callq	_OF_hasprop
	movq	(%rbx), %rdx
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str.5(%rip), %rsi
	movl	%r15d, %edi
	movl	$8, %ecx
	callq	_OF_getencprop
	movq	(%rbx), %rax
	movl	(%rax), %edx
	movl	4(%rax), %ecx
	leal	(%rcx,%rdx), %esi
	movl	%esi, 4(%rax)
	leal	-1(%rcx,%rdx), %ecx
	leaq	L_.str.6(%rip), %rsi
	movl	%r14d, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_4
LBB0_6:
	leaq	L_.str.4(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_5
LBB0_3:
	movl	$0, (%rdx)
	movq	_mp_ncpus@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rdx)
LBB0_4:
	movq	%rbx, %rdi
	addq	$24, %rdi
	movq	_MTX_DEF@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.7(%rip), %rsi
	xorl	%r12d, %r12d
	xorl	%edx, %edx
	callq	_mtx_init
	movq	$0, 16(%rbx)
	movl	%r15d, %edi
	callq	_OF_xref_from_node
	movq	_MAX_XICP_IRQS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_FALSE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	%r14d, %edi
	movl	%eax, %esi
	movl	$1, %ecx
	callq	_powerpc_register_pic
	movq	_root_pic@GOTPCREL(%rip), %rax
	movl	%r14d, (%rax)
LBB0_5:
	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	"ibm,int-on"

L_.str.1:                               ## @.str.1
	.asciz	"ibm,int-off"

L_.str.2:                               ## @.str.2
	.asciz	"ibm,set-xive"

L_.str.3:                               ## @.str.3
	.asciz	"ibm,get-xive"

L_.str.4:                               ## @.str.4
	.asciz	"Cannot attach without RTAS or OPAL\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.5:                               ## @.str.5
	.asciz	"ibm,interrupt-server-ranges"

L_.str.6:                               ## @.str.6
	.asciz	"Handling CPUs %d-%d\n"

	.comm	_mp_ncpus,4,2                   ## @mp_ncpus
L_.str.7:                               ## @.str.7
	.asciz	"XICP"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
	.comm	_MAX_XICP_IRQS,4,2              ## @MAX_XICP_IRQS
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_root_pic,4,2                   ## @root_pic
	.comm	_OPAL_INT_SET_CPPR,4,2          ## @OPAL_INT_SET_CPPR
	.comm	_OPAL_INT_SET_MFRR,4,2          ## @OPAL_INT_SET_MFRR
	.comm	_OPAL_XIVE_RESET,4,2            ## @OPAL_XIVE_RESET
	.comm	_OPAL_XIVE_XICS_MODE_EMU,4,2    ## @OPAL_XIVE_XICS_MODE_EMU
	.comm	_PSL_HV,4,2                     ## @PSL_HV
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_powernv_smp_ap_extra_init,4,2  ## @powernv_smp_ap_extra_init
	.comm	_xicp_smp_cpu_startup,4,2       ## @xicp_smp_cpu_startup
	.no_dead_strip	_xicp_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xicp_attach
_xicp_attach:                           ; @xicp_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	mov	x0, x19
	bl	_ofw_bus_get_node
	mov	x21, x0
	bl	_rtas_exists
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_rtas_token_lookup
	str	x0, [x20, #64]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_rtas_token_lookup
	str	x0, [x20, #56]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_rtas_token_lookup
	str	x0, [x20, #48]
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_rtas_token_lookup
	str	x0, [x20, #40]
Lloh8:
	adrp	x1, l_.str.5@PAGE
Lloh9:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	bl	_OF_hasprop
	ldr	x2, [x20]
	cbz	x0, LBB0_4
; %bb.2:
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	mov	w3, #8
	bl	_OF_getencprop
	ldr	x8, [x20]
	ldp	w9, w10, [x8]
	add	w10, w10, w9
	str	w10, [x8, #4]
	sub	w8, w10, #1
	stp	x9, x8, [sp]
Lloh12:
	adrp	x1, l_.str.6@PAGE
Lloh13:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	b	LBB0_5
LBB0_3:
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_device_printf
Lloh16:
	adrp	x8, _ENXIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	b	LBB0_6
LBB0_4:
	str	wzr, [x2]
Lloh19:
	adrp	x8, _mp_ncpus@GOTPAGE
Lloh20:
	ldr	x8, [x8, _mp_ncpus@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x2, #4]
LBB0_5:
	add	x0, x20, #24
Lloh22:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
Lloh24:
	ldr	w3, [x8]
Lloh25:
	adrp	x1, l_.str.7@PAGE
Lloh26:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x2, #0
	bl	_mtx_init
	str	xzr, [x20, #16]
	mov	x0, x21
	bl	_OF_xref_from_node
	mov	x1, x0
Lloh27:
	adrp	x8, _MAX_XICP_IRQS@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MAX_XICP_IRQS@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
Lloh30:
	adrp	x8, _FALSE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh32:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w3, #1
	bl	_powerpc_register_pic
	mov	w0, #0
Lloh33:
	adrp	x8, _root_pic@GOTPAGE
Lloh34:
	ldr	x8, [x8, _root_pic@GOTPAGEOFF]
Lloh35:
	str	w19, [x8]
LBB0_6:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotStr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ibm,int-on"

l_.str.1:                               ; @.str.1
	.asciz	"ibm,int-off"

l_.str.2:                               ; @.str.2
	.asciz	"ibm,set-xive"

l_.str.3:                               ; @.str.3
	.asciz	"ibm,get-xive"

l_.str.4:                               ; @.str.4
	.asciz	"Cannot attach without RTAS or OPAL\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.5:                               ; @.str.5
	.asciz	"ibm,interrupt-server-ranges"

l_.str.6:                               ; @.str.6
	.asciz	"Handling CPUs %d-%d\n"

	.comm	_mp_ncpus,4,2                   ; @mp_ncpus
l_.str.7:                               ; @.str.7
	.asciz	"XICP"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
	.comm	_MAX_XICP_IRQS,4,2              ; @MAX_XICP_IRQS
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_root_pic,4,2                   ; @root_pic
	.comm	_OPAL_INT_SET_CPPR,4,2          ; @OPAL_INT_SET_CPPR
	.comm	_OPAL_INT_SET_MFRR,4,2          ; @OPAL_INT_SET_MFRR
	.comm	_OPAL_XIVE_RESET,4,2            ; @OPAL_XIVE_RESET
	.comm	_OPAL_XIVE_XICS_MODE_EMU,4,2    ; @OPAL_XIVE_XICS_MODE_EMU
	.comm	_PSL_HV,4,2                     ; @PSL_HV
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_powernv_smp_ap_extra_init,4,2  ; @powernv_smp_ap_extra_init
	.comm	_xicp_smp_cpu_startup,4,2       ; @xicp_smp_cpu_startup
	.no_dead_strip	_xicp_attach
.subsections_via_symbols
