	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xlp_pic_init
_xlp_pic_init:                          ## @xlp_pic_init
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_nlm_get_pic_regbase
	movq	_xlp_pic_base@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	xorl	%eax, %eax
	callq	_nlm_nodeid
	movl	%eax, %edi
	callq	_nlm_get_pic_pcibase
	movq	_XLP_PCI_DEVINFO_REG0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_nlm_read_reg
	movl	%eax, %r14d
	movl	(%r15), %esi
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %edx
	callq	_printf
	testl	%r14d, %r14d
	jle	LBB0_2
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	subq	$8, %rsp
	movl	%ebx, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	pushq	$1
	pushq	$0
	pushq	$1
	callq	_nlm_pic_write_irt
	addq	$32, %rsp
	incl	%ebx
	cmpl	%ebx, %r14d
	jne	LBB0_1
LBB0_2:
	movq	(%r15), %rdi
	movq	_PIC_CLOCK_TIMER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	$-1, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nlm_pic_set_timer
	movq	_platform_timecounter@GOTPCREL(%rip), %rax
	leaq	-56(%rbp), %rcx
	movq	%rcx, (%rax)
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_platform_get_timecount,4,2     ## @platform_get_timecount
	.comm	_XLP_IO_CLK,4,2                 ## @XLP_IO_CLK
	.comm	_xlp_pic_base,8,3               ## @xlp_pic_base
	.comm	_XLP_PCI_DEVINFO_REG0,4,2       ## @XLP_PCI_DEVINFO_REG0
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"Initializing PIC...@%jx %d IRTs\n"

	.comm	_PIC_CLOCK_TIMER,4,2            ## @PIC_CLOCK_TIMER
	.comm	_platform_timecounter,8,3       ## @platform_timecounter
	.no_dead_strip	_xlp_pic_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xlp_pic_init
_xlp_pic_init:                          ; @xlp_pic_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	w0, #0
	bl	_nlm_get_pic_regbase
Lloh0:
	adrp	x21, _xlp_pic_base@GOTPAGE
Lloh1:
	ldr	x21, [x21, _xlp_pic_base@GOTPAGEOFF]
	str	x0, [x21]
	bl	_nlm_nodeid
	bl	_nlm_get_pic_pcibase
Lloh2:
	adrp	x8, _XLP_PCI_DEVINFO_REG0@GOTPAGE
Lloh3:
	ldr	x8, [x8, _XLP_PCI_DEVINFO_REG0@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_nlm_read_reg
	mov	x19, x0
	ldr	w1, [x21]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_printf
	cmp	w19, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w20, #0
	mov	w22, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21]
	str	w22, [sp]
	mov	x1, x20
	mov	w2, #0
	mov	w3, #0
	mov	w4, #1
	mov	w5, #0
	mov	w6, #1
	mov	w7, #0
	bl	_nlm_pic_write_irt
	add	w20, w20, #1
	cmp	w19, w20
	b.ne	LBB0_2
LBB0_3:
	ldr	x0, [x21]
Lloh7:
	adrp	x8, _PIC_CLOCK_TIMER@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PIC_CLOCK_TIMER@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x2, #-1
	mov	w3, #0
	mov	w4, #0
	bl	_nlm_pic_set_timer
Lloh10:
	adrp	x8, _platform_timecounter@GOTPAGE
Lloh11:
	ldr	x8, [x8, _platform_timecounter@GOTPAGEOFF]
	add	x9, sp, #16
Lloh12:
	str	x9, [x8]
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_platform_get_timecount,4,2     ; @platform_get_timecount
	.comm	_XLP_IO_CLK,4,2                 ; @XLP_IO_CLK
	.comm	_xlp_pic_base,8,3               ; @xlp_pic_base
	.comm	_XLP_PCI_DEVINFO_REG0,4,2       ; @XLP_PCI_DEVINFO_REG0
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"Initializing PIC...@%jx %d IRTs\n"

	.comm	_PIC_CLOCK_TIMER,4,2            ; @PIC_CLOCK_TIMER
	.comm	_platform_timecounter,8,3       ; @platform_timecounter
	.no_dead_strip	_xlp_pic_init
.subsections_via_symbols
