	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xlp_mem_init
_xlp_mem_init:                          ## @xlp_mem_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	%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
	movq	__end@GOTPCREL(%rip), %rdi
	callq	_MIPS_KSEG0_TO_PHYS
	movq	%rax, %rdi
	callq	_round_page
	addq	$131072, %rax                   ## imm = 0x20000
	movq	_xlp_mem_excl@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, 8(%rcx)
	leaq	L_str(%rip), %rdi
	callq	_puts
	xorl	%edi, %edi
	callq	_nlm_get_bridge_regbase
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movl	%r12d, %edi
	callq	_BRIDGE_DRAM_BAR
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_nlm_read_bridge_reg
	movl	%eax, %r15d
	movl	%r12d, %edi
	callq	_BRIDGE_DRAM_LIMIT
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_nlm_read_bridge_reg
	cmpl	$4096, %eax                     ## imm = 0x1000
	jb	LBB0_13
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%eax, %r13d
	shll	$8, %r15d
	andl	$-1048576, %r15d                ## imm = 0xFFF00000
	shll	$8, %r13d
	addl	$1048576, %r13d                 ## imm = 0x100000
	andl	$-1048576, %r13d                ## imm = 0xFFF00000
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	movl	%r15d, %edx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_printf
	cmpl	%r15d, %r13d
	jle	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_XLP_MEM_LIM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	%esi, %r15d
	jge	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%esi, %r13d
	jge	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_str.7(%rip), %rdi
	callq	_puts
	movl	%r13d, %edx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, %esi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_13
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_13
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	movl	%esi, %ebx
	callq	_printf
	movl	%ebx, %edx
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_phys_avail@GOTPCREL(%rip), %r13
	movslq	-48(%rbp), %rbx                 ## 4-byte Folded Reload
	leaq	(,%rbx,8), %rdi
	addq	(%r13), %rdi
	movl	%r15d, %esi
	callq	_mem_exclude_add
	testl	%eax, %eax
	jle	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	addl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	movslq	%eax, %r13
	leaq	L_.str.6(%rip), %r15
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_phys_avail@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rbx,8), %rdx
	movq	8(%rax,%rbx,8), %rcx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, %r14
	movl	%ebx, %esi
	shrl	$31, %esi
	addl	%ebx, %esi
	sarl	%esi
	movq	%r15, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_printf
	addq	$2, %rbx
	cmpq	%r13, %rbx
	jl	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
                                        ## kill: def $ebx killed $ebx killed $rbx def $rbx
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_phys_avail@GOTPCREL(%rip), %r13
LBB0_14:                                ##   in Loop: Header=BB0_1 Depth=1
	incl	%r12d
	cmpl	$8, %r12d
	jne	LBB0_1
## %bb.15:
	movq	(%r13), %rax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movslq	%ebx, %rcx
	movq	$0, 8(%rax,%rcx,8)
	movq	(%r13), %rax
	movq	$0, (%rax,%rcx,8)
	cmpl	$-1, %ecx
	jl	LBB0_23
## %bb.16:
	addl	$2, %ebx
	leaq	-1(%rbx), %rcx
	movl	%ebx, %eax
	andl	$3, %eax
	cmpq	$3, %rcx
	jae	LBB0_18
## %bb.17:
	xorl	%ecx, %ecx
	jmp	LBB0_20
LBB0_18:
	andl	$-4, %ebx
	xorl	%ecx, %ecx
	movq	_dump_avail@GOTPCREL(%rip), %rdx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rsi
	movq	(%rsi,%rcx,8), %rsi
	movq	(%rdx), %rdi
	movq	%rsi, (%rdi,%rcx,8)
	movq	(%r13), %rsi
	movq	8(%rsi,%rcx,8), %rsi
	movq	(%rdx), %rdi
	movq	%rsi, 8(%rdi,%rcx,8)
	movq	(%r13), %rsi
	movq	16(%rsi,%rcx,8), %rsi
	movq	(%rdx), %rdi
	movq	%rsi, 16(%rdi,%rcx,8)
	movq	(%r13), %rsi
	movq	24(%rsi,%rcx,8), %rsi
	movq	(%rdx), %rdi
	movq	%rsi, 24(%rdi,%rcx,8)
	addq	$4, %rcx
	cmpq	%rcx, %rbx
	jne	LBB0_19
LBB0_20:
	testq	%rax, %rax
	je	LBB0_23
## %bb.21:
	movq	_dump_avail@GOTPCREL(%rip), %rdx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rsi
	movq	(%rsi,%rcx,8), %rsi
	movq	(%rdx), %rdi
	movq	%rsi, (%rdi,%rcx,8)
	incq	%rcx
	decq	%rax
	jne	LBB0_22
LBB0_23:
	movq	%r14, %rdi
	callq	_btoc
	movq	_physmem@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_realmem@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	__end,4,2                       ## @_end
	.comm	_xlp_mem_excl,8,3               ## @xlp_mem_excl
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"  BAR %d: %#jx - %#jx : "

L_.str.2:                               ## @.str.2
	.asciz	"\tskipped - malformed %#jx -> %#jx\n"

	.comm	_XLP_MEM_LIM,4,2                ## @XLP_MEM_LIM
L_.str.3:                               ## @.str.3
	.asciz	" skipped - outside usable limit %#jx.\n"

L_.str.4:                               ## @.str.4
	.asciz	" truncated to %#jx.\n"

	.comm	_phys_avail,8,3                 ## @phys_avail
L_.str.6:                               ## @.str.6
	.asciz	"\tMem[%d]: %#jx - %#jx\n"

	.comm	_dump_avail,8,3                 ## @dump_avail
	.comm	_physmem,4,2                    ## @physmem
	.comm	_realmem,4,2                    ## @realmem
L_str:                                  ## @str
	.asciz	"Memory (from DRAM BARs):"

L_str.7:                                ## @str.7
	.asciz	" usable"

	.no_dead_strip	_xlp_mem_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xlp_mem_init
_xlp_mem_init:                          ; @xlp_mem_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
Lloh0:
	adrp	x0, __end@GOTPAGE
Lloh1:
	ldr	x0, [x0, __end@GOTPAGEOFF]
	bl	_MIPS_KSEG0_TO_PHYS
	bl	_round_page
	add	x8, x0, #32, lsl #12            ; =131072
Lloh2:
	adrp	x9, _xlp_mem_excl@GOTPAGE
Lloh3:
	ldr	x9, [x9, _xlp_mem_excl@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	str	x8, [x9, #8]
Lloh5:
	adrp	x0, l_str@PAGE
Lloh6:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w0, #0
	bl	_nlm_get_bridge_regbase
	mov	x20, x0
	mov	x19, #0
	mov	w26, #0
	mov	w21, #0
Lloh7:
	adrp	x22, l_.str.1@PAGE
Lloh8:
	add	x22, x22, l_.str.1@PAGEOFF
Lloh9:
	adrp	x25, _phys_avail@GOTPAGE
Lloh10:
	ldr	x25, [x25, _phys_avail@GOTPAGEOFF]
Lloh11:
	adrp	x24, l_.str.6@PAGE
Lloh12:
	add	x24, x24, l_.str.6@PAGEOFF
	b	LBB0_4
LBB0_1:                                 ;   in Loop: Header=BB0_4 Depth=1
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
                                        ; kill: def $w28 killed $w28 killed $x28 def $x28
	stp	x28, x23, [sp]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	bl	_printf
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w21, w21, #1
	cmp	w21, #8
	b.eq	LBB0_15
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	mov	x0, x21
	bl	_BRIDGE_DRAM_BAR
	mov	x1, x0
	mov	x0, x20
	bl	_nlm_read_bridge_reg
	mov	x23, x0
	mov	x0, x21
	bl	_BRIDGE_DRAM_LIMIT
	mov	x1, x0
	mov	x0, x20
	bl	_nlm_read_bridge_reg
	cmp	w0, #1, lsl #12                 ; =4096
	b.lo	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	lsl	w8, w23, #8
	and	w28, w8, #0xfff00000
	lsl	w8, w0, #8
	add	w8, w8, #256, lsl #12           ; =1048576
	and	w23, w8, #0xfff00000
	stp	x21, x28, [sp]
	str	x23, [sp, #16]
	mov	x0, x22
	bl	_printf
	cmp	w23, w28
	b.le	LBB0_1
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh15:
	adrp	x8, _XLP_MEM_LIM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _XLP_MEM_LIM@GOTPAGEOFF]
Lloh17:
	ldr	w27, [x8]
	cmp	w28, w27
	b.ge	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w23, w27
	b.ge	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh18:
	adrp	x0, l_str.7@PAGE
Lloh19:
	add	x0, x0, l_str.7@PAGEOFF
	bl	_puts
	mov	x27, x23
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	x27, [sp]
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x8, x27
	str	x8, [sp]
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x25]
	add	x0, x8, w26, sxtw #3
	mov	x1, x28
	mov	x2, x27
	bl	_mem_exclude_add
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	sxtw	x23, w26
	add	w8, w0, w26
	sxtw	x26, w8
LBB0_13:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x25]
	add	x8, x8, x23, lsl #3
	ldp	x8, x9, [x8]
	sub	x10, x9, x8
	add	x19, x19, x10
	cmp	w23, #0
	cinc	w10, w23, lt
	asr	w10, w10, #1
	stp	x8, x9, [sp, #8]
	str	x10, [sp]
	mov	x0, x24
	bl	_printf
	add	x23, x23, #2
	cmp	x23, x26
	b.lt	LBB0_13
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x26, x23
	b	LBB0_3
LBB0_15:
	ldr	x8, [x25]
	mov	x9, x26
	sbfiz	x9, x9, #3, #32
	add	x8, x9, x8
	str	xzr, [x8, #8]
	ldr	x8, [x25]
	str	xzr, [x8, x9]
	cmn	w26, #1
	b.lt	LBB0_18
; %bb.16:
	mov	x8, #0
	add	w9, w26, #2
	lsl	x9, x9, #3
Lloh24:
	adrp	x10, _dump_avail@GOTPAGE
Lloh25:
	ldr	x10, [x10, _dump_avail@GOTPAGEOFF]
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x25]
	ldr	x11, [x11, x8]
	ldr	x12, [x10]
	str	x11, [x12, x8]
	add	x8, x8, #8
	cmp	x9, x8
	b.ne	LBB0_17
LBB0_18:
	mov	x0, x19
	bl	_btoc
Lloh26:
	adrp	x8, _physmem@GOTPAGE
Lloh27:
	ldr	x8, [x8, _physmem@GOTPAGEOFF]
Lloh28:
	str	w0, [x8]
Lloh29:
	adrp	x8, _realmem@GOTPAGE
Lloh30:
	ldr	x8, [x8, _realmem@GOTPAGEOFF]
Lloh31:
	str	w0, [x8]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotStr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotStr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	__end,4,2                       ; @_end
	.comm	_xlp_mem_excl,8,3               ; @xlp_mem_excl
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"  BAR %d: %#jx - %#jx : "

l_.str.2:                               ; @.str.2
	.asciz	"\tskipped - malformed %#jx -> %#jx\n"

	.comm	_XLP_MEM_LIM,4,2                ; @XLP_MEM_LIM
l_.str.3:                               ; @.str.3
	.asciz	" skipped - outside usable limit %#jx.\n"

l_.str.4:                               ; @.str.4
	.asciz	" truncated to %#jx.\n"

	.comm	_phys_avail,8,3                 ; @phys_avail
l_.str.6:                               ; @.str.6
	.asciz	"\tMem[%d]: %#jx - %#jx\n"

	.comm	_dump_avail,8,3                 ; @dump_avail
	.comm	_physmem,4,2                    ; @physmem
	.comm	_realmem,4,2                    ; @realmem
l_str:                                  ; @str
	.asciz	"Memory (from DRAM BARs):"

l_str.7:                                ; @str.7
	.asciz	" usable"

	.no_dead_strip	_xlp_mem_init
.subsections_via_symbols
