	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_goya_mmu_init                  ## -- Begin function goya_mmu_init
	.p2align	4, 0x90
_goya_mmu_init:                         ## @goya_mmu_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r14d, %r14d
	cmpl	$0, 20(%rdi)
	je	LBB0_9
## %bb.1:
	movq	%rdi, %r15
	movq	24(%rdi), %r13
	movl	(%r13), %eax
	movq	_HW_CAP_MMU@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	jne	LBB0_9
## %bb.2:
	movabsq	$4294967297, %rcx               ## imm = 0x100000001
	movq	%rcx, (%r15)
	cmpl	$0, 32(%r15)
	jle	LBB0_8
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movslq	36(%r15), %rdx
	movslq	%ebx, %rsi
	imulq	%rsi, %rdx
	addq	40(%r15), %rdx
	movq	%r15, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_goya_mmu_update_asid_hop0_addr
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	cmpl	32(%r15), %ebx
	jl	LBB0_4
## %bb.7:
	movl	(%r13), %eax
	movq	_HW_CAP_MMU@GOTPCREL(%rip), %rdx
LBB0_8:
	orl	(%rdx), %eax
	movl	%eax, (%r13)
	movq	_mmSTLB_CACHE_INV_BASE_39_8@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_MMU_CACHE_MNG_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	sarl	$8, %edi
	callq	_lower_32_bits
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_WREG32
	movq	_mmSTLB_CACHE_INV_BASE_49_40@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_WREG32
	movq	_mmSTLB_STLB_FEATURE_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_STLB_STLB_FEATURE_EN_FOLLOWER_EN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	notl	%esi
	callq	_WREG32_AND
	movq	8(%r15), %rax
	movq	%r15, %rdi
	movl	$1, %esi
	callq	*(%rax)
	movq	_mmMMU_MMU_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_WREG32
	movq	_mmMMU_SPI_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$15, %esi
	callq	_WREG32
	jmp	LBB0_9
LBB0_5:
	movl	%eax, %r12d
	movl	16(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	movl	%r12d, %r14d
LBB0_9:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HW_CAP_MMU,4,2                 ## @HW_CAP_MMU
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to set hop0 addr for asid %d\n"

	.comm	_mmSTLB_CACHE_INV_BASE_39_8,4,2 ## @mmSTLB_CACHE_INV_BASE_39_8
	.comm	_MMU_CACHE_MNG_ADDR,4,2         ## @MMU_CACHE_MNG_ADDR
	.comm	_mmSTLB_CACHE_INV_BASE_49_40,4,2 ## @mmSTLB_CACHE_INV_BASE_49_40
	.comm	_mmSTLB_STLB_FEATURE_EN,4,2     ## @mmSTLB_STLB_FEATURE_EN
	.comm	_STLB_STLB_FEATURE_EN_FOLLOWER_EN_MASK,4,2 ## @STLB_STLB_FEATURE_EN_FOLLOWER_EN_MASK
	.comm	_mmMMU_MMU_ENABLE,4,2           ## @mmMMU_MMU_ENABLE
	.comm	_mmMMU_SPI_MASK,4,2             ## @mmMMU_SPI_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_goya_mmu_init                  ; -- Begin function goya_mmu_init
	.p2align	2
_goya_mmu_init:                         ; @goya_mmu_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldr	w8, [x0, #20]
	cbz	w8, LBB0_8
; %bb.1:
	mov	x19, x0
	ldr	x22, [x0, #24]
	ldr	w8, [x22]
Lloh0:
	adrp	x23, _HW_CAP_MMU@GOTPAGE
Lloh1:
	ldr	x23, [x23, _HW_CAP_MMU@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.2:
	movi.2s	v0, #1
	str	d0, [x19]
	ldr	w9, [x19, #32]
	cmp	w9, #1
	b.lt	LBB0_7
; %bb.3:
	mov	w20, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #40]
	ldrsw	x9, [x19, #36]
	sxtw	x10, w20
	madd	x2, x9, x10, x8
	mov	x0, x19
	mov	x1, x20
	bl	_goya_mmu_update_asid_hop0_addr
	cbnz	w0, LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w20, w20, #1
	ldr	w8, [x19, #32]
	cmp	w20, w8
	b.lt	LBB0_4
; %bb.6:
	ldr	w8, [x22]
LBB0_7:
	ldr	w9, [x23]
	orr	w8, w8, w9
Lloh2:
	adrp	x9, _mmSTLB_CACHE_INV_BASE_39_8@GOTPAGE
Lloh3:
	ldr	x9, [x9, _mmSTLB_CACHE_INV_BASE_39_8@GOTPAGEOFF]
	str	w8, [x22]
Lloh4:
	ldr	w20, [x9]
Lloh5:
	adrp	x8, _MMU_CACHE_MNG_ADDR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MMU_CACHE_MNG_ADDR@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	asr	w0, w8, #8
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_WREG32
Lloh8:
	adrp	x8, _mmSTLB_CACHE_INV_BASE_49_40@GOTPAGE
Lloh9:
	ldr	x8, [x8, _mmSTLB_CACHE_INV_BASE_49_40@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_WREG32
Lloh11:
	adrp	x8, _mmSTLB_STLB_FEATURE_EN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _mmSTLB_STLB_FEATURE_EN@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x8, _STLB_STLB_FEATURE_EN_FOLLOWER_EN_MASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _STLB_STLB_FEATURE_EN_FOLLOWER_EN_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	mvn	w1, w8
	bl	_WREG32_AND
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	mov	w1, #1
	blr	x8
Lloh17:
	adrp	x8, _mmMMU_MMU_ENABLE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _mmMMU_MMU_ENABLE@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	mov	w1, #1
	bl	_WREG32
Lloh20:
	adrp	x8, _mmMMU_SPI_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _mmMMU_SPI_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	mov	w1, #15
	bl	_WREG32
LBB0_8:
	mov	w21, #0
LBB0_9:
	mov	x0, x21
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x21, x0
	ldr	w0, [x19, #16]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_HW_CAP_MMU,4,2                 ; @HW_CAP_MMU
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to set hop0 addr for asid %d\n"

	.comm	_mmSTLB_CACHE_INV_BASE_39_8,4,2 ; @mmSTLB_CACHE_INV_BASE_39_8
	.comm	_MMU_CACHE_MNG_ADDR,4,2         ; @MMU_CACHE_MNG_ADDR
	.comm	_mmSTLB_CACHE_INV_BASE_49_40,4,2 ; @mmSTLB_CACHE_INV_BASE_49_40
	.comm	_mmSTLB_STLB_FEATURE_EN,4,2     ; @mmSTLB_STLB_FEATURE_EN
	.comm	_STLB_STLB_FEATURE_EN_FOLLOWER_EN_MASK,4,2 ; @STLB_STLB_FEATURE_EN_FOLLOWER_EN_MASK
	.comm	_mmMMU_MMU_ENABLE,4,2           ; @mmMMU_MMU_ENABLE
	.comm	_mmMMU_SPI_MASK,4,2             ; @mmMMU_SPI_MASK
.subsections_via_symbols
