	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goya_mmu_invalidate_cache
_goya_mmu_invalidate_cache:             ## @goya_mmu_invalidate_cache
	.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
	testl	%esi, %esi
	je	LBB0_6
## %bb.1:
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	_HW_CAP_MMU@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	je	LBB0_6
## %bb.2:
	cmpq	$0, 8(%rbx)
	jne	LBB0_3
## %bb.4:
	movq	_MMU_CONFIG_TIMEOUT_USEC@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_GOYA_PLDM_MMU_TIMEOUT_USEC@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %r14d
	leaq	4(%rbx), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_mmSTLB_INV_ALL_START@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movl	$1, %esi
	callq	_WREG32
	movl	(%r12), %esi
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	movl	%r14d, %r9d
	callq	_hl_poll_timeout
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_mutex_unlock
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.7:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_notice_ratelimited         ## TAILCALL
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HW_CAP_MMU,4,2                 ## @HW_CAP_MMU
	.comm	_GOYA_PLDM_MMU_TIMEOUT_USEC,4,2 ## @GOYA_PLDM_MMU_TIMEOUT_USEC
	.comm	_MMU_CONFIG_TIMEOUT_USEC,4,2    ## @MMU_CONFIG_TIMEOUT_USEC
	.comm	_mmSTLB_INV_ALL_START,4,2       ## @mmSTLB_INV_ALL_START
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout when waiting for MMU cache invalidation\n"

	.no_dead_strip	_goya_mmu_invalidate_cache
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goya_mmu_invalidate_cache
_goya_mmu_invalidate_cache:             ; @goya_mmu_invalidate_cache
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	w1, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _HW_CAP_MMU@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HW_CAP_MMU@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w8, w9, w8
	cbz	w8, LBB0_4
; %bb.2:
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _MMU_CONFIG_TIMEOUT_USEC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MMU_CONFIG_TIMEOUT_USEC@GOTPAGEOFF]
Lloh5:
	adrp	x10, _GOYA_PLDM_MMU_TIMEOUT_USEC@GOTPAGE
Lloh6:
	ldr	x10, [x10, _GOYA_PLDM_MMU_TIMEOUT_USEC@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x9, x10, eq
	ldr	w20, [x8]
	add	x21, x19, #4
	mov	x0, x21
	bl	_mutex_lock
Lloh7:
	adrp	x22, _mmSTLB_INV_ALL_START@GOTPAGE
Lloh8:
	ldr	x22, [x22, _mmSTLB_INV_ALL_START@GOTPAGEOFF]
	ldr	w0, [x22]
	mov	w1, #1
	bl	_WREG32
	ldr	w1, [x22]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #1000
	mov	x5, x20
	bl	_hl_poll_timeout
	mov	x20, x0
	mov	x0, x21
	bl	_mutex_unlock
	cbz	w20, LBB0_4
; %bb.3:
	ldr	w0, [x19]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_dev_notice_ratelimited
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_HW_CAP_MMU,4,2                 ; @HW_CAP_MMU
	.comm	_GOYA_PLDM_MMU_TIMEOUT_USEC,4,2 ; @GOYA_PLDM_MMU_TIMEOUT_USEC
	.comm	_MMU_CONFIG_TIMEOUT_USEC,4,2    ; @MMU_CONFIG_TIMEOUT_USEC
	.comm	_mmSTLB_INV_ALL_START,4,2       ; @mmSTLB_INV_ALL_START
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout when waiting for MMU cache invalidation\n"

	.no_dead_strip	_goya_mmu_invalidate_cache
.subsections_via_symbols
